local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, -90, 0.7, -50)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
local exhaust = createConditionObject(CONDITION_EXHAUST_COMBAT)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, spellConfig.exhausted)
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 11551) ~= -1 then
if getCreatureMana(cid) >= spellConfig.mana then
doCreatureAddMana(cid, spellConfig.mana)
doPlayerAddSpentMana(cid, spellConfig.mana * getConfigInfo('rateMagic'))
doAddCondition(cid, exhaust)
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid,"MESSAGE NO MANA.")
end
else
doPlayerSendCancel(cid,"MESSAGE NO VIP.")
end
end
[11/01/2009 14:00:08] data/spells/scripts/support/vip.lua:10: attempt to index global 'spellConfig' (a nil value)
[11/01/2009 14:00:08] Warning: [Event::loadScript] Can not load script. data/spells/scripts/support/vip.lua
[11/01/2009 13:53:06] Lua Script Error: [Spell Interface]
[11/01/2009 13:53:06] data/spells/scripts/support/vip.lua:onCastSpell
[11/01/2009 13:53:06] data/spells/scripts/support/vip.lua:11: attempt to call global 'getCreatureMana' (a nil value)
[11/01/2009 13:53:06] stack traceback:
[11/01/2009 13:53:06] data/spells/scripts/support/vip.lua:11: in function <data/spells/scripts/support/vip.lua:9>
people always with their vip shit lol
example, didnt tested, should work, in spells.xml put mana 0, you decide if use that exhausted or add exhausted from xml file.
PHP:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, -90, 0.7, -50) local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) local exhaust = createConditionObject(CONDITION_EXHAUST_COMBAT) setConditionParam(exhaust, CONDITION_PARAM_TICKS, spellConfig.exhausted) function onCastSpell(cid, var) if getPlayerStorageValue(cid, 11551) ~= -1 then if getCreatureMana(cid) >= spellConfig.mana then doCreatureAddMana(cid, spellConfig.mana) doPlayerAddSpentMana(cid, spellConfig.mana * getConfigInfo('rateMagic')) doAddCondition(cid, exhaust) doCombat(cid, combat, var) else doPlayerSendCancel(cid,"MESSAGE NO MANA.") end else doPlayerSendCancel(cid,"MESSAGE NO VIP.") end end
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
-- Put the rest of the combat code here O.o
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 11551) ~= -1 then
return doCombat(cid, combat, var)
end
doPlayerSendCancel(cid, "MESSAGE NO VIP.")
return LUA_ERROR
end
Very waste, why do that? All is in XML...
PHP:local area = createCombatArea(AREA_SQUARE1X1) setCombatArea(combat, area) -- Put the rest of the combat code here O.o function onCastSpell(cid, var) if getPlayerStorageValue(cid, 11551) ~= -1 then return doCombat(cid, combat, var) end doPlayerSendCancel(cid, "MESSAGE NO VIP.") return LUA_ERROR end
because if a player no vip use the spell it will remove the mana btw lol, that no right dont u think so?