• 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!

[Creaturescripts]Kill 2 monsters = Appear new tp for 30 seconds

felipedorgas

New Member
Joined
Aug 10, 2010
Messages
34
Reaction score
1
This script below, Brings up a teleport after killing the ONE monster, it lasts 30 seconds

Code:
local tpId = 1387 
local tps = { 
        ["Orshabaal"] = {pos = {x=761, y=57, z=7}, toPos = {x=767, y=52, z=7}, time = 30}, 
} 
 
function removeTp(tp) 
        local t = getTileItemById(tp.pos, tpId) 
        if t then 
                doRemoveItem(t.uid, 1) 
                doSendMagicEffect(tp.pos, CONST_ME_POFF) 
        end 
end 
 
function onDeath(cid) 
        local tp = tps[getCreatureName(cid)] 
        if tp then 
                doCreateTeleport(tpId, tp.toPos, tp.pos) 
                doCreatureSay(cid, "O teleport irá sumir em "..tp.time.." segundos.", TALKTYPE_ORANGE_1) 
                addEvent(removeTp, tp.time*1000, tp) 
        end 
        return TRUE 
end

+ this in monster.xml (example: orshabaal.xml)
Code:
<script> 
<event name="tp"/> 
</script>

but, I need the script to kill 2 (TWO) monster, appearing on the tp.

i give rep ^_^

thx
 
Last edited:
Code:
local config = {
        timeToRemove = 180, -- seconds
		message = "Go into the teleport in 3 minutes, else it will disappear.",
        teleportId = 1387,
        bosses = { -- Monster Name,  Teleport Position
                ["Ushuriel"] = {  pos={ x=549, y=446, z=12, stackpos=2 }, aid=20052 },--to crystal cave
				["Zugurosh"] = {  pos={ x=581, y=445, z=12, stackpos=2 }, aid=20055}, --to blood Halls
				["Madareth"] = {  pos={ x=564, y=486, z=12, stackpos=2 }, aid=20058}, --to the vat
                ["Annihilon"] = {  pos={ x=639, y=446, z=12, stackpos=2 }, aid=20064}, --the hyve
                ["Hellgorak"] = {  pos={ x=644, y=488, z=12, stackpos=2 }, aid=20066}--to shadow nexus
				},
		brothers ={
        ["Golgordan"] = {pos={ x=599, y=486, z=12, stackpos=1 },aid=20061, brother = "Latrivan"}, --The Arcanum
        ["Latrivan"] = {pos={ x=599, y=486, z=12, stackpos=1 },aid=20061, brother = "Golgordan"},
        brothersArea ={
                fromPos = {x = 591, y = 476, z = 12},
                toPos = {x = 607, y = 486, z = 12}	}	}
}
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

not made by me just edit to ur needs look at that brother part
 
Back
Top