Teddy
SweStream.se
When i kill Azerus the tp arent there and i get a error
ERROR:
SCRIPT
ERROR:
Code:
[14:11:29.625] [Warning - Monster::Monster] Unknown event name - MonsterPortal
[14:12:35.015] [Error - Action Interface]
[14:12:35.015] In a timer event called from:
[14:12:35.015] data/actions/scripts/quests/azerus.lua:onUse
[14:12:35.015] Description:
[14:12:35.015] (luaDoItemSetAttribute) Item not found
SCRIPT
Code:
local m = {
["Azerus3"] = {
message = "Escape through the teleport quickly before it closes!",
cfg = {
{
time = 10, -- Seconds until tp closes.
to = { x = 581, y = 575, z = 10 }, -- Where the tp takes you.
tp = { x = 581, y = 579, z = 9 } -- Where the tp creates.
},
}
}
}
if isPlayer(target) then
return true
end
local monster = m[getCreatureName(target)]
if monster then
for i = 1, #monster.cfg do
local c = monster.cfg[i]
local function deleteTeleport()
local teleport = getTileItemById(c.tp, 1387).uid
if(teleport > 0) then
doRemoveItem(teleport)
doSendMagicEffect(c.tp, CONST_ME_POFF)
end
return true
end
doCreateTeleport(1387, c.to, c.tp)
doSendMagicEffect(c.tp, CONST_ME_ENERGYAREA)
addEvent(deleteTeleport, c.time * 1000)
end
doCreatureSay(cid, monster.message, TALKTYPE_ORANGE_1)
end
return true
end
<event type="kill" name="MonsterPortal" event="script" value="azerus.lua"/>
registerCreatureEvent(cid, "monsterPortal")
<script>
<event name="MonsterPortal"/>
</script>