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

Inquisition - create teleport when kill both bosses

Xyzyk

RudziutOTS Maker
Joined
Jun 14, 2008
Messages
39
Reaction score
0
Location
Poland
How to make in this script:
LUA:
local bosses =  
				-- Teleport Takes Player -- Teleport Is Created -- Teleport Actionid --
    {["Ushuriel"] = {x=1345, y=390, z=13}, {x=1398, y=522, z=11}, 7941,
    ["Zugurosh"] = {x=1345, y=390, z=13}, {x=1432, y=521, z=11}, 7942,
    ["Madareth"] = {x=1345, y=390, z=13}, {x=1395, y=548, z=11}, 7943,
    ["Latrivan"] = {x=1345, y=390, z=13}, {x=1430, y=522, z=11}, 7944,
    ["Annihilon"] = {x=1345, y=390, z=13}, {x=1470, y=506, z=11}, 7945,
    ["Hellgorak"] = {x=1310, y=560, z=12}, {x=1475, y=548, z=11}, 7946}

local time = 180 -- Seconds
function onKill(cid, target, lastHit)
        for name, pos in pairs(bosses) do
                if (name == getCreatureName(target):lower()) then
						minutes = time:60
                        doCreateTeleport(5023, pos[1], pos[2])
						doSendMagicEffect(pos[2], CONST_ME_MAGIC_BLUE)
						doItemSetAttribute(getTileItemById(pos[2], 5023).uid, "aid", pos[3])
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have '.. minutes ..' seconds until the portal will disapear.')
                        addEvent(doRemoveItem, tpTime * 1000, getTileItemById(pos[2], 5023).uid, 1)
                end
        end
    return true
end

that if player kill bosses - 'Latrivan' and 'Golgordan' teleport will appear (like in script), but not if player kill one of them, but both.
 
Yeah... but this is the shortest which I've found and it have few differences that your script:
LUA:
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=1400, y=615, z=11, stackpos=2 }, aid=1001 },
				["Zugurosh"] = {  pos={ x=1434, y=614, z=11, stackpos=2 }, aid=1002},
				["Madareth"] = {  pos={ x=1398, y=642, z=11, stackpos=2 }, aid=1003},
                ["Annihilon"] = {  pos={ x=1473, y=599, z=11, stackpos=2 }, aid=1005},
                ["Hellgorak"] = {  pos={ x=1478, y=641, z=11, stackpos=2 }, aid=1006}
				},
		brothers ={
        ["Golgordan"] = {pos={ x=1433, y=645, z=11, stackpos=1 },aid=1004, brother = "Latrivan"},
        ["Latrivan"] = {pos={ x=1433, y=645, z=11, stackpos=1 },aid=1004, brother = "Golgordan"},
        brothersArea ={
                fromPos = {x = 1425, y = 645, z = 11},
                toPos = {x = 1441, y = 655, z = 11}	}	}
}
local function change(position)
	doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", 3000)
    return TRUE
end

function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
		local t = config.bosses[getCreatureName(target)]
		local position = t.pos
		doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", t.aid)
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
		addEvent(change, 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 position = t.pos
			doItemSetAttribute(getTileItemById(position, config.teleportId).uid, "aid", t.aid)
			doItemSetAttribute(teleport, "aid", t.aid)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, position)
		end
	end
	return TRUE

end
Could somebody remake this shorter script to it works like in thread?
 
just compare them yourself?
youll get help just because some people wants free rep probably
imo you should at least TRY to use BRAIN, and then ask for help
btw you copied my second one which is changing tps id like in global, not creating second tp

and if you want sth like ur script search for that mod
 
As you wish I tried to remake it, now could you tell me - is there any mistakes?

LUA:
local bosses =  
				-- Teleport Takes Player -- Teleport Is Created -- Teleport Actionid --
    {["Ushuriel"] = {x=1345, y=390, z=13}, {x=1398, y=522, z=11}, 7941,
    ["Zugurosh"] = {x=1345, y=390, z=13}, {x=1432, y=521, z=11}, 7942,
    ["Madareth"] = {x=1345, y=390, z=13}, {x=1395, y=548, z=11}, 7943,
    ["Annihilon"] = {x=1345, y=390, z=13}, {x=1470, y=506, z=11}, 7945,
    ["Hellgorak"] = {x=1310, y=560, z=12}, {x=1475, y=548, z=11}, 7946}
	
local brothers =
    {["Golgordan"] = {x=1345, y=390, z=13}, {x=1430, y=552, z=11}, 7944, "Latrivan",
    ["Latrivan"] = {x=1345, y=390, z=13}, {x=1430, y=552, z=11}, 7944, "Golgordan"}
	
local brothersArea =
            {fromPos = {x=1422, y=522, z=11},
            toPos = {x=1438, y=562, z=11}}

local time = 180 -- Seconds
function onKill(cid, target, lastHit)
        for name, pos in pairs(bosses) do
                if (name == getCreatureName(target):lower()) then
						minutes = 3
                        doCreateTeleport(5023, pos[1], pos[2])
						doSendMagicEffect(pos[2], CONST_ME_MAGIC_BLUE)
						doItemSetAttribute(getTileItemById(pos[2], 5023).uid, "aid", pos[3])
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have '.. minutes ..' seconds until the portal will disapear.')
                        addEvent(doRemoveItem, tpTime * 1000, getTileItemById(pos[2], 5023).uid, 1)
				end
		end
				for names, pos2 in pairs(brothers) do
					if (names == getCreatureName(target):lower()) then
						local brother = getCreatureByName(names.pos2[4])
						if(isMonster(brother) == true) then
							if(isInRange(getCreaturePosition(brother), brothersArea.fromPos, brothersArea.toPos) == true) then
								return true
							end
						else
							doCreateTeleport(5023, pos2[1], pos2[2])
							doSendMagicEffect(pos2[2], CONST_ME_MAGIC_BLUE)
							doItemSetAttribute(getTileItemById(pos2[2], 5023).uid, "aid", pos2[3])
							doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have '.. minutes ..' seconds until the portal will disapear.')
							addEvent(doRemoveItem, tpTime * 1000, getTileItemById(pos2[2], 5023).uid, 1)
						end
					end
				end
    return true
end
 
Back
Top