Skip to content

Commit

Permalink
add: monster types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitsunee committed Sep 7, 2024
1 parent 2c30ace commit bbc66bc
Showing 1 changed file with 125 additions and 0 deletions.
125 changes: 125 additions & 0 deletions src/types/monsters.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
type GameLanguage =
| "en"
| "ar"
| "br"
| "cns"
| "de"
| "fi"
| "fil"
| "fr"
| "id"
| "it"
| "jp"
| "kr"
| "nl"
| "pl"
| "ru"
| "sp"
| "sw"
| "th"
| "tw"
| "vi";

type EntityName = Record<"en" | "kr", string> &
Partial<Record<GameLanguage, string>>;

type MonsterRank =
| "small"
| "normal"
| "captain"
| "giant"
| "violet"
| "boss"
| "material"
| "super"
| "guard"
| "citizen"
| "worldboss";

type MonsterArea = "normal" | "dungeon" | "instance";

type EntityElement =
| "fire"
| "water"
| "electricity"
| "wind"
| "earth"
| "none";

interface MonsterAttack {
minAttack: number;
maxAttack: number;
attackRange: number;
target: "area" | "single";
triggerSkill?: number;
}

/**
* Monster Data from `/monster/{id}` endpoint
* Some (unused) props may be missing
*/
interface MonsterData {
id: number;
name: EntityName;
event: boolean;
level: number;
rank: MonsterRank;
area: MonsterArea;
element: EntityElement;
/**
* Use with `https://api.flyff.com/monster/image/{icon}`
*/
icon: string;
flying: boolean;
hp: number;
runaway?: boolean;
berserkThresholdHP?: number;
experienceTable: Array<number>;
attacks: Array<MonsterAttack>;
}

type MonsterSkillAbilityAttribute =
| "rooting"
| "stun"
| "hitrate"
| "invisibility"
| "poison"
| "slow"
| "double"
| "bleeding"
| "silent"
| "counterattackdamage"
| "counterattack"
| "loot"
| "moonbeam"
| "hitrateandpoison"
| "hitrateandpoisonandstun"
| "lootandslow"
| "poisonandbleedingandmoonbeam"
| "stunandrooting"
| "forcedblock"
| "weaponbleeding"
| "weaponstun"
| "weaponpoison"
| "allstun"
| "allpoison";

interface MonsterSkillAbility {
parameter: string;
attribute?: MonsterSkillAbilityAttribute;
}

interface MonsterSkillLevel {
duration?: number;
abilities?: Array<MonsterSkillAbility>;
}

/**
* Skill used in MonsterAttack available via `/skill/{id}`
* Some (unused) props may be missing
*/
interface MonsterSkill {
id: number;
name: EntityName;
levels: Array<MonsterSkillLevel>;
}

0 comments on commit bbc66bc

Please sign in to comment.