summaryrefslogtreecommitdiff
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
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
-rw-r--r--db/item_db.txt10
-rw-r--r--src/map/status.c13
2 files changed, 14 insertions, 9 deletions
diff --git a/db/item_db.txt b/db/item_db.txt
index 43bd86857..8c69617f7 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -3304,10 +3304,10 @@
12116,Elemental_Earth,Seismic Elemental Converter,11,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill 492,3; },{},{}
12117,Elemental_Wind,Lightning Elemental Converter,11,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ itemskill 492,5; },{},{}
// Elemental Resistance Potions
-12118,Resist_Fire,Fire Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,Ele_Fire,20,Ele_Water,-15; },{},{}
-12119,Resist_Water,Cold Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,Ele_Water,20,Ele_Wind,-15; },{},{}
-12120,Resist_Earth,Earth Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,Ele_Earth,20,Ele_Fire,-15; },{},{}
-12121,Resist_Wind,Thunder Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,Ele_Wind,20,Ele_Earth,-15; },{},{}
+12118,Resist_Fire,Fire Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,-15,0,20,0; },{},{}
+12119,Resist_Water,Cold Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,20,0,0,-15; },{},{}
+12120,Resist_Earth,Earth Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,0,20,-15,0; },{},{}
+12121,Resist_Wind,Thunder Resist Potion,2,,1,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1200000,0,-15,0,20; },{},{}
12122,Sesame_Pastry,Sesame Pastry,0,,1,70,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_HitFood,1200000,30; },{},{}
12123,Honey_Pastry,Honey Pastry,0,,1,70,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_FleeFood,1200000,30; },{},{}
12124,Rainbow_Cake,Rainbow Cake,0,,1,70,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_BATKFood,1200000,10; sc_start SC_MATKFood,120000,10; },{},{}
@@ -3464,7 +3464,7 @@
12273,Military_Rations_C,Military Rations C,0,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCFLEE,600000,33; },{},{}
12274,Daehwandan,Daehwandan,0,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHPRATE,36000000,5; percentheal 10,0; },{},{}
12275,Taecheongdan,Taecheongdan,0,,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,36000000,5; percentheal 0,10; },{},{}
-12279,Undead_Element_Scroll,Shadow Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,300000,Ele_Fire,20,Ele_Water,0; sc_start4 SC_ARMOR_ELEMENT,300000,Ele_Water,20,Ele_Wind,0; sc_start4 SC_ARMOR_ELEMENT,300000,Ele_Earth,20,Ele_Fire,0; sc_start4 SC_ARMOR_ELEMENT,300000,Ele_Wind,20,Ele_Earth,0; },{},{}
+12279,Undead_Element_Scroll,Shadow Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,300000,20,20,20,20; },{},{}
12280,Holy_Element_Scroll,Holy Armor Scroll,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ specialeffect2 91; sc_start SC_BENEDICTIO,300000,1; },{},{}
12701,Old_Blue_Box_F,Old Blue Box,2,,,200,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
//April Fools Day Event (2007)
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 );