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

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

zakius

Enter the Ninja!
Joined
Apr 30, 2009
Messages
2,635
Reaction score
65
Location
with Taiga
This script sets player storage after entering boss portal, you can use portal in main room only if you have storage, all portals shows orange text.

Its best if you use only one id of portals in all inq and boss creaturescript so it wont collide with other portals.

Code:
local config = 
{
	bosses=
	{
		[1001] = {pos={x=1460, y=540, z=11}, value=1, text="Entering The Crystal Caves"},
		[1002] = {pos={x=1414, y=550, z=11}, value=2, text="Entering The Blood Halls"},
		[1003] = {pos={x=1331, y=606, z=12}, value=3, text="Entering The Vats"},
		[1004] = {pos={x=1439, y=595, z=12}, value=4, text="Entering The Arcanum"},
		[1005] = {pos={x=1532, y=697, z=11}, value=5, text="Entering The Hive"},
		[1006] = {pos={x=1350, y=709, z=12}, value=6, text="Entering The Shadow Nexus"},
		[1007] = {pos={x=1349, y=486, z=13}, value=7, text="You managed to find and destroy The Shadow Nexus, going back to Main Room"}	
	},
	portals=
	{
		[3000] = {pos={x=1349, y=486, z=13}, text="Entering Inquisition Portals Room"},
		[3001] = {pos={x=1384, y=615, z=11}, text="Entering The Ward of Ushuriel"},
		[3002] = {pos={x=1472, y=469, z=11}, text="Entering The Undersea Kingdom"},
		[3003] = {pos={x=1417, y=614, z=11}, text="Entering The Ward of Zugurosh"},
		[3004] = {pos={x=1434, y=528, z=11}, text="Entering The Foundry"},
		[3005] = {pos={x=1398, y=654, z=11}, text="Entering The Ward of Madareth"},
		[3006] = {pos={x=1329, y=534, z=12}, text="Entering The Battlefield"},
		[3007] = {pos={x=1434, y=655, z=11}, text="Entering The Ward of The Demon Twins"},
		[3008] = {pos={x=1526, y=539, z=12}, text="Entering The Soul Wells"},
		[3009] = {pos={x=1473, y=614, z=11}, text="Entering The Ward of Annihilon"},
		[3010] = {pos={x=1478, y=656, z=11}, 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,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


Here is creatureevent, nothing special, just combined some scripts from there and added aid to portal.
Code:
local config = 
{
    time = 60, -- seconds
    teleportId = 5023,
    bosses = 
	{ -- Monster Name,  Teleport Position, aid, optional brothers name
		["Ushuriel"] = {  pos={ x=1383, y=615, z=11}, aid=1001},
		["Zugurosh"] = {  pos={ x=1415, y=614, z=11}, aid=1002},
		["Madareth"] = {  pos={ x=1398, y=655, z=11}, aid=1003},
		["Annihilon"] = {  pos={ x=1473, y=615, z=11}, aid=1005},
        ["Hellgorak"] = {  pos={ x=1478, y=657, z=11}, aid=1006},
		["Golgordan"] = {	pos={ x=1433, y=655, z=11}, aid=1004, brother = "Latrivan"},
        ["Latrivan"] = {	pos={ x=1433, y=655, z=11}, aid=1004, brother = "Golgordan"}
	}
}
local function changeBack(position)
	doItemSetAttribute(getTileItemById(t.pos, config.teleportId).uid, "aid", 3000)
end
function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
		if config.bosses[getCreatureName(target)].brother then if(isMonster(getCreatureByName(config.bosses[getCreatureName(target)].brother))) then return true end end
	    doItemSetAttribute(getTileItemById(config.bosses[getCreatureName(target)].pos, config.teleportId).uid, "aid", config.bosses[getCreatureName(target)].aid)
        doCreatureSay(cid, "Go into the teleport in "..config.timeToRemove.." seconds, else it will disappear.", TALKTYPE_MONSTER_SAY)
		addEvent(changeBack, config.time * 1000, t.pos)
	end
	return true
end

You need to change all positions in scripts
On map set aids: 200x are portals in main room, 300x are portals on way through seals, only the ones inside Arcanum need to be made normal way.

Works on 0.3.6 and 0.3.6pl1, not tested on 0.4 :/

EDIT: tabbing was better in Notepad++...

EDIT: if you want tp changing like on global, not creating new one use (NOT UPDATED FOR 0.3.7 LUAJIT, YOU HAVE TO UPDATE IT YOURSELF LOOKING AT SECOND CODE!
Code:
local config = {
        timeToRemove = 60, -- seconds
		message = "Go into the teleport in 60 seconds, else it will disappear.",
        teleportId = 9773,
        bosses = { -- Monster Name,  Teleport Position
                ["Ushuriel"] = {  pos={ x=1400, y=615, z=11, stackpos=2 }, aid=1001 },
				["Zugurosh"] = {  pos={ x=1434, y=614, z=11, stackpos=2 }, aid=1002},
				["Madareth"] = {  pos={ x=1398, y=642, z=11, stackpos=2 }, aid=1003},
                ["Annihilon"] = {  pos={ x=1473, y=599, z=11, stackpos=2 }, aid=1005},
                ["Hellgorak"] = {  pos={ x=1478, y=641, z=11, stackpos=2 }, aid=1006}
				},
		brothers ={
        ["Golgordan"] = {pos={ x=1433, y=645, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
        ["Latrivan"] = {pos={ x=1433, y=645, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
        brothersArea ={
                fromPos = {x = 1425, y = 645, z = 11},
                toPos = {x = 1441, y = 655, z = 11}	}	}
}
local function change(position)
	doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", 3000)
    return TRUE
end

function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
		local t = config.bosses[getCreatureName(target)]
		local position = t.pos
		doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", t.aid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
		addEvent(change, config.timeToRemove * 1000, position)
	elseif(config.brothers[getCreatureName(target)]) then
		local t = config.brothers[getCreatureName(target)]
        local brother = getCreatureByName(t.brother)
		if(isMonster(brother) == true) then
            if(isInRange(getCreaturePosition(brother), config.brothers.brothersArea.fromPos, config.brothers.brothersArea.toPos) == true) then
                return TRUE
			end
        else
			local position = t.pos
			doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", t.aid)
			doItemSetAttribute(teleport, "aid", t.aid)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, position)
		end
	end
	return TRUE
end
creaturescript, this one isnt tested, but should work(in position put pos of tp on map)

EDIT: tested second version of code, it WORKS
if you have problems its your fault

EDITED MOVEEVENT, IT NO LONGER USES LONG STORY

UPDATED FIRST TWO CODES, CHANGED NUMBER TO CONST AND MADE IT COMPATIBLE WITH LUAJIT INTERPRETER[ if(local t = ...) wasn't working]
IT SHOULD WORK NOW ON 0.3.7 BUT I HAVEN'T FULLY TESTED IT CAUSE I CANNOT SPAWN BOSSES A,D LUAJIT CRASHES ON /M :F
 
Last edited:
edited first post, fixed one bug and added comments
and again edited, made error adding comments, lol
 
@up: gz noob, I made and tested it on 0.3.6pl1 so dont complain, what doesnt work? I guess you didnt read whole post and text isnt working

I was right, told you to read whole post and yoiu still post error that you have because you DIDNT READ WHOLE POST, omg gz :D


@kermmm:
Code:
	<event type="kill" name="inquisitionPortals" script="teleports_inquisition.lua"/>
where teleports_inquisition.lua is name of file
and
Code:
registerCreatureEvent(cid, "inquisitionPortals")
in login.lua , not sure if is needed, but I guess with it script work without adding anything to boss files
 
Last edited:
Code:
[05/01/2010 15:33:27] [Error - MoveEvents Interface] 
[05/01/2010 15:33:27] data/movements/scripts/inq.lua:onStepIn
[05/01/2010 15:33:27] Description: 
[05/01/2010 15:33:27] data/movements/scripts/inq.lua:44: attempt to call global 'doCreatureSayWithDelay' (a nil value)
[05/01/2010 15:33:27] stack traceback:
[05/01/2010 15:33:27] 	data/movements/scripts/inq.lua:44: in function <data/movements/scripts/inq.lua:31>
 
Code:
[05/01/2010 15:33:27] [Error - MoveEvents Interface] 
[05/01/2010 15:33:27] data/movements/scripts/inq.lua:onStepIn
[05/01/2010 15:33:27] Description: 
[05/01/2010 15:33:27] data/movements/scripts/inq.lua:44: attempt to call global 'doCreatureSayWithDelay' (a nil value)
[05/01/2010 15:33:27] stack traceback:
[05/01/2010 15:33:27] 	data/movements/scripts/inq.lua:44: in function <data/movements/scripts/inq.lua:31>

You didn't add the 'doCreatureSayWithDelay' function.
 
Thanks zakius !
Look I got this script is good?

local bosses = { -- Teleport Takes Player -- Teleport Is Created --
["Ushuriel"] = { x=1173, y=1141, z=12 }, { x=1097, y=1214, z=12 },
["Zugurosh"] = { x=1126, y=1151, z=12 }, { x=1149, y=1231, z=12 },
["Madareth"] = { x=1045, y=1206, z=13 }, { x=1112, y=1240, z=12 },
["Latrivan"] = { x=1154, y=1195, z=13 }, { x=1147, y=1244, z=12 },
["Annihilon"] = { x=1244, y=1297, z=12 }, { x=1187, y=1198, z=12 },
["Hellgorak"] = { x=1067, y=1307, z=13 }, { x=1192, y=1240, z=12 }
}
local time = 30 -- Seconds
local function removeInqPortal(pos)
local v = getTileItemById(pos, 1387).uid
if 0 < v then
doRemoveItem(v)
end
end
function onKill(cid, target, lastHit)
for name, pos in pairs(bosses) do
if name:lower() == getCreatureName(target):lower() then
doCreateTeleport(1387, pos[1], pos[2])
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. time .." seconds until the portal will disapear.")
addEvent(removeInqPortal, time * 1000, pos[2])
end
end
return TRUE
end
 
not sure which parameters are needed for doRemoveItem(v), I preffer the one I'm sure how it works, so it will be doRemoveThing(v.uid, 1)
Also I dont know if :lower works.
But rest of script should work.
If you'll have any problems with it I can rewrite it like script in main post instead of for in pair style(which I don't understand, lol)
 
Umm, I can just edit the one that is somewhere here, cause one I have is bit edited and integrated into my map, bit hard to cut it ;d

Umm, sorry, found only map without spawns...
when I'll have more time I can try tu cut the one i have, but it can take some time
 
Last edited:
Umm, I can just edit the one that is somewhere here, cause one I have is bit edited and integrated into my map, bit hard to cut it ;d

Umm, sorry, found only map without spawns...
when I'll have more time I can try tu cut the one i have, but it can take some time

thank you
can help me to fix the script (thats the prob) X)

private message me your msn if you can help me
rep++ for your script anyway
 
first and second are tested, third should work.
post errors, or read whole post=>script works now o_O

only reason can be next syntax error, cause I edit it from time to time when I find anything to fix

BTW, if you tested scripts from release day, it was quite bugged that day :/
 
I can only post version using default portal id used in this script, if you want use other one, you have to change some things yourself
and ofc I dont know name of ur script file
Code:
<movevent type="StepIn" itemid="9773" event="script" value="tpinq.lua"/>
hope you know what to change?
(emm, actually if you requested this line I shouldnt expect that you will know, but hope dies last)
 
[21/01/2010 15:23:49] [Error - CreatureScript Interface]
[21/01/2010 15:23:49] In a timer event called from:
[21/01/2010 15:23:49] data/creaturescripts/scripts/inquisition.lua:eek:nKill
[21/01/2010 15:23:49] Description:
[21/01/2010 15:23:49] (luaDoItemSetAttribute) Item not found

getting this error on bosses

and the tp still doesn't work :(
 
Back
Top