Last edited:
data/actions/scripts/manarune.luaCronox give the xml script to and tell me where to put the script.. in data/spells/script or Data/action/script?
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == TRUE then
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
local mana_minimum = level * 2 + mlevel * 1 - 50
local mana_maximum = level * 3 + mlevel * 1
doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
end
return TRUE
end
<action itemid="2275" event="script" value="manarune.lua"/>
local mana_minimum = level * 2 + mlevel * 1 - 50
local mana_maximum = level * 3 + mlevel * 1
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 2000)
function onUse(cid, item, frompos, itemEx, topos)
p = getCreaturePosition(cid)
local posfire = {x=p.x-3, y=p.y-3, z=p.z}
local posfire2 = {x=p.x+3, y=p.y+3, z=p.z}
local posice = {x=p.x+3, y=p.y-3, z=p.z}
local posice2 = {x=p.x-3, y=p.y+3, z=p.z}
level = getPlayerLevel(cid)
mlevel = getPlayerMagLevel(cid)
voc = getPlayerVocation(cid)
rand = 0
template = {min = (((level * 4) + (mlevel * 2)) / 1.2) , max =(((level * 4) + (mlevel * 3)) / 1.1)}
if(isPlayer(itemEx.uid) == false) then
return true
end
if not hasCondition(cid, CONDITION_EXHAUST) then
rand = math.random(template.min, template.max)
doCreatureAddMana(cid, rand)
doSendMagicEffect(getPlayerPosition(cid),14)
doSendDistanceShoot(p,posfire,3)
doSendDistanceShoot(p,posfire2,3)
doSendDistanceShoot(p,posice,28)
doSendDistanceShoot(p,posice2,28)
doAddCondition(cid, exhaust)
else
doPlayerSendCancel(cid,"You are exhausted.")
end
return true
end
use function doSendDistanceShoot(fromPos, toPos, type) to send the effect around the player