Ir para conteúdo

Script Rain


758594

Posts Recomendados

Bom,eu tenho essa magia >

 

--// Requerimento para compatibilidade com as novas versões de OTServer \\

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

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

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

{0,1,1,1,0}

},

 

[3] = {

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

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

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

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

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

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

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

},

 

[4] = {

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

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

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

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

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

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

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

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

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

 

ai quero por nela,que só eu possa usar e no final dela caia dinheiro (2160) caia de 4 a 9 moedas de (2160).Vlw ^^

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

tenta assim.

 


--// Requerimento para compatibilidade com as novas versões de OTServer \\
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,0,0,0,1},
{1,0,2,0,1},
{1,0,0,0,1},
{0,1,1,1,0}
},

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

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

function onTargetCreature(cid, target)
doPushCreature(getCreaturePosition(cid), target)
doPlayerAddItem(cid,2160,4,9)
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[i], var)
if i == #combat then
addEvent(mayNotMove, i*150-150, cid, FALSE)
end
end
return TRUE
end

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

tenta assim.

 


--// Requerimento para compatibilidade com as novas versões de OTServer \\
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,0,0,0,1},
{1,0,2,0,1},
{1,0,0,0,1},
{0,1,1,1,0}
},

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

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

function onTargetCreature(cid, target)
doPushCreature(getCreaturePosition(cid), target)
doPlayerAddItem(cid,2160,4,9)
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[i], var)
if i == #combat then
addEvent(mayNotMove, i*150-150, cid, FALSE)
end
end
return TRUE
end

cara ate que ficou daora mais teria como deixa pra cair o dinheiro no final das nuvenzinha?

Link para o comentário
Compartilhar em outros sites

sim tenta assim que não der fala ai que vou tentar arrumar.

 

 

--// Requerimento para compatibilidade com as novas versões de OTServer \\
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
function onTargetCreature(cid, target)
doPushCreature(getCreaturePosition(cid), target)
doPlayerAddItem(cid,2160,4,9)
end
local arr = {
[1] = {
{1,1,1},
{1,2,1},
{1,1,1}
},
[2] = {
{0,1,1,1,0},
{1,0,0,0,1},
{1,0,2,0,1},
{1,0,0,0,1},
{0,1,1,1,0}
},
[3] = {
{0,0,1,1,1,0,0},
{0,1,0,0,0,1,0},
{1,0,0,0,0,0,1},
{1,0,0,2,0,0,1},
{1,0,0,0,0,0,1},
{0,1,0,0,0,1,0},
{0,0,1,1,1,0,0}
},
[4] = {
{0,0,0,1,1,1,0,0,0},
{0,0,1,0,0,0,1,0,0},
{0,1,0,0,0,0,0,1,0},
{1,0,0,0,0,0,0,0,1},
{1,0,0,0,2,0,0,0,1},
{1,0,0,0,0,0,0,0,1},
{0,1,0,0,0,0,0,1,0},
{0,0,1,0,0,0,1,0,0},
{0,0,0,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[i], var)
if i == #combat then
addEvent(mayNotMove, i*150-150, cid, FALSE)
end
end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

--// Requerimento para compatibilidade com as novas versões de OTServer \\
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,0,0,0,1},
{1,0,2,0,1},
{1,0,0,0,1},
{0,1,1,1,0}
},

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

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

function onTargetCreature(cid, target)
doPushCreature(getCreaturePosition(cid), target)
doCreateItem(2160, math.random(4,9), getThingPos(cid))
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[i], var)
if i == #combat then
addEvent(mayNotMove, i*150-150, cid, FALSE)
end
end
return TRUE
end

 

heart.png

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...