zakius
Enter the Ninja!
...Works on 0.3.6 and 0.3.6pl1, not tested on 0.4 :/
...Works on 0.3.6 and 0.3.6pl1, not tested on 0.4 :/
Code:[13/06/2010 13:33:05] [Error - CreatureScript Interface] [13/06/2010 13:33:05] data/creaturescripts/scripts/inquisition.lua:onKill [13/06/2010 13:33:05] Description: [13/06/2010 13:33:05] (luaDoItemSetAttribute) Item not found [13/06/2010 13:33:05] [Error - CreatureScript Interface] [13/06/2010 13:33:05] data/creaturescripts/scripts/inquisition.lua:onKill [13/06/2010 13:33:05] Description: [13/06/2010 13:33:05] (luaAddEvent) Callback parameter should be a function. [13/06/2010 13:33:05] [Error - CreatureScript Interface] [13/06/2010 13:33:05] data/creaturescripts/scripts/inquisition.lua:onKill [13/06/2010 13:33:05] Description: [13/06/2010 13:33:05] (luaDoItemSetAttribute) Item not found
I get this at the latrivan,golgordan part and it lags the server...
You don't have any other script like these for 0.2.7, cause 0.3.6 is sux, he open the ot only on 8.54 version :/
Can u help?
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=1859, y=1125, z=11, stackpos=2 }, aid=1001 },
["Zugurosh"] = { pos={ x=1823, y=1091, z=11, stackpos=2 }, aid=1002},
["Madareth"] = { pos={ x=1899, y=1165, z=11, stackpos=2 }, aid=1003},
["Annihilon"] = { pos={ x=1899, y=1084, z=11, stackpos=2 }, aid=1005},
["Hellgorak"] = { pos={ x=1806, y=1114, z=11, stackpos=2 }, aid=1006}
},
brothers ={
["Golgordan"] = {pos={ x=1942, y=1125, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=1942, y=1125, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 1926, y = 1119, z = 11},
toPos = {x = 1942, y = 1131, z = 11} } }
}
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, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end
local config = {
bosses={---aid of portal, position where it sends, value it sets, text it shows
[1001] = {pos={x=1773, y=1181, z=13, stackpos=1}, value=1, text="Entering The Crystal Caves"},
[1002] = {pos={x=2073, y=1010, z=14, stackpos=1}, value=2, text="Entering The Blood Halls"},
[1003] = {pos={x=1856, y=1179, z=12, stackpos=1}, value=3, text="Entering The Vats"},
[1004] = {pos={x=1740, y=1151, z=15, stackpos=1}, value=4, text="Entering The Arcanum"},
[1005] = {pos={x=1900, y=1082, z=12, stackpos=1}, value=5, text="Entering The Hive"},
[1006] = {pos={x=1814, y=1078, z=12, stackpos=1}, value=6, text="Entering The Shadow Nexus"}
},
mainroom={---aid, position, lowest value that can use this portal, text
[2001] = {pos={x=1773, y=1181, z=13, stackpos=1}, value=1, text="Entering The Crystal Caves"},
[2002] = {pos={x=2073, y=1010, z=14, stackpos=1}, value=2, text="Entering The Blood Halls"},
[2003] = {pos={x=1856, y=1179, z=12, stackpos=1}, value=3, text="Entering The Vats"},
[2004] = {pos={x=1740, y=1151, z=15, stackpos=1}, value=4, text="Entering The Arcanum"},
[2005] = {pos={x=1900, y=1082, z=12, stackpos=1}, value=5, text="Entering The Hive"} },
portals={---aid, position, text
[3000] = {pos={x=1865, y=1105, z=14}, text="Entering Inquisition Portals Room"},
[3001] = {pos={x=1875, y=1125, z=11}, text="Entering The Ward of Ushuriel"},
[3002] = {pos={x=1874, y=1152, z=13}, text="Entering The Undersea Kingdom"},
[3003] = {pos={x=1839, y=1091, z=11}, text="Entering The Ward of Zugurosh"},
[3004] = {pos={x=2059, y=987, z=11}, text="Entering The Foundry"},
[3005] = {pos={x=1899, y=1153, z=11}, text="Entering The Ward of Madareth"},
[3006] = {pos={x=1954, y=1029, z=13}, text="Entering The Battlefield"},
[3007] = {pos={x=1928, y=1125, z=11}, text="Entering The Ward of The Demon Twins"},
[3008] = {pos={x=1797, y=972, z=11}, text="Entering The Soul Wells"},
[3009] = {pos={x=1899, y=1099, z=11}, text="Entering The Ward of Annihilon"},
[3010] = {pos={x=1806, y=1130, z=11}, text="Entering The Ward of Hellgorak"},
[3011] = {pos={x=1869, y=1086, z=14}, text="Entering The Reward Room"} },
storage=56123,---storage used in boss and mainroom portals
walkback="You don't have enough energy to enter this portal",---message if you cannot use mainroom portal
e={} }----dunno whats this but have to be like this to make doCreatureSayWithDelay working, DON'T TOUCH}
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
if(config.bosses[item.actionid]) then
local t= config.bosses[item.actionid]
if getPlayerStorageValue(cid, config.storage)< t.value then
setPlayerStorageValue(cid, config.storage, t.value)
end
doTeleportThing(cid, t.pos)
doCreatureSayWithDelay(cid,t.text,19,1, config.e)
elseif(config.mainroom[item.actionid]) then
local t= config.mainroom[item.actionid]
if getPlayerStorageValue(cid, config.storage)>=t.value then
doTeleportThing(cid, t.pos)
doCreatureSayWithDelay(cid,t.text,19,1,config.e)
else
doTeleportThing(cid, fromPosition)
doCreatureSay(cid, config.walkback, 19)
end
elseif(config.portals[item.actionid]) then
local t= config.portals[item.actionid]
doTeleportThing(cid, t.pos)
doCreatureSayWithDelay(cid,t.text,19,1,config.e)
end
end
end
function doCreatureSayWithDelay(cid,text,type,delay,e,pcid)
if delay<=0 then
doCreatureSay(cid,text,type, false,pcid)
else
local func=function(pars)
doCreatureSay(pars.cid,pars.text,pars.type, false,pars.pcid)
pars.e.done=TRUE
end
e.done=FALSE
e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e,pcid=pcid})
end
end
function doNPCTalkALot(msgs,interval,pcid)
local e={}
local ret={}
if interval==nil then interval=10000 end --10 seconds is default time between messages
for aux=1,table.getn(msgs) do
e[aux]={}
doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux],pcid)
table.insert(ret,e[aux])
end
return(ret)
end
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=1859, y=1125, z=11, stackpos=2 }, aid=1001 },
["Zugurosh"] = { pos={ x=1823, y=1091, z=11, stackpos=2 }, aid=1002},
["Madareth"] = { pos={ x=1899, y=1165, z=11, stackpos=2 }, aid=1003},
["Annihilon"] = { pos={ x=1899, y=1084, z=11, stackpos=2 }, aid=1005},
["Hellgorak"] = { pos={ x=1806, y=1114, z=11, stackpos=2 }, aid=1006}
},
brothers ={
["Golgordan"] = {pos={ x=1942, y=1125, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
["Latrivan"] = {pos={ x=1942, y=1125, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
brothersArea ={
fromPos = {x = 1926, y = 1119, z = 11},
toPos = {x = 1942, y = 1131, z = 11} } }
}
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, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
end
return TRUE
end
<event type="kill" name="Inquisition" script="inqbosses.lua"/>
registerCreatureEvent(cid, "Inquisition")
[24/09/2010 18:21:26] [Error - LuaScriptInterface::loadFile] data/movements/scripts/Inquisition/Inquisition Texts.lua:36: '}' expected (to close '{' at line 1) near 'function'
[24/09/2010 18:21:26] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/Inquisition/Inquisition Texts.lua)
[14:9:52.374] [Error - CreatureScript Interface]
[14:9:52.374] data/creaturescripts/scripts/inquisition.lua:onKill
[14:9:52.374] Description:
[14:9:52.374] (luaDoItemSetAttribute) Item not found