DRG Spirit Surge

Piellar
Posts: 3
Joined: Thu Apr 11, 2013 2:36 pm

DRG Spirit Surge

Post by Piellar » Sat Apr 13, 2013 6:50 pm

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!
Attachments
DRG_SpiritSurge.patch
(7.44 KiB) Downloaded 481 times

compmike19
Posts: 115
Joined: Wed Jan 23, 2013 11:14 pm

Re: DRG Spirit Surge

Post by compmike19 » Sat Apr 13, 2013 8:22 pm

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.

Piellar
Posts: 3
Joined: Thu Apr 11, 2013 2:36 pm

Re: DRG Spirit Surge

Post by Piellar » Sun Apr 14, 2013 9:22 pm

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!

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: DRG Spirit Surge

Post by PrBlahBlahtson » Sat May 04, 2013 8:24 pm

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.

Ryukishi
Posts: 14
Joined: Wed Oct 30, 2013 12:17 pm

Re: DRG Spirit Surge

Post by Ryukishi » Fri Nov 22, 2013 1:30 am

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;

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: DRG Spirit Surge

Post by kjLotus » Fri Nov 22, 2013 1:52 am

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

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: DRG Spirit Surge

Post by TeoTwawki » Fri Nov 22, 2013 7:16 am

I keep having issues with the str boost on this. After it wears off I have -str till I log out and back in.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Ryukishi
Posts: 14
Joined: Wed Oct 30, 2013 12:17 pm

Re: DRG Spirit Surge

Post by Ryukishi » Fri Nov 22, 2013 10:47 am

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.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: DRG Spirit Surge

Post by TeoTwawki » Fri Nov 22, 2013 11:51 am

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.
Last edited by TeoTwawki on Fri Nov 22, 2013 8:16 pm, edited 1 time in total.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: DRG Spirit Surge

Post by kjLotus » Fri Nov 22, 2013 6:39 pm

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

Post Reply