Ir para conteúdo
  • 0

Shinra tensei (ajuda)


alanmtd

Pergunta

Iae Galera do Xtibia, Beleza???

 

Tenho aki uma spell shinra tensei , mais ela nao empurra e nao da um dano

alguem que meche com script poderia me ajudar

quero que empurre o player e de um dano de 1000 no life

 

Quote: \/

 

Quote
local mayNotMove = doCreatureSetNoMove

function doPushCreature(pos, target)
creature = getThingfromPos({x=target.x, y=target.y, z=target.z, stackpos=253}).uid
if target.y < pos.y and target.x == pos.x then
newpos = {x=target.x, y=target.y-1, z=target.z}
elseif target.y > pos.y and target.x == pos.x then
newpos = {x=target.x, y=target.y+1, z=target.z}
elseif target.y == pos.y and target.x > pos.x then
newpos = {x=target.x+1, y=target.y, z=target.z}
elseif target.y == pos.y and target.x < pos.x then
newpos = {x=target.x-1, y=target.y, z=target.z}
elseif target.y < pos.y and target.x > pos.x then
newpos = {x=target.x+1, y=target.y-1, z=target.z}
elseif target.y > pos.y and target.x < pos.x then
newpos = {x=target.x-1, y=target.y+1, z=target.z}
elseif target.y > pos.y and target.x > pos.x then
newpos = {x=target.x+1, y=target.y+1, z=target.z}
elseif target.y < pos.y and target.x < pos.x then
newpos = {x=target.x-1, y=target.y-1, z=target.z}
end
if creature > 0 then
if queryTileAddThing(creature, newpos) == TRUE then
doTeleportThing(creature, newpos, TRUE)
end
end
end

local arr = {
[1] = {
{1,1,1},
{1,2,1},
{1,1,1}
},

[2] = {
{0,1,1,1,0},
{1,1,1,1,1},
{1,1,2,1,1},
{1,1,1,1,1},
{0,1,1,1,0}
},

[3] = {
{0,0,1,1,1,0,0},
{0,1,1,1,1,1,0},
{1,1,1,1,1,1,1},
{1,1,1,2,1,1,1},
{1,1,1,1,1,1,1},
{0,1,1,1,1,1,0},
{0,0,1,1,1,0,0}
},

[4] = {
{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,1,1,1,1,1,0},
{1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,2,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1},
{0,1,1,1,1,1,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}
}
}

function onTargetCreature(cid, target)
doPushCreature(getCreaturePosition(cid), target)
end

combat = {}
for n, v in pairs(arr) do
combat[n] = createCombatObject()
_G["callback"..n] = onTargetCreature
setCombatCallback(combat[n], CALLBACK_PARAM_TARGETTILE, "callback"..n)
setCombatParam(combat[n], COMBAT_PARAM_EFFECT, 2)
setCombatArea(combat[n], createCombatArea(v))
end

function onCastSpell(cid, var)
mayNotMove(cid, TRUE)
for i = 1, #combat do
addEvent(doCombat, i*150-150, cid, combat, var)
if i == #combat then
addEvent(mayNotMove, i*150-150, cid, FALSE)
end
end
return TRUE
end

 

è isso rep+ a ajuda :))))

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Ta aqui manow:

 

local function doPushCreature(target, cid)

if target > 0 then
if not isNpc(target) then
local position = getThingPosition(cid)
local fromPosition = getThingPosition(target)
local x = ((fromPosition.x - position.x) < 0 and -1 or ((fromPosition.x - position.x) == 0 and 0 or 1))
local y = ((fromPosition.y - position.y) < 0 and -1 or ((fromPosition.y - position.y) == 0 and 0 or 1))
local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
doTeleportThing(target, toPosition, true)
end
end
end
end
local spell = {}
spell.config = {
[3] = {
damageType = 1,
areaEffect = 28,
area = {
{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},
}
},
[2] = {
damageType = 1,
areaEffect = 28,
area = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 3, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}
},
[1] = {
damageType = 1,
areaEffect = 28,
area = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}
}
}
spell.combats = {}
for _, config in ipairs(spell.config) do
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -40, 0, -47, 0)
function onTargetCreature(cid, target)
doPushCreature(target, cid)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
setCombatArea(combat, createCombatArea(config.area))
table.insert(spell.combats, combat)
end
function onCastSpell(cid, var)
for n = 1, #spell.combats do
addEvent(doCombat, (n * 150) - 150, cid, spell.combats[n], var)
end
return true
end
O dano voce edita ali naquela linha:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -40, 0, -47, 0)
Caso queira mudar o efeito, é em cima de cada uma das areas da spell.
Ajudei? rep+
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...