Cornwallis
Member
- Joined
- Jan 3, 2010
- Messages
- 480
- Reaction score
- 16
Okey, I tried to edit my recently edited mana potion script <3, unfortunately it failed ;s most likely because it was made by me ):
Also, if possible can someone add this somewhere in there and if possible, but not neccesary, make it happen 500 miliseconds after you use the item.
Code:
local vocations = {3,4,7,8} --Druid, sorc + promotion
function onUse(cid, item, fromPosition, itemEx, toPosition)
if not isPlayer(itemEx.uid) then
return doPlayerSendCancel(cid, 'You can only use this rune on players.')
end
if not(isInArray(vocations,getPlayerVocation(itemEx.uid)) and getPlayerLevel(itemEx.uid) >= 80) then
return doCreatureSay(itemEx.uid, "Only snipers and crusaders of level 80 and above may use this potion.",TALKTYPE_ORANGE_1)
end
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
local health_minimum = level * 2.2 + mlevel * 10.0
local health_maximum = level * 2.3 + mlevel * 10.0
doPlayerAddHealth(itemEx.uid, math.random(health_minimum, health_maximum))
doSendMagicEffect(toPosition, 12)
doChangeTypeItem(item.uid, item.type - 1)
return true
end
Also, if possible can someone add this somewhere in there and if possible, but not neccesary, make it happen 500 miliseconds after you use the item.
Code:
local mana_minimum = level * 0.7 + mlevel * 3.0
local mana_maximum = level * 0.8 + mlevel * 4.0
doPlayerAddMana(itemEx.uid, math.random(mana_minimum, mana_maximum))
doSendMagicEffect(toPosition, 12)