Spo teh pro
New Member
- Joined
- Jan 3, 2008
- Messages
- 319
- Reaction score
- 1
Hello folks 
I'm searching for a health potion script which is based on level and magic level (as UH in old times)
I'm sure anyone already has something like this but I couldn't find it with search function so I thought I'm going to ask here
Thank you in advance <3
- - - Updated - - -
I got this script now. Didn't try if it works (using TFS crying damson 0.3.8 or smth) I'm at work at the moment.
Question is. Could anyone explain the numbers in the brackets how to calculate?
I don't understand that
Also; Is magic level already included? because that's important for me too
Thank you
I'm searching for a health potion script which is based on level and magic level (as UH in old times)
I'm sure anyone already has something like this but I couldn't find it with search function so I thought I'm going to ask here
Thank you in advance <3
- - - Updated - - -
Code:
local EMPTY_POTION = 7635
local CHARGES = 3
local EXHAUST_TIME = 1 -- Exhaust time in seconds.
local STORE_VALUE = 3068 -- Value where exhaust is saved.
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(itemEx.uid)
local MIN = ((15((level)-8)+185)*(.60))
local MAX = ((15((level)-8)+185)*(.75))
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if exhaust(cid, STORE_VALUE, EXHAUST_TIME) > 0 then
if((not(isKnight(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 130) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
else
if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
if(item.actionid == 0) then
doSetItemActionId(item.uid, 99 + CHARGES)
return TRUE
end
local _charges = item.actionid - 100
if(_charges > 1) then
doSetItemActionId(item.uid, item.actionid - 1)
else
doRemoveItem(item.uid)
end
end
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return 1
end
I got this script now. Didn't try if it works (using TFS crying damson 0.3.8 or smth) I'm at work at the moment.
Question is. Could anyone explain the numbers in the brackets how to calculate?
I don't understand that
Also; Is magic level already included? because that's important for me too
Thank you
Last edited: