From b5f526d1ff2351011974c0e4f90e4996fb87c699 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Thu, 15 Nov 2007 04:29:05 +0000 Subject: - Added 2 new status changes for Life and Regeneration Potions [Zephyrus] - Fixed some items boxes giving wrong tamings. - Fixed another item giving 48 gladius[3] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11738 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 3 +++ db/Changelog.txt | 4 ++++ db/const.txt | 2 ++ db/item_db.txt | 18 +++++++++--------- src/map/pc.c | 4 ++++ src/map/skill.c | 18 ++++++++++++++---- src/map/status.c | 23 +++++++++++++++++++++++ src/map/status.h | 2 ++ 8 files changed, 61 insertions(+), 13 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index e9eb58dd9..39b217733 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -6,6 +6,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2007/11/16 * Added error messages when trying to place objects on invalid map coords * Fixed Divine Protection working against players (bugreport:410) + * Added 2 new status changes for Life and Regeneration Potions [Zephyrus] + - Fixed some items boxes giving wrong tamings. + - Fixed another item giving 48 gladius[3] 2007/11/15 * Fixed some homunculus skill offset calculation mistakes (bugreport:363) 2007/11/14 diff --git a/db/Changelog.txt b/db/Changelog.txt index 02fc120c2..eb53e9593 100644 --- a/db/Changelog.txt +++ b/db/Changelog.txt @@ -37,6 +37,10 @@ 2376 General's_Plate_Mail Increases heal recovery effectiveness on you by 10% ======================= +11/16 + * Rev. 11734 Corrected some taming item boxes. [Zephyrus] + - Fixed another item giving 48 Gladius[3] + - Added the Life Potion and Regeneration Potion functions. 11/13 * Rev. 11720 Corrected some of the ep. 12 accessory bonuses. [L0ne_W0lf] - Rev. 11722 Added some premium items (fireworks items and MDef Potions) [Zephyrus] diff --git a/db/const.txt b/db/const.txt index aca00297b..cd7303669 100644 --- a/db/const.txt +++ b/db/const.txt @@ -763,6 +763,8 @@ SC_INCDEF 262 SC_INCBASEATK 263 SC_FASTCAST 264 SC_INCMDEFRATE 265 +SC_HPREGEN 266 +SC_INCHEALRATE 267 e_gasp 0 e_what 1 diff --git a/db/item_db.txt b/db/item_db.txt index cf1a70507..34b726a84 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -3730,7 +3730,7 @@ 13642,2_Hour_Package_Vol_3,2_Hour Package Vol 3,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12252,4; getitem 12253,4; getitem 12208,4; getitem 12215,30; getitem 12216,30; getitem 12211,2; getitem 7621,2; },{},{} 13643,2_Hour_Package_Vol_4,2_Hour Package Vol 4,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12252,4; getitem 12255,4; getitem 12208,4; getitem 12215,30; getitem 12216,30; getitem 12211,2; getitem 7621,2; },{},{} 13644,2_Hour_Package_Vol_5,2_Hour Package Vol 5,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12252,4; getitem 12250,4; getitem 12208,4; getitem 12215,30; getitem 12216,30; getitem 12211,2; getitem 7621,2; },{},{} -13645,2_Hour_Package_Vol_6,2_Hour Package Vol 6,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12250,4; getitem 12251,4; getitem 12208,4; getitem 1220,48; getitem 12217,40; getitem 12211,2; getitem 7621,2; },{},{} +13645,2_Hour_Package_Vol_6,2_Hour Package Vol 6,2,20,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 12250,4; getitem 12251,4; getitem 12208,4; getitem 12215,30; getitem 12217,40; getitem 12211,2; getitem 7621,2; },{},{} 13646,Infiltrator_Box_,Refined Infiltrator Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 1267,1; },{},{} 13647,Muramasa_Box_,Refined Muramasa Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 1173,1; },{},{} 13648,Excalibur_Box_,Refined Excalibur Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 13401,1; },{},{} @@ -3901,11 +3901,11 @@ 13813,Food_Box_Vol_3,Food Box Vol 3,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14553,1; getitem 14556,1; getitem 14559,1; getitem 14562,1; getitem 14565,1; getitem 14568,1; },{},{} 13814,Healing_Box,Healing Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} 13815,Goblin_1_Taming_Box,Goblin Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14569,10; },{},{} -13816,Goblin_2_Taming_Box,Goblin Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14569,10; },{},{} -13817,Goblin_4_Taming_Box,Goblin Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14569,10; },{},{} -13818,Deleter_Taming_Box,Deleter Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14569,10; },{},{} -13819,Diabolic_Taming_Box,Diabolic Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14569,10; },{},{} -13820,Wanderer_Taming_Box,Wanderer Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14569,10; },{},{} +13816,Goblin_2_Taming_Box,Goblin Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14570,10; },{},{} +13817,Goblin_4_Taming_Box,Goblin Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14571,10; },{},{} +13818,Deleter_Taming_Box,Deleter Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14572,10; },{},{} +13819,Diabolic_Taming_Box,Diabolic Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14573,10; },{},{} +13820,Wanderer_Taming_Box,Wanderer Taming Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 14574,10; },{},{} 13821,Green_Apple_Box,Green_Apple_Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 7821,10; },{},{} 13822,Whole_Roast_Box,Whole_Roast_Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 7822,10; },{},{} 13823,Meat_Kabob_Box,Meat_Kabob_Box,2,,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem 7823,10; },{},{} @@ -3954,10 +3954,10 @@ 14531,Concentration_Power_Scroll,Concentration Power Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCHIT,1800000,30; },{},{} 14532,Field_Manual_25%,Field Manual 25%,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,25; },{},{} 14533,Field_Manual_100%,Field Manual 100%,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXPBOOST,1800000,100; },{},{} -14534,Small_Life_Potion,Small Life Potion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} -14535,Medium_Life_Potion,Medium Life Potion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} +14534,Small_Life_Potion,Small Life Potion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_HPREGEN,600000,5,5,0,0; },{},{} +14535,Medium_Life_Potion,Medium Life Potion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_HPREGEN,600000,7,4,0,0; },{},{} 14536,Abrasive,Abrasive,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCCRI,300000,30; },{},{} -14537,Regeneration_Potion,Regeneration Potion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} +14537,Regeneration_Potion,Regeneration Potion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCHEALRATE,1800000,20; },{},{} 14538,Glass_of_Illusion,Glass of Illusion,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{} 14539,Shadow_Armor_Scroll,Shadow Armor Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1800000,Ele_Shadow,20,Ele_Holy,-15; },{},{} 14540,Holy_Armor_Scroll,Holy Armor Scroll,2,,10,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start4 SC_ARMOR_ELEMENT,1800000,Ele_Holy,20,Ele_Shadow,-15; },{},{} diff --git a/src/map/pc.c b/src/map/pc.c index 5c46708b1..9bf6c5d22 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5502,6 +5502,10 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) } if(bonus!=100) hp = hp * bonus / 100; + + // Recovery Potion + if( sd->sc.count && sd->sc.data[SC_INCHEALRATE].timer!=-1 ) + hp += (int)(hp * sd->sc.data[SC_INCHEALRATE].val1/100.); } if(sp) { bonus = 100 + (sd->battle_status.int_<<1) diff --git a/src/map/skill.c b/src/map/skill.c index 0918eeed4..02df3b52a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -257,8 +257,13 @@ int skill_calc_heal (struct block_list *src, struct block_list *target, int skil heal += heal * skill * 2 / 100; sc = status_get_sc(target); - if (sc && sc->count && sc->data[SC_CRITICALWOUND].timer!=-1) - heal -= heal * sc->data[SC_CRITICALWOUND].val2/100; + if (sc && sc->count) + { + if( sc->data[SC_CRITICALWOUND].timer!=-1 ) + heal -= heal * sc->data[SC_CRITICALWOUND].val2/100; + if( sc->data[SC_INCHEALRATE].timer!=-1 ) + heal += heal * sc->data[SC_INCHEALRATE].val1/100; + } return heal; } @@ -6708,8 +6713,13 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns int heal = sg->val2; if (tstatus->hp >= tstatus->max_hp) break; - if (tsc && tsc->data[SC_CRITICALWOUND].timer!=-1) - heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100; + if (tsc) + { + if( tsc->data[SC_INCHEALRATE].timer!=-1 ) + heal += heal * tsc->data[SC_INCHEALRATE].val1 / 100; + if( tsc->data[SC_CRITICALWOUND].timer!=-1 ) + heal -= heal * tsc->data[SC_CRITICALWOUND].val2 / 100; + } if (status_isimmune(bl)) heal = 0; /* 黄金蟲カード(ヒール量0) */ clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1); diff --git a/src/map/status.c b/src/map/status.c index 2c9539b28..926b77162 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4949,6 +4949,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val if (sc->data[type].val2 > val2) return 0; break; + case SC_HPREGEN: case SC_STUN: case SC_SLEEP: case SC_POISON: @@ -5263,6 +5264,12 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val if (!val4) val4 = 1; tick = 10000; break; + case SC_HPREGEN: + // val1 = % of Max HP per tick + val4 = tick/(val2 * 1000); + if (!val4) val4 = 1; + tick = val2 * 1000; // val2 = seconds + break; case SC_HIDING: val2 = tick/1000; @@ -5860,6 +5867,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val //Place here SCs that have no SCB_* data, no skill associated, no ICON //associated, and yet are not wrong/unknown. [Skotlex] break; + case SC_INCHEALRATE: + if (val1 < 1) + val1 = 1; + break; default: if( calc_flag == SCB_NONE && StatusSkillChangeTable[type] == 0 && StatusIconChangeTable[type] == 0 ) { //Status change with no calc, no icon, and no skill associated...? @@ -6783,6 +6794,18 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) } break; + case SC_HPREGEN: + if( sd && (--sc->data[type].val4) >= 0 ) + { + if( status->hp < status->max_hp ) { + int hp = (int)(sd->status.max_hp * sc->data[type].val1 / 100.); + status_heal(bl, hp, 0, 2); + } + sc->data[type].timer = add_timer((sc->data[type].val2 * 1000) + tick, status_change_timer, bl->id, data ); + return 0; + } + break; + case SC_KNOWLEDGE: if (sd) { if(bl->m != sd->feel_map[0].m && bl->m != sd->feel_map[1].m && bl->m != sd->feel_map[2].m) diff --git a/src/map/status.h b/src/map/status.h index 153b7288e..71f84e93d 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -281,6 +281,8 @@ enum sc_type { SC_INCBASEATK, SC_FASTCAST, SC_INCMDEFRATE, // Mdef Potion + SC_HPREGEN, // Life Potion + SC_INCHEALRATE, // Regeneration Potion SC_MAX, //Automatically updated max, used in for's to check we are within bounds. }; int SkillStatusChangeTable(int skill); -- cgit v1.2.3-60-g2f50