summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-07-05 08:19:01 -0300
committerpanikon <panikon@zoho.com>2014-07-05 08:19:01 -0300
commit9173fa50ef2887b28603f223a102448a2c69a234 (patch)
tree0a17aa1427bf38747a207f17a74f475cce4c09eb
parent74c8045559123477b7e72f7d255128c5d7a0e869 (diff)
downloadhercules-9173fa50ef2887b28603f223a102448a2c69a234.tar.gz
hercules-9173fa50ef2887b28603f223a102448a2c69a234.tar.bz2
hercules-9173fa50ef2887b28603f223a102448a2c69a234.tar.xz
hercules-9173fa50ef2887b28603f223a102448a2c69a234.zip
Fixed issue in LG_SHIELDSPELL, the skill was working in lv 2 and 3 when it shouldn't be, some small refactoring as well.
Small refactoring in SR_ASSIMILATEPOWER
-rw-r--r--src/map/skill.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index d2021b0b4..065aa8e01 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8627,6 +8627,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
}
break;
case 2:
+ if( sd->bonus.shieldmdef == 0 )
+ break; // Nothing should happen if the shield has no mdef, not even displaying a message
if ( sd->bonus.shieldmdef >= 1 && sd->bonus.shieldmdef <= 3 )
splashrange = 1;
else if ( sd->bonus.shieldmdef >= 4 && sd->bonus.shieldmdef <= 5 )
@@ -8654,22 +8656,25 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
case 3:
{
- struct item *shield = &sd->status.inventory[sd->equip_index[EQI_HAND_L]];
int rate = 0;
+
+ if( shield_data->refine == 0 )
+ break; // Nothing should happen if the shield has no refine, not even displaying a message
+
switch( opt ) {
case 1:
- sc_start(src,bl,SC_SHIELDSPELL_REF,100,opt,shield->refine * 30000); //Now breaks Armor at 100% rate
+ sc_start(src,bl,SC_SHIELDSPELL_REF,100,opt,shield_data->refine * 30000); //Now breaks Armor at 100% rate
break;
case 2:
val = shield->refine * 10 * status->get_lv(src) / 100; //DEF Increase
rate = (shield->refine * 2) + (status_get_luk(src) / 10); //Status Resistance Rate
- if( sc_start2(src,bl,SC_SHIELDSPELL_REF,100,opt,val,shield->refine * 20000))
+ if( sc_start2(src,bl,SC_SHIELDSPELL_REF,100,opt,val,shield_data->refine * 20000))
clif->skill_nodamage(src,bl,SC_SCRESIST,skill_lv,
- sc_start(src,bl,SC_SCRESIST,100,rate,shield->refine * 30000));
+ sc_start(src,bl,SC_SCRESIST,100,rate,shield_data->refine * 30000));
break;
case 3:
sc_start(src,bl,SC_SHIELDSPELL_REF,100,opt,INVALID_TIMER); //HP Recovery
- val = sstatus->max_hp * ((status->get_lv(src) / 10) + (shield->refine + 1)) / 100;
+ val = sstatus->max_hp * ((status->get_lv(src) / 10) + (shield_data->refine + 1)) / 100;
status->heal(bl, val, 0, 2);
status_change_end(bl,SC_SHIELDSPELL_REF,INVALID_TIMER);
break;
@@ -8769,8 +8774,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
{
sp = dstsd->spiritball; //1%sp per spiritball.
pc->delspiritball(dstsd, dstsd->spiritball, 0);
+ status_percent_heal(src, 0, sp);
}
- if( sp ) status_percent_heal(src, 0, sp);
clif->skill_nodamage(src, bl, skill_id, skill_lv, sp ? 1:0);
} else {
clif->skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);