• 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]Exhaustion for each spell...

PharaPL

Learning Lua
Joined
Oct 12, 2008
Messages
43
Reaction score
0
Location
Poland
Im want to request code for TFS
(Im dont know thats is for c++ or other...)

.. For spells.xml to [exhaustioneach=5000]
When im use spell with thats code its only exhausting thats one spell, and no other runes, potions, spells ....

Please help!

Sorry for my Bad English
 
Last edited:
I would like this too, then we can make OpenTibia spells closer to WoW ones 8D...

If that is possible, would be cool that when you try to cast the spell again, it will say that you have to wait 'x' seconds/minutes/hours.

Cheers.
 
won't be hard, but, hm... like each exhaustion must be then stored in spells class o.0

I know that it is possible with LUA, but dont know the way to kep players from abusing it.
In LUA, each spell would have different storage value setting to 1 when casting and there would be used an addEvent function to set it back to 0, if the player logs out with exhaust, there will be onLogin check, that will remove it, but then, if the spell has like 5 minutes cooldown, players would logout and login and would be able to cast it again. The only way that would stop it, in my opinion, is to add the same addEvent as when casting spells to onLogin if player is exhausted, but it would take a lot of space.

I guess that it can be done in C++ much easier, when someone knows how to code in it, like you. ^^
 
won't be hard, but, hm... like each exhaustion must be then stored in spells class o.0

And why not just double exausth, So you can just add exausth1="xxx" or exausth2="xxxxx" so exausth2 gonna be for some stronger spell wich require an amount of time, I think thats more easy than make infinite number of exausth for each spell....
 
I know that it is possible with LUA, but dont know the way to kep players from abusing it.
In LUA, each spell would have different storage value setting to 1 when casting and there would be used an addEvent function to set it back to 0, if the player logs out with exhaust, there will be onLogin check, that will remove it, but then, if the spell has like 5 minutes cooldown, players would logout and login and would be able to cast it again. The only way that would stop it, in my opinion, is to add the same addEvent as when casting spells to onLogin if player is exhausted, but it would take a lot of space.

I guess that it can be done in C++ much easier, when someone knows how to code in it, like you. ^^

You can use exhaust from data/lib?
 
Sorry im newbie...
Meybe you can and fucntion with exhaust2, 3 and 4, for spells / runes in newest tfs version?

Anyway...
Meybe im can ad to spell exhaust with condition?
But thats, when dont exhausting potions ?


Sorry for my bad english ;/
 
Phara have good idea =] Create a new condition, for example "master destruction exhaust" and add this condition to player for xx time when he is casting spell . Until condition is gone player can not cast this spell. I'm not sure that we won't need a new lua function(getPlayerConditionIdTrue or something), but it's no problem (no problem for programist, not for me... YET!) =]
 
I know that it is possible with LUA, but dont know the way to kep players from abusing it.
In LUA, each spell would have different storage value setting to 1 when casting and there would be used an addEvent function to set it back to 0, if the player logs out with exhaust, there will be onLogin check, that will remove it, but then, if the spell has like 5 minutes cooldown, players would logout and login and would be able to cast it again. The only way that would stop it, in my opinion, is to add the same addEvent as when casting spells to onLogin if player is exhausted, but it would take a lot of space.

I guess that it can be done in C++ much easier, when someone knows how to code in it, like you. ^^

Insteah of setting the storage to 1 and with addEvent back to 0 you can set the storage to the current time with os.time().
At the beginning of the spell you make a if clause and check, if the time now (os.time()) - the time when the storage was last set (getPlayerStorageValue()) is higher than x seconds exhaustion.
With this method you won't have the abusing problem.

BTW: a function like that has already been done, you can find it in data/lib/exhaustion of TFS 0.3 b2 :thumbup:
 
Back
Top