strix seran
New Member
- Joined
- Feb 23, 2017
- Messages
- 6
- Reaction score
- 0
Hello,
I'm trying to implement the script so that the minion of gaz'haragoth turns into a teleport when it dies, but nothing happens. Can someone help me? Follows the script:
creaturescripts.xml:
/creaturescripts/scripts/tpgaz.lua:
monster/dreamhaunters/minion of gaz'haragoth.xml:
I'm trying to implement the script so that the minion of gaz'haragoth turns into a teleport when it dies, but nothing happens. Can someone help me? Follows the script:
creaturescripts.xml:
C++:
<event type="kill" name="TpGaz" script="tpgaz.lua" />
/creaturescripts/scripts/tpgaz.lua:
Lua:
local teleportToPosition = Position(33544, 32418, 15)
local function remove teleport(position)
local teleportItem = Tile(position):getItemById(24109)
if teleportItem then
teleportItem:remove()
position:sendMagiceEffect(CONST_ME_POFF)
end
end
function onKill(creature, target)
local targetMonster = target:getMonster()
if not targetMonster or targetMonster:getName():lower() ~= 'minion of gaz haragoth' then
return true
end
local position = targetMonster:getPosition()
position:sendMagicEffect(CONST_ME_TELEPORT)
local item = Game.createItem(24109, 1, position)
if item:isTeleport() then
item:setDestination(teleportToPosition)
end
addEvent(removeTeleport, 2 * 60 * 1000, position)
return true
end
monster/dreamhaunters/minion of gaz'haragoth.xml:
C++:
<script>
<event name="TpGaz" />
</script>