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

[RL-Map Quest] Parchment Room Quest

Ezzam

New Member
Joined
Jan 16, 2008
Messages
213
Reaction score
2
P_room.gif


I havn't tested this yet, but i tried to start the ot (TFS 0.3.2)
and i didn't get any error. Hopefully it works. All made by me!
(sorry if it not work's, but some other lua-scripters can fix it if they have time)

Add this line to Movements.XML
Code:
	<movevent event="AddItem" actionid="60999" script="Demon-Edron-Summon4.lua"/>

And create a file called: Demon-Edron-Summon4.lua and add this inside
Code:
function onAddItem(moveitem, tileitem, position)
  if moveitem.itemid == 1951 then
    doRemoveItem(moveitem.uid)
    parchment = {x=33063, y=31624, z=15}
    demon1pos = {x=33060, y=31623, z=15}
    demon2pos = {x=33066, y=31623, z=15}
    demon3pos = {x=33060, y=31627, z=15}
    demon4pos = {x=33066, y=31627, z=15}
    doSummonCreature("Demon", demon1pos)
    doSummonCreature("Demon", demon2pos)
    doSummonCreature("Demon", demon3pos)
    doSummonCreature("Demon", demon4pos)
    addEvent(doCreateItem,10000,1951,1,parchment)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You made the demon lord angry and he summoned 4 demons around you.")
	end
	return TRUE
end
 
Last edited:
Should work.. Quest can be completed once every 15 minutes:
Code:
function doQuestAgain()
  setGlobalStorageValue(cid, 60999, -1)
end

function onAddItem(moveitem, tileitem, position)
  if getGlobalStorageValue(60999) == -1 and getPlayerStorageValue(cid, 60998) == -1 then
    if moveitem.itemid == 1951 and moveitem.actionid == 60999 then
      doTransformItem(moveitem.uid, 1953)
      demon1pos = {x=33060, y=31623, z=15}
      demon2pos = {x=33066, y=31623, z=15}
      demon3pos = {x=33060, y=31627, z=15}
      demon4pos = {x=33066, y=31627, z=15}
      doSummonCreature("Demon", demon1pos)
      doSummonCreature("Demon", demon2pos)
      doSummonCreature("Demon", demon3pos)
      doSummonCreature("Demon", demon4pos)
      local bag = doPlayerAddItem(cid, 2000, 1)
      doAddContainerItem(bag, 2165, 1)
      doAddContainerItem(bag, 2151, 2)
      doAddContainerItem(bag, 2230, 1)
      doAddContainerItem(bag, 2229, 1)
      doAddContainerItem(bag, 1951, 1)
      setPlayerStorageValue(uid, 60998, 1)
      setGlobalStorageValue(uid, 60999, 1)
     addEvent(doQuestAgain, 54000)
    else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This quest can only be made once after every 15 minutes, and once per character.")
    end
  else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This quest has already been done by you.")
	end
	return TRUE
end
 
Last edited:
Seems nice. Does this quest exist on real tibia? :)

oh yea it does =* reputation for you bro !

well, its not working for me! :/ Doesnt shove any errors, so I dont know whats the problem.
 
Last edited by a moderator:
In Tibia its onRemoveItem.

I know that in TFS you can declare position in .xml file, but Im not using tfs :mad:
Code:
local positions = {
	{ x = 33060, y = 31623, z = 15 },
	{ x = 33066, y = 31623, z = 15 },
	{ x = 33060, y = 31627, z = 15 },
	{ x = 33066, y = 31627, z = 15 },
	{ x = 33063, y = 31624, z = 15 }
}

function onRemoveItem(moveitem, tileitem, pos)
	if comparePositions(pos, positions[5]) == TRUE then
		if getGlobalStorageValue(GLOBAL_STORAGES["parchment"]) ~= TRUE then
			for i = 1, 4 do
				doCreateMonster("Demon", positions[i])
			end
			
			setGlobalStorageValue(GLOBAL_STORAGES["parchment"], TRUE)
		end
	end
	return TRUE
end

Change GLOBAL_STORAGES["parchment"] to some number, or simply add to your global.lua/constant.lua:

GLOBAL_STORAGES = { ["parchment"] = somenumber }

oki

Here is comparePositions hie hie:
Code:
function comparePositions(pos1, pos2)
	if(pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z) then
		return TRUE
	end
	
	return FALSE
end
 
As i said, i'm not sure it work's, but mabye Rudolf Czarodziej's does, the only thing to do is to try... If it does: ++rep to you.

*EDIT*
the quest is west from edron demons. (not too far)
 
Thx Ezz, but how do I do it so I can do the quest multiple times without delay?
 
Hello

Hello.im using tfs crimdamson 0.3.2 and give error.

PHP:
[20/05/2009 08:40:46] Lua Script Error: [MoveEvents Interface] 
[20/05/2009 08:40:46] data/movements/scripts/Demon-Edron-Summon4.lua:onAddItem

[20/05/2009 08:40:46] luaGetPlayerStorageValue(). Player not found


HTML:
 if moveitem.itemid == 1951 and moveitem.actionid == 60999 then
      doTransformItem(moveitem.uid, 1953)
      demon1pos = {x=33060, y=31623, z=15}
      demon2pos = {x=33066, y=31623, z=15}
      demon3pos = {x=33060, y=31627, z=15}
      demon4pos = {x=33066, y=31627, z=15}
      doSummonCreature("Demon", demon1pos)
      doSummonCreature("Demon", demon2pos)
      doSummonCreature("Demon", demon3pos)
      doSummonCreature("Demon", demon4pos)
      local bag = doPlayerAddItem(cid, 2000, 1)
      doAddContainerItem(bag, 2165, 1)
      doAddContainerItem(bag, 2151, 2)
      doAddContainerItem(bag, 2230, 1)
      doAddContainerItem(bag, 2229, 1)
      doAddContainerItem(bag, 1951, 1)
      setPlayerStorageValue(uid, 60998, 1)
      setGlobalStorageValue(uid, 60999, 1)
     addEvent(doQuestAgain, 54000)
    else

PHP:
<movevent type="AddItem" actionid="60999" event="script" value="Demon-Edron-Summon4.lua"/>


ist correct?
 
bump
can sameone fix script: if sb take a parchament then will be summoned 4 demons?
tfs 0.3.6
 
Not working...
TFS 0.3.6...


Code:
function doQuestAgain()
  setGlobalStorageValue(cid, 60999, -1)
end

function onAddItem(moveitem, tileitem, position)
  if getGlobalStorageValue(60999) == -1 and getPlayerStorageValue(cid, 60998) == -1 then
    if moveitem.itemid == 1951 and moveitem.actionid == 60999 then
      doTransformItem(moveitem.uid, 1953)
      demon1pos = {x=33060, y=31623, z=15}
      demon2pos = {x=33066, y=31623, z=15}
      demon3pos = {x=33060, y=31627, z=15}
      demon4pos = {x=33066, y=31627, z=15}
      doSummonCreature("Demon", demon1pos)
      doSummonCreature("Demon", demon2pos)
      doSummonCreature("Demon", demon3pos)
      doSummonCreature("Demon", demon4pos)
      local bag = doPlayerAddItem(cid, 2000, 1)
      doAddContainerItem(bag, 2165, 1)
      doAddContainerItem(bag, 2151, 2)
      doAddContainerItem(bag, 2230, 1)
      doAddContainerItem(bag, 2229, 1)
      doAddContainerItem(bag, 1951, 1)
      setPlayerStorageValue(uid, 60998, 1)
      setGlobalStorageValue(uid, 60999, 1)
     addEvent(doQuestAgain, 54000)
    else
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This quest can only be made once after every 15 minutes, and once per character.")
    end
  else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This quest has already been done by you.")
	end
	return TRUE
end

Code:
<movevent type="AddItem" actionid="60999" event="script" value="Parchment Room Quest.lua."/>

42638585.jpg

87246852.jpg

85535442.jpg
 
Code:
local cfg = {
	playerStorage = 60999,
	globalStorage = 60999,
	minutes = 30,
	positions = {
		{x=33060, y=31623, z=15},
		{x=33066, y=31623, z=15},
		{x=33060, y=31627, z=15},
		{x=33066, y=31627, z=15}
	},
	bagItems = {
		{2165}, {2151, 2}, {2230}, {2229}, {1951}
	}
}
function onAddItem(moveitem, tileitem, position, cid)
	if getGlobalStorageValue(cfg.globalStorage) < 1 and getPlayerStorageValue(cid, cfg.playerStorage) < 1 then
		for _, t in pairs(cfg.positions) do
			doSummonCreature("Demon", t)
		end
		local bag = doPlayerAddItem(cid, 2000, 1)
		for _, t in pairs(cfg.bagItems) do
			doAddContainerItem(bag, t[1], t[2] or 1)
		end
		setPlayerStorageValue(cid, cfg.playerStorage, 1)
		setGlobalStorageValue(cfg.globalStorage, 1)
		addEvent(setGlobalStorageValue, cfg.minutes * 60000, 60999, -1)
	end
end
The script still sucks ..
 
bump. can someone give script which summons 4 demons if parchament will be movied? rep++
 
Back
Top