diff options
author | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-27 14:11:08 +0000 |
---|---|---|
committer | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-27 14:11:08 +0000 |
commit | 083e1e7f223ca36cdda5bf02940dcbb59a18c466 (patch) | |
tree | 03f499f66c3fe432c5badf738859564a7f959b1e /src/map/skill.h | |
parent | a688b3155af430cc703f7d40548bbbf5e3a5addf (diff) | |
download | hercules-083e1e7f223ca36cdda5bf02940dcbb59a18c466.tar.gz hercules-083e1e7f223ca36cdda5bf02940dcbb59a18c466.tar.bz2 hercules-083e1e7f223ca36cdda5bf02940dcbb59a18c466.tar.xz hercules-083e1e7f223ca36cdda5bf02940dcbb59a18c466.zip |
* skill_check_condition clean up (bugreport:2770, bugreport:2957, bugreport:3010)
- Weapon, SP, HP and state are checked at the beginning of cast.
- Required items and ammos are checked at the end of cast.
- SP and status change required are removed at the end of cast without checking again.
- Required items are removed only if the skill is successfully used.
- Autocasts won't check for requirements but will remove them if you have them(except for SP/HP).
Hope won't cause any problems...
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13815 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.h')
-rw-r--r-- | src/map/skill.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/map/skill.h b/src/map/skill.h index c52f5ccc1..c5aa25eb8 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -68,6 +68,12 @@ struct status_change_entry; #define SD_SPLASH 0x4000 // skill_area_sub will count targets in skill_area_temp[2] #define 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 +struct skill_condition { + int weapon,ammo,ammo_qty,hp,sp,zeny,spiritball,mhp,state; + int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE]; +}; + // スキルデ?タベ?ス struct s_skill_db { char name[NAME_LENGTH]; @@ -81,7 +87,7 @@ struct s_skill_db { int blewcount[MAX_SKILL_LEVEL]; int hp[MAX_SKILL_LEVEL],sp[MAX_SKILL_LEVEL],mhp[MAX_SKILL_LEVEL],hp_rate[MAX_SKILL_LEVEL],sp_rate[MAX_SKILL_LEVEL],zeny[MAX_SKILL_LEVEL]; int weapon,ammo,ammo_qty[MAX_SKILL_LEVEL],state,spiritball[MAX_SKILL_LEVEL]; - int itemid[10],amount[10]; + int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE]; int castnodex[MAX_SKILL_LEVEL], delaynodex[MAX_SKILL_LEVEL]; int nocast; int unit_id[2]; @@ -281,7 +287,13 @@ int skill_unit_ondamaged(struct skill_unit *src,struct block_list *bl,int damage int skill_castfix( struct block_list *bl, int skill_id, int skill_lv); int skill_castfix_sc( struct block_list *bl, int time); int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv); -int skill_check_condition( struct map_session_data *sd, short skill, short lv, int type); + +// Skill conditions check and remove [Inkfish] +int skill_check_condition_castbegin(struct map_session_data *sd, short skill, short lv); +int skill_check_condition_castend(struct map_session_data *sd, short skill, short lv); +int skill_consume_requirement(struct map_session_data *sd, short skill, short lv, short type); +struct skill_condition skill_get_requirement(struct map_session_data *sd, short skill, short lv); + int skill_check_pc_partner(struct map_session_data *sd, short skill_id, short* skill_lv, int range, int cast_flag); // -- moonsoul (added skill_check_unit_cell) int skill_check_unit_cell(int skillid,int m,int x,int y,int unit_id); |