Ir para conteúdo

Restringir Spells Por Reset


Adriez

Posts Recomendados

fmz manos ?? o scrip desse jeito assim q solta a magia fala sorry you need 20 reset or more so que a magia sai do msm jeito se eu mudar if getResets(cid) para getPlayerReset(cid) aew da erro antes msm de usar a magia no executavel como fazer funfa ??? flws fmz

 

[Error - Spell Interface]

[14/08/2011 02:54:04] data/spells/scripts/ThorKiller.lua:onCastSpell

[14/08/2011 02:54:04] Description:

[14/08/2011 02:54:04] data/spells/scripts/ThorKiller.lua:157: attempt to call global 'getPlayerReset' (a nil value)

[14/08/2011 02:54:04] stack traceback:

[14/08/2011 02:54:05] data/spells/scripts/ThorKiller.lua:157: in function <data/spells/scripts/ThorKiller.lua:156>

 

 

 

local acombat1 = createCombatObject()=
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, 

COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 15)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, 

CONST_ANI_ENCHANTEDSPEAR)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -30, -20, 

-100, -105)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, 

COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 36)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 33)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -30, -20, 

-100, -105)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, 

COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 37)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 

CONST_ME_HOLYDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 32)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -30, -20, 

-100, -105)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE, 

COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 38)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 10)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -30, -20, 

-100, -105)

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}


arr2 = {
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
{1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 0, 1, 1, 1, 2, 1, 1, 1, 0, 1},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1},
{1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
}

arr3 = {
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}
}

arr4 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}


local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
setCombatArea(acombat4, area4)


function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
doCombat(cid,combat4,positionToVariant(pos))
end

setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE, 

"onTargetTile")

setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE, 

"onTargetTile2")

setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, 

"onTargetTile3")

setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, 

"onTargetTile4")


local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, acombat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, acombat4, parameters.var)
end

local reset_min = 20



function getResets(cid) 
resets = getPlayerStorageValue(cid,2310) 
if resets < 1 then 
resets = 1 
end 
return resets 

end

function onCastSpell(cid, var) 
if getResets(cid) >= reset_min then 
doPlayerAddMana(cid, math.random(45000, 55000)) 
doCombat(cid, combat, var) 
else 
doPlayerSendCancel(cid, "Sorry, you need "..reset_min.." reset's or more to 

use this spell.") 
end 
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 5, parameters)
addEvent(onCastSpell2, 10, parameters)
addEvent(onCastSpell3, 15, parameters)
addEvent(onCastSpell4, 20, parameters)

return TRUE

end

Editado por Adriez
Link para o comentário
Compartilhar em outros sites

fmz manos ?? ta tirando neh num da pra visualiza o trem =.= mais coloquei e agora =.=

Editado por Adriez
Link para o comentário
Compartilhar em outros sites

Se eu nao me engano nao tem como blokear a magia, acho mais facil vc fazer uma vocaçao que so quem possui 20 reset vai ter, ai coloca a magia apenas pra ela.

Link para o comentário
Compartilhar em outros sites

tenta tira esse "return TRUE" do final. E poem o "return" no "doCombat(cid, combat, var)".

 

function onCastSpell(cid, var)

if getResets(cid) >= reset_min then

doPlayerAddMana(cid, math.random(45000, 55000))

return doCombat(cid, combat, var)

else

doPlayerSendCancel(cid, "Sorry, you need "..reset_min.." reset's or more to use this spell.")

end

Editado por Jhon992
Link para o comentário
Compartilhar em outros sites

Teste assim!

 

 

local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE,  COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 15)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT,  CONST_ANI_ENCHANTEDSPEAR)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 36)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 33)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE,  COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 37)
setCombatParam(combat2, COMBAT_PARAM_EFFECT,  CONST_ME_HOLYDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 32)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE,  COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 38)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 10)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}


arr2 = {
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
{1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 0, 1, 1, 1, 2, 1, 1, 1, 0, 1},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1},
{1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
}

arr3 = {
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}
}

arr4 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}


local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
setCombatArea(acombat4, area4)


function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
doCombat(cid,combat4,positionToVariant(pos))
end

local setCombatCallback(acombat1, CALLBACK_PARAM_TARGETTILE,  "onTargetTile")

local setCombatCallback(acombat2, CALLBACK_PARAM_TARGETTILE,  "onTargetTile2")

local setCombatCallback(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

local setCombatCallback(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, acombat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, acombat4, parameters.var)
end

local reset_min = 20                        



function getResets(cid) 
resets = getPlayerStorageValue(cid,2310) 
if resets < 1 then 
resets = 1 
end 
return resets 

end

function onCastSpell(cid, var) 
if getResets(cid) >= reset_min then 
doPlayerAddMana(cid, math.random(45000, 55000)) 
doCombat(cid, combat, var) 
else 
doPlayerSendCancel(cid, "Sorry, you need "..reset_min.." reset's or more to setCombatCallback'use this spell.") 
end 
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 5, parameters)
addEvent(onCastSpell2, 10, parameters)
addEvent(onCastSpell3, 15, parameters)
addEvent(onCastSpell4, 20, parameters)

return TRUE

end

Link para o comentário
Compartilhar em outros sites

fmz manos ??? @mulizeu o meu erro la em cima num seria coloca a funcao do reset na lib nao em q lugar da lib eu coloco e em q lib pra ve se funfa ?? flws fmz o q tu me falo deu esse erro quando carrega as magias ja da esse erro [Error - LuaScriptInterface::loadFile] data/spells/scripts/ThorKiller.lua:115: ')' expected near ','

[27/08/2011 05:55:58] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/ThorKiller.lua)

[27/08/2011 05:55:58] data/spells/scripts/ThorKiller.lua:115: ')' expected near ','

Editado por Adriez
Link para o comentário
Compartilhar em outros sites

Ta ae

 

----------- BY MULIZEU---------
local acombat1 = createCombatObject()
local acombat2 = createCombatObject()
local acombat3 = createCombatObject()
local acombat4 = createCombatObject()

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE,  COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 15)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT,  CONST_ANI_ENCHANTEDSPEAR)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 36)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 33)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE,  COMBAT_PHYSICALDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_EFFECT, 37)
setCombatParam(combat2, COMBAT_PARAM_EFFECT,  CONST_ME_HOLYDAMAGE)
setCombatParam(combat3, COMBAT_PARAM_DISTANCEEFFECT, 32)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

local combat4 = createCombatObject()
setCombatParam(combat4, COMBAT_PARAM_TYPE,  COMBAT_PHYSICALDAMAGE)
setCombatParam(combat4, COMBAT_PARAM_EFFECT, 38)
setCombatParam(combat4, COMBAT_PARAM_DISTANCEEFFECT, 10)
setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -30, -20,  -100, -105)

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 2, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}


arr2 = {
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
{1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 0, 1, 1, 1, 2, 1, 1, 1, 0, 1},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1},
{1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1},
{1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
}

arr3 = {
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0}
}

arr4 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}


local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
local area3 = createCombatArea(arr3)
local area4 = createCombatArea(arr4)
setCombatArea(acombat1, area1)
setCombatArea(acombat2, area2)
setCombatArea(acombat3, area3)
setCombatArea(acombat4, area4)


function onTargetTile(cid, pos)
doCombat(cid,combat1,positionToVariant(pos))
end

function onTargetTile2(cid, pos)
doCombat(cid,combat2,positionToVariant(pos))
end

function onTargetTile3(cid, pos)
doCombat(cid,combat3,positionToVariant(pos))
end

function onTargetTile4(cid, pos)
doCombat(cid,combat4,positionToVariant(pos))
end

setCombatCallBack(acombat1, CALLBACK_PARAM_TARGETTILE,  "onTargetTile")

setCombatCallBack(acombat2, CALLBACK_PARAM_TARGETTILE,  "onTargetTile2")

setCombatCallBack(acombat3, CALLBACK_PARAM_TARGETTILE, "onTargetTile3")

setCombatCallBack(acombat4, CALLBACK_PARAM_TARGETTILE, "onTargetTile4")


local function onCastSpell1(parameters)
doCombat(parameters.cid, acombat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, acombat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, acombat3, parameters.var)
end

local function onCastSpell4(parameters)
doCombat(parameters.cid, acombat4, parameters.var)
end

local reset_min = 20                        



function getResets(cid) 
resets = getPlayerStorageValue(cid,2310) 
if resets < 1 then 
resets = 1 
end 
return resets 

end

function onCastSpell(cid, var) 
if getResets(cid) >= reset_min then 
doPlayerAddMana(cid, math.random(45000, 55000)) 
doCombat(cid, combat, var) 
else 
doPlayerSendCancel(cid, "Sorry, you need "..reset_min.." reset's or more to setCombatCallback'use this spell.") 
end 
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 5, parameters)
addEvent(onCastSpell2, 10, parameters)
addEvent(onCastSpell3, 15, parameters)
addEvent(onCastSpell4, 20, parameters)
return TRUE
end

Link para o comentário
Compartilhar em outros sites

fmz manos ?? @mulizeu agora deu isso data/spells/scripts/ThorKiller.lua:116: attempt to call global 'setCombatCallBack' (a nil value)

[27/08/2011 21:54:57] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/ThorKiller.lua)

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...