Index: scripts/globals/abilities/call_wyvern.lua =================================================================== --- scripts/globals/abilities/call_wyvern.lua (revision 4144) +++ scripts/globals/abilities/call_wyvern.lua (working copy) @@ -10,14 +10,16 @@ -- OnUseAbility ----------------------------------- -function OnAbilityCheck(player,target,ability) +function OnAbilityCheck(player,target,ability) if (player:getPet() ~= nil) then - return MSGBASIC_ALREADY_HAS_A_PET,0; - else + return MSGBASIC_ALREADY_HAS_A_PET,0; + elseif(player:hasStatusEffect(EFFECT_SPIRIT_SURGE) == true) then + return MSGBASIC_UNABLE_TO_USE_JA,0; + else return 0,0; - end -end; - + end +end; + function OnUseAbility(player, target, ability) player:spawnPet(PET_WYVERN); end; Index: scripts/globals/abilities/jump.lua =================================================================== --- scripts/globals/abilities/jump.lua (revision 4144) +++ scripts/globals/abilities/jump.lua (working copy) @@ -9,9 +9,15 @@ -- OnUseAbility ----------------------------------- -function OnAbilityCheck(player,target,ability) - return 0,0; -end; - +function OnAbilityCheck(player,target,ability) + -- Under Spirit Surge, Jump also decreases target defence by 20% for 60 seconds + if(player:hasStatusEffect(EFFECT_SPIRIT_SURGE) == true) then + if(target:hasStatusEffect(EFFECT_DEFENSE_DOWN) == false) then + target:addStatusEffect(EFFECT_DEFENSE_DOWN, 20, 0, 60); + end + end + return 0,0; +end; + function OnUseAbility(player, target, ability) end; \ No newline at end of file Index: scripts/globals/abilities/spirit_surge.lua =================================================================== --- scripts/globals/abilities/spirit_surge.lua (revision 0) +++ scripts/globals/abilities/spirit_surge.lua (working copy) @@ -0,0 +1,56 @@ +----------------------------------- +-- Ability: Spirit Surge +----------------------------------- + +require("scripts/globals/status"); + +----------------------------------- +-- OnUseAbility +----------------------------------- + +function OnAbilityCheck(player,target,ability) + -- The wyvern must be present in order to use Spirit Surge + if (target:getPet() == nil) then + return MSGBASIC_REQUIRES_A_PET,0; + else + return 0,0; + end +end; + +function OnUseAbility(player, target, ability) + -- Spirit Surge increases dragoon's MAX HP increases by 25% of wyvern MaxHP + -- bg wiki says 25% ffxiclopedia says 15%, going with 25 for now + local mhp_boost = ((target:getPet():getMaxHP())*0.25); + + -- The dragoon is healed by wyvern's remaining HP + local petHP = target:getPet():getHP(); + target:addHP(petHP); + + -- The wyvern's current TP is transfered to the dragoon + local petTP = target:getPet():getTP(); + target:addTP(petTP); + + -- The wyvern is "absorbed" into the dragoon (Call Wyvern will not allow a resummon during the effect) + target:despawnPet(); + + -- All Jump recast times are reset + target:resetRecast(RECAST_ABILITY,158); -- Jump + target:resetRecast(RECAST_ABILITY,159); -- High Jump + target:resetRecast(RECAST_ABILITY,160); -- Super Jump + + -- Spirit Surge increases dragoon's Strength + local strBoost = 0; + if(target:getMainJob()==JOB_DRG) then + strBoost = (1 + target:getMainLvl()/5); -- Use Mainjob Lvl + elseif(target:getSubJob()==JOB_DRG) then + strBoost = (1 + target:getSubLvl()/5); -- Use Subjob Lvl + end + + -- Spirit Surge lasts 60 seconds, or 20 more if Wyrm Mail+2 is equipped + local duration = 60; + if(target:getEquipID(SLOT_BODY)==10683) then + duration = duration + 20; + end + + player:addStatusEffect(EFFECT_SPIRIT_SURGE,mhp_boost,0,duration,0,strBoost); +end; \ No newline at end of file Index: scripts/globals/effects/spirit_surge.lua =================================================================== --- scripts/globals/effects/spirit_surge.lua (revision 4144) +++ scripts/globals/effects/spirit_surge.lua (working copy) @@ -1,7 +1,7 @@ ----------------------------------- -- +-- EFFECT_SPIRIT_SURGE -- --- ----------------------------------- ----------------------------------- @@ -9,6 +9,18 @@ ----------------------------------- function onEffectGain(target,effect) + -- The dragoon's MAX HP increases by % of wyvern MaxHP + target:addMod(MOD_HP,effect:getPower()); + target:addHP(effect:getPower()); + + -- The dragoon gets a Strength boost relative to his level + target:addMod(MOD_STR,effect:getSubPower()); + + -- The dragoon gets a 50 Accuracy boost + target:addMod(MOD_ACC, 50); + + -- The dragoon gets 25% Haste (256/1024, see http://wiki.bluegartr.com/bg/Job_Ability_Haste for haste calculation) + target:addMod(MOD_HASTE_ABILITY, 256); end; ----------------------------------- @@ -23,4 +35,15 @@ ----------------------------------- function onEffectLose(target,effect) + -- The dragoon's MAX HP returns to normal (when the MAXHP boost in onEffectGain() gets implemented) + target:delMod(MOD_HP,effect:getPower()); + + -- The dragoon loses the Strength boost + target:delMod(MOD_STR,effect:getSubPower()); + + -- The dragoon loses the 50 Accuracy boost + target:delMod(MOD_ACC, 50); + + -- The dragoon loses 25% Haste + target:delMod(MOD_HASTE_ABILITY, 256); end; \ No newline at end of file Index: src/map/utils/battleutils.cpp =================================================================== --- src/map/utils/battleutils.cpp (revision 4144) +++ src/map/utils/battleutils.cpp (working copy) @@ -3840,7 +3840,11 @@ ((CMobEntity*)PVictim)->PEnmityContainer->LowerEnmityByPercent(PAttacker , enmityReduction, NULL); } - // try skill up (CharEntity only) + // Under Spirit Surge, High Jump lowers the target's TP proportionately to the amount of damage dealt (TP is reduced by damage * 2) + if (tier == 2 && PAttacker->StatusEffectContainer->HasStatusEffect(EFFECT_SPIRIT_SURGE)) + PVictim->addTP(-(totalDamage * 2)); + + // try skill up (CharEntity only) if (PAttacker->objtype == TYPE_PC) charutils::TrySkillUP((CCharEntity*)PAttacker, (SKILLTYPE)PWeapon->getSkillType(), PVictim->GetMLevel());