Hi all !
Here! My noob scripting presents; "Teh Healing Herb" !!!
Create healingherb.lua in your actions/scripts folder.
Then paste this in your healingherb.lua ;
And open your actions.xml file then paste this;
(I am used Holy Orchid but you can change item id :thumbup
Hehe ! It's ready !
As you see when you use this it will add some health and mana !
P.S: I am newbie scripter as you see
Comments are always welcome
New !
Antidote Herb !
It will cure your poison or fire damage !
Here is the HP Pill !
When you use this item it will raise your max hp by 10 !
Here is the MP Pill !
It's same as HP Pill but it will raise your mana by 15 !
Soul Crystal
When your soul point go under 10 use this item and you will gain 200 soul points.
Here! My noob scripting presents; "Teh Healing Herb" !!!
Create healingherb.lua in your actions/scripts folder.
Then paste this in your healingherb.lua ;
PHP:
function onUse(cid, item, frompos, item2, topos)
local hp = math.random(100,250)
local mp = math.random(50,150)
if doPlayerRemoveItem(cid, item.itemid, 1) == TRUE then
doSendMagicEffect(getCreaturePosition(cid),13)
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doSendAnimatedText(getCreaturePosition(cid), "Aaahhh..." , 192)
else
doPlayerSendCancel(cid, "Sorry, not possible!")
end
return TRUE
end
PHP:
<action itemid="5922" script="healingherb.lua"/>
Hehe ! It's ready !
As you see when you use this it will add some health and mana !
P.S: I am newbie scripter as you see
Comments are always welcome
New !
Antidote Herb !
It will cure your poison or fire damage !
PHP:
function onUse(cid, item, frompos, item2, topos)
local PlayerPos = getCreaturePosition(cid)
if getCreatureCondition(cid, 1) == TRUE then
doSendMagicEffect(PlayerPos,14)
doRemoveCondition(cid, 1)
doSendAnimatedText(PlayerPos, "Aaahhh..." , 192)
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid, "You are not poisoned!")
end
if getCreatureCondition(cid, 2) == TRUE then
doSendMagicEffect(PlayerPos,13)
doRemoveCondition(cid, 2)
doSendAnimatedText(PlayerPos, "Aaahhh..." , 192)
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid, "You are not burned!")
end
return TRUE
end
When you use this item it will raise your max hp by 10 !
PHP:
function onUse(cid, item, frompos, item2, topos)
local currenthp = getCreatureMaxHealth(cid)
local maxhp = 10
local playerpos = getCreaturePosition(cid)
if doPlayerRemoveItem(cid, item.itemid, 1) == TRUE then
doSendMagicEffect(playerpos,13)
setCreatureMaxHealth(cid, currenthp + maxhp)
doCreatureAddHealth(cid, currenthp)
doPlayerSendTextMessage(cid, 22, "You gained " .. maxhp .. " extra health point!")
else
doPlayerSendCancel(cid, "Sorry, not possible!")
end
return TRUE
end
It's same as HP Pill but it will raise your mana by 15 !
PHP:
function onUse(cid, item, frompos, item2, topos)
local currentmp = getCreatureMaxMana(cid)
local maxmp = 15
local playerpos = getCreaturePosition(cid)
if doPlayerRemoveItem(cid, item.itemid, 1) == TRUE then
doSendMagicEffect(playerpos,14)
setCreatureMaxMana(cid, currentmp + maxmp)
doCreatureAddMana(cid, currentmp)
doPlayerSendTextMessage(cid, 22, "You gained " .. maxmp .. " extra mana point!")
else
doPlayerSendCancel(cid, "Sorry, not possible!")
end
return TRUE
end
Soul Crystal
When your soul point go under 10 use this item and you will gain 200 soul points.
PHP:
function onUse(cid, item, frompos, item2, topos)
local PlayerPos = getCreaturePosition(cid)
local lvl = getPlayerLevel(cid)
local soulpoint = getPlayerSoul(cid)
if soulpoint >= 10 == TRUE then
doSendMagicEffect(PlayerPos,12)
doPlayerAddSoul(cid, 200)
doPlayerSendTextMessage(cid, 22, "You gained 200 Soul Point!")
doRemoveItem(cid, item.uid, 1)
else
doPlayerSendCancel(cid, "Sorry, you still have some soul points!")
end
return TRUE
end
Last edited: