LucasFerraz
Systems Analyst
If a team die inside of room then if next team come they have to kill all alive monsters to start quest.
How can I do to remove all monsters alive?
How can I do to remove all monsters alive?
Lua:
function onStepIn(cid, item, position, fromPosition)
--Config-->
local starting = {x = 570, y = 550, z = 10, stackpos = 253}
local ending = {x = 592, y = 578, z = 10, stackpos = 253}
local checking = {x = starting.x, y = ending.y, z = starting.z, stackpos = starting.stackpos}
local queststatus = getPlayerStorageValue(cid, 1974)
local player_pos_entrada = {x = 582, y = 574, z = 10}
--EndConfig-->
--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.
if item.actionid == 1974 and queststatus == -1 then
doCreatureSay(cid, "It seems by defeating Azerus you have stopped this army from entering in your world! Better leave this ghastly place forever.", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 1974, 1)
return TRUE
end
if item.actionid == 1973 and queststatus == -1 then
totalmonsters = 0
monster = {}
repeat
creature = getThingfromPos(checking)
if creature.itemid > 0 then
if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 6 then
totalmonsters = totalmonsters + 1
monster[totalmonsters] = creature.uid
end
end
checking.x = checking.x + 1
if checking.x > ending.x then
checking.x = starting.x
checking.y = checking.y + 1
end
until checking.y > ending.y
if totalmonsters ~= 0 then
current = 0
repeat
current = current + 1
doRemoveCreature(monster[current])
until current >= totalmonsters
end
doTeleportThing(cid, player_pos_entrada)
doSendMagicEffect(player_pos_entrada, 10)
else
doMoveCreature(cid, newdir)
end
end