• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved How to change this script so it fits 1.0?

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
Code:
local bosses = { -- Teleport Takes Player -- Teleport Is Created --
        ["Dipthrah"] = {{ x=1212, y=1415, z=7 }, { x=1167, y=1420, z=7 }},
        ["Vashresamun"] = {{ x=1227, y=1415, z=7 }, { x=1167, y=1447, z=7 }},
        ["Thalas"] = {{ x=1244, y=1415, z=7 }, { x=1167, y=1474, z=7 }},
        ["Omruc"] = {{ x=1260, y=1415, z=7 }, { x=1191, y=1420, z=7 }},
        ["Mahrdis"] = {{ x=1277, y=1415, z=7}, { x=1191, y=1447, z=7 }},
        ["Rahemos"] = {{ x=1295, y=1415, z=7 }, { x=1191, y=1474, z=7 }},       
        ["Ashmunrah"] = {{ x=1313, y=1415, z=7 }, { x=1215, y=1447, z=7 }}            
}

local time = 30 -- Seconds
function doRemoveTeleport(pos, id)
    return doRemoveItem(getTileItemById(pos, id).uid, 1)
end
function onKill(cid, target, lastHit)
    for name, pos in pairs(bosses) do
        if (name:lower() == getCreatureName(target):lower()) then
            doCreateTeleport(1387, pos[1], pos[2])
            doCreatureSay(cid, "You have ".. time .." seconds until the portal will disapear.", TALKTYPE_ORANGE_1)
            addEvent(doRemoveTeleport, time * 1000, pos[2], 1387)
        end
    end
    return true
end

to

TFS 1.0?
 
Code:
local bosses = {
    ["dipthrah"] = {
        dest = { x=1212, y=1415, z=7 },
        from = { x=1167, y=1420, z=7 }
    },
    ["vashresamun"] = {
        dest = { x=1227, y=1415, z=7 },
        from = { x=1167, y=1447, z=7 }
    },
    ["thalas"] = {
        dest = { x=1244, y=1415, z=7 },
        from = { x=1167, y=1474, z=7 }
    },
    ["omruc"] = {
        dest = { x=1260, y=1415, z=7 },
        from = { x=1191, y=1420, z=7 }
    },
    ["mahrdis"] = {
        dest = { x=1277, y=1415, z=7 },
        from = { x=1191, y=1447, z=7 }
    },
    ["rahemos"] = {
        dest = { x=1295, y=1415, z=7 },
        from = { x=1191, y=1474, z=7 }
    },
    ["ashmunrah"] = {
        dest = { x=1313, y=1415, z=7 },
        from = { x=1215, y=1447, z=7 }
    }
}
local time = 30 -- Seconds
function onKill(cid, target)
    local boss = bosses[getCreatureName(target):lower()]
    if boss ~= nil then
        local tp = Item(doCreateTeleport(1387, boss.dest, boss.from))
        Player(cid):say("You have " .. time .. " seconds until the portal disapears.", TALKTYPE_ORANGE_1)
        addEvent(Item.remove, time * 1000, tp)
    end
    return true
end
 
Last edited:
Back
Top