• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Annih dosent work.

Brask

EdenSoft
Joined
Oct 22, 2011
Messages
21
Reaction score
0
Location
Sweden
Ok my annih script is bugged cant use the switch. all i want is when playerA is on the posisons they teleports to playerB posisons. ( i am using ItemID:1945 as a switch)
i will give rep+ for the one thats helps me aut i am not a good att chaning scripts so thanks for help.

PHP:
local playerA={
	{x=1106, y=1095, z=15},
	{x=1106, y=1094, z=15},
	{x=1106, y=1093, z=15},
	{x=1106, y=1092, z=15}
}
local playerB={
	{x=1166, y=1080, z=15},
	{x=1165, y=1080, z=15},
	{x=1164, y=1080, z=15},
	{x=1163, y=1080, z=15}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local t = {}
	if item.itemid == 1945 then
		for i = 1, 4 do
			t[i]=getTopCreature(playerA[i]).uid
			if t[i] == 0 or not isPlayer(t[i]) then
				return doPlayerSendCancel(cid, 'You need 4 players for this quest.')
			elseif getPlayerLevel(t[i]) < 100 then
				return doPlayerSendCancel(cid, 'All players need to have level 100 or higher.')
			end
		end
		for i = 1, 6 do
			doCreateMonster('Demon', summon[i])
		end
		for i=1, 4 do
			doTeleportThing(t[i], playerB[i])
			doSendMagicEffect(playerA[i], CONST_ME_POFF)
			doSendMagicEffect(playerB[i], CONST_ME_ENERGYAREA)
		end
	else
		for x = from.x, to.x do
			for y = from.y, to.y do
				local v = getTopCreature({x=x, y=y, z=from.z}).uid
				if v ~= 0 then
					if isPlayer(v) then
						return doPlayerSendCancel(cid, 'There is already a team in the quest room.')
					elseif isMonster(v) then
						table.insert(t, v)
					end
				end
			end
		end
		for i = 1, #t do
			doRemoveCreature(t[i])
		end
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end

Regards Brask

if it is another script that dosent summon deamons (just teleporting players when using switch) i can take that script insted.
 
Last edited by a moderator:
This is for real map so you will have to change the positions. :p

Code:
        -- Annihilator by Shawak v2.1

        -- CONFIG --

        local room = {     -- room with demons
        fromX = 33217,
        fromY = 31655,
        fromZ = 13,
        --------------
        toX = 33224,
        toY = 31663,
        toZ = 13
        }

        local monster_pos = {
        [1] = {pos = {33220, 31657, 13}, monster = "Demon"},
        [2] = {pos = {33222, 31657, 13}, monster = "Demon"},
        [3] = {pos = {33219, 31661, 13}, monster = "Demon"},
        [4] = {pos = {33221, 31661, 13}, monster = "Demon"},
        [5] = {pos = {33223, 31659, 13}, monster = "Demon"},
        [6] = {pos = {33224, 31659, 13}, monster = "Demon"}
        }

        local players_pos = {
        {x = 33225, y =31671, z = 13, stackpos = 253},
        {x = 33224, y =31671, z = 13, stackpos = 253},
        {x = 33223, y =31671, z = 13, stackpos = 253},
        {x = 33222, y =31671, z = 13, stackpos = 253}
        }

        local new_player_pos = {
        {x = 33222, y = 31659, z = 13},
        {x = 33221, y = 31659, z = 13},
        {x = 33220, y = 31659, z = 13},
        {x = 33219, y = 31659, z = 13}
        }

        local playersOnly = "yes"
        local questLevel = 100

        ------------------------------------------------------
        --- CONFIG END ---------------------------------------
        ------------------------------------------------------

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player[i].uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        local door = getTileItemById({x=33225, y=31659, z=13}, 5109).uid
                    if door > 0 then
                        doTransformItem(door, 5108)
                    end

                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end
 
Dident work.
[30/10/2011 16:40:47] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/annihilator.lua:25: '}' expected (to close '{' at line 15) near '['
[30/10/2011 16:40:47] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)
[30/10/2011 16:40:47] data/actions/scripts/quests/annihilator.lua:25: '}' expected (to close '{' at line 15) near '['

And yes i did change it to the right posisons.

PHP:
-- Annihilator by Shawak v2.1

        -- CONFIG --

        local room = {     -- room with demons
        fromX = 1163,
        fromY = 1078,
        fromZ = 15,
        --------------
        toX = 1169,
        toY = 1082,
        toZ = 15
        }

        local monster_pos = {
        [1] = {pos = {1163, 1078, 15}, monster = "Demon"},
        [2] = {pos = {1165, 1078, 15}, monster = "Demon"},
        [3] = {pos = {1167, 1078, 15}, monster = "Demon"},
        [4] = {pos = {1169, 1078, 15}, monster = "Demon"},
        [5] = {pos = {1163, 1182, 15}, monster = "Demon"},
	    [6] = {pos = {1165, 1182, 15}, monster = "Demon"},
		[7] = {pos = {1167, 1182, 15}, monster = "Demon"},
		[8] = {pos = {1169, 1182, 15}, monster = "Demon"},
        [9] = {pos = {1167, 1080, 15}, monster = "Orshabaal"}
		[10] = {pos = {1168, 1080, 15}, monster = "Demon"},
		[11] = {pos = {1169, 1080, 15}, monster = "Demon"},
        }

        local players_pos = {
        {x = 1106, y =1095, z = 15, stackpos = 253},
        {x = 1106, y =1094, z = 15, stackpos = 253},
        {x = 1106, y =1093, z = 15, stackpos = 253},
        {x = 1106, y =1092, z = 15, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1166, y = 1080, z = 15},
        {x = 1165, y = 1080, z = 15},
        {x = 1164, y = 1080, z = 15},
        {x = 1163, y = 1080, z = 15}
        }

        local playersOnly = "yes"
        local questLevel = 130

        ------------------------------------------------------
        --- CONFIG END ---------------------------------------
        ------------------------------------------------------

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player[i].uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                        local door = getTileItemById({x=33225, y=31659, z=15}, 5109).uid
                    if door > 0 then
                        doTransformItem(door, 5108)
                    end

                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end
 
Lua:
-- Annihilator by Shawak v2.1 

        -- CONFIG -- 

        local room = {     -- room with demons 
        fromX = 1163, 
        fromY = 1078, 
        fromZ = 15, 
        -------------- 
        toX = 1169, 
        toY = 1082, 
        toZ = 15 
        } 

        local monster_pos = { 
        [1] = {pos = {1163, 1078, 15}, monster = "Demon"}, 
        [2] = {pos = {1165, 1078, 15}, monster = "Demon"}, 
        [3] = {pos = {1167, 1078, 15}, monster = "Demon"}, 
        [4] = {pos = {1169, 1078, 15}, monster = "Demon"}, 
        [5] = {pos = {1163, 1182, 15}, monster = "Demon"}, 
        [6] = {pos = {1165, 1182, 15}, monster = "Demon"}, 
        [7] = {pos = {1167, 1182, 15}, monster = "Demon"}, 
        [8] = {pos = {1169, 1182, 15}, monster = "Demon"}, 
        [9] = {pos = {1167, 1080, 15}, monster = "Orshabaal"}, 
        [10] = {pos = {1168, 1080, 15}, monster = "Demon"}, 
        [11] = {pos = {1169, 1080, 15}, monster = "Demon"}, 
        } 

        local players_pos = { 
        {x = 1106, y =1095, z = 15, stackpos = 253}, 
        {x = 1106, y =1094, z = 15, stackpos = 253}, 
        {x = 1106, y =1093, z = 15, stackpos = 253}, 
        {x = 1106, y =1092, z = 15, stackpos = 253} 
        } 

        local new_player_pos = { 
        {x = 1166, y = 1080, z = 15}, 
        {x = 1165, y = 1080, z = 15}, 
        {x = 1164, y = 1080, z = 15}, 
        {x = 1163, y = 1080, z = 15} 
        } 

        local playersOnly = "yes" 
        local questLevel = 130 

        ------------------------------------------------------ 
        --- CONFIG END --------------------------------------- 
        ------------------------------------------------------ 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
        local all_ready, monsters, player, level = 0, 0, {}, 0 
        if item.itemid == 1945 then 
                for i = 1, #players_pos do 
                        table.insert(player, 0) 
                end 
                for i = 1, #players_pos do 
                        player[i] = getThingfromPos(players_pos[i]) 
                        if player[i].itemid > 0 then 
                                if string.lower(playersOnly) == "yes" then 
                                        if isPlayer(player[i].uid) == TRUE then 
                                                all_ready = all_ready+1 
                                        else 
                                                monsters = monsters+1 
                                        end 
                                else 
                                        all_ready = all_ready+1 
                                end 
                        end 
                end 
                if all_ready == #players_pos then 
                        for i = 1, #players_pos do 
                                player[i] = getThingfromPos(players_pos[i]) 
                                if isPlayer(player[i].uid) == TRUE then 
                                        if getPlayerLevel(player[i].uid) >= questLevel then 
                                                level = level+1 
                                        end 
                                else 
                                        level = level+1 
                                end 
                        end 
                        if level == #players_pos then 
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then 
                                        local door = getTileItemById({x=33225, y=31659, z=15}, 5109).uid 
                    if door > 0 then 
                        doTransformItem(door, 5108) 
                    end 

                                        for _, area in pairs(monster_pos) do 
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]}) 
                                        end 
                                        for i = 1, #players_pos do 
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF) 
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE) 
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA) 
                                                doTransformItem(item.uid,1946) 
                                        end 
                                else 
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.") 
                                end 
                        else 
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.") 
                        end 
                else 
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.") 
                end 
        elseif item.itemid == 1946 then 
                local player_room = 0 
                for x = room.fromX, room.toX do 
                        for y = room.fromY, room.toY do 
                                for z = room.fromZ, room.toZ do 
                                        local pos = {x=x, y=y, z=z,stackpos = 253} 
                                        local thing = getThingfromPos(pos) 
                                        if thing.itemid > 0 then 
                                                if isPlayer(thing.uid) == TRUE then 
                                                        player_room = player_room+1 
                                                end 
                                        end 
                                end 
                        end 
                end 
                if player_room >= 1 then 
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")           
                elseif player_room == 0 then 
                        for x = room.fromX, room.toX do 
                                for y = room.fromY, room.toY do 
                                        for z = room.fromZ, room.toZ do 
                                                local pos = {x=x, y=y, z=z,stackpos = 253} 
                                                local thing = getThingfromPos(pos) 
                                                if thing.itemid > 0 then 
                                                        doRemoveCreature(thing.uid) 
                                                end 
                                        end 
                                end 
                        end 
                        doTransformItem(item.uid,1945) 
                end 
        end 
        return TRUE 
end
 
Change it correct before saying it's not working. :ninja:

Code:
[COLOR=#000000][COLOR=#007700]-- [/COLOR][COLOR=#0000BB]Annihilator by Shawak v2.1 
 
        [/COLOR][COLOR=#007700]-- [/COLOR][COLOR=#0000BB]CONFIG [/COLOR][COLOR=#007700]-- 
 
        [/COLOR][COLOR=#0000BB]local room [/COLOR][COLOR=#007700]= {     -- [/COLOR][COLOR=#0000BB]room with demons 
        fromX [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1163[/COLOR][COLOR=#007700], 
        [/COLOR][COLOR=#0000BB]fromY [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1078[/COLOR][COLOR=#007700], 
        [/COLOR][COLOR=#0000BB]fromZ [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700], 
        -------------- 
        [/COLOR][COLOR=#0000BB]toX [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1169[/COLOR][COLOR=#007700], 
        [/COLOR][COLOR=#0000BB]toY [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1082[/COLOR][COLOR=#007700], 
        [/COLOR][COLOR=#0000BB]toZ [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15 
        [/COLOR][COLOR=#007700]} 
 
        [/COLOR][COLOR=#0000BB]local monster_pos [/COLOR][COLOR=#007700]= { 
        [[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1163[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1078[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1165[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1078[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1167[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1078[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]4[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1169[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1078[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]5[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1163[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1182[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]6[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1165[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1182[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]7[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1167[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1182[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]8[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1169[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1182[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]9[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1167[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Orshabaal"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]10[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1168[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]}, 
        [[/COLOR][COLOR=#0000BB]11[/COLOR][COLOR=#007700]] = {[/COLOR][COLOR=#0000BB]pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]1169[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]monster [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"Demon"[/COLOR][COLOR=#007700]} 
        } 
 
        [/COLOR][COLOR=#0000BB]local players_pos [/COLOR][COLOR=#007700]= { 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1106[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]1095[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]stackpos [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]253[/COLOR][COLOR=#007700]}, 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1106[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]1094[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]stackpos [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]253[/COLOR][COLOR=#007700]}, 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1106[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]1093[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]stackpos [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]253[/COLOR][COLOR=#007700]}, 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1106[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]1092[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]stackpos [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]253[/COLOR][COLOR=#007700]} 
        } 
 
        [/COLOR][COLOR=#0000BB]local new_player_pos [/COLOR][COLOR=#007700]= { 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1166[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1165[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1164[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, 
        {[/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1163[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1080[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]} 
        } 
 
        [/COLOR][COLOR=#0000BB]local playersOnly [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"yes" 
        [/COLOR][COLOR=#0000BB]local questLevel [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]130 
 
        [/COLOR][COLOR=#007700]------------------------------------------------------ 
        --- [/COLOR][COLOR=#0000BB]CONFIG END [/COLOR][COLOR=#007700]--------------------------------------- 
        ------------------------------------------------------ 
 
function [/COLOR][COLOR=#0000BB]onUse[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]item[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]fromPosition[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]itemEx[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]toPosition[/COLOR][COLOR=#007700]) 
        [/COLOR][COLOR=#0000BB]local all_ready[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]monsters[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]level [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700], {}, [/COLOR][COLOR=#0000BB]0 
        [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]item[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]itemid [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]1945 then 
                [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#FF8000]#players_pos do 
                        [/COLOR][COLOR=#0000BB]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]insert[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]0[/COLOR][COLOR=#007700]) 
                [/COLOR][COLOR=#0000BB]end 
                [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#FF8000]#players_pos do 
                        [/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]] = [/COLOR][COLOR=#0000BB]getThingfromPos[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]players_pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]]) 
                        if [/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#0000BB]itemid [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]0 then 
                                [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]string[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]lower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]playersOnly[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#DD0000]"yes" [/COLOR][COLOR=#0000BB]then 
                                        [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]isPlayer[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000BB]TRUE then 
                                                all_ready [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]all_ready[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]1 
                                        [/COLOR][COLOR=#007700]else 
                                                [/COLOR][COLOR=#0000BB]monsters [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]monsters[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]1 
                                        end 
                                [/COLOR][COLOR=#007700]else 
                                        [/COLOR][COLOR=#0000BB]all_ready [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]all_ready[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]1 
                                end 
                        end 
                end 
                [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]all_ready [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#FF8000]#players_pos then 
                        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#FF8000]#players_pos do 
                                [/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]] = [/COLOR][COLOR=#0000BB]getThingfromPos[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]players_pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]]) 
                                if [/COLOR][COLOR=#0000BB]isPlayer[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000BB]TRUE then 
                                        [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]getPlayerLevel[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700]) >= [/COLOR][COLOR=#0000BB]questLevel then 
                                                level [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]level[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]1 
                                        end 
                                [/COLOR][COLOR=#007700]else 
                                        [/COLOR][COLOR=#0000BB]level [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]level[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]1 
                                end 
                        end 
                        [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]level [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#FF8000]#players_pos then 
                                [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]string[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]lower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]playersOnly[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#DD0000]"yes" [/COLOR][COLOR=#007700]and [/COLOR][COLOR=#0000BB]monsters [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]0 [/COLOR][COLOR=#007700]or [/COLOR][COLOR=#0000BB]string[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]lower[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]playersOnly[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#DD0000]"no" [/COLOR][COLOR=#0000BB]then 
                                        local door [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]getTileItemById[/COLOR][COLOR=#007700]({[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]33225[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]31659[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]5109[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]uid 
                    [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]door [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]0 then 
                        doTransformItem[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]door[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]5108[/COLOR][COLOR=#007700]) 
                    [/COLOR][COLOR=#0000BB]end 
 
                                        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]_[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]area in pairs[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]monster_pos[/COLOR][COLOR=#007700]) do 
                                                        [/COLOR][COLOR=#0000BB]doSummonCreature[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]area[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]monster[/COLOR][COLOR=#007700],{[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]area[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]area[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]2[/COLOR][COLOR=#007700]],[/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]area[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]3[/COLOR][COLOR=#007700]]}) 
                                        [/COLOR][COLOR=#0000BB]end 
                                        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]i [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]1[/COLOR][COLOR=#007700], [/COLOR][COLOR=#FF8000]#players_pos do 
                                                [/COLOR][COLOR=#0000BB]doSendMagicEffect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]players_pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]CONST_ME_POFF[/COLOR][COLOR=#007700]) 
                                                [/COLOR][COLOR=#0000BB]doTeleportThing[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]player[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]new_player_pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]FALSE[/COLOR][COLOR=#007700]) 
                                                [/COLOR][COLOR=#0000BB]doSendMagicEffect[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]new_player_pos[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]i[/COLOR][COLOR=#007700]], [/COLOR][COLOR=#0000BB]CONST_ME_ENERGYAREA[/COLOR][COLOR=#007700]) 
                                                [/COLOR][COLOR=#0000BB]doTransformItem[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]item[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]1946[/COLOR][COLOR=#007700]) 
                                        [/COLOR][COLOR=#0000BB]end 
                                [/COLOR][COLOR=#007700]else 
                                        [/COLOR][COLOR=#0000BB]doPlayerSendTextMessage[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]19[/COLOR][COLOR=#007700],[/COLOR][COLOR=#DD0000]"Only players can do this quest."[/COLOR][COLOR=#007700]) 
                                [/COLOR][COLOR=#0000BB]end 
                        [/COLOR][COLOR=#007700]else 
                                [/COLOR][COLOR=#0000BB]doPlayerSendTextMessage[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]19[/COLOR][COLOR=#007700],[/COLOR][COLOR=#DD0000]"All Players have to be level "[/COLOR][COLOR=#007700]..[/COLOR][COLOR=#0000BB]questLevel[/COLOR][COLOR=#007700]..[/COLOR][COLOR=#DD0000]" to do this quest."[/COLOR][COLOR=#007700]) 
                        [/COLOR][COLOR=#0000BB]end 
                [/COLOR][COLOR=#007700]else 
                        [/COLOR][COLOR=#0000BB]doPlayerSendTextMessage[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]19[/COLOR][COLOR=#007700],[/COLOR][COLOR=#DD0000]"You need "[/COLOR][COLOR=#007700]..[/COLOR][COLOR=#0000BB]table[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]getn[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]players_pos[/COLOR][COLOR=#007700])..[/COLOR][COLOR=#DD0000]" players to do this quest."[/COLOR][COLOR=#007700]) 
                [/COLOR][COLOR=#0000BB]end 
        [/COLOR][COLOR=#007700]elseif [/COLOR][COLOR=#0000BB]item[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]itemid [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]1946 then 
                local player_room [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]0 
                [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]fromX[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]toX [/COLOR][COLOR=#007700]do 
                        for [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]fromY[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]toY [/COLOR][COLOR=#007700]do 
                                for [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]fromZ[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]toZ [/COLOR][COLOR=#007700]do 
                                        [/COLOR][COLOR=#0000BB]local pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]stackpos [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]253[/COLOR][COLOR=#007700]} 
                                        [/COLOR][COLOR=#0000BB]local thing [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]getThingfromPos[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]pos[/COLOR][COLOR=#007700]) 
                                        if [/COLOR][COLOR=#0000BB]thing[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]itemid [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]0 then 
                                                [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]isPlayer[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]thing[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700]) == [/COLOR][COLOR=#0000BB]TRUE then 
                                                        player_room [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]player_room[/COLOR][COLOR=#007700]+[/COLOR][COLOR=#0000BB]1 
                                                end 
                                        end 
                                end 
                        end 
                end 
                [/COLOR][COLOR=#007700]if [/COLOR][COLOR=#0000BB]player_room [/COLOR][COLOR=#007700]>= [/COLOR][COLOR=#0000BB]1 then 
                        doPlayerSendTextMessage[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]cid[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]19[/COLOR][COLOR=#007700],[/COLOR][COLOR=#DD0000]"There is already a team in the quest room."[/COLOR][COLOR=#007700])           
                elseif [/COLOR][COLOR=#0000BB]player_room [/COLOR][COLOR=#007700]== [/COLOR][COLOR=#0000BB]0 then 
                        [/COLOR][COLOR=#007700]for [/COLOR][COLOR=#0000BB]x [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]fromX[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]toX [/COLOR][COLOR=#007700]do 
                                for [/COLOR][COLOR=#0000BB]y [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]fromY[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]toY [/COLOR][COLOR=#007700]do 
                                        for [/COLOR][COLOR=#0000BB]z [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]fromZ[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]room[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]toZ [/COLOR][COLOR=#007700]do 
                                                [/COLOR][COLOR=#0000BB]local pos [/COLOR][COLOR=#007700]= {[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]stackpos [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]253[/COLOR][COLOR=#007700]} 
                                                [/COLOR][COLOR=#0000BB]local thing [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]getThingfromPos[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]pos[/COLOR][COLOR=#007700]) 
                                                if [/COLOR][COLOR=#0000BB]thing[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]itemid [/COLOR][COLOR=#007700]> [/COLOR][COLOR=#0000BB]0 then 
                                                        doRemoveCreature[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]thing[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700]) 
                                                [/COLOR][COLOR=#0000BB]end 
                                        end 
                                end 
                        end 
                        doTransformItem[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]item[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]uid[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000BB]1945[/COLOR][COLOR=#007700]) 
                [/COLOR][COLOR=#0000BB]end 
        end 
        [/COLOR][COLOR=#007700]return [/COLOR][COLOR=#0000BB]TRUE 
end
[/COLOR][/COLOR]
 
How have you registred the script in actions.xml? I'm not sure if I really provided the right script because I have two different annihilator scripts. :ninja:

This should be changed also.

Code:
[COLOR=#000000][COLOR=#0000BB]local door [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#0000BB]getTileItemById[/COLOR][COLOR=#007700]({[/COLOR][COLOR=#0000BB]x[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]33225[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]y[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]31659[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]z[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000BB]15[/COLOR][COLOR=#007700]}, [/COLOR][COLOR=#0000BB]5109[/COLOR][COLOR=#007700]).[/COLOR][COLOR=#0000BB]uid [/COLOR][/COLOR]
 
Try to use this script... I translated the descriptions in script into English here:

Code:
--Anihilator Script by Rahim
local monsters = {  --[COLOR="#0000CD"]DON'T BOTHER ABOUT THAT PART[/COLOR]
    [100] = "demon",
    [150] = "orshabaal",
    [200] = "ghazbaran"
    }
local items = {  --[COLOR="#0000CD"]rewards. [item.uid of the chest] = item id of reward[/COLOR]
    [8001] = 2494,
    [8002] = 2400,
    [8003] = 2431,
    [8004] = 2112
}
local config = {
    --[COLOR="#0000CD"]lever[/COLOR]
    storage = 6217412,
    tylkoRaz = "nie", --[COLOR="#0000CD"]player who has done the quest, can he do it again or not. Even if yes then he won't be able to get rewards again. tak = yes // nie = no[/COLOR]
    lvl = 100, --[COLOR="#0000CD"]level required[/COLOR]
    tylkoRazNaDzien = "tak", --[COLOR="#0000CD"]quest can be done once a day tak = yes // nie = no[/COLOR]
    summonowacPotwory = "tak", --[COLOR="#0000CD"]leave this part but make sure there are no demons in your map editor where they usually summon when pulling the lever[/COLOR]
    --[COLOR="#0000CD"]fill your own positions everywhere![/COLOR]
    players = {  --[COLOR="#0000CD"]players position[/COLOR]
        {x=33222, y=31671, z=13, stackpos=253},
        {x=33223, y=31671, z=13, stackpos=253},
        {x=33224, y=31671, z=13, stackpos=253},
        {x=33225, y=31671, z=13, stackpos=253}},
    npos = {  --[COLOR="#0000CD"]players position after pulling the lever[/COLOR]
        {x=33219, y=31659, z=13},
        {x=33220, y=31659, z=13},
        {x=33221, y=31659, z=13},
        {x=33222, y=31659, z=13}},
    monsterPos = {  --[COLOR="#0000CD"]name and position of monster that will appear after pulling the lever[/COLOR]
        {"Demon",{x=33220,y=31657,z=13,stackpos=253}},
        {"Demon",{x=33219,y=31661,z=13,stackpos=253}},
        {"Demon",{x=33222,y=31657,z=13,stackpos=253}},
        {"Demon",{x=33221,y=31661,z=13,stackpos=253}},
        {"Demon",{x=33223,y=31659,z=13,stackpos=253}},
        {"Demon",{x=33224,y=31659,z=13,stackpos=253}}
        }
}
local function getMonster(lv)
    local x = 100
    for i = 2, 4 do
        if(monsters[i*50] > lv) then
            x = monsters[i*50]
        end
    end
    return monsters[x]
end
function onUse(cid, item, frompos, item2, topos)
    if item.itemid == 1945 then
        local tbl = {}
        for k, v in pairs(config.players) do
            local player = getThingfromPos(v)
            if(not isPlayer(player.uid)) then
                doPlayerSendCancel(cid, "You need four players for this quest.")
                return TRUE
            end
            if(getPlayerLevel(player.uid) < config.lvl) then
                doPlayerSendCancel(cid,"Somebody in your team hasn't required level!")
                return TRUE
            end
            if(config.tylkoRaz == "tak") then
                if(getPlayerStorageValue(player.uid,config.storage) == 1) then
                    doPlayerSendCancel(cid,"Somebody in your team already has a quest.")
                    return TRUE
                end
            end
            table.insert(tbl, player.uid)
        end
        for i, v in ipairs(tbl) do
            doTeleportThing(v, config.npos[i])
            doSendMagicEffect(config.npos[i], 12)
            doSendAnimatedText(config.npos[i], "Fight!", 192)
        end
        if(config.tylkoRazDziennie == "tak") then
            doTransformItem(item.uid,item.itemid+1)
        end
        if(config.summonowacPotwory ~= "tak") then
            return TRUE
        end
        local lv = getPlayerLevel(cid)
        for k, v in pairs(config.monsterPos) do
            local monster = getThingfromPos(v[2])
            if monster.uid > 0 then  --if script will find a monster on a position were demons are suppose to summon, he will kill them and summon demon as it should be.
                doCreatureAddHealth(monster.uid, -9999999999)
            end
            doSummonCreature(getMonster(lv), v[2])
            doSendMagicEffect(v[2], CONST_ME_MAGIC_BLUE)
        end
        return TRUE
    end
    if(getPlayerStorageValue(cid,config.storage) == 1) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This's empty.")
        return TRUE
    end
    local nagroda = items[item.uid]
    if(not nagroda) then
        return FALSE
    end
    doPlayerAddItem(cid, nagroda, 1)
    setPlayerStorageValue(cid, config.storage, 1)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a " .. getItemName(nagroda) .. ".")
    return TRUE
end

I marked with blue things that will be important for you. :)
Repp if i helped ;P
this script works for me fine on tfs 0.4 :)

edit: ofc don't forget change unique ids to yours one and add a line in actions.xml
 
in action.xml its written:
<action uniqueid="5000" event="script" value="quests/annihilator.lua"/>
and what is this for possison?
local door = getTileItemById({x=33225, y=31659, z=15}, 5109).uid

hmm, can some one give me a script whit my possisons, and the uid that the switch should had and for last what i should wright in action.xml.
thank u for help but its getting caind of messy for me to understand. i am learning to change in script but i am new so need littel back up.

i will rep u, but i whold love if some can do this for me.




PHP:
-- Annihilator by Shawak v2.1 
 
        -- CONFIG -- 
 
        local room = {     -- room with demons 
        fromX = 1163, 
        fromY = 1078, 
        fromZ = 15, 
        -------------- 
        toX = 1169, 
        toY = 1082, 
        toZ = 15 
        } 
 
        local monster_pos = { 
        [1] = {pos = {1163, 1078, 15}, monster = "Demon"}, 
        [2] = {pos = {1165, 1078, 15}, monster = "Demon"}, 
        [3] = {pos = {1167, 1078, 15}, monster = "Demon"}, 
        [4] = {pos = {1169, 1078, 15}, monster = "Demon"}, 
        [5] = {pos = {1163, 1182, 15}, monster = "Demon"}, 
        [6] = {pos = {1165, 1182, 15}, monster = "Demon"}, 
        [7] = {pos = {1167, 1182, 15}, monster = "Demon"}, 
        [8] = {pos = {1169, 1182, 15}, monster = "Demon"}, 
        [9] = {pos = {1167, 1080, 15}, monster = "Orshabaal"}, 
        [10] = {pos = {1168, 1080, 15}, monster = "Demon"}, 
        [11] = {pos = {1169, 1080, 15}, monster = "Demon"} 
        } 
 
        local players_pos = { 
        {x = 1106, y =1095, z = 15, stackpos = 253}, 
        {x = 1106, y =1094, z = 15, stackpos = 253}, 
        {x = 1106, y =1093, z = 15, stackpos = 253}, 
        {x = 1106, y =1092, z = 15, stackpos = 253} 
        } 
 
        local new_player_pos = { 
        {x = 1166, y = 1080, z = 15}, 
        {x = 1165, y = 1080, z = 15}, 
        {x = 1164, y = 1080, z = 15}, 
        {x = 1163, y = 1080, z = 15} 
        } 
 
        local playersOnly = "yes" 
        local questLevel = 130 
 
        ------------------------------------------------------ 
        --- CONFIG END --------------------------------------- 
        ------------------------------------------------------ 
 
function onUse(cid, item, fromPosition, itemEx, toPosition) 
        local all_ready, monsters, player, level = 0, 0, {}, 0 
        if item.itemid == 1945 then 
                for i = 1, #players_pos do 
                        table.insert(player, 0) 
                end 
                for i = 1, #players_pos do 
                        player[i] = getThingfromPos(players_pos[i]) 
                        if player[i].itemid > 0 then 
                                if string.lower(playersOnly) == "yes" then 
                                        if isPlayer(player[i].uid) == TRUE then 
                                                all_ready = all_ready+1 
                                        else 
                                                monsters = monsters+1 
                                        end 
                                else 
                                        all_ready = all_ready+1 
                                end 
                        end 
                end 
                if all_ready == #players_pos then 
                        for i = 1, #players_pos do 
                                player[i] = getThingfromPos(players_pos[i]) 
                                if isPlayer(player[i].uid) == TRUE then 
                                        if getPlayerLevel(player[i].uid) >= questLevel then 
                                                level = level+1 
                                        end 
                                else 
                                        level = level+1 
                                end 
                        end 
                        if level == #players_pos then 
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then 
                                        local door = getTileItemById({x=1106, y=1096, z=15}, 5109).uid 
                    if door > 0 then 
                        doTransformItem(door, 5108) 
                    end 
 
                                        for _, area in pairs(monster_pos) do 
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]}) 
                                        end 
                                        for i = 1, #players_pos do 
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF) 
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE) 
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA) 
                                                doTransformItem(item.uid,1946) 
                                        end 
                                else 
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.") 
                                end 
                        else 
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.") 
                        end 
                else 
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.") 
                end 
        elseif item.itemid == 1946 then 
                local player_room = 0 
                for x = room.fromX, room.toX do 
                        for y = room.fromY, room.toY do 
                                for z = room.fromZ, room.toZ do 
                                        local pos = {x=x, y=y, z=z,stackpos = 253} 
                                        local thing = getThingfromPos(pos) 
                                        if thing.itemid > 0 then 
                                                if isPlayer(thing.uid) == TRUE then 
                                                        player_room = player_room+1 
                                                end 
                                        end 
                                end 
                        end 
                end 
                if player_room >= 1 then 
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")           
                elseif player_room == 0 then 
                        for x = room.fromX, room.toX do 
                                for y = room.fromY, room.toY do 
                                        for z = room.fromZ, room.toZ do 
                                                local pos = {x=x, y=y, z=z,stackpos = 253} 
                                                local thing = getThingfromPos(pos) 
                                                if thing.itemid > 0 then 
                                                        doRemoveCreature(thing.uid) 
                                                end 
                                        end 
                                end 
                        end 
                        doTransformItem(item.uid,1945) 
                end 
        end 
        return TRUE 
end
 
Last edited by a moderator:
After alot of looking here on otland and on the script i made it, thanks for help and i will rep u :)
 
Last edited:
Back
Top