jestemPolakiem
New Member
Regeneration Mixture
created by jestemPolakiem
created by jestemPolakiem
Introduction
Welcome all members of this forum! I would like to give you my newly-created script.
This post was created in the previous model, put here for a look, professionalism and format. Of course, everything is translated by Google Translate, confirming that in the upper right corner is a special icon.
Description
The action script is simple - you get or purchase the item called regeneration mixture (with id 7443) and uses it. Automatically uses on it - can not be used on another creature. It has five to use - or if it is purchased in a shop allowed to establish more. It adds for 30 seconds, a certain amount of life and mana - you have a pattern here
PHP:
health = getCreatureMaxHealth(cid) * 0.2 + 50, mana = getCreatureMaxMana(cid) * 0.15 + 40
Changelog
- fixed bug when a logout form - thanks to Karpio
Install
data/actions/actions.xml - before </actions>
PHP:
<action itemid="7443" event="script" value="regmixture.lua" override="yes"/>
data/items/items.xml - before </items>
PHP:
<item id="7443" article="a" name="regeneration mixture" override="yes">
<attribute key="description" value="Potion regenerate your life and a certain amount of mana in a given time."/>
<attribute key="decayTo" value="7636"/>
<attribute key="charges" value="5"/>
<attribute key="showcharges" value="1"/>
<attribute key="weight" value="300"/>
</item>
data/actions/scripts/regmixture.lua
PHP:
function onUse(cid, item, fromPos, itemEx, toPos)
local function doRegeneration(cid, formula, count)
if (not isPlayer(cid)) then
return
end
doCreatureAddHealth(cid, formula.health)
doCreatureAddMana(cid, formula.mana)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
if (count ~= 1) then
addEvent(doRegeneration, 1000, cid, formula, count - 1)
end
return true
end
local form = {health = getCreatureMaxHealth(cid) * 0.2 + 50, mana = getCreatureMaxMana(cid) * 0.15 + 40}
doRegeneration(cid, form, 30)
doChangeTypeItem(item.uid, item.type - 1)
return true
end
Termination
I greet all
jestemPolakiem
Last edited: