From af5a784f2c5aef2055b3133b82b1eff4a5e64e75 Mon Sep 17 00:00:00 2001 From: ultramage Date: Thu, 10 Jan 2008 18:14:59 +0000 Subject: Fixed Abracadabra unable to cast non-targeted skills (bugreport:186) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12044 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 1 + src/map/skill.c | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 9129294c5..068eaea60 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2008/01/10 + * Fixed Abracadabra unable to cast non-targeted skills (bugreport:186) * Another round of login server cleaning [ultramage] - fixed passwordencrypt on SQL not behaving correctly (since r10753) - corrected some column lengths in the login db (username, password,...) diff --git a/src/map/skill.c b/src/map/skill.c index fe2fff2a5..2fba7b6ca 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3023,14 +3023,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in abra_skilllv = min(skilllv, skill_get_max(abra_skillid)); clif_skill_nodamage (src, bl, skillid, skilllv, 1); - if (sd) - { //Crash-protection against Abracadabra casting pets - sd->skillitem = abra_skillid; - sd->skillitemlv = abra_skilllv; + if( sd ) + {// player-casted sd->state.abra_flag = 1; - clif_item_skill (sd, abra_skillid, abra_skilllv); - } else - { // [Skotlex] + if( skill_get_inf(abra_skillid)&INF_SELF_SKILL ) + // non-targeted, execute immediately + unit_skilluse_id(src, bl->id, abra_skillid, abra_skilllv); + else + {// targeted, delay and let player pick target + sd->skillitem = abra_skillid; + sd->skillitemlv = abra_skilllv; + clif_item_skill(sd, abra_skillid, abra_skilllv); + } + } + else + {// mob-casted struct unit_data *ud = unit_bl2ud(src); int inf = skill_get_inf(abra_skillid); int target_id = 0; @@ -7485,8 +7492,7 @@ int skill_check_condition(struct map_session_data* sd, short skill, short lv, in //Abracadabra skill, skip requisites! if(type&1) { //Clear out the data. - sd->skillitem = sd->skillitemlv = 0; - sd->state.abra_flag = 0; + sd->skillitem = sd->skillitemlv = sd->state.abra_flag = 0; } return 1; } -- cgit v1.2.3-70-g09d2