summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-18 17:09:12 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-18 17:09:12 +0000
commit460ee2693ff9c955cf8d9cb6aa748d5d541297d1 (patch)
tree09889a6eb1a6f216eb8c9f913278c23f2060bd2c /src/map
parent615b7532efe7ffe61d3cbb15257df5e3699d58d8 (diff)
downloadhercules-460ee2693ff9c955cf8d9cb6aa748d5d541297d1.tar.gz
hercules-460ee2693ff9c955cf8d9cb6aa748d5d541297d1.tar.bz2
hercules-460ee2693ff9c955cf8d9cb6aa748d5d541297d1.tar.xz
hercules-460ee2693ff9c955cf8d9cb6aa748d5d541297d1.zip
- Changed the way SC_ARMOR_ELEMENT is called (Resistance potions)
- Now each val represent an element (1 = Water 2 = Earth 3 = Fire 4 = Wind) - Fixed bug 1039 (Shadow Armor Scroll's Script Fails) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12393 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/status.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/status.c b/src/map/status.c
index d100dbb69..89b45cd67 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2339,8 +2339,10 @@ int status_calc_pc(struct map_session_data* sd,int first)
}
if(sc->data[SC_ARMOR_ELEMENT])
{ //This status change should grant card-type elemental resist.
- sd->subele[sc->data[SC_ARMOR_ELEMENT]->val1] += sc->data[SC_ARMOR_ELEMENT]->val2;
- sd->subele[sc->data[SC_ARMOR_ELEMENT]->val3] += sc->data[SC_ARMOR_ELEMENT]->val4;
+ sd->subele[ELE_WATER] += sc->data[SC_ARMOR_ELEMENT]->val1;
+ sd->subele[ELE_EARTH] += sc->data[SC_ARMOR_ELEMENT]->val2;
+ sd->subele[ELE_FIRE] += sc->data[SC_ARMOR_ELEMENT]->val3;
+ sd->subele[ELE_WIND] += sc->data[SC_ARMOR_ELEMENT]->val4;
}
}
@@ -6898,8 +6900,11 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
case SC_HPREGEN:
if( sd && --(sce->val4) >= 0 )
{
- if( status->hp < status->max_hp ) {
- int hp = (int)(sd->status.max_hp * sce->val1 / 100.);
+ if( status->hp < status->max_hp )
+ {
+ // val1 < 0 = per maxhp %
+ // val1 > 0 = exact amount
+ int hp = (sce->val1 < 0) ? (int)(sd->status.max_hp * -1 * sce->val1 / 100.) : sce->val1 ;
status_heal(bl, hp, 0, 2);
}
sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data );