• 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!

Action TFS 1.x Potions System : Percents and Summons!

great mana potion heals like 1200 mana.

to be exactly all potions heals lot of mana, any fix?
 
Change the multipliers or set it to flat rate in the config
 
hi, amazing one.. using it on tfs 1.2 but after use mana/health potions it doesnt create the empty vial/flask, it just disappear ..

how to make it to create an empty vial/flask after using?
 
I haven't been into scripting in quite awhile, and I haven't been up to date on the master branch at github, so I am just guessing that something was changed with how items are removed, anyways try this and let me know if it works.

find:
Code:
if config.removeOnUse and not caster:getGroup():getAccess() then
                                        Item(item.uid):remove(1)
                                end

and replace with

Code:
if config.removeOnUse and not caster:getGroup():getAccess() then
                                        Item(item.uid):remove(1)
caster:addItem(potion.empty)
                                end

and let me know if it works.

Its a quick cheap workaround.
 
hi, amazing one.. using it on tfs 1.2 but after use mana/health potions it doesnt create the empty vial/flask, it just disappear ..

how to make it to create an empty vial/flask after using?
did that work for you??
 
Codinablack i'll try it now.. i wasnt being able to access the internet so thats it :D after testing i'll inform you about.. thanks

[edit]

Its working.. thanks :) im starting back to learn.. twas really wasy and im so noob :D i saw that after using on the floor only the splash was being created but not the empty.. so i just copy the code there too and tada :)

thanks for helping to solve the problem but im having this problem when i try to heal any monster

Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/potions.lua:onUse
data/lib/misc/verification.lua:7: attempt to call method 'getId' (a nil value)
stack traceback:
        [C]: in function 'getId'
        data/lib/misc/verification.lua:7: in function 'isCreatureFriend'
        data/actions/scripts/other/potions.lua:98: in function <data/actions/scripts/other/potions.lua:31>

verification is the name that i gave to the lib that u told be needed to make it work in your 1st post
 
Last edited:
Are you using 1.2? Because that is for party, and I know they did some reworking of the parties system, but I don't remember off the top of my head what they did...
 
Yes im using tfs 1.2 but the error shows when i try to heal even a normal monster.. i mean not summon .. i would like to use the heal party/guild member but i dont have right skills to change it by myself.. anyway.. its okay using only for self healing.. Great system :D
 
getId() is no longer a method of party. I believe you should be able to just set PID to self:getParty(). the Party object it returns can be compared to other Party objects, so it should work. Just adjust the lib accordingly @Codinablack
 
When I get my new mobo and ssd I will be sure to update that script and lib seeing as how that seems to be the most popular of my releases. I am glad too, because I put alot of work into this release and was most proud of it, but I have done so much better work since then, the whole thing needs a big overhaul honestly. Artofwork was right when he was telling me about reusing code and he helped me to learn alot, alot of which can be applied to this script to make it slightly shorter, optimized and more organized. Thanks for the comment and update @RazorBlade , it should definitely be an easy update for that one, but as for the potions system I should probably do alot more work.

@dkangel83 it doesn't work right now for you because the one you are using is for 1.1, the other one is for 1.0 so you would have more problems with it. I went ahead and decided to make the changes, although I am looking at my code and with these new updates I realize that I was so inefficient with my code, could do it all over with way less checks. Anyways I am tired as fuck so I may have missed something, but I decided to go ahead and make the adjustments for you anyways. All should work well, I don't have 1.2 right now so you will have to post back and let me know, but just replace the lib verification.lua with this....

http://pastebin.com/yYkt95x7

Then let me know if it works please. If it does, enjoy :D
 
Oh thanks for.. i was taking a nap thats why i didnt before :)

Everything works to be ok .. i just needed to add the code that u gave me before
Code:
Item(item.uid):remove(1)

caster:addItem(potion.empty)
after line 102 in the right file cuz using pot on monsters wasnt making it disappear nor craeting an empty :D
 
Last edited:
You are beast! GJ DUDE <3

Btw this script took sometime to find for my 10.77 server on google.. 1.1 versions need more notice so they go up in population!
Tibia OT mana health potion procent based on level just adding a few lines so people find it easier

just a quick question aswell. Want to change the exhaust from using pots down to 1 second instead of 2. For exampel:
[8473] = {empty = 7635, spellid = 2, splash = 2, exhaust = 2000, health = true, mana = false, healthpercent = 60, lvlReq = 150, vocations = {4, 8, 12}}, -- ultimate health potion

and then I change it to:
[8473] = {empty = 7635, spellid = 2, splash = 2, exhaust = 1000, health = true, mana = false, healthpercent = 60, lvlReq = 150, vocations = {4, 8, 12}}, -- ultimate health potion

still takes 2 seconds no matter what I change it to for the potions to get used.
 
Last edited by a moderator:
You are beast! GJ DUDE <3

Btw this script took sometime to find for my 10.77 server on google.. 1.1 versions need more notice so they go up in population!
Tibia OT mana health potion procent based on level just adding a few lines so people find it easier

just a quick question aswell. Want to change the exhaust from using pots down to 1 second instead of 2. For exampel:
[8473] = {empty = 7635, spellid = 2, splash = 2, exhaust = 2000, health = true, mana = false, healthpercent = 60, lvlReq = 150, vocations = {4, 8, 12}}, -- ultimate health potion

and then I change it to:
[8473] = {empty = 7635, spellid = 2, splash = 2, exhaust = 1000, health = true, mana = false, healthpercent = 60, lvlReq = 150, vocations = {4, 8, 12}}, -- ultimate health potion

still takes 2 seconds no matter what I change it to for the potions to get used.

Thats because it is still grouped with another potion that has the same spellid, either change all of them with spellid "2" to "1000" or give it a different spellid, try that and let me know if it works for you
 
Back
Top