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

MoveEvent Inq portals(with orange text, storages to use main room and creating boss portals)

check positions and ids,

to mods: is there any chance to "reward" people that cannot even copypaste properly or read tutorial?
 
help in tfs 0.4.0

[25/02/2011 01:07:44] data/movements/scripts/tpinq.lua:eek:nStepIn
[25/02/2011 01:07:44] Description:
[25/02/2011 01:07:44] data/movements/scripts/tpinq.lua:39: attempt to call global 'doCreatureSayWithDelay' (a nil value)
[25/02/2011 01:07:44] stack traceback:
[25/02/2011 01:07:44] data/movements/scripts/tpinq.lua:39: in function <data/movements/scripts/tpinq.lua:31>

help me please :/ i rep++ you for help me
 
Well. It's great that you posted your server version and debug log. Oh wait. You didn't posted them. So how I can know what is wrong?
Probably you use some version with changed talktypes. Possible that I will make version for newer servers someday but I'm too lazy to setup a server and that update pitted on my drive for really long time
 
@Zakius
in a moment I'll post the error that appear, for now I'm at work. hugs.
 
Lua:
local config = 
{
	bosses=
	{
		[1001] = {pos={x=171, y=561, z=13}, value=1, text="Entering The Crystal Caves"},
		[1002] = {pos={x=313, y=474, z=13}, value=2, text="Entering The Blood Halls"},
		[1003] = {pos={x=286, y=363, z=13}, value=3, text="Entering The Vats"},
		[1004] = {pos={x=410, y=412, z=13}, value=4, text="Entering The Arcanum"},
		[1005] = {pos={x=296, y=682, z=13}, value=5, text="Entering The Hive"},
		[1006] = {pos={x=257, y=466, z=13}, value=6, text="Entering The Shadow Nexus"},
		[1007] = {pos={x=1705, y=1156, z=10}, value=7, text="You managed to find and destroy The Shadow Nexus, take your reward."}	
	},
	portals=
	{
		[3000] = {pos={x=177, y=438, z=14}, text="Entering Inquisition Portals Room"},
		[3001] = {pos={x=237, y=553, z=12}, text="Entering The Ward of Ushuriel"},
		[3002] = {pos={x=273, y=532, z=13}, text="Entering The Undersea Kingdom"},
		[3003] = {pos={x=381, y=527, z=13}, text="Entering The Ward of Zugurosh"},
		[3004] = {pos={x=300, y=448, z=10}, text="Entering The Foundry"},
		[3005] = {pos={x=338, y=467, z=13}, text="Entering The Ward of Madareth"},
		[3006] = {pos={x=390, y=350, z=13}, text="Entering The Battlefield"},
		[3007] = {pos={x=503, y=351, z=13}, text="Entering The Ward of The Demon Twins"},
		[3008] = {pos={x=578, y=408, z=13}, text="Entering The Soul Wells"},
		[3009] = {pos={x=635, y=480, z=13}, text="Entering The Ward of Annihilon"},
		[3010] = {pos={x=333, y=590, z=10}, text="Entering The Ward of Hellgorak"}	
	},
	mainroom={},
	storage=56123,
	walkback="You don't have enough energy to enter this portal",
	texttype = TALKTYPE_MONSTER_SAY
}
for i = 1, 5 do
   config.mainroom[2000+i]=config.bosses[1000+i]
end	

function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) then
		if(config.bosses[item.actionid]) then
			if getPlayerStorageValue(cid, config.storage) < config.bosses[item.actionid].value then
				setPlayerStorageValue(cid, config.storage, config.bosses[item.actionid].value)
			end
			doTeleportThing(cid, t.pos)
			doCreatureSay(cid,config.bosses[item.actionid].text,config.texttype)
		elseif(config.mainroom[item.actionid]) then
			if getPlayerStorageValue(cid, config.storage)>=config.mainroom[item.actionid].value then
				doTeleportThing(cid, config.mainroom[item.actionid].pos)
				doCreatureSay(cid,config.mainroom[item.actionid].text,config.texttype)
			else
				doTeleportThing(cid, fromPosition)
				doCreatureSay(cid, config.walkback, config.texttype)
			end
		elseif(config.portals[item.actionid]) then
			doTeleportThing(cid, config.portals[item.actionid].pos)
			doCreatureSay(cid,config.portals[item.actionid].text,config.texttype)
		end
	end
end

[16:26:09.812] [Error - MoveEvents Interface]
[16:26:09.812] data/movements/scripts/inqportals.lua:eek:nStepIn
[16:26:09.812] Description:
[16:26:09.812] data/movements/scripts/inqportals.lua:41: attempt to index global 't' (a nil value)
[16:26:09.812] stack traceback:
[16:26:09.812] data/movements/scripts/inqportals.lua:41: in function <data/movements/scripts/inqportals.lua:35>

Thanks.
 
oh, right
I edited code a bit cause luajit wasn't able to do some tricks but forgot to change few things

replace all t. with config.bosses[item.actionid].
 
Changed color type to numbers and worked but don't need sorage (energy) to enter main room tps. 0.4 3777

edited;
[16:12:32.297] [Error - CreatureScript Interface]
[16:12:32.297] data/creaturescripts/scripts/inqportals.lua:eek:nKill
[16:12:32.297] Description:
[16:12:32.297] data/creaturescripts/scripts/inqportals.lua:25: attempt to index field 'brothers' (a nil value)
[16:12:32.297] stack traceback:
[16:12:32.297] data/creaturescripts/scripts/inqportals.lua:25: in function <data/creaturescripts/scripts/inqportals.lua:19>

creaturescripts too.
 
Last edited:
bump, fix please.
the old one worked. (some months ago.)
 
Just use my scritp.


Lua:
local t = {
	message	= "You now have 2 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear",
	bosses	= { -- Monster Name,	Teleport To Position,	 	Teleport Position
		["Ushuriel"] = {ttp={x=1173,	y=1333,	z=12},	tp={x=1279,	y=1279,	z=10,	stackpos=1}},
		["Zugurosh"] = {ttp={x=1182,	y=1228,	z=11},	tp={x=1247,	y=1243,	z=10,	stackpos=1}},
		["Madareth"] = {ttp={x=1257,	y=1333,	z=11},	tp={x=1301,	y=1305,	z=10,	stackpos=1}},
		["Golgordan"] = {ttp={x=1142,	y=1304,	z=14},	tp={x=1336,	y=1273,	z=10,	stackpos=1}, bro = "Latrivan"},
		["Latrivan"] = {ttp={x=1142,	y=1304,	z=14},	tp={x=1336,	y=1273,	z=10,	stackpos=1}, bro = "Golgordan"},
		["Annihilon"] = {ttp={x=1303,	y=1237,	z=11},	tp={x=1301,	y=1239,	z=10,	stackpos=1}},
		["Hellgorak"] = {ttp={x=1214,	y=1233,	z=11},	tp={x=1208,	y=1277,	z=10,	stackpos=1}}
	}
}
 
function onKill(cid, target, lastHit)
	local k = t.bosses[getCreatureName(target)]
	if(not isPlayer(target)) and isPlayer(cid) and k and not(getCreatureMaster(target)) then		
			if(k.bro) then
			local bro = getCreatureByName(k.bro)
			if isMonster(bro) and getDistanceBetween(getThingPosition(cid), getThingPosition(bro)) < 12 then return true end
		end
		doCreateTeleport(5023, k.ttp, k.tp)		
		doCreatureSay(cid, t.message, TALKTYPE_ORANGE_1)
			addEvent(function()
			local itek = getTileItemById(k.tp, 5023)
			if itek.uid ~= 0 then
				doRemoveThing(itek.uid, 1)
				doSendMagicEffect(k.tp, CONST_ME_POFF)
			end
		end, 120*1000, k.tp)		
end
	return true
end
 
there are any t.
:s

script:
Lua:
local config = 
{
	bosses=
	{
		[1001] = {pos={x=171, y=561, z=13}, value=1, text="Entering The Crystal Caves"},
		[1002] = {pos={x=313, y=474, z=13}, value=2, text="Entering The Blood Halls"},
		[1003] = {pos={x=286, y=363, z=13}, value=3, text="Entering The Vats"},
		[1004] = {pos={x=410, y=412, z=13}, value=4, text="Entering The Arcanum"},
		[1005] = {pos={x=296, y=682, z=13}, value=5, text="Entering The Hive"},
		[1006] = {pos={x=257, y=466, z=13}, value=6, text="Entering The Shadow Nexus"},
		[1007] = {pos={x=1705, y=1156, z=10}, value=7, text="You managed to find and destroy The Shadow Nexus, take your reward."}	
	},
	portals=
	{
		[3000] = {pos={x=177, y=438, z=14}, text="Entering Inquisition Portals Room"},
		[3001] = {pos={x=237, y=553, z=12}, text="Entering The Ward of Ushuriel"},
		[3002] = {pos={x=273, y=532, z=13}, text="Entering The Undersea Kingdom"},
		[3003] = {pos={x=381, y=527, z=13}, text="Entering The Ward of Zugurosh"},
		[3004] = {pos={x=300, y=448, z=10}, text="Entering The Foundry"},
		[3005] = {pos={x=338, y=467, z=13}, text="Entering The Ward of Madareth"},
		[3006] = {pos={x=390, y=350, z=13}, text="Entering The Battlefield"},
		[3007] = {pos={x=503, y=351, z=13}, text="Entering The Ward of The Demon Twins"},
		[3008] = {pos={x=578, y=408, z=13}, text="Entering The Soul Wells"},
		[3009] = {pos={x=635, y=480, z=13}, text="Entering The Ward of Annihilon"},
		[3010] = {pos={x=333, y=590, z=10}, text="Entering The Ward of Hellgorak"}	
	},
	mainroom={},
	storage=56123,
	walkback="You don't have enough energy to enter this portal",
	texttype = TALKTYPE_MONSTER_SAY
}
for i = 1, 5 do
   config.mainroom[2000+i]=config.bosses[1000+i]
end	

function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) then
		if(config.bosses[item.actionid]) then
			if getPlayerStorageValue(cid, config.storage) < config.bosses[item.actionid].value then
				setPlayerStorageValue(cid, config.storage, config.bosses[item.actionid].value)
			end
			doTeleportThing(cid, config.bosses[item.actionid].pos)
			doCreatureSay(cid,config.bosses[item.actionid].text,19)
		elseif(config.mainroom[item.actionid]) then
			if getPlayerStorageValue(cid, config.storage)>=config.mainroom[item.actionid].value then
				doTeleportThing(cid, config.mainroom[item.actionid].pos)
				doCreatureSay(cid,config.mainroom[item.actionid].text,19)
			else
				doTeleportThing(cid, fromPosition)
				doCreatureSay(cid, config.walkback, 19)
			end
		elseif(config.portals[item.actionid]) then
			doTeleportThing(cid, config.portals[item.actionid].pos)
			doCreatureSay(cid,config.portals[item.actionid].text,19)
		end
	end
end
 
Back
Top