• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Full Annihilator Quest with automatically closing doors

Indenpedens

Banned User
Joined
Nov 6, 2010
Messages
584
Reaction score
39
Location
Poland
ergo go to data\actions\scripts and create file annihilator.lua and paste:
Code:
local from={x=33218, y=31656, z=13}
local to={x=33225, y=31661, z=13}
 
local summon={
	{x=33224, y=31659, z=13},
	{x=33223, y=31659, z=13},
	{x=33222, y=31661, z=13},
	{x=33220, y=31661, z=13},
	{x=33221, y=31657, z=13},
	{x=33219, y=31657, z=13}
}
 
local playerA={
	{x=33222, y=31671, z=13},
	{x=33223, y=31671, z=13},
	{x=33224, y=31671, z=13},
	{x=33225, y=31671, z=13}
}
 
local playerB={
	{x=33219, y=31659, z=13},
	{x=33220, y=31659, z=13},
	{x=33221, y=31659, z=13},
	{x=33222, y=31659, z=13}
}
 
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
		local v = getTileItemById({x=33225, y=31659, z=13}, 5109).uid
		if v ~= 0 then
			doTransformItem(v, 5108)
		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
in actions.xml
Code:
<action uniqueid="5000" event="script" value="annihilator.lua"/>

now rewards
in data\actions\scripts create annichest.lua and paste this:
Code:
-- annihilator chests

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

   	if item.uid == 8000 then
   		queststatus = getPlayerStorageValue(cid,37013)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a demon armor.")
   			doPlayerAddItem(cid,2494,1)
   			setPlayerStorageValue(cid,37013,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")
   		end
   	elseif item.uid == 8001 then
   		queststatus = getPlayerStorageValue(cid,37013)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a magic sword.")
   			doPlayerAddItem(cid,2400,1)
   			setPlayerStorageValue(cid,37013,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")
   		end
   	elseif item.uid == 8002 then
   		queststatus = getPlayerStorageValue(cid,37013)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a stonecutter axe.")
   			doPlayerAddItem(cid,2431,1)
   			setPlayerStorageValue(cid,37013,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")
   		end
   	elseif item.uid == 8003 then
   		queststatus = getPlayerStorageValue(cid,37013)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a present box.")
   			 box = doPlayerAddItem(cid,1990,1)
			doAddContainerItem(box, 2326, 1)
   			setPlayerStorageValue(cid,37013,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "The chest is empty.")
   		end
	else
		return 0
   	end

   	return 1
end
in actions.xml:
Code:
<action uniqueid="8000" script="annichest.lua" />
<action uniqueid="8001" script="annichest.lua" />
<action uniqueid="8002" script="annichest.lua" />
<action uniqueid="8003" script="annichest.lua" />

door 5108 id
5P1T6.jpg


on the map set unique ids in chests and lever
nz6P5.jpg


features: automatically closing doors, auto spawn demons, all positions are set like rl tibia, only 4 players with 100 level can do this quest(no summoned monsters)
 
Last edited:
Back
Top