CheatsBCN
New Member
- Joined
- Mar 6, 2012
- Messages
- 131
- Reaction score
- 1
Hello, i tryed to do my own demon helmet quest with looking at some scripts so i can learn a bit (and so i dont request for to many script as some got angry with me jeje) this is what i did but its all the time returning me that there is some monster alive even when no monster is alive.
this is the script, i know there are some out there but i want to fix this one cus its in someway different and also to see where is there error and learn. i will apreciate any help.
the problem is in the function clearAll() dunno what is wrong but couldnt see it..
- - - Updated - - -
....
this is the script, i know there are some out there but i want to fix this one cus its in someway different and also to see where is there error and learn. i will apreciate any help.
Lua:
local pinkstonepos1 = {x=1027, y=1096, z=8, stackpos=1} -- Blocking stone position.
local TeleportToPos = { x = 1139, y = 1111, z = 8, stackpos=2} -- Position the player will be ported to when leaving the DHQ, like the Temple...
local LeverPos = { x = 1043, y = 1095, z = 8, stackpos=2} -- Lever Position
local TeleportOutPos = { x = 1035, y = 1096, z = 8, stackpos=1} -- where tp is created
local timeToRemove = 5 -- Time before quest reset
local starting= {x = 1027, y = 1089, z = 8} -- edit this to the top left sqm of ur annhilator room
local ending= {x = 1041, y = 1101, z = 8} -- edit this to the bottom right sqm of ur annhilator room
local demon1pos = {x=1032, y=1095, z=8}
local demon2pos = {x=1032, y=1098, z=8}
local demon3pos = {x=1034, y=1096, z=8}
local demon4pos = {x=1037, y=1095, z=8}
local demon5pos = {x=1037, y=1098, z=8}
local banshee1pos = {x=1036, y=1092, z=8}
local banshee2pos = {x=1036, y=1100, z=8}
local banshee3pos = {x=1039, y=1097, z=8}
function onUse(cid, item, fromPos, item2, toPos)
local hi = false
if (cleanArea()) then
if item.itemid == 1945 then
doRemoveItem(getThingfromPos(pinkstonepos1).uid, 1)
doCreateTeleport(1387, TeleportToPos, TeleportOutPos)
doSendMagicEffect(TeleportOutPos, CONST_ME_TELEPORT)
doCreatureSay(cid, "You have " .. timeToRemove .. " seconds to go into de teleport!", TALKTYPE_ORANGE_1)
doTransformItem(item.uid,1946)
addEvent(doRemoveTeleport, (1000*timeToRemove))
elseif item.itemid == 1946 then
doPlayerSendCancel(cid,"Sorry, not possible.") -- message if the lever is pulled again.
end
else
doPlayerSendCancel(cid,"You have to kill all the monsters before you can pull it!")
end
return true
end
function cleanArea()
local checking= {x = starting.x, y = starting.y, z = starting.z, stackpos = 253}
while(checking.y <= ending.y) do
local creature = getTopCreature(checking).uid or getTopCreature(checking)
if(isCreature(creature) == TRUE) then
return false
end
if(checking.x == ending.x) then
checking.x = starting.x
checking.y = checking.y + 1
end
checking.x = checking.x + 1
end
return true
end
function doRemoveTeleport()
if getThingfromPos({x=1035, y=1096, z=8, stackpos=1}).itemid == 1387 then
doCreateItem(1355, 1, pinkstonepos1)
doRemoveItem(getThingfromPos({x=1035, y=1096, z=8, stackpos=1}).uid,1)
doSendMagicEffect({x=1035, y=1096, z=8, stackpos=15}, CONST_ME_POFF)
doTransformItem(getThingfromPos({x=1043, y=1095, z=8, stackpos=2}).uid, 1945)
respawn()
end
return true
end
function respawn()
doSummonCreature("Demon", demon1pos)
doSummonCreature("Demon", demon2pos)
doSummonCreature("Demon", demon3pos)
doSummonCreature("Demon", demon4pos)
doSummonCreature("Demon", demon5pos)
doSummonCreature("Banshee", banshee1pos)
doSummonCreature("Banshee", banshee2pos)
doSummonCreature("Banshee", banshee3pos)
end
the problem is in the function clearAll() dunno what is wrong but couldnt see it..
- - - Updated - - -
....