summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-11 21:00:12 +0000
committerrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-11 21:00:12 +0000
commit7685ceccfe593b9b06492e8eadc7f0a1fe30076f (patch)
tree6c86329efee7e56fabb83ad35cef6bcad23abcf8 /src
parent5627e06649104c82bf836be3d848174b8152f8cf (diff)
downloadhercules-7685ceccfe593b9b06492e8eadc7f0a1fe30076f.tar.gz
hercules-7685ceccfe593b9b06492e8eadc7f0a1fe30076f.tar.bz2
hercules-7685ceccfe593b9b06492e8eadc7f0a1fe30076f.tar.xz
hercules-7685ceccfe593b9b06492e8eadc7f0a1fe30076f.zip
Fixed bugreport:5963 AB_CHEAL should now work properly on immune targets(Mado, berserk, shield of deaf).
Fixed bugreport:5981 PA_SACRIFICE now won't be granted by bonus damage from cards(RENEWAL CHANGE). Fixed bugreport:5892 & bugreport:5900 SO_SPELLFIST is now working properly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16268 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c13
-rw-r--r--src/map/skill.c23
-rw-r--r--src/map/unit.c8
3 files changed, 29 insertions, 15 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 112e8b723..1d794cc99 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3279,7 +3279,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
case MG_COLDBOLT: {
struct status_change *sc = status_get_sc(src);
if ( sc && sc->count ) {
- if ( sc->data[SC_SPELLFIST] && (!sd || !sd->state.autocast) ) {
+ if ( sc->data[SC_SPELLFIST] && mflag&BF_SHORT ) {
skillratio += (sc->data[SC_SPELLFIST]->val4 * 100) + (sc->data[SC_SPELLFIST]->val2 * 100) - 100;// val4 = used bolt level, val2 = used spellfist level. [Rytech]
ad.div_ = 1;// ad mods, to make it work similar to regular hits [Xazax]
ad.flag = BF_WEAPON|BF_SHORT;
@@ -3293,7 +3293,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
case MG_FIREBOLT: {
struct status_change *sc = status_get_sc(src);
if ( sc && sc->count ) {
- if ( sc->data[SC_SPELLFIST] && (!sd || !sd->state.autocast) ) {
+ if ( sc->data[SC_SPELLFIST] && mflag&BF_SHORT ) {
skillratio += (sc->data[SC_SPELLFIST]->val4 * 100) + (sc->data[SC_SPELLFIST]->val2 * 100) - 100;
ad.div_ = 1;
ad.flag = BF_WEAPON|BF_SHORT;
@@ -3307,7 +3307,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
case MG_LIGHTNINGBOLT: {
struct status_change *sc = status_get_sc(src);
if ( sc && sc->count ) {
- if ( sc->data[SC_SPELLFIST] && (!sd || !sd->state.autocast) ) {
+ if ( sc->data[SC_SPELLFIST] && mflag&BF_SHORT ) {
skillratio += (sc->data[SC_SPELLFIST]->val4 * 100) + (sc->data[SC_SPELLFIST]->val2 * 100) - 100;
ad.div_ = 1;
ad.flag = BF_WEAPON|BF_SHORT;
@@ -4412,9 +4412,10 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
status_change_end(src, SC_EXEEDBREAK, INVALID_TIMER);
}
if( sc->data[SC_SPELLFIST] ) {
- if( --(sc->data[SC_SPELLFIST]->val1) >= 0 )
- wd = battle_calc_attack(BF_MAGIC,src,target,sc->data[SC_SPELLFIST]->val3,sc->data[SC_SPELLFIST]->val4,flag);
- else
+ if( --(sc->data[SC_SPELLFIST]->val1) >= 0 ){
+ struct Damage ad = battle_calc_attack(BF_MAGIC,src,target,sc->data[SC_SPELLFIST]->val3,sc->data[SC_SPELLFIST]->val4,flag|BF_SHORT);
+ wd.damage = ad.damage;
+ }else
status_change_end(src,SC_SPELLFIST,INVALID_TIMER);
}
if( sc->data[SC_GIANTGROWTH] && (wd.flag&BF_SHORT) && rnd()%100 < sc->data[SC_GIANTGROWTH]->val2 )
diff --git a/src/map/skill.c b/src/map/skill.c
index 9a2e3ed6f..25a921c6f 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6288,11 +6288,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
unit_skillcastcancel(src,1);
if(sd) {
int sp = skill_get_sp(sd->skillid_old,sd->skilllv_old);
+ if( skillid == SO_SPELLFIST ){
+ sc_start4(src,type,100,skilllv+1,skilllv,sd->skillid_old,sd->skilllv_old,skill_get_time(skillid,skilllv));
+ sd->skillid_old = sd->skilllv_old = 0;
+ break;
+ }
sp = sp * (90 - (skilllv-1)*20) / 100;
if(sp < 0) sp = 0;
status_zap(src, 0, sp);
- if( skillid == SO_SPELLFIST )
- sc_start4(src,type,100,skilllv+1,skilllv,(sd->skillid_old)?sd->skillid_old:MG_FIREBOLT,(sd->skilllv_old)?sd->skilllv_old:skilllv,skill_get_time(skillid,skilllv));
}
break;
case SA_SPELLBREAKER:
@@ -7442,7 +7445,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if( sd && tstatus && !battle_check_undead(tstatus->race, tstatus->def_ele) )
{
i = skill_calc_heal(src, bl, AL_HEAL, pc_checkskill(sd, AL_HEAL), true);
- if(dstsd && pc_ismadogear(dstsd)) i = 0; // Should heal by 0 or won't do anything? [malufett]
+
+ if( (dstsd && pc_ismadogear(dstsd)) || status_isimmune(bl) || (tsc && tsc->data[SC_BERSERK]))
+ i = 0; // Should heal by 0 or won't do anything?? in iRO it breaks the healing to members.. [malufett]
+
status_heal(bl, i, 0, 1);
clif_skill_nodamage(bl, bl, skillid, i, 1);
}
@@ -8662,8 +8668,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
return 0;
}
- if(ud->skillid != SA_CASTCANCEL &&
- !(ud->skillid == SO_SPELLFIST && (sd && (sd->skillid_old == MG_FIREBOLT || sd->skillid_old == MG_COLDBOLT || sd->skillid_old == MG_LIGHTNINGBOLT))) ) {// otherwise handled in unit_skillcastcancel()
+ if(ud->skillid != SA_CASTCANCEL && ud->skillid != SO_SPELLFIST) {// otherwise handled in unit_skillcastcancel()
if( ud->skilltimer != tid ) {
ShowError("skill_castend_id: Timer mismatch %d!=%d!\n", ud->skilltimer, tid);
ud->skilltimer = INVALID_TIMER;
@@ -11836,8 +11841,12 @@ int skill_check_condition_castbegin(struct map_session_data* sd, short skill, sh
// perform skill-specific checks (and actions)
switch( skill ) {
- case SA_CASTCANCEL:
- case SO_SPELLFIST:
+ case SO_SPELLFIST:
+ if(sd->skillid_old != MG_FIREBOLT && sd->skillid_old != MG_COLDBOLT && sd->skillid_old != MG_LIGHTNINGBOLT){
+ clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
+ return 0;
+ }
+ case SA_CASTCANCEL:
if(sd->ud.skilltimer == INVALID_TIMER) {
clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0);
return 0;
diff --git a/src/map/unit.c b/src/map/unit.c
index af4f95350..71baef598 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1072,7 +1072,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
if(sd) {
switch(skill_num){
case SA_CASTCANCEL:
- case SO_SPELLFIST:
if(ud->skillid != skill_num){
sd->skillid_old = ud->skillid;
sd->skilllv_old = ud->skilllv;
@@ -1107,7 +1106,12 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh
return 0;
}
break;
-
+ case MG_FIREBOLT:
+ case MG_LIGHTNINGBOLT:
+ case MG_COLDBOLT:
+ sd->skillid_old = skill_num;
+ sd->skilllv_old = skill_lv;
+ break;
}
if (!skill_check_condition_castbegin(sd, skill_num, skill_lv))
return 0;