Page 1 of 3

DRG Spirit Surge

Posted: Sat Apr 13, 2013 6:50 pm
by Piellar
Hello!

Awesome project, I decided to pitch in when I saw that Spirit Surge (DRG 1-hour) wasn't implemented. So here goes!

My source for working on this was http://wiki.bluegartr.com/bg/Spirit_Surge

Please note that scripts/globals/abilities/spirit_surge.lua doesn't yet exist in your trunk!

The following should work after applying the patch. Using Spirit Surge will :

- Heal by the wyvern's current HP
- Grant the wyvern's current TP
- Dismiss the wyvern
- Reset Jump, High Jump and Super Jump cooldowns

While under Spirit Surge's effect, the following will apply:

- Grant a STR boost dependent of level
- Grant 50 ACC
- Grant 25% Haste
- Jump lowers the target's defense by 20% for 60 seconds (does not stack with other defense down effects)
- High Jump lowers the target's TP proportionately to the amount of damage dealt

Finally, Call Wyvern cannot be used during Spirit Surge and Spirit Surge requires a wyvern to use.

The following is still unimplemented:

- Spirit Surge should raise DRG's max HP by 25% of the wyvern's max HP
- Super Jump should reduce enmity of person behind DRG by 50% during Spirit Surge

These require much more careful coding and I'm still not that familiar with the project's code. Still it's a start!

Cheers!

Re: DRG Spirit Surge

Posted: Sat Apr 13, 2013 8:22 pm
by compmike19
Awesome man, it's mostly trial and error keep tweaking it until it's correct. It's always welcome to have more people helping out to complete missing features. A lot of people on IRC will usually try to point you in the right direction if you need a hand also.

Re: DRG Spirit Surge

Posted: Sun Apr 14, 2013 9:22 pm
by Piellar
Alrighty, thanks for the warm welcome!

After some testing, it seems I've done one mistake: despawnPet() must be called on the owner, not on the pet. So right now with the above patch, the pet does not disappear when using Spirit Surge, which is slightly OP. Otherwise, I'm glad the Jump cooldowns are reset properly and everything else is fine. :3

But don't worry, I hope to post soon the full fix for everything Spirit Surge related!

Re: DRG Spirit Surge

Posted: Sat May 04, 2013 8:24 pm
by PrBlahBlahtson
Piellar wrote:- Spirit Surge should raise DRG's max HP by 25% of the wyvern's max HP
- Super Jump should reduce enmity of person behind DRG by 50% during Spirit Surge
Haven't tried it, shooting from the hip, been a while, haven't even looked at your patch to see if what I'm suggesting is impossible, yadda yadda.

For the first, player:getPet():getMaxHP() or something to that effect should return the max HP. I think Spirit Link might have some examples of usage, if that doesn't work, and I didn't use that method much, so syntax errors are likely. Max HP can be increased by one of the mods, probably a food-related one. Removing it afterward could be tricky, unless you store the value in Spirit Surge's power, and then player:delMod(MAX_HP_MOD_HERE,effect:getPower()), or something to that effect. See Sentinel for an example of storing effect strength in power like that. Handy trick. Wyvern max HP is not accurate to pre-DRG buff yet (is post-buff known?), so expect your Spirit Surges to be slightly inaccurate in that regard.

For the second, tentatively step through the party and check location during Super Jump. Beware of isBehind(), since it actually only checks that both entities are facing the same direction. Pretty sure Super Jump isn't even implemented though, so tossing a --TODO: blahblahblah into a script to make it easily findable would not be unacceptable. I'm not aware of anything implemented in LUA that steps through the party at the moment like that, but I'm pretty sure you can get party size and then step through with something like for i=0, maxpartysize do (see Switchstix in Castle Zvahl Baileys and many other places for usage.) Position checks might be something you can adapt from SATA's implementation in weaponskill.lua.

If you're a DRG fan and you happen to find the base power for Healing Breath 1, 2, or 4, the rest of the formula's already built in HB III, along with lots of notes on missing things. I could never find them, but I didn't look particularly hard.

Re: DRG Spirit Surge

Posted: Fri Nov 22, 2013 1:30 am
by Ryukishi
Sorry for the long post, and bumping an old thread, but I'm having a slight issue with the patch. On the game server window it says "[Error] luatils::OnEffectGain(And also Lose): scripts/globals/effects/spirit_surge.lua:25: function arguments expected near ':' "
This is what that file looks like under OnEffectGain and Lose:
onEffectGain Action
-----------------------------------

function onEffectGain(target,effect)
-- TODO The dragoon's MAX HP increases by (25% of wyvern MAXHP)
-- local petMaxHP = target:getPet():getMaxHP();
-- but there's no LUA function to change MAX HP

-- The dragoon is healed by wyvern's remaining HP
local petHP = target:player():getHP();
target:addHP(petHP);

-- The wyvern's current TP is transfered to the dragoon
local petTP = target:player():getTP();
target:addTP(petTP);

-- The wyvern is "absorbed" into the dragoon (Call Wyvern will not allow a resummon during the effect)
target:player:despawnPet();

-- All Jump recast times are reset
target:resetAbilityRecast(158); -- Jump
target:resetAbilityRecast(159); -- High Jump
target:resetAbilityRecast(160); -- Super Jump

-- The dragoon gets a Strength boost relative to his level
target:addMod(MOD_STR,effect:getPower());

-- 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;

-----------------------------------
-- onEffectTick Action
-----------------------------------

function onEffectTick(target,effect)
end;

-----------------------------------
-- onEffectLose Action
-----------------------------------

function onEffectLose(target,effect)
-- TODO The dragoon's MAX HP returns to normal (when the MAXHP boost in onEffectGain() gets implemented)

-- The dragoon loses the Strength boost
target:delMod(MOD_STR,effect:getPower());

-- The dragoon loses the 50 Accuracy boost
target:delMod(MOD_ACC,50);

-- The dragoon loses 25% Haste
target:delMod(MOD_HASTE_ABILITY,256);
end;

Re: DRG Spirit Surge

Posted: Fri Nov 22, 2013 1:52 am
by kjLotus
Ryukishi wrote: -- The wyvern is "absorbed" into the dragoon (Call Wyvern will not allow a resummon during the effect)
target:player:despawnPet();

Re: DRG Spirit Surge

Posted: Fri Nov 22, 2013 7:16 am
by TeoTwawki
I keep having issues with the str boost on this. After it wears off I have -str till I log out and back in.

Re: DRG Spirit Surge

Posted: Fri Nov 22, 2013 10:47 am
by Ryukishi
I'm having kind of the same issue. Instead when I use spirit surge it gives me a negative str value. And once it wears it stacks the negative even more. Including the haste mod.

Re: DRG Spirit Surge

Posted: Fri Nov 22, 2013 11:51 am
by TeoTwawki
Temporarily set mine to a static value instead of getPower() which works but is obviously not retail behavior. Didn't notice the haste misbehaving, wasn't but paying it much attention at the time.

Re: DRG Spirit Surge

Posted: Fri Nov 22, 2013 6:39 pm
by kjLotus
on a side note, there is actually a function to increase max hp (see: mantra), so if someone wants to fix this i can try to get someone to commit it