Eduardo170
Well-Known Member
Hello guys. The OTX Server Version: (2.X.S - 3) - Codename: (LORD ZEDD). need help with this script not working after kill an Boss.
Error
This is the script
Error
Code:
[9/12/2016 22:51:29] [Error - CreatureScript Interface]
[9/12/2016 22:51:29] data/creaturescripts/scripts/inquisition/inquisitionPortals.lua:onKill
[9/12/2016 22:51:29] Description:
[9/12/2016 22:51:29] (LuaInterface::luaDoCreateItem) Item not found
[9/12/2016 22:51:29] [Error - CreatureScript Interface]
[9/12/2016 22:51:29] data/creaturescripts/scripts/inquisition/inquisitionPortals.lua:onKill
[9/12/2016 22:51:29] Description:
[9/12/2016 22:51:29] (LuaInterface::luaDoItemSetAttribute) Item not found
This is the script
Code:
local config = {
timeToRemove = 180,
message = "You now have 3 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",
tpId = 1387,
bosses = {
["Ushuriel"] = {pos = {x = 959, y = 1436, z = 10}, aid = 1001},
["Zugurosh"] = {pos = {x = 959, y = 1416, z = 10}, aid = 1002},
["Madareth"] = {pos = {x = 989, y = 1418, z = 10}, aid = 1003},
["Annihilon"] = {pos = {x = 1021, y = 1610, z = 10}, aid = 1005},
["Hellgorak"] = {pos = {x = 1022, y = 1444, z = 10}, aid = 1006},
},
brothers ={
["Golgordan"] = {pos = {x = 988, y = 1445, z = 10, stackpos = 1}, aid = 1004, brother = "Latrivan"},
["Latrivan"] = {pos = {x = 988, y = 1445, z = 10, stackpos = 1}, aid = 1004, brother = "Golgordan"},
brothersArea = { fromPos = {x = 980, y = 1439, z = 10}, toPos = {x = 996, y = 1451, z = 10},
},
},
}
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, 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 teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, 'You don\'t have enough energy to enter this portal', TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end
Last edited: