mikkelseen
Klockan 7
Heylo! I would like to have an script, that when you right click on an item, for example the small basin, ID 1378. You get full HP and Mana, is that possible?
Thanks.
Thanks.
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1378 then
doPlayerSendTextMessage(cid,21,"You gained full HP and MP!")
getCreatureMaxHealth(cid)
getCreatureMaxMana(cid)
end
return TRUE
end
LUA:function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 1378 then doPlayerSendTextMessage(cid,21,"You gained full HP and MP!") getCreatureMaxHealth(cid) getCreatureMaxMana(cid) end return TRUE end
function onUse(cid, item, frompos, item2, topos)
local msg = "You restored all your healthpoints and manapoints."
local hp = getCreatureMaxHealth(cid)
local mana = getCreatureMaxMana(cid)
local ppos = getCreaturePosition(cid)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mana)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, msg)
doSendMagicEffect(ppos, 12)
doSendMagicEffect(frompos, 1)
end
<action itemid="1378" event="script" value="healing basin.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hp = getCreatureMaxHealth(cid)
local mana = getCreatureMaxMana(cid)
local position = getCreaturePosition(cid)
local value = math.random(1, 255)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mana)
doSendMagicEffect(position, CONST_ME_HEARTS)
doSendMagicEffect(frompos, CONST_ME_LOSEENERGY)
doSendAnimatedText(cid, HP/MP MAX!, value)
return true
end
<action actionid="1378" event="script" value="healingbasin.lua"/>