local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
doPlayerAddMana(cid, math.random(500, 550))
return doCombat(cid, combat, var)
end
<rune name="Mana Rune" id="2294" allowfaruse="1" charges="1" lvl="1" maglv="5" exhaustion="750" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/donor mana rune.lua"/>
Lol, and that is why im learning? And Manarune.lua isn't there.
Somebody?
doPlayerAddMana(cid, math.random(500, 550))
doPlayerAddMana(cid, math.random(1000, 1100))
So Im gonna create an own lua file and put this doPlayerAddMana(cid, math.random(1000, 1100))
in it?!
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
doPlayerAddMana(cid, math.random(500, 550))
return doCombat(cid, combat, var)
end
doPlayerAddMana(cid, math.random(500, 550))
doPlayerAddMana(cid, math.random(1000, 1050))
local storage = {
MinMana = 1000, --Minimum mana cure
MaxMana = 1100, --Maximum mana cure
CostIngotts = 1, --Cost 1 ingott
IngottItemID = XXXX, --Edit this: XXXX = ingott item number , dont delete the ,
Effect = 2 --Effect number
}
function onUse(cid,var)
local minvalue = getPlayerStorageValue(cid, storage.MinMana) -- Dont edit this
local maxvalue = getPlayerStorageValue(cid, storage.MaxMana) -- Dont edit this
local cost = getPlayerStorageValue(cid, storage.CostIngotts) -- Dont edit this
local ingott = getPlayerStorageValue(cid, storage.IngottItemID) -- Dont edit this
local position = getPlayerPosition(cid)
local effect = getPlayerStorageValue(cid, storage.Effect)
doPlayerAddMana(cid, math.random(minvalue, maxvalue)) -- Dont edit this
doSendMagicEffect(position, effect) -- Dont edit this
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) -- Edit only the Aaaah
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
doRemoveItem(ingott.uid,cost)
end
return 1
end
<action itemid="XXXX" script="manarune.lua" allowfaruse="1" blockwalls="1" />
Go to data/actions/scripts ,create file manarune.lua and put this:
PHP:local storage = { MinMana = 1000, --Minimum mana cure MaxMana = 1100, --Maximum mana cure CostIngotts = 1, --Cost 1 ingott IngottItemID = XXXX, --Edit this: XXXX = ingott item number , dont delete the , Effect = 2 --Effect number } function onUse(cid,var) local minvalue = getPlayerStorageValue(cid, storage.MinMana) -- Dont edit this local maxvalue = getPlayerStorageValue(cid, storage.MaxMana) -- Dont edit this local cost = getPlayerStorageValue(cid, storage.CostIngotts) -- Dont edit this local ingott = getPlayerStorageValue(cid, storage.IngottItemID) -- Dont edit this local position = getPlayerPosition(cid) local effect = getPlayerStorageValue(cid, storage.Effect) doPlayerAddMana(cid, math.random(minvalue, maxvalue)) -- Dont edit this doSendMagicEffect(position, effect) -- Dont edit this doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) -- Edit only the Aaaah if item.type > 1 then doChangeTypeItem(item.uid,item.type-1) else doRemoveItem(item.uid,1) doRemoveItem(ingott.uid,cost) end return 1 end
then go to data/actions and open actions.xml & add line:
in the XXXX put your manarune item id.PHP:<action itemid="XXXX" script="manarune.lua" allowfaruse="1" blockwalls="1" />
-- If i helped u , add reputation.
local config = {
mini = 1000
maxi = 1500
removee = true -- make false if you dont want to remove rune on use
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if c.removee ~= false then
doRemoveItem(item.uid)
end
return doPlayerAddMana(cid,math.random(c.mini,c.maxi)) and doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
<action itemid="XXX" event="script" value="manarune.lua"/>
Sorry but what is the manarune item id? XD
And anyway when i do it this shows up:
[11/09/2010 12:05:55] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/manarune.lua: No such file or directory
[11/09/2010 12:05:55] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/manarune.lua)
[11/09/2010 12:05:55] cannot open data/actions/scripts/manarune.lua: No such file or directory
local storage = {
MinMana = 1000, --Minimum mana cure
MaxMana = 1100, --Maximum mana cure
CostIngotts = 1, --Cost 1 ingott
IngottItemID = XXXX, --PUT INGOTT ITEM ID IN XXXX - DONT REMOVE THE ","
Effect = 2 --Effect number
}
function onUse(cid,var)
local minvalue = getPlayerStorageValue(cid, storage.MinMana) -- Dont edit this
local maxvalue = getPlayerStorageValue(cid, storage.MaxMana) -- Dont edit this
local cost = getPlayerStorageValue(cid, storage.CostIngotts) -- Dont edit this
local ingott = getPlayerStorageValue(cid, storage.IngottItemID) -- Dont edit this
local position = getPlayerPosition(cid)
local effect = getPlayerStorageValue(cid, storage.Effect)
doPlayerAddMana(cid, math.random(minvalue, maxvalue)) -- Dont edit this
doSendMagicEffect(position, effect) -- Dont edit this
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) -- Edit only the Aaaah
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
doRemoveItem(ingott.uid,cost)
end
return 1
end
<action itemid="XXXX" script="manarune.lua" allowfaruse="1" blockwalls="1" />