Super Nova
A Sad Alien
I have a script that heals Health. But is there such thing as a script that heals Mana when you walk on a certain square?
function onStepIn(cid, item, position, fromPosition)
doPlayerAddMana(cid, (getCreatureMaxMana - getPlayerMana))
doSendMagicEffect(topos, 14)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Mana healed.")
return TRUE
end
LUA:function onStepIn(cid, item, position, fromPosition) doPlayerAddMana(cid, (getCreatureMaxMana - getPlayerMana)) doSendMagicEffect(topos, 14) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Mana healed.") return TRUE end
local config = {
healHP = 1000000,
healPlayers = "yes",
healMonsters = "yes",
}
local healthArea = {
fromX = 999,
fromY = 1002,
fromZ = 7,
toX = 999,
toY = 1002,
toZ = 7,
}
function onThink(cid, interval, lastExecution)
for x = healthArea.fromX, healthArea.toX do
for y = healthArea.fromY, healthArea.toY do
for z = healthArea.fromZ, healthArea.toZ do
local pos = {x=x, y=y, z=z, stackpos = 253}
local thing = getThingfromPos(pos)
doSendMagicEffect(pos, 29)
if thing.itemid > 0 then
if(isPlayer(thing.uid) == TRUE and string.lower(config.healPlayers) == "yes") then
doCreatureAddHealth(thing.uid, config.healHP)
if string.lower(getConfigValue("showHealingDamage")) == "no" then
doSendAnimatedText(pos, "+"..config.healHP.."", 19)
end
elseif(isMonster(thing.uid) == TRUE and string.lower(config.healMonsters) == "yes") then
doCreatureAddHealth(thing.uid, config.healHP)
if string.lower(getConfigValue("showHealingDamageForMonsters")) == "no" then
doSendAnimatedText(pos, "+"..config.healHP.."", 19)
end
end
end
end
end
end
return TRUE
end
local config = {
healMana = 1000000,
}
local healthMana = {
fromX = 999,
fromY = 1002,
fromZ = 7,
toX = 999,
toY = 1002,
toZ = 7,
}
function onThink(cid, interval, lastExecution)
for x = healthMana.fromX, healthMana.toX do
for y = healthMana.fromY, healthMana.toY do
for z = healthMana.fromZ, healthMana.toZ do
local pos = {x=x, y=y, z=z, stackpos = 253}
local thing = getThingfromPos(pos)
doSendMagicEffect(pos, 29)
if thing.itemid > 0 then
if(isPlayer(thing.uid) == TRUE) then
doPlayerAddMana(thing.uid, config.healMana)
if string.lower(getConfigValue("showHealingDamage")) == "no" then
doSendAnimatedText(pos, "+"..config.healMana.."", 19)
end
end
end
end
end
return TRUE
end