• 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!

Can someone fix this PLEASE!

FLE

Member
Joined
Oct 5, 2008
Messages
422
Reaction score
24
Location
Vancouver Canada
hey this is the script i use for my anni ... anyways what I need done, I need the switch to reset back, after the quest was done.... so the next team can do it! I am not always available to reset it for players and i'm sure its possible to do in a script!

PHP:
-- annihilator lever

function onUse(cid, item, frompos, item2, topos)

monster = "Demon" ------ nome do monstro
pos = {x=33219, y=31657, z=13} ---posicao em que o monstro ira aparecer
monster2 = "Demon" ------ nome do monstro
pos2 = {x=33221, y=31657, z=13} ---posicao em que o monstro ira aparecer
monster2 = "Demon" ------ nome do monstro
pos3 = {x=33220, y=31661, z=13} ---posicao em que o monstro ira aparecer
monster2 = "Demon" ------ nome do monstro
pos4 = {x=33222, y=31661, z=13} ---posicao em que o monstro ira aparecer
monster2 = "Demon" ------ nome do monstro
pos5 = {x=33223, y=31659, z=13} ---posicao em que o monstro ira aparecer
monster2 = "Demon" ------ nome do monstro
pos6 = {x=33224, y=31659, z=13} ---posicao em que o monstro ira aparecer


   	if item.uid == 5000 and item.itemid == 1945 then
		player1pos = {x = 33225, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE}
		player1 = getThingfromPos(player1pos)

		player2pos = {x = 33224, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE}
		player2 = getThingfromPos(player2pos)

		player3pos = {x = 33223, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE}
		player3 = getThingfromPos(player3pos)

		player4pos = {x = 33222, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE}
		player4 = getThingfromPos(player4pos)
		dzwignia = os.clock()


		if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
			queststatus1 = getPlayerStorageValue(player1.uid,7000)
			queststatus2 = getPlayerStorageValue(player2.uid,7000)
			queststatus3 = getPlayerStorageValue(player3.uid,7000)
			queststatus4 = getPlayerStorageValue(player4.uid,7000)

			if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
				nplayer1pos = {x = 33222, y = 31659, z = 13}
				nplayer2pos = {x = 33221, y = 31659, z = 13}
				nplayer3pos = {x = 33220, y = 31659, z = 13}
				nplayer4pos = {x = 33219, y = 31659, z = 13}

				doSendMagicEffect(player1pos,2)
				doSendMagicEffect(player2pos,2)
				doSendMagicEffect(player3pos,2)
				doSendMagicEffect(player4pos,2)

                                doSummonCreature(monster,pos)
                                doSummonCreature(monster2,pos2)
                                doSummonCreature(monster,pos3)
                                doSummonCreature(monster2,pos4)
                                doSummonCreature(monster,pos5)
                                doSummonCreature(monster2,pos6)

				doTeleportThing(player1.uid,nplayer1pos)
				doTeleportThing(player2.uid,nplayer2pos)
				doTeleportThing(player3.uid,nplayer3pos)
				doTeleportThing(player4.uid,nplayer4pos)

				doSendMagicEffect(nplayer1pos,10)
				doSendMagicEffect(nplayer2pos,10)
				doSendMagicEffect(nplayer3pos,10)
				doSendMagicEffect(nplayer4pos,10)

				doTransformItem(item.uid,item.itemid+1)
			else
				doPlayerSendCancel(cid,"Someone in the party has  already done this quest")
			end
		else
			doPlayerSendCancel(cid,"You Need 4 players for this quest.")
		end

	elseif item.uid ==5000 and item.itemid == 1946 then
		if (dzwignia - os.clock()) > 60 then
		doTransformItem(item.uid,item.itemid-1)
		end
		if getPlayerAccess(cid) > 0 then
			doTransformItem(item.uid,item.itemid-1)
			end
		end
	return 1
end

Thank You so much!
 
This is the script that we're using for Real Map Project's Annihilator Quest:
Lua:
  local playerPosition =
{
        {x = 33225, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE},
        {x = 33224, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE},
        {x = 33223, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE},
        {x = 33222, y = 31671, z = 13, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
        {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 summonDemonPos =
{
        {x = 33223, y = 31659, z = 13, stackpos=STACKPOS_TOP_CREATURE},
        {x = 33224, y = 31659, z = 13, stackpos=STACKPOS_TOP_CREATURE},
        {x = 33219, y = 31657, z = 13, stackpos=STACKPOS_TOP_CREATURE},
        {x = 33221, y = 31657, z = 13, stackpos=STACKPOS_TOP_CREATURE},
        {x = 33220, y = 31661, z = 13, stackpos=STACKPOS_TOP_CREATURE},
        {x = 33222, y = 31661, z = 13, stackpos=STACKPOS_TOP_CREATURE}
}
--Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if item.itemid == 1945 then
                for i = 1, 4 do
                failed = TRUE
                player[i] = getThingfromPos(playerPosition[i])
                        if player[i].itemid > 0 then
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerStorageValue(player[i].uid, 30015) == -1 then
                                                if getPlayerLevel(player[i].uid) >= 1 then
                                                        failed = FALSE
                                                end
                                        end
                                end
                        end
                        if failed == TRUE then
                                doPlayerSendCancel(cid, "Sorry, not possible.")
                        return TRUE
                        end
                end
                for i = 1,6 do
                local getdemon = getThingfromPos(summonDemonPos[i])
                        doSummonCreature("Demon", summonDemonPos[i])
                end
                local doorpos = {x=33225, y=31659, z=13, stackpos=1}
                local getdoor = getThingfromPos(doorpos)
                if getdoor.itemid == 1211 then
                        doRemoveItem(getdoor.uid, 1)
                        doCreateItem(1210, 1, doorpos)
                end
                for i = 1, 4 do
                        doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
                        doTeleportThing(player[i].uid, newPosition[i], FALSE)
                        doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
                end
                doTransformItem(item.uid, item.itemid + 1)
                local function clearAnni()
                local spec_pos = {}
                        spec_pos.x = 33227
                        spec_pos.y = 31657
                        spec_pos.z = 13
               
                local tp_pos = {}
                        tp_pos.x = 33226
                        tp_pos.y = 31671
                        tp_pos.z = 13

                local list = getSpectators(spec_pos, 9, 5, false)
                        if(list) then
                                for i = 1, table.getn(list) do
                                        if isPlayer(list[i]) then
                                                tp_pos.x = tp_pos.x - 1
                                                doTeleportThing(list[i], tp_pos)
                                        else
                                        doRemoveCreature(list[i])
                                        end
                                end
                        end
                end
                local function resetLever()
                local posLever = {x = 33226, y = 31671, z = 13, stackpos = 1}
                local getLever = getThingfromPos(posLever)
                        doTransformItem(getLever.uid, getLever.itemid - 1)
                end
                addEvent(clearAnni, 15 * 60 * 1000)
                addEvent(resetLever, 20 * 60 * 1000)
                return TRUE
        end
end
Change the positions, if needed.
It clears the Annihilator Quest room (removes demons) 15 minutes after starting the quest, and pulls back the lever after 20 minutes.
 
Back
Top