Lifetap spells

Discussion in 'General Discussion' started by solar, Dec 3, 2023.

  1. solar

    solar Administrator Staff Member

    Messages:
    1,197
    When a spell has target type tap (lifetap 13 or AE tap 20), it's a buff (has duration) and the caster and target are the same (as with a recourse) then the effects in the spell are all made negative. There is a field on buffs that is usually set to the value 2 but when those 3 conditions are true then it's set to 4. This is so it can be saved/reloaded as a reversed spell when zoning.
    An example of this is Steal Strength on A Dark Reaver. The spell has a negative STR effect so it lowers the STR of the target you proc it on, and then because it meets the criteria of being tap and having duration, the game is supposed to cast the same detrimental spell as a recourse on the player themselves. The game then sets this as a type 4 buff and reverses the effects so the negative STR becomes positive when calculating bonuses even though it's the same spell id. This method of making 'steal' spells has obvious issues - it's detrimental and can overwrite beneficial spells, can't be clicked off, has to be excluded from checking resists, etc. This way of doing things was abandoned by Sony in favor of setting an autocast recourse spell id on spells that is just normal spell and most modern things work that way, but a few old item procs are still this way in our version. The full list of spells that are like this is pretty short:

    833 Bond of Sathir
    944 Steal Strength
    947 Dread Touch
    1321 Malevolent Grasp
    1342 Test GLT
    1344 Test GACD
    1346 Test GSTRD
    1506 Scouring Wind
    1790 Feast of Blood
    1811 Soul Bond
    1816 Soul Well
    2677 Paralyzing Curse
    3978 Greenmist Recourse
    3980 Soul Well Recourse

    Greenmist Recourse is unfortunately broken. It seems like it's in between the old way and the new way. Because the recourse spell has the tap target type and the effects in it are positive, when they become reversed it gives negative effects. It sounds like it didn't work on AK, that it just didn't cast the recourse. It may be because it's marked beneficial, or because it was disabled since it's messed up.

    Soul Well is also weird because it's a tap buff and it also has a recourse, but the recourse is identical to the spell so it works either way, by using the Soul Well or the Soul Well Recourse, because it gives positive effects when reversed.

    I think that instant spells that are lifetaps are also supposed to work by casting them again on the caster as a reversed recourse, but I haven't implemented that yet due to having to refactor a lot of stuff to get there.

    Please report anything I may have broken with these things. Thanks :)
     
    Delorne and Manstache like this.
  2. Mokli

    Mokli I Feel Loved

    Messages:
    2,461
    So, can you clarify the end result of the changes you are putting in for Greenmist in particular? Is it that it will still work, just become detrimental and you can't click it off or will it no longer function?
     
  3. solar

    solar Administrator Staff Member

    Messages:
    1,197
    Greenmist Recourse works but it's a hack. I think that on AK it didn't do a recourse at all, but I tried to make it work a long time ago already - https://www.takproject.net/forums/index.php?threads/recourse-procs-not-refreshing.17393/#post-90324

    So if you look at Greenmist Recourse - https://lucy.alkabor.com/spell_3978.html
    Code:
    [ Only registered users can see the bbcode. Click Here To Register... ]
    The effects are positive, but it has target type Lifetap, which causes it to have its effects reversed when it's self cast, and that's what it does when you proc the main spell Greenmist. If they had made it regular Single target type, then it would work fine. So the hack I did is to have the target cast it on the player, which is wrong, but it makes it not reversed since the caster and target are different, and it results in a positive effect from the recourse. It makes the enemy target animate and the spell is cast at the level of the thing it procced on. That means when you then proc on a lower level NPC, it can't overwrite it. I thought I had fixed it a while back but when I was working on this I had realized that it still wasn't working reliably. What I ended up doing is to have it just dispel the Greenmist Recourse before refreshing it when it can't overwrite. This causes the message "The green mist disperses." each time that happens which looks confusing because there is no message for when it's applied. This way you do end up with some benefit from the buff instead of a negative effect. I couldn't figure out how this worked last time I messed with it, but I didn't realize Greenmist Recourse was backwards like that in the spell data and that it didn't work on AK.

    I think realistically this just affects a couple of weapons that have these procs, like Mrylokar's Dagger of Vengeance and A Dark Reaver. All the player cast spells use normal recourses not this reversed type of spell.
     
    Mokli likes this.