• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Leech bug again, using mana potion returns health and additional mana

Unknown Soldier

Mapping a map
Joined
Oct 30, 2010
Messages
294
Solutions
11
Reaction score
665
Hello,

Tried to search for solution on github as well as on OTLand but couldn't find any fix for that, but I am sure many people already noticed that. Have this bug been already solved?

Drinking a mana potion in TFS 1.4.2 while having mana and/or life leech condition(s), beside adding specified amount of mana from potion, restores additional mana, and heals player. The percent value of additional mana and health are exactly the same as the mana and life leech bonus values (Example from gif image: 43/138=31 | 15/138=11).

Is there any solution?

Thanks in advance

leechbugagain.gif
 
Last edited:
From what I see TFS default potions add mana with use of doTargetCombat:
Lua:
doTargetCombat(player, target, COMBAT_MANADRAIN, potion.mana[1], potion.mana[2])
Which results in all these leech logic to be aplied as for regular attacks.
This PR seems to fixed this for healing (COMBAT_HEALING):

But seems like for COMBAT_MANADRAIN it still works as previously.
Try changing this condition (re-test other use cases also - I'm totaly unware of these new Tibia features).

Not sure but from what I see simple condition target != caster should do the trick but I'm not aware of any use cases here so might be I'm totally wrong :) Or simply exclude COMBAT_MANADRAIN too (need some rechecks as It's first time I see there's something called leech in Tibia).
 
Last edited:
I came across the same pull request, but those fixes were implemented for TFS 1.3 as far as I remember, so TFS 1.4.2 already have them.

Anyway, using target != caster helped :) I appreciate your help! It has to be fixed in official TFS too.

leechbugagain3.gif
 
Last edited:
Back
Top