// Copyright (c) rAthena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef SKILL_HPP #define SKILL_HPP #include "../common/cbasetypes.hpp" #include "../common/db.hpp" #include "../common/mmo.hpp" // MAX_SKILL, struct square #include "../common/timer.hpp" #include "map.hpp" // struct block_list enum damage_lv : uint8; enum sc_type : int16; enum send_target : uint8; enum e_damage_type : uint8; struct map_session_data; struct homun_data; struct skill_unit; struct skill_unit_group; struct status_change_entry; #define MAX_SKILL_PRODUCE_DB 280 /// Max Produce DB #define MAX_PRODUCE_RESOURCE 12 /// Max Produce requirements #define MAX_SKILL_ARROW_DB 150 /// Max Arrow Creation DB #define MAX_ARROW_RESULT 5 /// Max Arrow results/created #define MAX_SKILL_ABRA_DB 160 /// Max Skill list of Abracadabra DB #define MAX_SKILL_IMPROVISE_DB 30 /// Max Skill for Improvise #define MAX_SKILL_LEVEL 13 /// Max Skill Level (for skill_db storage) #define MAX_MOBSKILL_LEVEL 100 /// Max monster skill level (on skill usage) #define MAX_SKILL_CRIMSON_MARKER 3 /// Max Crimson Marker targets (RL_C_MARKER) #define SKILL_NAME_LENGTH 31 /// Max Skill Name length #define SKILL_DESC_LENGTH 31 /// Max Skill Desc length extern DBMap* skilldb_name2id; /// Constants to identify a skill's nk value (damage properties) /// The NK value applies only to non INF_GROUND_SKILL skills /// when determining skill castend function to invoke. enum e_skill_nk : uint16 { NK_NO_DAMAGE = 0x01, NK_SPLASH = 0x02|0x04, // 0x4 = splash & split NK_SPLASHSPLIT = 0x04, NK_NO_CARDFIX_ATK = 0x08, NK_NO_ELEFIX = 0x10, NK_IGNORE_DEF = 0x20, NK_IGNORE_FLEE = 0x40, NK_NO_CARDFIX_DEF = 0x80, NK_CRITICAL = 0x100, }; /// Constants to identify the skill's inf value: enum e_skill_inf { INF_ATTACK_SKILL = 0x01, INF_GROUND_SKILL = 0x02, INF_SELF_SKILL = 0x04, // Skills casted on self where target is automatically chosen // 0x08 not assigned INF_SUPPORT_SKILL = 0x10, INF_TARGET_TRAP = 0x20, }; /// A skill with 3 would be no damage + splash: area of effect. /// Constants to identify a skill's inf2 value. enum e_skill_inf2 { INF2_QUEST_SKILL = 0x00001, INF2_NPC_SKILL = 0x00002, //NPC skills are those that players can't have in their skill tree. INF2_WEDDING_SKILL = 0x00004, INF2_SPIRIT_SKILL = 0x00008, INF2_GUILD_SKILL = 0x00010, INF2_SONG_DANCE = 0x00020, INF2_ENSEMBLE_SKILL = 0x00040, INF2_TRAP = 0x00080, INF2_TARGET_SELF = 0x00100, //Refers to ground placed skills that will target the caster as well (like Grandcross) INF2_NO_TARGET_SELF = 0x00200, INF2_PARTY_ONLY = 0x00400, INF2_GUILD_ONLY = 0x00800, INF2_NO_ENEMY = 0x01000, INF2_AUTOSHADOWSPELL = 0x02000, // Skill that available for SC_AUTOSHADOWSPELL INF2_CHORUS_SKILL = 0x04000, // Chorus skill INF2_NO_BG_DMG = 0x08000, // Skill that ignore bg reduction INF2_NO_GVG_DMG = 0x10000, // Skill that ignore gvg reduction INF2_NO_NEARNPC = 0x20000, // disable to cast skill if near with NPC [Cydh] INF2_HIT_TRAP = 0x40000, // can hit trap-type skill (INF2_TRAP) [Cydh] }; /// Skill info type 3 enum e_skill_inf3 { INF3_NOLP = 0x000001, // Skill that can ignore Land Protector INF3_FREE = 0x000002, // Free INF3_USABLE_HIDING = 0x000004, // Skill that can be use in hiding INF3_USABLE_DANCE = 0x000008, // Skill that can be use while in dancing state INF3_HIT_EMP = 0x000010, // Skill that could hit emperium INF3_STASIS_BL = 0x000020, // Skill that can ignore SC_STASIS INF3_KAGEHUMI_BL = 0x000040, // Skill blocked by kagehumi INF3_EFF_VULTURE = 0x000080, // Skill range affected by AC_VULTURE INF3_EFF_SNAKEEYE = 0x000100, // Skill range affected by GS_SNAKEEYE INF3_EFF_SHADOWJUMP = 0x000200, // Skill range affected by NJ_SHADOWJUMP INF3_EFF_RADIUS = 0x000400, // Skill range affected by WL_RADIUS INF3_EFF_RESEARCHTRAP = 0x000800, // Skill range affected by RA_RESEARCHTRAP INF3_NO_EFF_HOVERING = 0x001000, // Skill that does not affect user that has SC_HOVERING active INF3_USABLE_WARG = 0x002000, // Skill that can be use while riding warg INF3_USABLE_MADO = 0x004000, // Skill that can be used while on Madogear INF3_USABLE_MANHOLE = 0x008000, // Skill that can be used to target while under SC__MANHOLE effect INF3_HIT_HIDING = 0x010000, // Skill that affects hidden targets INF3_SC_GLOOMYDAY_SK = 0x020000, // Skill that affects SC_GLOOMYDAY_SK INF3_SC_DANCEWITHWUG = 0x040000, // Skill that is affected by SC_DANCEWITHWUG INF3_BITE_BLOCK = 0x080000, // Skill blocked by RA_WUGBITE INF3_NO_EFF_AUTOGUARD = 0x100000, // Skill is not blocked by SC_AUTOGUARD (physical-skill only) INF3_NO_EFF_CICADA = 0x200000, // Skill is not blocked by SC_UTSUSEMI or SC_BUNSINJYUTSU (physical-skill only) }; /// Walk intervals at which chase-skills are attempted to be triggered. /// If you change this, make sure it's an odd value (for icewall block behavior). #define WALK_SKILL_INTERVAL 5 /// Time that's added to canact delay on castbegin and substracted on castend /// This is to prevent hackers from sending a skill packet after cast but before a timer triggers castend const t_tick SECURITY_CASTTIME = 100; /// Flags passed to skill_attack/skill_area_sub enum e_skill_display { SD_LEVEL = 0x1000, // skill_attack will send -1 instead of skill level (affects display of some skills) SD_ANIMATION = 0x2000, // skill_attack will use '5' instead of the skill's 'type' (this makes skills show an animation). Also being used in skill_attack for splash skill (NK_SPLASH) to check status_check_skilluse SD_SPLASH = 0x4000, // skill_area_sub will count targets in skill_area_temp[2] SD_PREAMBLE = 0x8000, // skill_area_sub will transmit a 'magic' damage packet (-30000 dmg) for the first target selected }; #define MAX_SKILL_ITEM_REQUIRE 10 /// Maximum required items #define MAX_SKILL_STATUS_REQUIRE 3 /// Maximum required statuses #define MAX_SKILL_EQUIP_REQUIRE 10 /// Maximum required equipped item /// Single skill requirement. !TODO: Cleanup the variable types struct skill_condition { int32 hp; ///< HP cost int32 mhp; ///< Max HP to trigger int32 sp; /// SP cost int16 hp_rate; /// HP cost (%) int16 sp_rate; /// SP cost (%) uint32 zeny; /// Zeny cost uint32 weapon; /// Weapon type. Combined bitmask of enum weapon_type (1<