summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt5
-rw-r--r--db/const.txt22
-rw-r--r--db/item_db.txt62
-rw-r--r--src/map/battle.c17
-rw-r--r--src/map/pc.c178
-rw-r--r--src/map/pc.h19
-rw-r--r--src/map/script.c145
-rw-r--r--src/map/skill.c58
-rw-r--r--src/map/status.c52
-rw-r--r--src/map/status.h36
-rw-r--r--src/map/unit.c7
11 files changed, 321 insertions, 280 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c81a41857..3ee052e70 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,11 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+09/06/28
+ * Implemented script command "autobonus". [Inkfish]
+ - "autobonus" is similar to "bonusautoscript", however it has a timer of its own.
+ - Updated itemdb changing items bonus using "bonusautoscript + sc_start" mode to "autobonus + bonus" mode.
+ - Remove bonusautoscript and status changes that was needed by bonusautoscript and is no longer in use.
09/06/23
* Minor update to atcommand_jailfor and atcommand_char_ban's modif_p var incrementation for minute-based bans/jails. [Paradox924X]
09/06/20
diff --git a/db/const.txt b/db/const.txt
index b34502b89..2bf4d41d4 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -780,7 +780,7 @@ SC_BLOODLUST 243
SC_FLEET 244
SC_SPEED 245
SC_DEFENCE 246
-SC_INCASPDRATE 247
+//SC_INCASPDRATE 247
SC_INCFLEE2 248
SC_JAILED 249
SC_ENCHANTARMS 250
@@ -791,11 +791,11 @@ SC_ITEMBOOST 258
SC_BOSSMAPINFO 259
SC_LIFEINSURANCE 260
SC_INCCRI 261
-SC_INCDEF 262
-SC_INCBASEATK 263
-SC_FASTCAST 264
+//SC_INCDEF 262
+//SC_INCBASEATK 263
+//SC_FASTCAST 264
SC_MDEF_RATE 265
-SC_HPREGEN 266
+//SC_HPREGEN 266
SC_INCHEALRATE 267
SC_PNEUMA 268
SC_AUTOTRADE 269
@@ -805,18 +805,18 @@ SC_SPCOST_RATE 272
SC_COMMONSC_RESIST 273
SC_SEVENWIND 274
SC_DEF_RATE 275
-SC_SPREGEN 276
+//SC_SPREGEN 276
SC_WALKSPEED 277
SC_REBIRTH 284
-SC_SKILLCASTRATE 285
-SC_DEFRATIOATK 286
-SC_HPDRAIN 287
-SC_SKILLATKBONUS 288
+//SC_SKILLCASTRATE 285
+//SC_DEFRATIOATK 286
+//SC_HPDRAIN 287
+//SC_SKILLATKBONUS 288
SC_ITEMSCRIPT 289
SC_S_LIFEPOTION 290
SC_L_LIFEPOTION 291
SC_JEXPBOOST 292
-SC_IGNOREDEF 293
+//SC_IGNOREDEF 293
SC_HELLPOWER 294
SC_INVINCIBLE 295
SC_INVINCIBLEOFF 296
diff --git a/db/item_db.txt b/db/item_db.txt
index 87d759eb7..f7a3c2f27 100644
--- a/db/item_db.txt
+++ b/db/item_db.txt
@@ -540,8 +540,8 @@
1178,Schweizersabel_,Schweizersabel,4,20,,1600,160,,1,2,0x00004082,7,2,34,4,48,1,3,{ bonus bAtkEle,Ele_Wind; bonus bDef,1; bonus3 bAutoSpell,"MG_LIGHTNINGBOLT",3,100; },{},{}
1179,Executioner__,Executioner,4,20,,2200,155,,1,1,0x00004082,7,2,34,4,48,1,3,{ bonus bIgnoreDefRace,RC_DemiHuman; bonus2 bAddRace,RC_DemiHuman,20; bonus2 bSubRace,RC_DemiHuman,-10; bonus bAtkEle,Ele_Dark; },{},{}
1180,Dragon_Slayer_,Dragon Slayer,4,20,,1300,150,,1,2,0x00004082,7,2,34,4,48,1,3,{ bonus bIgnoreDefRace,RC_Dragon; bonus2 bAddRace,RC_Dragon,15; },{},{}
-1181,Tae_Goo_Lyeon,Tae Goo Lyeon,4,20,,2000,250,,1,2,0x00004082,2,2,34,4,90,1,3,{ bonus bFlee2,10; if (JobLevel>=70) bonusautoscript "{ sc_start SC_INCBASEATK,10000,50; }",10; if (getrefine() > 8) { bonus bCastrate,-20; bonus bDelayRate,-20; } },{},{}
-1182,Bloody_Eater,Bloody Eater,4,20,,1200,200,,1,2,0x00004082,7,2,34,4,50,1,3,{ bonus bAtkEle,Ele_Ghost; bonusautoscript "{ specialeffect2 EF_FIRESPLASHHIT; sc_start SC_INCCRI,5000,100; sc_start SC_INCBASEATK,5000,50; }",1; bonus bHPGainValue,100; },{},{}
+1181,Tae_Goo_Lyeon,Tae Goo Lyeon,4,20,,2000,250,,1,2,0x00004082,2,2,34,4,90,1,3,{ bonus bFlee2,10; if (JobLevel>=70) autobonus "{ bonus bBaseAtk,50; }",10,10000; if (getrefine() > 8) { bonus bCastrate,-20; bonus bDelayRate,-20; } },{},{}
+1182,Bloody_Eater,Bloody Eater,4,20,,1200,200,,1,2,0x00004082,7,2,34,4,50,1,3,{ bonus bAtkEle,Ele_Ghost; autobonus "{ bonus bCritical,100; bonus bBaseAtk,50; }",1,5000,0,"{ specialeffect2 EF_FIRESPLASHHIT; }"; bonus bHPGainValue,100; },{},{}
1183,Brave_Assaulter's_Katzbalger,Brave Assaulter's Katzbalger,4,,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus bStr,2; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
1184,Valorous_Assaulter's_Katzbalger,Valorous Assaulter's Katzbalger,4,,,0,200,,1,0,0x00004082,7,2,34,3,80,1,3,{ bonus bCritical,20; bonus2 bAddRace,RC_DemiHuman,55; bonus bCritAtkRate,20; bonus bUnbreakableWeapon,0; },{},{}
1185,Violet_Fear,Violet Fear,4,,,2200,275,,1,2,0x00004082,2,2,34,4,80,1,3,{ bonus3 bAutoSpell,"WZ_METEOR",3,30; bonus3 bAutoSpell,"WZ_FROSTNOVA",5,50; },{},{}
@@ -629,8 +629,8 @@
1278,Katar_Of_Piercing_Wind_,Katar of Piercing Wind,4,45000,,1200,105,,1,3,0x00001000,7,2,34,3,55,1,16,{ bonus bAtkEle,Ele_Wind; bonus2 bAddEff,Eff_Sleep,500; },{},{}
1279,Brave_Carnage_Katar,Brave Carnage Katar,4,,,0,130,,1,0,0x00001000,7,2,34,3,80,1,16,{ bonus bStr,1; bonus bDex,1; bonus bLuk,1; bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
1280,Valorous_Carnage_Katar,Valorous Carnage Katar,4,,,0,130,,1,0,0x00001000,7,2,34,3,80,1,16,{ bonus bStr,1; bonus bDex,1; bonus bLuk,1; bonus2 bAddRace,RC_DemiHuman,70; bonus bCritAtkRate,20; bonus bAspdRate,5; bonus bUnbreakableWeapon,0; },{},{}
-1281,Krieger_Katar1,Glorious Bloody Roar,4,0,,0,140,,1,0,0x00001000,7,2,34,4,80,1,16,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) bonusautoscript "{ sc_start SC_INCASPDRATE,3000,100; }",50; },{},{}
-1282,Krieger_Katar2,Glorious Jamadhar,4,0,,0,140,,1,0,0x00001000,7,2,34,4,80,1,16,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus bCritAtkRate,5; if(getrefine() > 8) bonusautoscript "{ sc_start SC_INCASPDRATE,3000,100; }",50; },{},{}
+1281,Krieger_Katar1,Glorious Bloody Roar,4,0,,0,140,,1,0,0x00001000,7,2,34,4,80,1,16,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) autobonus "{ bonus bAspdRate,100; }",50,3000; },{},{}
+1282,Krieger_Katar2,Glorious Jamadhar,4,0,,0,140,,1,0,0x00001000,7,2,34,4,80,1,16,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus bCritAtkRate,5; if(getrefine() > 8) autobonus "{ bonus bAspdRate,100; }",50,3000; },{},{}
// 1-Handed Axes
1301,Axe,Axe,4,500,,800,38,,1,3,0x000654E3,7,2,2,1,3,1,6,{},{},{}
1302,Axe_,Axe,4,500,,800,38,,1,4,0x000654E3,7,2,2,1,3,1,6,{},{},{}
@@ -672,7 +672,7 @@
1377,Hurricane_Fury,Hurricane's Fury,4,20,,3500,332,,1,1,0x000444A2,2,2,34,4,80,1,7,{ bonus2 bSubSize,1,10+getrefine(); bonus bAspdRate,getrefine(); bonus3 bAutoSpell,"NPC_PULSESTRIKE",5,20; },{},{}
1378,Great_Axe_C,Refined Great Axe,4,1,,0,215,,1,0,0x000444A2,7,2,34,4,1,0,7,{ bonus bStr,5; bonus bHit,20; bonus2 bAddSkillBlow,"MC_MAMMONITE",5; bonus2 bAddEff,Eff_Stun,1500; },{},{}
1379,Valorous_Insane_Battle_Axe,Valorous Insane Battle Axe,4,,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
-1380,Brave_Insane_Battle_Axe,Brave Insane Battle Axe,4,,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; bonusautoscript "{ sc_start SC_STRIPARMOR,3000,0; }",5,BF_WEAPON,1; bonus bUnbreakableWeapon,0; },{},{}
+1380,Brave_Insane_Battle_Axe,Brave Insane Battle Axe,4,,,0,200,,1,0,0x000444A2,7,2,34,3,80,1,7,{ bonus bStr,3; bonus2 bAddRace,RC_DemiHuman,55; autobonus "{ bonus bBreakArmorRate,10000; }",5,3000; bonus bUnbreakableWeapon,0; },{},{}
1381,Novice_Battle_Axe,Novice Battle Axe,4,1,,0,100,,1,0,0x000444A3,7,2,34,1,1,0,7,{},{},{}
1382,Krieger_Twohand_Axe1,Glorious Two-Handed Axe,4,0,,0,220,,1,0,0x000444A2,7,2,34,4,80,1,7,{ bonus2 bAddRace,RC_DemiHuman,70; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) { bonus2 bIgnoreDefRate,RC_DemiHuman,5; bonus3 bAutoSpell,"NPC_CRITICALWOUND",1,50; } if(getrefine() > 8) { bonus3 bAutoSpell,"NPC_CRITICALWOUND",1,50; bonus4 bAutoSpellOnSkill,"MC_MAMMONITE","NPC_CRITICALWOUND",2,100; bonus4 bAutoSpellOnSkill,"WS_CARTTERMINATION","NPC_CRITICALWOUND",2,100; } },{},{}
// 1-Handed Spears
@@ -782,9 +782,9 @@
1538,Spike_,Spike,4,20,,700,85,,1,2,0x00008110,7,2,2,4,40,1,8,{ bonus bCritical,40; bonus bDefRate,-67; bonus bDef2Rate,-67; },{},{}
1539,Golden_Mace_,Golden Mace,4,20,,800,110,,1,2,0x00008110,7,2,2,4,40,1,8,{ bonus2 bAddRace,RC_Undead,10; bonus bUnbreakableWeapon,0; },{},{}
1540,Grand_Cross_,Grand Cross,4,20,,1500,140,,1,1,0x00008110,7,2,2,4,40,1,8,{ bonus bAtkEle,Ele_Holy; skill "PR_TURNUNDEAD",3; bonus3 bAutoSpell,"PR_TURNUNDEAD",3,100; bonus2 bSPDrainValueRace,RC_Undead,1; bonus2 bSPGainRace,RC_Undead,3; },{},{}
-1541,Nemesis,Nemesis,4,20,,900,120,,1,0,0x00008110,7,2,2,4,60,1,8,{ bonus bAtkEle,Ele_Holy; bonus2 bAddRace,RC_Undead,10; bonus2 bAddRace,RC_Demon,10; bonus3 bAutoSpell,"AL_CRUCIS",1+getrefine(),100; bonusautoscript "{ sc_start SC_INCBASEATK,20000,50; }",10; },{},{}
+1541,Nemesis,Nemesis,4,20,,900,120,,1,0,0x00008110,7,2,2,4,60,1,8,{ bonus bAtkEle,Ele_Holy; bonus2 bAddRace,RC_Undead,10; bonus2 bAddRace,RC_Demon,10; bonus3 bAutoSpell,"AL_CRUCIS",1+getrefine(),100; autobonus "{ bonus bBaseAtk,50; }",10,20000; },{},{}
1542,Valorous_Battlefield_Morning_Star,Valorous Battlefield Morning Star,4,0,,0,105,,1,0,0x0004C5B3,7,2,2,3,80,1,8,{ bonus bStr,1; bonus bDex,1; bonus2 bAddRace,RC_DemiHuman,75; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
-1543,Brave_Battlefield_Morning_Star,Brave Battlefield Morning Star,4,0,,0,105,,1,0,0x0004C5B3,7,2,2,3,80,1,8,{ bonus bStr,1; bonus bDex,1; bonus2 bAddRace,RC_DemiHuman,75; bonus bUnbreakableWeapon,0; bonusautoscript "{ sc_start SC_STUN,6000,0; }",5,BF_WEAPON,1; },{},{}
+1543,Brave_Battlefield_Morning_Star,Brave Battlefield Morning Star,4,0,,0,105,,1,0,0x0004C5B3,7,2,2,3,80,1,8,{ bonus bStr,1; bonus bDex,1; bonus2 bAddRace,RC_DemiHuman,75; bonus bUnbreakableWeapon,0; autobonus "{ bonus2 bAddEff,Eff_Stun,5000; }",5,6000; },{},{}
//1544#Luna_Kaleet#
1545,Novice_Mace,Novice Mace,4,1,,0,57,,1,0,0x0004C5B3,7,2,2,1,2,0,8,{},{},{}
1546,Krieger_Onehand_Mace1,Glorious Morning Star,4,0,,0,130,,1,0,0x0004C5B3,7,2,2,4,80,1,8,{ bonus2 bAddRace,RC_DemiHuman,75; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) { bonus2 bIgnoreDefRate,RC_DemiHuman,5; bonus bAspd,5; } if(getrefine() > 8) { bonus2 bAddEff,Eff_Stun,2000; bonus bAspd,5; } },{},{}
@@ -815,7 +815,7 @@
1573,Ancient_Magic,Ancient Magic,4,20,,700,30,,1,2,0x00410100,7,2,2,3,70,1,15,{ bonus bMatkRate,15; if (isequipped(2334) || isequipped(2372)) { bonus bMdef,8; bonus bMaxSPRate,10; bonus bInt,4; }; },{},{}
1574,Brave_Battle_Strategy_Book,Brave Battle Strategy Book,4,0,,0,90,,1,0,0x00410100,7,2,2,3,80,1,15,{ bonus bStr,2; bonus bInt,1; bonus bMatkRate,15; bonus2 bAddRace,RC_DemiHuman,75; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
1575,Valorous_Battle_Strategy_Book,Valorous Battle Strategy Book,4,0,,0,90,,1,0,0x00410100,7,2,2,3,80,1,15,{ bonus bStr,2; bonus bInt,1; bonus bMatkRate,15; bonus2 bIgnoreMDefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; },{},{}
-1576,Krieger_Book1,Glorious Tablet,4,0,,0,90,,1,0,0x00410100,7,2,2,4,80,1,15,{ bonus bMatkRate,15; bonus2 bAddRace,RC_DemiHuman,80; bonus2 bIgnoreDefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) bonusautoscript "{ sc_start SC_ATKPOTION,3000,200; }",50; },{},{}
+1576,Krieger_Book1,Glorious Tablet,4,0,,0,90,,1,0,0x00410100,7,2,2,4,80,1,15,{ bonus bMatkRate,15; bonus2 bAddRace,RC_DemiHuman,80; bonus2 bIgnoreDefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) autobonus "{ bonus bBaseAtk,200; }",50,3000; },{},{}
1577,Krieger_Book2,Glorious Apocalipse,4,0,,0,90,,1,0,0x00410100,7,2,2,4,80,1,15,{ bonus bMatkRate,15; bonus2 bAddRace,RC_DemiHuman,80; bonus2 bIgnoreDefRate,RC_DemiHuman,25; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus bMatkRate,5; bonus bCastrate,-5; bonus bDelayRate,-5; } },{},{}
1599,Angra_Manyu,Angra Manyu,4,1,,10,200,,2,0,0xFFFFFFFF,7,2,2,1,1,1,8,{ bonus bAllStats,50; bonus bBaseAtk,3800; bonus2 bHPDrainRate,1000,100; },{},{}
// Staffs
@@ -848,7 +848,7 @@
1627,Staffy,Staffy,4,20,,0,120,,1,0,0x00818314,7,2,2,1,1,0,10,{ bonus bMatkRate,15; bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{}
1628,Survival_Rod_C,Refined Survivor's Rod,4,1,,0,71,,1,0,0x00818314,7,2,2,3,1,0,10,{ bonus bDex,4; bonus bMatkRate,20; bonus bMaxHP,500; },{},{}
1629,Walking_Stick,Gentleman's Staff,4,20,,500,40,,1,1,0x00818314,7,2,2,4,50,1,10,{ bonus bMatkRate,15; bonus bDex,1; if (isequipped(5045)) { bonus bDex,2; bonus bInt,2; bonus bSPrecovRate,5; bonus bMatkRate,getrefine(); } },{},{}
-1630,Radiant_Wisdom,Release of Wish,4,20,,500,30,,1,0,0x00010204,7,2,2,3,50,1,10,{ bonus bMatkRate,15; bonus bInt,3; bonus bHealPower,5; bonusautoscript "{ specialeffect2 EF_HEAL; sc_start4 SC_HPREGEN,10000,100,2,0,0; sc_start4 SC_SPREGEN,10000,50,2,0,0; }",10,BF_MAGIC; },{},{}
+1630,Radiant_Wisdom,Release of Wish,4,20,,500,30,,1,0,0x00010204,7,2,2,3,50,1,10,{ bonus bMatkRate,15; bonus bInt,3; bonus bHealPower,5; autobonus "{ bonus2 bSPRegenRate,100,2000; bonus2 bHPRegenRate,50,2000; }",10,10000,BF_MAGIC,"{ specialeffect2 EF_HEAL; }"; },{},{}
1631,Holy_Stick,Holy Stick,4,20,,500,50,,1,1,0x00008100,7,2,2,4,70,1,10,{ bonus bAtkEle,Ele_Holy; bonus bMatkRate,15; bonus2 bCastrate,156,-25; bonus2 bCastrate,77,-25; bonus2 bCastrate,79,-25; },{},{}
1632,Warlock's_Magic_Wand,Warlock's Magic Wand,4,0,,0,70,,1,0,0x00818314,7,2,2,3,80,1,10,{ bonus bInt,4; bonus bDex,3; bonus bMatkRate,15; bonus2 bIgnoreMdefRate,RC_DemiHuman,25; bonus3 bAddEff,Eff_Stun,500,ATF_SKILL; bonus bUnbreakableWeapon,0; },{},{}
1633,Warlock's_Battle_Wand,Warlock's Battle Wand,4,0,,0,70,,1,0,0x00818314,7,2,2,3,80,1,10,{ bonus bInt,3; bonus bDex,3; bonus bMatkRate,15; bonus2 bMagicAddRace,RC_DemiHuman,15; bonus3 bAddEff,Eff_Stun,500,ATF_SKILL; bonus bUnbreakableWeapon,0; },{},{}
@@ -896,7 +896,7 @@
1734,Orc_Archer_Bow,Orc Archer's Bow,4,20,,1600,120,,5,0,0x000A0808,7,2,34,4,65,1,11,{ bonus2 bAddMonsterDropItem,1753,200; if(isequipped(1753)) bonus bLongAtkRate,50; },{},{}
1735,Kkakkung,Kkakkung,4,20,,0,120,,5,0,0x000A0848,7,2,34,1,1,0,11,{ bonus2 bAddRace,RC_Boss,50; bonus2 bAddRace,RC_NonBoss,50; },{},{}
1736,Double_Bound,Double Bound,4,20,,900,70,,5,3,0x00000800,2,2,34,3,70,1,11,{ bonus3 bAutoSpell,"AC_DOUBLE",GetSkillLv("AC_DOUBLE"),100; },{},{}
-1737,Ixion_Wing,Ixion Wings,4,20,,300,135,,5,1,0x00000800,2,2,34,4,70,1,11,{ bonusautoscript "{ sc_start SC_INCASPDRATE,7000,7; }",10+(getrefine()*2); bonus2 bAddSkillBlow,"AC_CHARGEARROW",3; },{},{}
+1737,Ixion_Wing,Ixion Wings,4,20,,300,135,,5,1,0x00000800,2,2,34,4,70,1,11,{ autobonus "{ bonus bAspdRate,7; }",10+(getrefine()*2),7000; bonus2 bAddSkillBlow,"AC_CHARGEARROW",3; },{},{}
1738,Valorous_Battle_CrossBow,Valorous Battle CrossBow,4,0,,0,100,,5,0,0x000A0848,7,2,34,3,80,1,11,{ bonus bDex,2; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
1739,Brave_Battle_CrossBow,Brave Battle CrossBow,4,0,,0,100,,5,0,0x000A0848,7,2,34,3,80,1,11,{ bonus bDex,2; bonus bInt,10; bonus2 bAddRace,RC_DemiHuman,55; bonus bUnbreakableWeapon,0; },{},{}
//1740#Nepentis_Bow#
@@ -951,10 +951,10 @@
1821,Seismic_Fist,Seismic Fist,4,20,,650,80,,1,3,0x00008100,7,2,2,3,75,1,12,{ bonus3 bAutoSpell,"SA_SEISMICWEAPON",5,10; },{},{}
1822,Combo_Battle_Glove,Barrage Fist,4,20,,500,30,,1,4,0x00008100,7,2,2,3,60,1,12,{ bonus2 bSkillAtk,"MO_TRIPLEATTACK",15; bonus2 bSkillAtk,"MO_CHAINCOMBO",15; bonus2 bSkillAtk,"MO_COMBOFINISH",20; },{},{}
1823,Valorous_Battle_Fist,Valorous Battle Fist,4,0,,0,30,,1,0,0x00008100,7,2,2,3,80,1,12,{ bonus bStr,2; bonus bAgi,1; bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus4 bAutoSpell,"CH_SOULCOLLECT",1,5,0; bonus bUnbreakableWeapon,0; },{},{}
-1824,Brave_Battle_Fist,Brave Battle Fist,4,0,,0,30,,1,0,0x00008100,7,2,2,3,80,1,12,{ bonus bStr,2; bonus bInt,1; bonus2 bAddRace,RC_DemiHuman,95; bonus2 bCastrate,271,-25; bonusautoscript "{ sc_start4 SC_SKILLCASTRATE,6000,271,0,0,-100; }",5,BF_WEAPON; bonus bUnbreakableWeapon,0; },{},{}
+1824,Brave_Battle_Fist,Brave Battle Fist,4,0,,0,30,,1,0,0x00008100,7,2,2,3,80,1,12,{ bonus bStr,2; bonus bInt,1; bonus2 bAddRace,RC_DemiHuman,95; bonus2 bCastrate,271,-25; autobonus "{ bonus2 bCastrate,271,-100; }",5,6000; bonus bUnbreakableWeapon,0; },{},{}
//1825#Soul_Of_Hels_Leon#
1826,Krieger_Knuckle1,Glorious Claw,4,0,,0,30,,1,0,0x00008100,7,2,2,4,80,1,12,{ bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus3 bAutoSpell,"MO_INVESTIGATE",1,50; bonus3 bAutoSpell,"AL_DECAGI",1,50; } },{},{}
-1827,Krieger_Knuckle2,Glorious Fist,4,0,,0,30,,1,0,0x00008100,7,2,2,4,80,1,12,{ bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) bonusautoscript3 "{ sc_start4 SC_SKILLCASTRATE,6000,271,401,0,-100; }",500,"MO_EXPLOSIONSPIRITS"; },{},{}
+1827,Krieger_Knuckle2,Glorious Fist,4,0,,0,30,,1,0,0x00008100,7,2,2,4,80,1,12,{ bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) autobonus3 "{ bonus2 bCastrate,271,-100; bonus2 bCastrate,401,-100; }",500,6000,"MO_EXPLOSIONSPIRITS"; },{},{}
// Instruments
1901,Violin,Violin,4,4000,,700,50,,1,3,0x00080000,7,1,2,1,2,1,13,{},{},{}
1902,Violin_,Violin,4,4000,,700,50,,1,4,0x00080000,7,1,2,1,2,1,13,{},{},{}
@@ -1238,11 +1238,11 @@
2373,Holy_Robe_,Holy Robe,5,20,,1700,,7,,1,0x00008110,7,2,16,,60,1,0,{ bonus bMdef,5; bonus2 bSubRace,RC_Demon,15; bonus2 bSubEle,Ele_Dark,10; },{},{}
2374,Lucifer_Robe,Diabolus Robe,5,20,,300,,6,,1,0x00098B1C,2,2,16,,55,1,0,{ bonus bMaxSP,150; bonus bMdef,5; bonus bHealPower,6; bonus bDelayRate,-10; if (isequipped(2729)) { bonus bAtkRate,3; bonus bMatkRate,3; } },{},{}
2375,Lucifer_Armor,Diabolus Armor,5,20,,600,,7,,1,0x000654E2,2,2,16,,55,1,0,{ bonus bStr,2; bonus bDex,1; bonus bMaxHP,150; bonus2 bResEff,Eff_Stun,500; bonus2 bResEff,Eff_Stone,500; if (isequipped(2729)) { bonus bAtkRate,3; bonus bMatkRate,3; } },{},{}
-2376,Assaulter_Plate,Assaulter Plate,5,0,,0,,7,,1,0x006444A2,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2538) && isequipped(2435)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bVit,3; bonus bMaxHPRate,12; bonus2 bSkillHeal2,"AL_HEAL",10; bonus2 bAddItemHealRate,IG_Recovery,10; bonusautoscript2 "{ sc_start4 SC_HPREGEN,10000,600,1,0,0; }",5,BF_WEAPON; }; },{},{}
+2376,Assaulter_Plate,Assaulter Plate,5,0,,0,,7,,1,0x006444A2,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2538) && isequipped(2435)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bVit,3; bonus bMaxHPRate,12; bonus2 bSkillHeal2,"AL_HEAL",10; bonus2 bAddItemHealRate,IG_Recovery,10; autobonus2 "{ bonus2 bHPRegenRate,600,1000; }",5,10000; }; },{},{}
2377,Elite_Engineer_Armor,Elite Engineer Armor,5,0,,0,,7,,1,0x00040420,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2538) && isequipped(2435)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bStr,3; bonus bMaxHPRate,12; bonus2 bSkillAtk,"MC_MAMMONITE",20; bonus2 bSkillHeal,"AM_POTIONPITCHER",10; bonus2 bSkillHeal2,"AM_POTIONPITCHER",10; bonus2 bSkillHeal2,"AL_HEAL",10; bonus bUnbreakableArmor,0; }; },{},{}
-2378,Assassin_Robe,Assassin Robe,5,0,,0,,7,,1,0x02021040,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2538) && isequipped(2435)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bAgi,3; bonus bMaxHPRate,12; bonus bCritical,5; bonus bAspdRate,5; bonusautoscript "{ sc_start4 SC_HPREGEN,10000,300,1,0,0; }",5,BF_WEAPON; }; },{},{}
-2379,Warlock's_Battle_Robe,Warlock's Battle Robe,5,0,,0,,3,,1,0x00810204,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2539) && isequipped(2436)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bInt,3; bonus bMaxHPRate,12; bonus2 bResEff,Eff_Stun,2000; bonusautoscript2 "{ sc_start4 SC_ELEMENTALCHANGE,10000,1,Ele_Ghost,1,0; }",5,BF_WEAPON; }; },{},{}
-2380,Medic's_Robe,Medic's Robe,5,0,,0,,3,,1,0x00008110,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2539) && isequipped(2436)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bInt,3; bonus bMaxHPRate,12; bonus2 bCastrate,156,-50; bonus bHealPower,6; bonusautoscript2 "{ sc_start4 SC_ELEMENTALCHANGE,10000,1,Ele_Ghost,1,0; }",5,BF_WEAPON; }; },{},{}
+2378,Assassin_Robe,Assassin Robe,5,0,,0,,7,,1,0x02021040,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2538) && isequipped(2435)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bAgi,3; bonus bMaxHPRate,12; bonus bCritical,5; bonus bAspdRate,5; autobonus "{ bonus2 bHPRegenRate,300,1000; }",5,10000; }; },{},{}
+2379,Warlock's_Battle_Robe,Warlock's Battle Robe,5,0,,0,,3,,1,0x00810204,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2539) && isequipped(2436)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bInt,3; bonus bMaxHPRate,12; bonus2 bResEff,Eff_Stun,2000; autobonus2 "{ bonus bDefEle,Ele_Ghost; }",5,10000 }; },{},{}
+2380,Medic's_Robe,Medic's Robe,5,0,,0,,3,,1,0x00008110,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2539) && isequipped(2436)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bInt,3; bonus bMaxHPRate,12; bonus2 bCastrate,156,-50; bonus bHealPower,6; autobonus2 "{ bonus bDefEle,Ele_Ghost; }",5,10000 }; },{},{}
2381,Elite_Archer_Suit,Elite Archer Suit,5,0,,0,,3,,1,0x00080808,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2539) && isequipped(2436)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bDex,3; bonus bMaxHPRate,12; bonus bLongAtkDef,10; bonus bDelayRate,-25; }; },{},{}
2382,Elite_Shooter_Suit,Elite Shooter Suit,5,0,,0,,3,,1,0x01000000,7,2,16,,80,1,0,{ bonus bMaxHP,150; bonus bMdef,2; bonus2 bSubRace,RC_DemiHuman,2; if (isequipped(2540) && isequipped(2437)) { bonus2 bSubRace,RC_NonDemiHuman,-300; bonus bDex,3; bonus bMaxHPRate,12; bonus bLongAtkDef,10; bonus bDelayRate,-25; }; },{},{}
2383,Brynhild,Brynhild,5,0,,400,,,,0,0xFFFFFFFF,7,2,16,,94,0,0,{ bonus bMdef,10; bonus bMaxHP,20*BaseLevel; bonus bMaxSP,5*BaseLevel; bonus2 bAddRace,RC_NonBoss,10; bonus2 bAddRace,RC_Boss,10; bonus bMatkRate,10; bonus bUnbreakableArmor,0; bonus bNoKnockback,0; },{},{}
@@ -1251,7 +1251,7 @@
2386,Chameleon_Armor,Chameleon Armor,5,20,,1700,,5,,0,0x00CFDF80,2,2,16,,70,1,0,{ if(BaseClass==Job_Swordman||BaseClass==Job_Merchant||BaseClass==Job_Thief) bonus bDef,3; else if(BaseClass==Job_Mage||BaseClass==Job_Archer||BaseClass==Job_Acolyte) bonus bMDef,5; },{},{}
2387,Sprint_Mail,Sprint Mail,5,20,,1000,,1,,1,0x00CFDF80,2,2,16,,0,1,0,{ bonus bVit,1; bonus bHPrecovRate,5; bonus2 bAddItemHealRate,IG_Recovery,3; },{},{}
2388,Gandora,Gandora,5,20,,300,,4,,1,0x00021040,2,2,16,,70,1,0,{ bonus bAgi,1; bonus bFlee,5; bonus bAspdRate,2; },{},{}
-2389,Naga_Scale_Armor,Naga Scale Armor,5,20,,1000,,5,,1,0x00CFDF80,2,2,16,,0,1,0,{ bonus bMDef,2; bonusautoscript2 "{ sc_start SC_INCBASEATK,10000,10; }",10; },{},{}
+2389,Naga_Scale_Armor,Naga Scale Armor,5,20,,1000,,5,,1,0x00CFDF80,2,2,16,,0,1,0,{ bonus bMDef,2; autobonus2 "{ bonus bBaseAtk,10; }",10,10000; },{},{}
2390,Refined_Tights,Refined Tights,5,20,,400,,6,,1,0x00080808,2,2,16,,75,1,0,{ bonus bMDef,2; bonus bFlee2,3; },{},{}
2391,Life_Link,Life Link,5,20,,3500,,9,,1,0x00004082,2,2,16,,82,1,0,{ bonus bVit,2; bonus bMdef,5; bonus bHPrecovRate,50; },{},{}
//2392,Old_Green_Pantie,Old Green Pantie
@@ -1945,13 +1945,13 @@
4408,Gloom_Under_Night_Card,Gloom Under Night Card,6,20,,10,,,,,,,,16,,,,,{ bonus2 bAddEle,Ele_Holy,40; bonus2 bAddEle,Ele_Dark,40; bonus2 bAddRace,RC_Angel,40; bonus2 bAddRace,RC_Demon,40; },{},{}
4409,Agav_Card,Agav Card,6,20,,10,,,,,,,,16,,,,,{ bonus bMatkRate,5; bonus bDef,-10; if (BaseClass == Job_Mage) bonus bMaxSP,100; },{},{}
4410,Echio_Card,Echio Card,6,20,,10,,,,,,,,16,,,,,{ bonus bBaseAtk,15; if (BaseClass == Job_Swordman) bonus bMaxHP,500; },{},{}
-4411,Vanberk_Card,Vanberk Card,6,20,,10,,,,,,,,769,,,,,{ bonus bStr,2; bonusautoscript "{ specialeffect2 EF_ENHANCE; sc_start SC_INCCRI,5000,100; }",5; },{},{}
-4412,Isilla_Card,Isilla Card,6,20,,10,,,,,,,,769,,,,,{ bonus bInt,2; bonusautoscript "{ specialeffect2 EF_SUFFRAGIUM; sc_start SC_FASTCAST,5000,50; sc_start SC_INCFLEE,5000,30; }",50,BF_MAGIC; },{},{}
-4413,Hodremlin_Card,Hodremlin Card,6,20,,10,,,,,,,,32,,,,,{ bonus2 bSubSize,0,15; bonus2 bSubSize,1,15; bonus2 bSubSize,2,15; bonusautoscript2 "{ specialeffect2 EF_WIND; sc_start SC_INCFLEE2,10000,30; }",3,BF_WEAPON|BF_MAGIC; },{},{}
+4411,Vanberk_Card,Vanberk Card,6,20,,10,,,,,,,,769,,,,,{ bonus bStr,2; autobonus "{ bonus bCritical,100; }",5,5000,0,"{ specialeffect2 EF_ENHANCE; }"; },{},{}
+4412,Isilla_Card,Isilla Card,6,20,,10,,,,,,,,769,,,,,{ bonus bInt,2; autobonus "{ bonus bCastrate,50; bonus bFlee,30; }",50,5000,BF_MAGIC,"{ specialeffect2 EF_SUFFRAGIUM; }"; },{},{}
+4413,Hodremlin_Card,Hodremlin Card,6,20,,10,,,,,,,,32,,,,,{ bonus2 bSubSize,0,15; bonus2 bSubSize,1,15; bonus2 bSubSize,2,15; autobonus2 "{ bonus bFlee2,30; }",3,10000,BF_WEAPON|BF_MAGIC,"{ specialeffect2 EF_WIND; }"; },{},{}
4414,Seeker_Card,Seeker Card,6,20,,10,,,,,,,,32,,,,,{ skill "MG_STONECURSE",1; bonus2 bResEff,Eff_Stone,3000; bonus bMdef,10; },{},{}
4415,Snowier_Card,Snowier Card,6,20,,10,,,,,,,,136,,,,,{ bonus2 bAddMonsterDropItem,536,2000; bonus2 bAddItemHealRate,536,100; },{},{}
4416,Siroma_Card,Siroma Card,6,20,,10,,,,,,,,136,,,,,{ bonus2 bSkillAtk,14,25; bonus2 bCastrate,14,-25; },{},{}
-4417,Ice_Titan_Card,Ice Titan Card,6,20,,10,,,,,,,,64,,,,,{ bonus bVit,2; bonusautoscript2 "{ specialeffect2 EF_FREEZED; sc_start SC_INCDEF,10000,10; }",3,BF_WEAPON|BF_MAGIC; },{},{}
+4417,Ice_Titan_Card,Ice Titan Card,6,20,,10,,,,,,,,64,,,,,{ bonus bVit,2; autobonus2 "{ bonus bDef,10; }",3,10000,BF_WEAPON|BF_MAGIC,"{ specialeffect2 EF_FREEZED; }"; },{},{}
4418,Gazeti_Card,Gazeti Card,6,20,,10,,,,,,,,136,,,,,{ bonus3 bAutoSpell,"MG_COLDBOLT",2,100; },{},{}
4419,Ktullanux_Card,Ktullanux Card,6,20,,10,,,,,,,,16,,,,,{ bonus2 bAddEle,Ele_Fire,50; bonus5 bAutoSpellWhenHit,"WZ_FROSTNOVA",10,20,BF_WEAPON|BF_MAGIC,0; },{},{}
4420,Muscipular_Card,Muscipular Card,6,20,,10,,,,,,,,32,,,,,{ bonus3 bAutoSpellWhenHit,"AL_HEAL",1,100; bonus3 bAutoSpellWhenHit,"AL_INCAGI",1,100; },{},{}
@@ -1959,7 +1959,7 @@
4422,Roween_Card,Roween Card,6,20,,10,,,,,,,,4,,,,,{ bonus bFlee,5; bonus bFlee2,3; bonus2 bAddEle,Ele_Water,10; bonus2 bCriticalAddRace,RC_Fish,15; },{},{}
4423,Galion_Card,Galion Card,6,20,,10,,,,,,,,136,,,,,{ bonus bHit,5; bonus2 bAddEle,Ele_Water,5; },{},{}
4424,Stapo_Card,Stapo Card,6,20,,10,,,,,,,,136,,,,,{ skill "TF_PICKSTONE",1; skill "TF_THROWSTONE",1; },{},{}
-4425,Atroce_Card,Atroce Card,6,20,,10,,,,,,,,2,,,,,{ bonus bBaseAtk,25; bonusautoscript "{ specialeffect2 EF_POTION_BERSERK; sc_start SC_INCASPDRATE,10000,100; }",5; },{},{}
+4425,Atroce_Card,Atroce Card,6,20,,10,,,,,,,,2,,,,,{ bonus bBaseAtk,25; autobonus "{ bonus bAspdRate,100; }",5,10000,0,"{ specialeffect2 EF_POTION_BERSERK; }"; },{},{}
4426,Byorgue_Card,Byorgue Card,6,20,,10,,,,,,,,16,,,,,{ if(BaseJob == Job_Rogue) { bonus bMatkRate,10; bonus2 bAddRace,RC_NonBoss,10; bonus2 bAddRace,RC_Boss,10; } },{},{}
4427,Sword_Guardian_Card,Sword Guardian Card,6,20,,10,,,,,,,,2,,,,,{ if (getiteminfo(getequipid(EQI_HAND_R),11) == 2 || getiteminfo(getequipid(EQI_HAND_R),11) == 3) { bonus bHit,5; bonus bCritical,5; bonus2 bSkillAtk,62,25; } },{},{}
4428,Bow_Guardian_Card,Bow Guardian Card,6,20,,10,,,,,,,,2,,,,,{ if (getiteminfo(getequipid(EQI_HAND_R),11) == 11) { bonus bHit,5; bonus bCritical,5; bonus2 bSkillAtk,47,50; } },{},{}
@@ -4010,10 +4010,10 @@
13031,Sword_Breaker_,Swordbreaker,4,20,,1000,70,,1,3,0x028F5EEE,7,2,2,4,36,1,1,{ bonus bBreakWeaponRate,500; },{},{}
13032,Mail_Breaker_,Mailbreaker,4,20,,1000,70,,1,3,0x028F5EEE,7,2,2,4,36,1,1,{ bonus bBreakArmorRate,500; },{},{}
13033,Assasin_Dagger_,Assassin Dagger,4,20,,600,140,,1,1,0x00001000,7,2,2,4,36,1,1,{ bonus bMaxHPrate,20; bonus bMaxSPrate,15; bonus bAspdRate,2; bonus bAtkEle,Ele_Dark; },{},{}
-13034,Twilight_Desert,Desert Twilight,4,20,,600,130,,1,2,0x00001000,2,2,2,2,70,1,1,{ if (isequipped(13035)) { bonus bMaxSP,20; bonus bMaxHPRate,5; bonus bHit,10; bonus2 bAddSize,2,30; bonusautoscript "{ specialeffect2 EF_POTION_BERSERK; sc_start SC_INCASPDRATE,7000,100; }",1; } },{},{}
+13034,Twilight_Desert,Desert Twilight,4,20,,600,130,,1,2,0x00001000,2,2,2,2,70,1,1,{ if (isequipped(13035)) { bonus bMaxSP,20; bonus bMaxHPRate,5; bonus bHit,10; bonus2 bAddSize,2,30; autobonus "{ bonus bAspdRate,100; }",1,7000,0,"{ specialeffect2 EF_POTION_BERSERK; }"; } },{},{}
13035,Sandstorm,Sandstorm,4,20,,600,50,,1,4,0x00001000,2,2,2,2,70,1,1,{},{},{}
13036,Brave_Assassin's_Damascus,Brave Assassin's Damascus,4,0,,0,120,,1,0,0x028F5EEF,7,2,2,3,80,1,1,{ bonus bStr,1; bonus bAgi,1; bonus2 bAddRace,RC_DemiHuman,75; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if (Class == Job_Ninja || Class == Job_Rogue || Class == Job_Stalker) bonus bMatkRate,15; },{},{}
-13037,Valorous_Assassin's_Damascus,Valorous Assassin's Damascus,4,0,,0,120,,1,0,0x029E7CEB,7,2,2,3,80,1,1,{ bonus bStr,1; bonus bAgi,1; bonus2 bAddRace,RC_DemiHuman,75; bonus bUnbreakableWeapon,0; bonusautoscript "{ sc_start SC_DEFRATIOATK,6000,1; }",50; if (Class == Job_Ninja || Class == Job_Rogue || Class == Job_Stalker) bonus bMatkRate,15; },{},{}
+13037,Valorous_Assassin's_Damascus,Valorous Assassin's Damascus,4,0,,0,120,,1,0,0x029E7CEB,7,2,2,3,80,1,1,{ bonus bStr,1; bonus bAgi,1; bonus2 bAddRace,RC_DemiHuman,75; bonus bUnbreakableWeapon,0; autobonus "{ bonus bDefRatioAtkRace,RC_NonBoss,1; }",50,6000; if (Class == Job_Ninja || Class == Job_Rogue || Class == Job_Stalker) bonus bMatkRate,15; },{},{}
//13038#Trackers_Dagger#
//13039#Ivory_Knife#
13040,Novice_Cutter,Novice Cutter,4,1,,0,50,,1,0,0xFE9F7EEF,7,2,2,1,1,0,1,{},{},{}
@@ -4028,7 +4028,7 @@
13105,The_Garrison_,Garrison,4,48000,,500,70,,7,2,0x01000000,7,2,34,2,55,1,17,{ bonus bHit,-10; },{},{}
13106,Gold_Lux,Gold Lux,4,100000,,500,20,,7,0,0x01000000,7,2,34,3,12,1,17,{ bonus bHit,-10; if(getskilllv("GS_GLITTERING")>0) bonus3 bAutoSpell,"GS_GLITTERING",getskilllv("GS_GLITTERING"),100; },{},{}
13107,Wasteland_Outlaw,Western Outlaw,4,20,,580,68,,7,2,0x01000000,7,2,34,3,70,1,17,{ bonus bHit,readparam(bAgi)/10; bonus bAspdRate,readparam(bAgi)/14; },{},{}
-13108,Soldier_Revolver,Soldier Revolver,4,0,,0,70,,7,0,0x01000000,7,2,34,3,80,1,17,{ bonus bDex,2; bonus bHit,-10; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonusautoscript "{ sc_start SC_INCASPDRATE,3000,100; }",5; bonus bUnbreakableWeapon,0; },{},{}
+13108,Soldier_Revolver,Soldier Revolver,4,0,,0,70,,7,0,0x01000000,7,2,34,3,80,1,17,{ bonus bDex,2; bonus bHit,-10; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; autobonus "{ bonus bAspdRate,100; }",5,3000; bonus bUnbreakableWeapon,0; },{},{}
13110,Glorious_Revolver,Glorious Revolver,4,0,,0,80,,7,0,0x01000000,7,2,34,4,80,1,17,{ bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus4 bAutoSpellOnSkill,"GS_RAPIDSHOWER","GS_GLITTERING",1,1000; bonus2 bSkillAtk,"GS_RAPIDSHOWER",getrefine(); } },{},{}
13150,Branch,Branch,4,3000,,500,50,,9,3,0x01000000,7,2,34,1,1,1,18,{},{},{}
13151,The_Cyclone,Cyclone,4,17500,,700,120,,9,1,0x01000000,7,2,34,2,24,1,18,{ bonus bHit,10; bonus bCritical,10; },{},{}
@@ -4052,13 +4052,13 @@
13169,Thunder_P_,Thunder-P,4,76000,,700,80,,9,2,0x01000000,7,2,34,3,70,1,20,{ bonus bSplashRange,1; bonus bHit,-5; bonus bAspdRate,20; },{},{}
13170,Lever_Action_Rifle,Lever Action Rifle,4,20,,770,138,,9,2,0x01000000,7,2,34,3,70,1,18,{ bonus bHit,20; bonus bCritical,50; bonus bAspdRate,-5; },{},{}
13171,Soldier_Rifle,Soldier Rifle,4,0,,0,50,,9,0,0x01000000,7,2,34,3,80,1,18,{ bonus bDex,2; bonus bHit,10; bonus bCritical,10; bonus2 bAddRace,RC_DemiHuman,75; bonus2 bCastRate,512,-25; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
-13172,Soldier_Gatling_Gun,Soldier Gatling Gun,4,0,,0,80,,9,0,0x01000000,7,2,34,3,80,1,19,{ bonus bDex,2; bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonusautoscript "{ sc_start SC_INCBASEATK,6000,80; sc_start4 SC_HPDRAIN,6000,120,1,0,0; }",5; bonus bUnbreakableWeapon,0; },{},{}
-13173,Soldier_Shotgun,Soldier Shotgun,4,0,,0,100,,9,0,0x01000000,7,2,34,3,80,1,20,{ bonus bDex,2; bonus bSplashRange,1; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonusautoscript "{ sc_start SC_INCBASEATK,6000,80; sc_start4 SC_HPDRAIN,6000,100,1,0,0; }",5; bonus bUnbreakableWeapon,0; },{},{}
-13174,Soldier_Grenade_Launcher,Soldier Grenade Launcher,4,0,,0,300,,9,0,0x01000000,7,2,34,3,80,1,21,{ bonus bDex,2; bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonusautoscript "{ sc_start SC_INCBASEATK,9000,300; sc_start4 SC_HPDRAIN,9000,120,1,0,0; }",5; bonus bUnbreakableWeapon,0; },{},{}
+13172,Soldier_Gatling_Gun,Soldier Gatling Gun,4,0,,0,80,,9,0,0x01000000,7,2,34,3,80,1,19,{ bonus bDex,2; bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,20; autobonus "{ bonus bBaseAtk,80; bonus2 bHPLossRate,120,1000; }",5,6000; bonus bUnbreakableWeapon,0; },{},{}
+13173,Soldier_Shotgun,Soldier Shotgun,4,0,,0,100,,9,0,0x01000000,7,2,34,3,80,1,20,{ bonus bDex,2; bonus bSplashRange,1; bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; autobonus "{ bonus bBaseAtk,80; bonus bHPLossRate,100,1000,0,0; }",5,6000; bonus bUnbreakableWeapon,0; },{},{}
+13174,Soldier_Grenade_Launcher,Soldier Grenade Launcher,4,0,,0,300,,9,0,0x01000000,7,2,34,3,80,1,21,{ bonus bDex,2; bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,20; autobonus "{ bonus bBaseAtk,300; bonus bHPLossRate,120,1000,0,0; }",5,9000; bonus bUnbreakableWeapon,0; },{},{}
13176,Glorious_Rifle,Glorious Rifle,4,0,,0,90,,9,0,0x01000000,7,2,34,4,80,1,18,{ bonus2 bAddRace,RC_DemiHuman,75; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus2 bSkillAtk,"GS_TRIPLEACTION",30; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus2 bCastrate,"GS_TRACKING",-25; bonus2 bSkillAtk,"GS_TRACKING",getrefine() * 3; } },{},{}
13177,Glorious_Gatling_Gun,Glorious Gatling Gun,4,0,,0,90,,9,0,0x01000000,7,2,34,4,80,1,19,{ bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,25; bonus2 bSkillAtk,"GS_TRIPLEACTION",30; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) bonus2 bAddRace,RC_DemiHuman,getrefine(); },{},{}
13178,Glorious_Shotgun,Glorious Shotgun,4,0,,0,110,,9,0,0x01000000,7,2,34,4,80,1,20,{ bonus2 bAddRace,RC_DemiHuman,55; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bSplashRange,1; bonus2 bSkillAtk,"GS_TRIPLEACTION",30; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus2 bSkillAtk,"GS_SPREADATTACK",getrefine() * 2; bonus3 bAddEffOnSkill,"GS_SPREADATTACK",Eff_Stun,5000; } },{},{}
-13179,Glorious_Grenade_Launcher,Glorious Grenade Launcher,4,0,,0,330,,9,0,0x01000000,7,2,34,4,80,1,21,{ bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus2 bSkillAtk,"GS_TRIPLEACTION",30; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus2 bSkillAtk,"GS_GROUNDDRIFT",getrefine() * 2; bonusautoscript "{ sc_start SC_INCASPDRATE,3000,20; }",50; } },{},{}
+13179,Glorious_Grenade_Launcher,Glorious Grenade Launcher,4,0,,0,330,,9,0,0x01000000,7,2,34,4,80,1,21,{ bonus2 bAddRace,RC_DemiHuman,35; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus2 bSkillAtk,"GS_TRIPLEACTION",30; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus2 bSkillAtk,"GS_GROUNDDRIFT",getrefine() * 2; autobonus "{ bonus bAspdRate,20; }",50,3000; } },{},{}
// Bullets
13200,Bullet,Bullet,10,1,,2,10,,,,0x01000000,7,2,32768,,1,,3,{},{},{}
13201,Silver_Bullet,Silver Bullet,10,15,,2,15,,,,0x01000000,7,2,32768,,1,,3,{ bonus bAtkEle,Ele_Holy; },{},{}
@@ -4086,8 +4086,8 @@
13303,Huuma_Blaze,Fuuma Shuriken Rekka,4,78000,,2300,185,,1,0,0x02000000,7,2,34,4,55,1,22,{ bonus bDex,-2; bonus bAtkEle,Ele_Fire; bonus3 bAutoSpell,"MG_FIREBALL",5,30; },{},{}
13304,Huuma_Calm_Mind,Spirit of Kamaitachi,4,20,,1550,112,,1,2,0x02000000,7,2,34,3,70,1,22,{ bonus2 bSkillAtk,"NJ_HUUMA",30; bonus bNoCastCancel,0; },{},{}
13305,Brave_Huuma_Front_Shuriken,Brave Huuma Front Shuriken,4,0,,0,55,,1,0,0x02000000,7,2,34,3,80,1,22,{ bonus bStr,2; bonus bDex,1; bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bUnbreakableWeapon,0; },{},{}
-13306,Valorous_Huuma_Front_Shuriken,Valorous Huuma Front Shuriken,4,0,,0,55,,1,0,0x02000000,7,2,34,3,80,1,22,{ bonus bStr,2; bonus bDex,1; bonus2 bAddRace,RC_DemiHuman,95; bonusautoscript "{ sc_start4 SC_SKILLATKBONUS,10000,525,544,0,100; }",5; bonus bUnbreakableWeapon,0; },{},{}
-13307,Glorious_Huuma_Shuriken,Glorious Huuma Shuriken,4,0,,0,55,,1,0,0x02000000,7,2,34,4,80,1,22,{ bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bMatkRate,15; bonusautoscript "{ sc_start4 SC_SKILLATKBONUS,10000,525,544,0,10; }",50; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus4 bAutoSpellOnSkill,"NJ_ISSEN","AL_HEAL",10,800; bonus4 bAutoSpellOnSkill,"NJ_HUUMA","NPC_CRITICALWOUND",2,100; } },{},{}
+13306,Valorous_Huuma_Front_Shuriken,Valorous Huuma Front Shuriken,4,0,,0,55,,1,0,0x02000000,7,2,34,3,80,1,22,{ bonus bStr,2; bonus bDex,1; bonus2 bAddRace,RC_DemiHuman,95; autobonus "{ bonus2 bSkillAtk,525,100; bonus2 bSkillAtk,544,100; }",5,10000; bonus bUnbreakableWeapon,0; },{},{}
+13307,Glorious_Huuma_Shuriken,Glorious Huuma Shuriken,4,0,,0,55,,1,0,0x02000000,7,2,34,4,80,1,22,{ bonus2 bAddRace,RC_DemiHuman,95; bonus2 bIgnoreDefRate,RC_DemiHuman,20; bonus bMatkRate,15; autobonus "{ bonus2 bSkillAtk,525,10; bonus2 bSkillAtk,544,10; }",50,10000; bonus bUnbreakableWeapon,0; if(getrefine() > 5) bonus2 bIgnoreDefRate,RC_DemiHuman,5; if(getrefine() > 8) { bonus4 bAutoSpellOnSkill,"NJ_ISSEN","AL_HEAL",10,800; bonus4 bAutoSpellOnSkill,"NJ_HUUMA","NPC_CRITICALWOUND",2,100; } },{},{}
13400,Cutlas_,Cutlus,4,20,,900,150,,1,1,0x000654E2,7,2,2,4,40,1,2,{ skill "SM_BASH",5; bonus bStr,2; bonus bDef,1; },{},{}
13401,Excalibur_C,Refined Excalibur,4,,,0,199,,1,0,0x000654E2,7,2,2,4,1,0,2,{ bonus bInt,10; bonus bLuk,10; bonus bAtkEle,Ele_Holy; },{},{}
13402,Cutlas_C,Refined Cutlus,4,,,0,185,,1,0,0x000654E2,7,2,2,4,1,0,2,{ skill "SM_BASH",5; bonus bStr,2; bonus bDef,1; },{},{}
diff --git a/src/map/battle.c b/src/map/battle.c
index 17f052bb0..505d37373 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1786,12 +1786,6 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
}
}
- if( sc && sc->count && sc->data[SC_DEFRATIOATK]
- && !is_boss(target)
- && skill_num != PA_SACRIFICE && skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS && skill_num != PA_SHIELDCHAIN
- && !flag.cri )
- flag.pdef = flag.pdef2 = sc->data[SC_DEFRATIOATK]->val1; // Occult Impact Effect
-
if (!flag.idef || !flag.idef2)
{ //Defense reduction
short vit_def;
@@ -1806,19 +1800,10 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
{
if( i > 100 ) i = 100;
def1 -= def1 * i / 100;
- // def2 -= def2 * i / 100;
+ def2 -= def2 * i / 100;
}
}
- if( sc && sc->count && sc->data[SC_IGNOREDEF]
- && !is_boss(target)
- && skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS )
- {
- i = cap_value(sc->data[SC_IGNOREDEF]->val1,1,100);
- def1 -= def1 * i / 100;
- def2 -= def2 * i / 100;
- }
-
if( battle_config.vit_penalty_type && battle_config.vit_penalty_target&target->type )
{
unsigned char target_count; //256 max targets should be a sane max
diff --git a/src/map/pc.c b/src/map/pc.c
index 3c596ec13..a378e0bfe 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -804,7 +804,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->followtimer = INVALID_TIMER; // [MouseJstr]
sd->invincible_timer = INVALID_TIMER;
- sd->npc_timer_id = -1;
+ sd->npc_timer_id = INVALID_TIMER;
sd->pvp_timer = INVALID_TIMER;
sd->canuseitem_tick = tick;
@@ -813,7 +813,13 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
sd->cansendmail_tick = tick;
for(i = 0; i < MAX_SKILL_LEVEL; i++)
- sd->spirit_timer[i] = -1;
+ sd->spirit_timer[i] = INVALID_TIMER;
+ for(i = 0; i < ARRAYLENGTH(sd->autobonus); i++)
+ sd->autobonus[i].active = INVALID_TIMER;
+ for(i = 0; i < ARRAYLENGTH(sd->autobonus2); i++)
+ sd->autobonus2[i].active = INVALID_TIMER;
+ for(i = 0; i < ARRAYLENGTH(sd->autobonus3); i++)
+ sd->autobonus3[i].active = INVALID_TIMER;
if (battle_config.item_auto_get)
sd->state.autoloot = 10000;
@@ -1406,59 +1412,6 @@ int pc_disguise(struct map_session_data *sd, int class_)
return 1;
}
-int pc_autoscript_add(struct s_autoscript *scripts, int max, short rate, short flag, short target, struct script_code *script, bool onskill)
-{
- int i;
- ARR_FIND(0, max, i, scripts[i].script == NULL);
- if( i == max )
- {
- ShowWarning("pc_autoscript_bonus: Reached max (%d) number of autoscripts per character!\n", max);
- return 0;
- }
-
- scripts[i].script = script;
- scripts[i].rate = rate;
- scripts[i].target = target; // 0 = Script on Self 1 = Script on Target
-
- if( !onskill )
- { // Auto-update flag value.
- if( !(flag&BF_RANGEMASK) )
- flag|=BF_SHORT|BF_LONG; //No range defined? Use both.
- if( !(flag&BF_WEAPONMASK) )
- flag|=BF_WEAPON; //No attack type defined? Use weapon.
- if( !(flag&BF_SKILLMASK) )
- {
- if( flag&(BF_MAGIC|BF_MISC) )
- flag|=BF_SKILL; //These two would never trigger without BF_SKILL
- if( flag&BF_WEAPON )
- flag|=BF_NORMAL|BF_SKILL;
- }
- }
- scripts[i].flag = flag;
- return 1;
-}
-
-void pc_autoscript_clear(struct map_session_data *sd)
-{
- int i;
-
- if( sd->state.autocast )
- return;
-
- for (i = 0; i < MAX_PC_BONUS && sd->autoscript[i].script; i++)
- script_free_code(sd->autoscript[i].script);
-
- for (i = 0; i < MAX_PC_BONUS && sd->autoscript2[i].script; i++)
- script_free_code(sd->autoscript2[i].script);
-
- for (i = 0; i < MAX_PC_BONUS && sd->autoscript3[i].script; i++)
- script_free_code(sd->autoscript3[i].script);
-
- memset(&sd->autoscript, 0, sizeof(sd->autoscript));
- memset(&sd->autoscript2, 0, sizeof(sd->autoscript2));
- memset(&sd->autoscript3, 0, sizeof(sd->autoscript3));
-}
-
static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, short lv, short rate, short flag, short card_id)
{
int i;
@@ -1626,6 +1579,107 @@ static int pc_bonus_item_drop(struct s_add_drop *drop, const short max, short id
return 1;
}
+int pc_addautobonus(struct s_autobonus *bonus,char max,struct script_code *script,short rate,unsigned int dur,short flag,struct script_code *other_script,unsigned short pos,bool onskill)
+{
+ int i;
+
+ ARR_FIND(0, max, i, bonus[i].rate == 0);
+ if( i == max )
+ {
+ ShowWarning("pc_addautobonus: Reached max (%d) number of autobonus per character!\n", max);
+ return 0;
+ }
+
+ if( !onskill )
+ {
+ if( !(flag&BF_RANGEMASK) )
+ flag|=BF_SHORT|BF_LONG; //No range defined? Use both.
+ if( !(flag&BF_WEAPONMASK) )
+ flag|=BF_WEAPON; //No attack type defined? Use weapon.
+ if( !(flag&BF_SKILLMASK) )
+ {
+ if( flag&(BF_MAGIC|BF_MISC) )
+ flag|=BF_SKILL; //These two would never trigger without BF_SKILL
+ if( flag&BF_WEAPON )
+ flag|=BF_NORMAL|BF_SKILL;
+ }
+ }
+
+ bonus[i].rate = rate;
+ bonus[i].duration = dur;
+ bonus[i].active = INVALID_TIMER;
+ bonus[i].atk_type = flag;
+ bonus[i].pos = pos;
+ bonus[i].bonus_script = script;
+ bonus[i].other_script = other_script;
+ return 1;
+}
+
+int pc_delautobonus(struct map_session_data* sd, struct s_autobonus *autobonus,char max,bool restore)
+{
+ int i;
+ nullpo_retr(0, sd);
+
+ for( i = 0; i < max; i++ )
+ {
+ if( autobonus[i].active != INVALID_TIMER && ( !restore || (autobonus[i].pos && !(sd->state.autobonus&autobonus[i].pos)) ) )
+ { // Logout / Unequipped an item with an activated bonus
+ delete_timer(autobonus[i].active,pc_endautobonus);
+ autobonus[i].active = INVALID_TIMER;
+ }
+
+ if( restore && sd->state.autobonus&autobonus[i].pos )
+ {
+ if( autobonus[i].active != INVALID_TIMER )
+ run_script(autobonus[i].bonus_script,0,sd->bl.id,0);
+ continue;
+ }
+
+ if( sd->state.autocast )
+ continue;
+
+ if( autobonus[i].bonus_script )
+ script_free_code(autobonus[i].bonus_script);
+ if( autobonus[i].other_script )
+ script_free_code(autobonus[i].other_script);
+ autobonus[i].rate = autobonus[i].atk_type = autobonus[i].duration = autobonus[i].pos = 0;
+ autobonus[i].bonus_script = autobonus[i].other_script = NULL;
+ autobonus[i].active = INVALID_TIMER;
+ }
+
+ return 0;
+}
+
+int pc_exeautobonus(struct map_session_data *sd,struct s_autobonus *autobonus)
+{
+ nullpo_retr(0, sd);
+ nullpo_retr(0, autobonus);
+
+ if( autobonus->bonus_script )
+ run_script(autobonus->bonus_script,0,sd->bl.id,0);
+ if( autobonus->other_script )
+ run_script(autobonus->other_script,0,sd->bl.id,0);
+
+ autobonus->active = add_timer(gettick()+autobonus->duration, pc_endautobonus, sd->bl.id, (intptr)autobonus);
+ sd->state.autobonus |= autobonus->pos;
+
+ return 0;
+}
+
+int pc_endautobonus(int tid, unsigned int tick, int id, intptr data)
+{
+ struct map_session_data *sd = map_id2sd(id);
+ struct s_autobonus *autobonus = (struct s_autobonus *)data;
+
+ nullpo_retr(0, sd);
+ nullpo_retr(0, autobonus);
+
+ autobonus->active = INVALID_TIMER;
+ sd->state.autobonus &= ~autobonus->pos;
+ status_calc_pc(sd,0);
+ return 0;
+}
+
/*==========================================
* ? 備品による能力等のボ?ナス設定
*------------------------------------------*/
@@ -5240,16 +5294,6 @@ int pc_skillatk_bonus(struct map_session_data *sd, int skill_num)
ARR_FIND(0, ARRAYLENGTH(sd->skillatk), i, sd->skillatk[i].id == skill_num);
if( i < ARRAYLENGTH(sd->skillatk) ) bonus = sd->skillatk[i].val;
- if( sd->sc.data[SC_SKILLATKBONUS] )
- {
- if( sd->sc.data[SC_SKILLATKBONUS]->val1 && sd->sc.data[SC_SKILLATKBONUS]->val1 == skill_num )
- bonus += sd->sc.data[SC_SKILLATKBONUS]->val4;
- if( sd->sc.data[SC_SKILLATKBONUS]->val2 && sd->sc.data[SC_SKILLATKBONUS]->val2 == skill_num )
- bonus += sd->sc.data[SC_SKILLATKBONUS]->val4;
- if( sd->sc.data[SC_SKILLATKBONUS]->val3 && sd->sc.data[SC_SKILLATKBONUS]->val3 == skill_num )
- bonus += sd->sc.data[SC_SKILLATKBONUS]->val4;
- }
-
return bonus;
}
@@ -6966,6 +7010,9 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag)
status_change_end(&sd->bl, SC_ARMOR_RESIST, -1);
}
+ if( sd->state.autobonus&sd->status.inventory[n].equip )
+ sd->state.autobonus &= ~sd->status.inventory[n].equip; //Check for activated autobonus [Inkfish]
+
sd->status.inventory[n].equip=0;
if(flag&1) {
@@ -7920,6 +7967,7 @@ int do_init_pc(void)
add_timer_func_list(pc_autosave, "pc_autosave");
add_timer_func_list(pc_spiritball_timer, "pc_spiritball_timer");
add_timer_func_list(pc_follow_timer, "pc_follow_timer");
+ add_timer_func_list(pc_endautobonus, "pc_endautobonus");
add_timer(gettick() + autosave_interval, pc_autosave, 0, 0);
diff --git a/src/map/pc.h b/src/map/pc.h
index 3d09ebcbe..90e055c17 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -67,9 +67,13 @@ struct s_add_drop {
int race, rate;
};
-struct s_autoscript {
- unsigned short rate, flag, target;
- struct script_code *script;
+struct s_autobonus {
+ short rate,atk_type;
+ unsigned int duration;
+ struct script_code *bonus_script;
+ struct script_code *other_script;
+ int active;
+ unsigned short pos;
};
struct map_session_data {
@@ -126,6 +130,7 @@ struct map_session_data {
unsigned int bg_id;
unsigned skillonskill : 1;
unsigned short user_font;
+ unsigned short autobonus;
} state;
struct {
unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
@@ -243,7 +248,7 @@ struct map_session_data {
} itemhealrate[MAX_PC_BONUS];
// zeroed structures end here
// manually zeroed structures start here.
- struct s_autoscript autoscript[MAX_PC_BONUS], autoscript2[MAX_PC_BONUS], autoscript3[MAX_PC_BONUS]; //Auto script on attack, when attacked, on skill usage
+ struct s_autobonus autobonus[MAX_PC_BONUS], autobonus2[MAX_PC_BONUS], autobonus3[MAX_PC_BONUS]; //Auto script on attack, when attacked, on skill usage
// manually zeroed structures end here.
// zeroed vars start here.
int arrow_atk,arrow_ele,arrow_cri,arrow_hit;
@@ -571,8 +576,10 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd,
int pc_updateweightstatus(struct map_session_data *sd);
-int pc_autoscript_add(struct s_autoscript *scripts, int max, short rate, short flag, short target, struct script_code *script, bool onskill);
-void pc_autoscript_clear(struct map_session_data *sd);
+int pc_addautobonus(struct s_autobonus *bonus,char max,struct script_code *script,short rate,unsigned int dur,short atk_type,struct script_code *other_script,unsigned short pos,bool onskill);
+int pc_exeautobonus(struct map_session_data* sd,struct s_autobonus *bonus);
+int pc_endautobonus(int tid, unsigned int tick, int id, intptr data);
+int pc_delautobonus(struct map_session_data* sd,struct s_autobonus *bonus,char max,bool restore);
int pc_bonus(struct map_session_data*,int,int);
int pc_bonus2(struct map_session_data *sd,int,int,int);
diff --git a/src/map/script.c b/src/map/script.c
index dd4022220..9edab3e2a 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6624,87 +6624,121 @@ BUILDIN_FUNC(bonus)
return 0;
}
-/// Bonus script that has a chance of being executed on attack.
-BUILDIN_FUNC(bonusautoscript)
+BUILDIN_FUNC(autobonus)
{
- int rate, flag = 0, target = 0;
- const char *str;
- struct script_code *script;
+ unsigned int dur;
+ short rate;
+ short atk_type = 0;
TBL_PC* sd;
+ struct script_code *bonus_script;
+ struct script_code *other_script = NULL;
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
+ return 0; // no player attached
+ if( sd->state.autocast )
+ return 0;
+ if( sd->state.autobonus&sd->status.inventory[current_equip_item_index].equip )
+ return 0;
- str = script_getstr(st,2);
+ bonus_script = parse_script(script_getstr(st,2), "autobonus bonus", 0, 0);
rate = script_getnum(st,3);
- if( script_hasdata(st,4) )
- flag = script_getnum(st,4);
+ dur = script_getnum(st,4);
+
+ if( !bonus_script || !rate || !dur )
+ return 0;
+
if( script_hasdata(st,5) )
- target = script_getnum(st,5);
- script = parse_script(str, "autoscript bonus", 0, 0);
- if( !script )
- return 1;
- if( sd->state.autocast || !pc_autoscript_add(sd->autoscript, ARRAYLENGTH(sd->autoscript), rate, flag, target, script, false) )
+ atk_type = script_getnum(st,5);
+ if( script_hasdata(st,6) )
+ other_script = parse_script(script_getstr(st,6), "autobonus other", 0, 0);
+
+ if( !pc_addautobonus(sd->autobonus,ARRAYLENGTH(sd->autobonus),bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
{
- script_free_code(script);
- return 1;
+ if( bonus_script )
+ script_free_code(bonus_script);
+ if( other_script )
+ script_free_code(other_script);
}
- return 0;
+
+ return 0;
}
-/// Bonus script that has a chance of being executed when attacked.
-BUILDIN_FUNC(bonusautoscript2)
+
+BUILDIN_FUNC(autobonus2)
{
- int rate, flag = 0, target = 0;
- const char *str;
- struct script_code *script;
+ unsigned int dur;
+ short rate;
+ short atk_type = 0;
TBL_PC* sd;
+ struct script_code *bonus_script;
+ struct script_code *other_script = NULL;
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
+ return 0; // no player attached
+ if( sd->state.autocast )
+ return 0;
+ if( sd->state.autobonus&sd->status.inventory[current_equip_item_index].equip )
+ return 0;
- str = script_getstr(st,2);
+ bonus_script = parse_script(script_getstr(st,2), "autobonus bonus", 0, 0);
rate = script_getnum(st,3);
- if( script_hasdata(st,4) )
- flag = script_getnum(st,4);
+ dur = script_getnum(st,4);
+
+ if( !bonus_script || !rate || !dur )
+ return 0;
+
if( script_hasdata(st,5) )
- target = script_getnum(st,5);
- script = parse_script(str, "autoscript2 bonus", 0, 0);
- if (!script)
- return 1;
- if( sd->state.autocast || !pc_autoscript_add(sd->autoscript2, ARRAYLENGTH(sd->autoscript2), rate, flag, target, script, false) )
+ atk_type = script_getnum(st,5);
+ if( script_hasdata(st,6) )
+ other_script = parse_script(script_getstr(st,6), "autobonus2 other", 0, 0);
+
+ if( !pc_addautobonus(sd->autobonus2,ARRAYLENGTH(sd->autobonus2),bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,false) )
{
- script_free_code(script);
- return 1;
+ if( bonus_script )
+ script_free_code(bonus_script);
+ if( other_script )
+ script_free_code(other_script);
}
- return 0;
+
+ return 0;
}
-/// Bonus script that has a chance of being executed when used a skill
-BUILDIN_FUNC(bonusautoscript3)
+
+BUILDIN_FUNC(autobonus3)
{
- int rate, skill, target = 0;
- const char *str;
- struct script_code *script;
+ unsigned int dur;
+ short rate,atk_type;
TBL_PC* sd;
+ struct script_code *bonus_script;
+ struct script_code *other_script = NULL;
sd = script_rid2sd(st);
if( sd == NULL )
- return 0;// no player attached, report source
+ return 0; // no player attached
+ if( sd->state.autocast )
+ return 0;
+ if( sd->state.autobonus&sd->status.inventory[current_equip_item_index].equip )
+ return 0;
- str = script_getstr(st,2);
+ bonus_script = parse_script(script_getstr(st,2), "autobonus bonus", 0, 0);
rate = script_getnum(st,3);
- skill = ( script_isstring(st,4) ? skill_name2id(script_getstr(st,4)) : script_getnum(st,4) );
- if( script_hasdata(st,5) )
- target = script_getnum(st,5);
- script = parse_script(str, "autoscript3 bonus", 0, 0);
- if( !script )
- return 1;
- if( sd->state.autocast || !pc_autoscript_add(sd->autoscript3, ARRAYLENGTH(sd->autoscript3), rate, skill, target, script, true) )
+ dur = script_getnum(st,4);
+ atk_type = ( script_isstring(st,5) ? skill_name2id(script_getstr(st,5)) : script_getnum(st,5) );
+
+ if( !bonus_script || !rate || !dur || !atk_type )
+ return 0;
+
+ if( script_hasdata(st,6) )
+ other_script = parse_script(script_getstr(st,6), "autobonus3 other", 0, 0);
+
+ if( !pc_addautobonus(sd->autobonus3,ARRAYLENGTH(sd->autobonus3),bonus_script,rate,dur,atk_type,other_script,sd->status.inventory[current_equip_item_index].equip,true) )
{
- script_free_code(script);
- return 1;
+ if( bonus_script )
+ script_free_code(bonus_script);
+ if( other_script )
+ script_free_code(other_script);
}
+
return 0;
}
@@ -14029,7 +14063,7 @@ static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
int skillid = va_arg(ap,int);
int skilllv = va_arg(ap,int);
int casttime = va_arg(ap,int);
- bool cancel = va_arg(ap,bool);
+ int cancel = va_arg(ap,int);
int emotion = va_arg(ap,int);
int target = va_arg(ap,int);
@@ -14066,8 +14100,7 @@ static int buildin_mobuseskill_sub(struct block_list *bl,va_list ap)
BUILDIN_FUNC(areamobuseskill)
{
struct block_list center;
- int m,range,mobid,skillid,skilllv,casttime,emotion,target;
- bool cancel;
+ int m,range,mobid,skillid,skilllv,casttime,emotion,target,cancel;
if( (m = map_mapname2mapid(script_getstr(st,2))) < 0 )
{
@@ -14185,9 +14218,9 @@ struct script_function buildin_func[] = {
BUILDIN_DEF2(bonus,"bonus3","ivii"),
BUILDIN_DEF2(bonus,"bonus4","ivvii"),
BUILDIN_DEF2(bonus,"bonus5","ivviii"),
- BUILDIN_DEF(bonusautoscript,"si??"),
- BUILDIN_DEF(bonusautoscript2,"si??"),
- BUILDIN_DEF(bonusautoscript3,"siv?"),
+ BUILDIN_DEF(autobonus,"sii??"),
+ BUILDIN_DEF(autobonus2,"sii??"),
+ BUILDIN_DEF(autobonus3,"siiv?"),
BUILDIN_DEF(skill,"vi?"),
BUILDIN_DEF(addtoskill,"vi?"), // [Valaris]
BUILDIN_DEF(guildskill,"vi"),
diff --git a/src/map/skill.c b/src/map/skill.c
index 27bf689ac..6c6bb0cf0 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1042,20 +1042,22 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
}
}
- //Auto-script when attacking
- if( sd && sd->autoscript[0].script )
+ //Autobonus when attacking
+ if( sd && sd->autobonus[0].rate )
{
int i;
- for( i = 0; i < ARRAYLENGTH(sd->autoscript) && sd->autoscript[i].script; i++ )
+ for( i = 0; i < ARRAYLENGTH(sd->autobonus); i++ )
{
- if(!(sd->autoscript[i].flag&attack_type&BF_WEAPONMASK &&
- sd->autoscript[i].flag&attack_type&BF_RANGEMASK &&
- sd->autoscript[i].flag&attack_type&BF_SKILLMASK))
- continue; // one or more trigger conditions were not fulfilled
- if( rand()%1000 > sd->autoscript[i].rate )
+ if( rand()%1000 > sd->autobonus[i].rate )
+ continue;
+ if( sd->autobonus[i].active != INVALID_TIMER )
continue;
+ if(!(sd->autobonus[i].atk_type&attack_type&BF_WEAPONMASK &&
+ sd->autobonus[i].atk_type&attack_type&BF_RANGEMASK &&
+ sd->autobonus[i].atk_type&attack_type&BF_SKILLMASK))
+ continue; // one or more trigger conditions were not fulfilled
sd->state.autocast = 1;
- run_script(sd->autoscript[i].script,0,sd->autoscript[i].target?bl->id:src->id,0);
+ pc_exeautobonus(sd,&sd->autobonus[i]);
sd->state.autocast = 0;
}
}
@@ -1128,18 +1130,18 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, int s
sd->state.autocast = 0;
}
- if( sd->autoscript3[0].script )
+ if( sd && sd->autobonus3[0].rate )
{
- for( i = 0; i < ARRAYLENGTH(sd->autoscript3) && sd->autoscript3[i].script; i++ )
+ for( i = 0; i < ARRAYLENGTH(sd->autobonus3); i++ )
{
- if( sd->autoscript3[i].flag != skillid )
+ if( rand()%1000 > sd->autobonus3[i].rate )
continue;
- if( sd->autoscript3[i].target && bl == NULL )
+ if( sd->autobonus3[i].active != INVALID_TIMER )
continue;
- if( rand()%1000 > sd->autoscript3[i].rate )
+ if( sd->autobonus3[i].atk_type != skillid )
continue;
sd->state.autocast = 1;
- run_script(sd->autoscript3[i].script,0,sd->bl.id,0);
+ pc_exeautobonus(sd,&sd->autobonus3[i]);
sd->state.autocast = 0;
}
}
@@ -1316,20 +1318,23 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
}
}
}
- //Auto-script when attacked
- if( dstsd && !status_isdead(bl) && dstsd->autoscript2[0].script && !(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE) )
+
+ //Autobonus when attacked
+ if( dstsd && !status_isdead(bl) && dstsd->autobonus2[0].rate && !(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE) )
{
int i;
- for( i = 0; i < ARRAYLENGTH(dstsd->autoscript2) && dstsd->autoscript2[i].script; i++ )
+ for( i = 0; i < ARRAYLENGTH(dstsd->autobonus2); i++ )
{
- if(!(dstsd->autoscript2[i].flag&attack_type&BF_WEAPONMASK &&
- dstsd->autoscript2[i].flag&attack_type&BF_RANGEMASK &&
- dstsd->autoscript2[i].flag&attack_type&BF_SKILLMASK))
- continue; // one or more trigger conditions were not fulfilled
- if( rand()%1000 > dstsd->autoscript2[i].rate )
+ if( rand()%1000 > dstsd->autobonus2[i].rate )
+ continue;
+ if( dstsd->autobonus2[i].active != INVALID_TIMER )
continue;
+ if(!(dstsd->autobonus2[i].atk_type&attack_type&BF_WEAPONMASK &&
+ dstsd->autobonus2[i].atk_type&attack_type&BF_RANGEMASK &&
+ dstsd->autobonus2[i].atk_type&attack_type&BF_SKILLMASK))
+ continue; // one or more trigger conditions were not fulfilled
dstsd->state.autocast = 1;
- run_script(dstsd->autoscript2[i].script,0,dstsd->autoscript2[i].target?src->id:bl->id,0);
+ pc_exeautobonus(dstsd,&dstsd->autobonus2[i]);
dstsd->state.autocast = 0;
}
}
@@ -8984,9 +8989,6 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
}
}
- if( sc && sc->count && sc->data[SC_SKILLCASTRATE] && (sc->data[SC_SKILLCASTRATE]->val1 == skill_id || sc->data[SC_SKILLCASTRATE]->val2 == skill_id || sc->data[SC_SKILLCASTRATE]->val3 == skill_id) )
- time += time * sc->data[SC_SKILLCASTRATE]->val4 / 100;
-
// config cast time multiplier
if (battle_config.cast_rate != 100)
time = time * battle_config.cast_rate / 100;
@@ -9005,8 +9007,6 @@ int skill_castfix_sc (struct block_list *bl, int time)
if (sc && sc->count) {
if (sc->data[SC_SLOWCAST])
time += time * sc->data[SC_SLOWCAST]->val2 / 100;
- if (sc->data[SC_FASTCAST])
- time -= time * sc->data[SC_FASTCAST]->val1 / 100;
if (sc->data[SC_SUFFRAGIUM]) {
time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100;
status_change_end(bl, SC_SUFFRAGIUM, -1);
diff --git a/src/map/status.c b/src/map/status.c
index 2955520c6..6a3acd8cf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -518,14 +518,11 @@ void initChangeTables(void)
StatusChangeFlagTable[SC_INCFLEERATE] |= SCB_FLEE;
StatusChangeFlagTable[SC_INCCRI] |= SCB_CRI;
StatusChangeFlagTable[SC_INCFLEE2] |= SCB_FLEE2;
- StatusChangeFlagTable[SC_INCDEF] |= SCB_DEF;
StatusChangeFlagTable[SC_INCMHPRATE] |= SCB_MAXHP;
StatusChangeFlagTable[SC_INCMSPRATE] |= SCB_MAXSP;
- StatusChangeFlagTable[SC_INCASPDRATE] |= SCB_ASPD;
StatusChangeFlagTable[SC_INCATKRATE] |= SCB_BATK|SCB_WATK;
StatusChangeFlagTable[SC_INCMATKRATE] |= SCB_MATK;
StatusChangeFlagTable[SC_INCDEFRATE] |= SCB_DEF;
- StatusChangeFlagTable[SC_INCBASEATK] |= SCB_BATK;
StatusChangeFlagTable[SC_STRFOOD] |= SCB_STR;
StatusChangeFlagTable[SC_AGIFOOD] |= SCB_AGI;
StatusChangeFlagTable[SC_VITFOOD] |= SCB_VIT;
@@ -1782,8 +1779,6 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
+ sizeof(sd->add_drop)
+ sizeof(sd->itemhealrate)
);
- // clear autoscripts...
- pc_autoscript_clear(sd);
// vars zeroing. ints, shorts, chars. in that order.
memset (&sd->arrow_atk, 0,sizeof(sd->arrow_atk)
@@ -1835,6 +1830,11 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
+ sizeof(sd->unstripable_equip)
);
+ // Autobonus
+ pc_delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),true);
+ pc_delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus),true);
+ pc_delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus),true);
+
// Parse equipment.
for(i=0;i<EQI_MAX-1;i++) {
current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus]
@@ -3382,8 +3382,6 @@ static unsigned short status_calc_batk(struct block_list *bl, struct status_chan
if(!sc || !sc->count)
return cap_value(batk,0,USHRT_MAX);
- if(sc->data[SC_INCBASEATK])
- batk += sc->data[SC_INCBASEATK]->val1;
if(sc->data[SC_ATKPOTION])
batk += sc->data[SC_ATKPOTION]->val1;
if(sc->data[SC_BATKFOOD])
@@ -3602,8 +3600,6 @@ static signed char status_calc_def(struct block_list *bl, struct status_change *
return 90;
if(sc->data[SC_STEELBODY])
return 90;
- if(sc->data[SC_INCDEF])
- def += sc->data[SC_INCDEF]->val1;
if(sc->data[SC_ARMORCHANGE])
def += sc->data[SC_ARMORCHANGE]->val2;
if(sc->data[SC_DRUMBATTLE])
@@ -3914,8 +3910,6 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change *
aspd_rate -= 200;
}
- if(sc->data[SC_INCASPDRATE])
- aspd_rate -= sc->data[SC_INCASPDRATE]->val2;
if(sc->data[i=SC_ASPDPOTION3] ||
sc->data[i=SC_ASPDPOTION2] ||
sc->data[i=SC_ASPDPOTION1] ||
@@ -5023,9 +5017,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
if (sce->val2 > val2)
return 0;
break;
- case SC_HPREGEN:
- case SC_HPDRAIN:
- case SC_SPREGEN:
case SC_S_LIFEPOTION:
case SC_L_LIFEPOTION:
case SC_BOSSMAPINFO:
@@ -5355,9 +5346,6 @@ 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:
- case SC_HPDRAIN:
- case SC_SPREGEN:
case SC_S_LIFEPOTION:
case SC_L_LIFEPOTION:
if( val1 == 0 ) return 0;
@@ -5897,7 +5885,6 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
if (val1 < 0)
val1 = 0;
break;
- case SC_INCASPDRATE:
case SC_INCFLEE2:
case SC_INCCRI:
val2 = val1*10; //Actual boost (since 100% = 1000)
@@ -5923,7 +5910,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
// Mod your resistance against elements:
// val1 = water | val2 = earth | val3 = fire | val4 = wind
// break;
- case SC_FASTCAST:
+ //case ????:
//Place here SCs that have no SCB_* data, no skill associated, no ICON
//associated, and yet are not wrong/unknown. [Skotlex]
break;
@@ -6994,20 +6981,6 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
}
break;
- case SC_HPDRAIN:
- if( --(sce->val4) >= 0 )
- {
- int flag, hp = (sce->val1 < 0) ? (int)(status->max_hp * -1 * sce->val1 / 100.) : sce->val1;
- map_freeblock_lock();
- status_fix_damage(NULL, bl, hp, 0);
- flag = !sc->data[type];
- map_freeblock_unlock();
- if( flag ) return 0;
- sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);
- }
- break;
-
- case SC_HPREGEN:
case SC_S_LIFEPOTION:
case SC_L_LIFEPOTION:
if( sd && --(sce->val4) >= 0 )
@@ -7022,19 +6995,6 @@ int status_change_timer(int tid, unsigned int tick, int id, intptr data)
}
break;
- case SC_SPREGEN:
- if( sd && --(sce->val4) >= 0 )
- {
- // val1 < 0 = per max% | val1 > 0 = exact amount
- int sp = 0;
- if( status->sp < status->max_sp )
- sp = (sce->val1 < 0) ? (int)(sd->status.max_sp * -1 * sce->val1 / 100.) : sce->val1 ;
- status_heal(bl, 0, sp, 2);
- sc_timer_next((sce->val2 * 1000) + tick, status_change_timer, bl->id, data);
- return 0;
- }
- break;
-
case SC_BOSSMAPINFO:
if( sd && --(sce->val4) >= 0 )
{
diff --git a/src/map/status.h b/src/map/status.h
index 2d45b2626..21d2ba67d 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -264,8 +264,8 @@ typedef enum sc_type {
SC_FLEET,
SC_SPEED,
SC_DEFENCE,
- SC_INCASPDRATE,
- SC_INCFLEE2,
+ //SC_INCASPDRATE,
+ SC_INCFLEE2 = 247,
SC_JAILED,
SC_ENCHANTARMS, //250
SC_MAGICALATTACK,
@@ -279,22 +279,22 @@ typedef enum sc_type {
SC_BOSSMAPINFO,
SC_LIFEINSURANCE, //260
SC_INCCRI,
- SC_INCDEF,
- SC_INCBASEATK,
- SC_FASTCAST,
- SC_MDEF_RATE,
- SC_HPREGEN,
- SC_INCHEALRATE,
+ //SC_INCDEF,
+ //SC_INCBASEATK = 263,
+ //SC_FASTCAST,
+ SC_MDEF_RATE = 265,
+ //SC_HPREGEN,
+ SC_INCHEALRATE = 267,
SC_PNEUMA,
SC_AUTOTRADE,
SC_KSPROTECTED, //270
- SC_ARMOR_RESIST,
+ SC_ARMOR_RESIST = 271,
SC_SPCOST_RATE,
SC_COMMONSC_RESIST,
SC_SEVENWIND,
SC_DEF_RATE,
- SC_SPREGEN,
- SC_WALKSPEED,
+ //SC_SPREGEN,
+ SC_WALKSPEED = 277,
// Mercenary Only Bonus Effects
SC_MERC_FLEEUP,
@@ -305,16 +305,16 @@ typedef enum sc_type {
SC_MERC_QUICKEN,
SC_REBIRTH,
- SC_SKILLCASTRATE, //285
- SC_DEFRATIOATK,
- SC_HPDRAIN,
- SC_SKILLATKBONUS,
- SC_ITEMSCRIPT,
+ //SC_SKILLCASTRATE, //285
+ //SC_DEFRATIOATK,
+ //SC_HPDRAIN,
+ //SC_SKILLATKBONUS,
+ SC_ITEMSCRIPT = 289,
SC_S_LIFEPOTION, //290
SC_L_LIFEPOTION,
SC_JEXPBOOST,
- SC_IGNOREDEF,
- SC_HELLPOWER,
+ //SC_IGNOREDEF,
+ SC_HELLPOWER = 294,
SC_INVINCIBLE, //295
SC_INVINCIBLEOFF,
diff --git a/src/map/unit.c b/src/map/unit.c
index 88304940b..89e1b3788 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1955,12 +1955,15 @@ int unit_free(struct block_list *bl, int clrtype)
case BL_PC:
{
struct map_session_data *sd = (struct map_session_data*)bl;
+
if( status_isdead(bl) )
pc_setrestartvalue(sd,2);
pc_delinvincibletimer(sd);
- pc_autoscript_clear(sd);
-
+ pc_delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),false);
+ pc_delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus),false);
+ pc_delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus),false);
+
if( sd->followtimer != -1 )
pc_stop_following(sd);