Ir para conteúdo

Target Docreaturesetnomove


lukervis

Posts Recomendados

Estava tentando criar uma magia que imobilizaria o target por 5 segundos, eu fiz a magia tudo corretamente... confiram no @edit..

 

@EDIT:

consegui fazer uma aqui:

 

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)

setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)

setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

 

function onCastSpell(cid, var)

 

doCreatureSetNoMove(target, true)

addEvent(doCreatureSetNoMove, 5000, target, false)

 

return doCombat(cid, combat, var)

end

 

 

só que quando vou usar da o seguinte erro

 

[14/03/2012 23:37:23] [Error - Spell Interface]

[14/03/2012 23:37:23] In a timer event called from:

[14/03/2012 23:37:23] data/spells/scripts/pbot/exori stun.lua:onCastSpell

[14/03/2012 23:37:23] Description:

[14/03/2012 23:37:23] (luaDoCreatureSetNoMove) Creature not found

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

se n pois pra checa se tem target, e nem definiu se o target,dai ele n é achado

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if target ~= 0 and target ~= nill then
doCreatureSetNoMove(target, true)
addEvent(doCreatureSetNoMove, 5000, target, false)
return doCombat(cid, combat, var)
end

end

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)

setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)

setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

 

function onCastSpell(cid, var))

doCreatureSetNoMove(cid, true)

addEvent(doCreatureSetNoMove, 5000, cid, false)

return doCombat(cid, combat, var)

end

 

end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...