Ir para conteúdo
  • 0

Script para spell empurrar--simix,vodkart,alguem


slekron

Pergunta

algum poderia em ajudar eu fiz uma spell e gostaria q ela empurrasse ,vou postar aki se alguem puder ajudar

por favor fast '-'.

 

local combat1 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 81)

setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, 215)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -7.0, 7.25, -7.15, 7.55)

 

local combat2 = createCombatObject()

setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat2, COMBAT_PARAM_EFFECT, 71)

setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, 215)

setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -7.0, 7.25, -7.15, 7.55)

 

arr1 = {

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0},

{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0},

}

 

arr2 = {

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0},

{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0},

}

 

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

setCombatArea(combat1, area1)

setCombatArea(combat2, area2)

 

local function onCastSpell1(parameters)

doCombat(parameters.cid, combat1, parameters.var)

end

 

local function onCastSpell2(parameters)

doCombat(parameters.cid, combat2, parameters.var)

end

 

function onCastSpell(cid, var)

local parameters = { cid = cid, var = var}

addEvent(onCastSpell1, 100, parameters)

addEvent(onCastSpell2, 150, parameters)

 

return TRUE

end

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

vou te passar uma função

adiciona isso em 000-constant

 

function doMoveCreature2(cid, dir)

return queryTileAddThing(cid, changeposbydir(getThingPos(cid), dir, 1)) == 1

and

doMoveCreature(cid, dir)

or

0

end

 

e agora uma spells que empurra

 

local mytable = {}

local combat1 = createCombatObject()

setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat1, COMBAT_PARAM_EFFECT, 42)

setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) -- errado

 

local combat2 = createCombatObject()

setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat2, COMBAT_PARAM_EFFECT, 42)

setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) -- errado

 

local combat3 = createCombatObject()

setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat3, COMBAT_PARAM_EFFECT, 42)

setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) -- errado

 

local combat4 = createCombatObject()

setCombatParam(combat4, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat4, COMBAT_PARAM_EFFECT, 42)

setCombatFormula(combat4, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) -- errado

 

local combat5 = createCombatObject()

setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat5, COMBAT_PARAM_EFFECT, 42)

setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) -- errado

 

local combat6 = createCombatObject()

setCombatParam(combat5, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat5, COMBAT_PARAM_EFFECT, 42)

setCombatFormula(combat5, COMBAT_FORMULA_LEVELMAGIC, -1.3, -30, -1.7, 0) -- errado

 

local combat7 = createCombatObject()

 

local arr1 = {

{0, 0, 0, 0, 3, 0, 0, 0, 0},

}

 

local arr2 = {

{0, 0, 0, 1, 1, 1, 0, 0, 0},

{0, 0, 0, 0, 2, 0, 0, 0, 0},

}

 

local arr3 = {

{0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 1, 1, 1, 0, 0, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 2, 0, 0, 0, 0},

}

 

local arr4 = {

{0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 1, 1, 1, 1, 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, 2, 0, 0, 0, 0},

}

 

local arr5 = {

{0, 1, 1, 1, 1, 1, 1, 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, 0},

{0, 0, 0, 0, 2, 0, 0, 0, 0},

}

 

local arr6 = {

{0, 1, 1, 1, 1, 1, 1, 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, 0},

{0, 0, 0, 0, 0, 0, 0, 0, 0},

{0, 0, 0, 0, 2, 0, 0, 0, 0},

}

 

 

local arr7 = {

{1, 1, 1, 1, 1, 1, 1, 1, 1},

{0, 1, 1, 1, 1, 1, 1, 1, 0},

{0, 0, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 1, 1, 1, 1, 1, 0, 0},

{0, 0, 0, 1, 1, 1, 0, 0, 0},

{0, 0, 0, 0, 2, 0, 0, 0, 0},

}

 

local area1 = createCombatArea(arr1)

local area2 = createCombatArea(arr2)

local area3 = createCombatArea(arr3)

local area4 = createCombatArea(arr4)

local area5 = createCombatArea(arr5)

local area6 = createCombatArea(arr6)

local area7 = createCombatArea(arr7)

setCombatArea(combat1, area1)

setCombatArea(combat2, area2)

setCombatArea(combat3, area3)

setCombatArea(combat4, area4)

setCombatArea(combat5, area5)

setCombatArea(combat6, area6)

setCombatArea(combat7, area7)

 

function onTargetCreature(cid, target)

table.insert(mytable, target)

end

 

function onTargetCreature2(cid, target)

table.insert(mytable, target)

end

 

function onTargetCreature3(cid, target)

table.insert(mytable, target)

end

 

function onTargetCreature4(cid, target)

table.insert(mytable, target)

end

 

function onTargetCreature5(cid, target)

table.insert(mytable, target)

end

 

function onTargetCreature6(cid, target)

table.insert(mytable, target)

end

 

function event7(p)

if isPlayer(p.id) then

doCombat(p.id, p.combat, p.var)

for x=1, #mytable do

if isCreature(mytable[x]) then

doMoveCreature2(mytable[x], getPushDir(p.id, mytable[x]), 0)

end

end

mytable = {}

end

end

 

function onTileteon(cid, pos)

local thing = getTileItemByType(pos, 6)

if thing.uid > 0 then

if isInArray({1492,1493}, thing.itemid) then

doTransformItem(thing.uid, thing.itemid+1, 1)

elseif thing.itemid == 1494 then

doRemoveItem(thing.uid, 1)

end

end

end

 

setCombatCallback(combat1, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

setCombatCallback(combat2, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature2")

setCombatCallback(combat3, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature3")

setCombatCallback(combat4, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature4")

setCombatCallback(combat5, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature5")

setCombatCallback(combat6, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature6")

setCombatCallback(combat6, CALLBACK_PARAM_TARGETTILE, "onTileteon")

 

function onCastSpell(cid, var)

doCombat(cid, combat6, var)

addEvent(event7, 100, {id=cid, combat=combat1, var=var})

addEvent(event7, 200, {id=cid, combat=combat2, var=var})

addEvent(event7, 300, {id=cid, combat=combat3, var=var})

addEvent(event7, 400, {id=cid, combat=combat4, var=var})

addEvent(event7, 500, {id=cid, combat=combat5, var=var})

addEvent(event7, 600, {id=cid, combat=combat6, var=var})

return TRUE

end

Link para o comentário
Compartilhar em outros sites

  • 0

function onCastSpell(cid, var)
local pos = getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid),1)
pos.stackpos = 253
if (isPlayer(getThingFromPos(pos).uid)) then
player = getThingFromPos(pos).uid
addEvent(doEmpurrePlayer, 1, cid, player, 1, getCreaturePosition(cid))
end
doCombat(cid, combat6, var)
addEvent(event7, 100, {id=cid, combat=combat1, var=var})
addEvent(event7, 200, {id=cid, combat=combat2, var=var})
addEvent(event7, 300, {id=cid, combat=combat3, var=var})
addEvent(event7, 400, {id=cid, combat=combat4, var=var})
addEvent(event7, 500, {id=cid, combat=combat5, var=var})
addEvent(event7, 600, {id=cid, combat=combat6, var=var})
return TRUE
end

 

usa esse onCastSpel, mais não esqueça de adicionar a função nas libs.

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

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...