Alright i've been trying real hard now and i cant seem to get this shit fixed...
Here's my action script leveldoor shit
Actions.xml
Some leveldoors work but mostly they don't!
If i don't fix this shit i'll go berserk soon!
I would really appreciate if the ones that know of this would just read through and spot some errors or just link me to a supergreat tutorial!
Thanks!
/John
Here's my action script leveldoor shit
PHP:
function onUse(cid, item, frompos, item2, topos)
playerpos = getPlayerPosition(cid)
doorpos = {x=frompos.x, y=frompos.y, z=frompos.z, stackpos=253}
doorlevel = item.actionid-1000
if item.itemid == 1227
or item.itemid == 1229
or item.itemid == 1245
or item.itemid == 1247
or item.itemid == 1259
or item.itemid == 1261
or item.itemid == 3540
or item.itemid == 3549 then
if getPlayerLevel(cid) >= doorlevel then
doTransformItem(item.uid, item.itemid+1)
if playerpos.y == doorpos.y+1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 0)
elseif playerpos.x == doorpos.x-1 and playerpos.y == doorpos.y then
doMoveCreature(cid, 1)
elseif playerpos.y == doorpos.y-1 and playerpos.x == doorpos.x then
doMoveCreature(cid, 2)
elseif playerpos.y == doorpos.y and playerpos.x == doorpos.x+1 then
doMoveCreature(cid, 3)
elseif playerpos.x == doorpos.x+1 and playerpos.y == doorpos.y-1 then
doMoveCreature(cid, 4)
elseif playerpos.x == doorpos.x-1 and playerpos.y == doorpos.y-1 then
doMoveCreature(cid, 5)
elseif playerpos.x == doorpos.x+1 and playerpos.y == doorpos.y+1 then
doMoveCreature(cid, 6)
elseif playerpos.x == doorpos.x-1 and playerpos.y == doorpos.y+1 then
doMoveCreature(cid, 7)
end
else
doPlayerSendTextMessage(cid, 22, "Only the worthy may pass.\nYou need level "..(doorlevel).." to pass this door.")
end
elseif item.itemid == 1228
or item.itemid == 1230
or item.itemid == 1246
or item.itemid == 1248
or item.itemid == 1260
or item.itemid == 1262
or item.itemid == 3541
or item.itemid == 3550 then
if item.itemid == 1228
or item.itemid == 1246
or item.itemid == 1260
or item.itemid == 3550 then
doMoveCreature(cid, 1)
return 1
elseif item.itemid == 1230
or item.itemid == 1248
or item.itemid == 1262
or item.itemid == 3541 then
doMoveCreature(cid, 2)
return 1
end
doTransformItem(item.uid, item.itemid-1)
else
return 0
end
return 1
end
Actions.xml
PHP:
// THE LEVEL DOORS
// ROOK QUEST
<action uniqueid="1337" script="quest.lua" />
// ROOK QUEST END
-- Level Doors
<action itemid="1227" script="leveldoor.lua"/>
<action itemid="1229" script="leveldoor.lua"/>
<action itemid="1261" script="leveldoor.lua"/>
<action fromid="1245" toid="1262" script="leveldoor.lua"/>
<action fromid="3540" toid="3541" script="leveldoor.lua"/>
<action fromid="3549" toid="3550" script="leveldoor.lua"/>
<action fromid="1229" toid="1230" script="leveldoor.lua"/>
// THE LEVEL DOORS
Some leveldoors work but mostly they don't!
If i don't fix this shit i'll go berserk soon!
I would really appreciate if the ones that know of this would just read through and spot some errors or just link me to a supergreat tutorial!
Thanks!
/John