¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

TRINEO QUE SE DESLIZA (SOLO PARA 8.0)

Ir abajo

TRINEO QUE SE DESLIZA (SOLO PARA 8.0) Empty TRINEO QUE SE DESLIZA (SOLO PARA 8.0)

Mensaje por gmdiego5 Dom Mar 09, 2008 6:50 am

Esto es para que los trineos wapos del 8.0 se puedan mover =P espero que les sirva ^^

W = Trineo = 7266
X = primer perro = 7268
Y = segundo perro = 7269
Z = tercer perro = 7270
A = ActionId 9001 (el lugar donde se detienen)
N = nada(Nieve)

pongan algo parecido a esto en el map editor:

W
X
Y
Z
N
N
N
N
N
A

data/movements/movements.xml:
Código:
<movevent event="StepIn" itemid="7266" script="dogsled.lua" />



data/movements/scripts/dogsled.lua:
Código:

function addSled(params)
local startpos = params.startpos
local spawnDelay = params.spawnDelay

local speed = 250 --La velocidad en milisegundos para que el trineo se mueva 1 espacio

local pos = params.pos
local cid = params.cid

-- Ni se te ocurra editar nada de lo que viene almenos que sepas lo que haces =P
local groundpos = {x=pos.x, y=pos.y, z=pos.z, stackpos=0}
local ground = getThingfromPos(groundpos)

pos1 = {x=pos.x, y=pos.y, z=pos.z, stackpos=1}
pos2 = {x=pos.x, y=pos.y+2, z=pos.z, stackpos=1}
pos3 = {x=pos.x, y=pos.y+3, z=pos.z, stackpos=1}
pos4 = {x=pos.x, y=pos.y+5, z=pos.z, stackpos=1}
item1 = getThingfromPos(pos1)
item2 = getThingfromPos(pos2)
item3 = getThingfromPos(pos3)
item4 = getThingfromPos(pos4)

newpos = {x=pos.x, y=pos.y+1, z=pos.z}

if ground.actionid == 9001 then
spawnparams = {startpos = startpos, pos = pos}
addEvent(spawnSled,spawnDelay*1000,spawnparams)
setPlayerStorageValue(cid,9000,-1)
else
doRemoveItem(item1.uid,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item3.uid,1)
doRemoveItem(item4.uid,1)

newpos1 = {x=newpos.x, y=newpos.y, z=newpos.z}
newpos2 = {x=newpos.x, y=newpos.y+2, z=newpos.z}
newpos3 = {x=newpos.x, y=newpos.y+3, z=newpos.z}
newpos4 = {x=newpos.x, y=newpos.y+5, z=newpos.z}
doCreateItem(7266,1,newpos1)
doCreateItem(7268,1,newpos2)
doCreateItem(7269,1,newpos3)
doCreateItem(7270,1,newpos4)

doTeleportThing(cid, newpos)

newparams = {pos = newpos, cid = cid, startpos = startpos, spawnDelay = 10}
addEvent(addSled,speed,newparams)
end
end

function spawnSled(params)
local startpos = params.startpos
local pos = params.pos
pos1 = {x=startpos.x, y=startpos.y, z=startpos.z}
pos2 = {x=startpos.x, y=startpos.y+2, z=startpos.z}
pos3 = {x=startpos.x, y=startpos.y+3, z=startpos.z}
pos4 = {x=startpos.x, y=startpos.y+5, z=startpos.z}
doCreateItem(7266,1,pos1)
doCreateItem(7268,1,pos2)
doCreateItem(7269,1,pos3)
doCreateItem(7270,1,pos4)

pos1 = {x=pos.x, y=pos.y, z=pos.z, stackpos=1}
pos2 = {x=pos.x, y=pos.y+2, z=pos.z, stackpos=1}
pos3 = {x=pos.x, y=pos.y+3, z=pos.z, stackpos=1}
pos4 = {x=pos.x, y=pos.y+5, z=pos.z, stackpos=1}
item1 = getThingfromPos(pos1)
item2 = getThingfromPos(pos2)
item3 = getThingfromPos(pos3)
item4 = getThingfromPos(pos4)
doRemoveItem(item1.uid,1)
doRemoveItem(item2.uid,1)
doRemoveItem(item3.uid,1)
doRemoveItem(item4.uid,1)

ppos1 = {x=startpos.x, y=startpos.y, z=startpos.z, stackpos=253}
ppos2 = {x=startpos.x, y=startpos.y+2, z=startpos.z, stackpos=253}
ppos3 = {x=startpos.x, y=startpos.y+3, z=startpos.z, stackpos=253}
ppos4 = {x=startpos.x, y=startpos.y+5, z=startpos.z, stackpos=253}
player1 = getThingfromPos(ppos1)
player2 = getThingfromPos(ppos2)
player3 = getThingfromPos(ppos3)
player4 = getThingfromPos(ppos4)

nppos1 = {x=startpos.x+1, y=startpos.y, z=startpos.z}
nppos2 = {x=startpos.x+1, y=startpos.y+2, z=startpos.z}
nppos3 = {x=startpos.x+1, y=startpos.y+3, z=startpos.z}
nppos4 = {x=startpos.x+1, y=startpos.y+5, z=startpos.z}
if player1.itemid > 0 then
doTeleportThing(player1.uid, nppos1)
end
if player2.itemid > 0 then
doTeleportThing(player2.uid, nppos2)
end
if player3.itemid > 0 then
doTeleportThing(player3.uid, nppos3)
end
if player4.itemid > 0 then
doTeleportThing(player4.uid, nppos4)
end
end

function onStepIn(cid, item, pos)
if isPlayer(cid) == 1 then
isMoving = getPlayerStorageValue(cid,9000)
if item.itemid == 7266 and isMoving == -1 then
params = {cid = cid, pos = pos, startpos = pos, spawnDelay = 10}
addEvent(addSled, 100, params)
setPlayerStorageValue(cid,9000,1)
end
end
end

BY:DIEGO
gmdiego5
gmdiego5
Posteador
Posteador

Masculino
Cantidad de envíos : 107
Edad : 29
Localización : Ciber
Humor : Muy happy :)
Fecha de inscripción : 09/03/2008

http://diegorap4.spaces.live.com/default.aspx?mkt=es-MX&partner=

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.