Index: scripts/globals/spells/phalanx.lua =================================================================== --- scripts/globals/spells/phalanx.lua (revision 4230) +++ scripts/globals/spells/phalanx.lua (working copy) @@ -27,7 +27,7 @@ final = 0; end elseif(enhskill>300) then - final = (enhskill/29) + 28; + final = ((enhskill-300)/29) + 28; else print("Warning: Unknown enhancing magic skill for phalanx."); end Index: src/map/utils/battleutils.cpp =================================================================== --- src/map/utils/battleutils.cpp (revision 4230) +++ src/map/utils/battleutils.cpp (working copy) @@ -426,7 +426,7 @@ } //matching day 10% bonus, matching weather 10% or 25% for double weather - float dBonus = 1.0; + float dBonus = 0.0; uint32 WeekDay = CVanaTime::getInstance()->getWeekday(); WEATHER weather = GetWeather(PAttacker, false); @@ -462,8 +462,12 @@ dBonus -= 0.1; else if (weather == weakWeatherDouble[element] && (obiBonus || rand() % 100 < 33)) dBonus -= 0.25; - damage = (damage * (float)dBonus); - + damage += (int)(damage * (float)dBonus); + damage = DmgTaken(PDefender, damage); + damage = MagicDmgTaken(PDefender, damage); + damage = damage - PDefender->getMod(MOD_PHALANX); + if(damage <= 0) + return 0; return HandleStoneskin(PDefender, damage); } @@ -949,7 +953,6 @@ { Action->additionalEffect = subeffects[enspell+1]; Action->addEffectMessage = 163; - Action->addEffectMessage = 163; Action->addEffectParam = CalculateEnspellDamage(PAttacker, PDefender, 1, enspell-1); PDefender->addHP(-Action->addEffectParam); @@ -958,7 +961,7 @@ { Action->additionalEffect = subeffects[enspell-7]; Action->addEffectMessage = 163; - Action->addEffectParam = CalculateEnspellDamage(PAttacker, PDefender, 2, enspell > 8 ? enspell-7 : enspell); + Action->addEffectParam = CalculateEnspellDamage(PAttacker, PDefender, 2, enspell > 8 ? enspell-9 : enspell-1); PDefender->addHP(-Action->addEffectParam); }