• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

kill monster createportal

Djivar

AKA Wickedviruz
Joined
Sep 28, 2009
Messages
1,641
Reaction score
19
Location
Sweden,edsbyn
kill monster creat portal


data/creaturescripts/inquisition.lua:

PHP:
local config = {
    message = "Go into the teleporter in 3 minutes, else it will disappear.",
    timeToRemove = 180, -- seconds
    teleportId = 1387,
    bosses = { -- Monster Name, Teleport To Position, Teleport Position
        ["Ushuriel"] = { { x = 222, y = 564, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 } },
        ["Annihilion"] = { { x = 276, y = 1045, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 } },
        ["Hellgorak"] = { { x = 169, y = 1047, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 } },
        ["Madareth"] = { { x = 416, y = 1017, z = 6 }, { x = 218, y = 564, z = 6, stackpos = 1 } },
        ["Zugurosh"] = { { x = 424, y = 1119, z = 7 }, { x = 218, y = 564, z = 6, stackpos = 1 } },
        ["Latrivan"] = { { x = 46, y = 1109, z = 7 }, { x = 218, y = 564, z = 6, stackpos = 1 } }
    }
}

local function removal(position)
    if getThingfromPos(position).itemid == config.teleportId then
        doRemoveItem(getThingfromPos(position).uid)
    end
    return TRUE
end

function onDeath(cid, corpse, killer)
    local position = getCreaturePosition(cid)
    for name, pos in pairs(config.bosses) do
        if name == getCreatureName(cid) then
            teleport = doCreateTeleport(config.teleportId, pos[1], pos[2])
            doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
            addEvent(removal, config.timeToRemove * 1000, pos[2])
        end
    end
    return TRUE
end

data/creaturescripts/creaturescripts.xml:
PHP:
    <event type="death" name="Inquisition" script="inquisition.lua"/>

To make it work you have to add in every monster that will use this script those lines (suggested after </flags>):
PHP:
<script>
    <event name="Inquisition"/>
</script>

and also register an event for player, by NPC, action, onLogin script or whatever:
PHP:
    registerCreatureEvent(cid, "Inquisition")
 
I believe I already did, several times.
 
Last edited:
Back
Top