Index: scripts/globals/status.lua =================================================================== --- scripts/globals/status.lua (revision 3801) +++ scripts/globals/status.lua (working copy) @@ -849,6 +849,8 @@ MOD_REFRESH_DOWN = 0x195 -- plague, reduce mp MOD_REGAIN_DOWN = 0x196 -- plague, reduce tp +MOD_QUADRUPLE_ATTACK = 0x1A5 + MOD_EAT_RAW_FISH = 409 MOD_EAT_RAW_MEAT = 410 ----------------------------------- Index: scripts/globals/weaponskills.lua =================================================================== --- scripts/globals/weaponskills.lua (revision 3801) +++ scripts/globals/weaponskills.lua (working copy) @@ -690,22 +690,31 @@ function getMultiAttacks(attacker, numHits) local bonusHits = 0; local tripleChances = 1; + local quadrupleChances = 1; local doubleRate = attacker:getMod(MOD_DOUBLE_ATTACK)/100; local tripleRate = attacker:getMod(MOD_TRIPLE_ATTACK)/100; + local quadrupleRate = attacker:getMod(MOD_QUADRUPLE_ATTACK)/100; - --triple only procs on first hit, or first two hits if dual wielding + --triple and quadruple only procs on first hit, or first two hits if dual wielding if(attacker:getOffhandDmg() > 0) then tripleChances = 2; + quadrupleChance = 2; end for i = 1, numHits, 1 do chance = math.random(); - if (chance < tripleRate and i <= tripleChances) then + if (chance < quadrupleRate and i <= quadrupleChances) then + bonusHits = bonusHits + 3; + elseif (chance < tripleRate and i <= tripleChances) then bonusHits = bonusHits + 2; else - --have to check if triples are possible, or else double attack chance + --have to check if triples and quadruples are possible, or else double attack chance -- gets accidentally increased by triple chance (since it can only proc on 1 or 2) - if (i <= tripleChances) then + if (i <= quadrupleChances) then + if (chance < quadrupleRate + tripleRate) then + bonusHits = bonusHits + 2; + end + elseif (i <= tripleChances) then if (chance < tripleRate + doubleRate) then bonusHits = bonusHits + 1; end @@ -722,6 +731,7 @@ -- recalculate mods doubleRate = attacker:getMod(MOD_DOUBLE_ATTACK)/100; tripleRate = attacker:getMod(MOD_TRIPLE_ATTACK)/100; + quadrupleRate = attacker:getMod(MOD_QUADRUPLE_ATTACK)/100; end end if ((numHits + bonusHits ) > 8) then Index: src/map/modifier.h =================================================================== --- src/map/modifier.h (revision 3801) +++ src/map/modifier.h (working copy) @@ -436,12 +436,16 @@ MOD_WYVERN_BREATH =0x192, MOD_STEP_ACCURACY =0x193,// Bonus accuracy for Dancer's steps + MOD_QUADRUPLE_ATTACK =0x1A5,// Percent chance + MOD_MAG_BURST_BONUS =408, MOD_EAT_RAW_FISH = 409, MOD_EAT_RAW_MEAT = 410 + + }; -#define MAX_MODIFIER 411 +#define MAX_MODIFIER 0x242 Index: src/map/utils/battleutils.cpp =================================================================== --- src/map/utils/battleutils.cpp (revision 3803) +++ src/map/utils/battleutils.cpp (working copy) @@ -2398,6 +2398,7 @@ int8 tripleAttack = PEntity->getMod(MOD_TRIPLE_ATTACK); int8 doubleAttack = PEntity->getMod(MOD_DOUBLE_ATTACK); + int8 quadrupleAttack = PEntity->getMod(MOD_QUADRUPLE_ATTACK); //check for merit upgrades if (PEntity->objtype == TYPE_PC) @@ -2434,9 +2435,14 @@ doubleAttack = dsp_cap(doubleAttack,0,100); tripleAttack = dsp_cap(tripleAttack,0,100); + quadrupleAttack = dsp_cap(quadrupleAttack,0,100); - if (rand()%100 < tripleAttack) + if (rand()%100 < quadrupleAttack) { + num +=3; + } + else if (rand()%100 < tripleAttack) + { num +=2; } else if (rand()%100 < doubleAttack)