zakius
Enter the Ninja!
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.
Here is creatureevent, nothing special, just combined some scripts from there and added aid to portal.
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!
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
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
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: