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

boss check TFS 1.2

Pedrook

Advanced OT User
Joined
May 24, 2009
Messages
442
Solutions
3
Reaction score
183
Location
Brazil
boss check, the player use a command! boss check
or! bosscheck (and a list of active bosses appears on the server)
with a cost of "gold"
 
create global table of alive boss
onCreatureAppear -> table of alive boss +1 -> Boss.uid
onCreatureDisappear -> table of alive boss -1 -> nil
or onDeath, onKill -> table of alive boss -1 -> nil
one example, idea...

Lua:
function onCreatureAppear(self, creature)
    if self == creature then
        if TABLE_ALIVE_BOSS == nil then
              TABLE_ALIVE_BOSS = {}
        else
       TABLE_ALIVE_BOSS[self:getName()] = Creature(self)
    end end
end

Lua:
    function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    local boss = TABLE_ALIVE_BOSS[param]
    if boss ~= nil then
     player:popupFYI(param .. ' exist')
     end
return false
end

blablablabla.....
 
or just register every boss on spawn withstorage and check on storages. You can set storage to 0 with ondeath event
 
create global table of alive boss
onCreatureAppear -> table of alive boss +1 -> Boss.uid
onCreatureDisappear -> table of alive boss -1 -> nil
or onDeath, onKill -> table of alive boss -1 -> nil
one example, idea...

Lua:
function onCreatureAppear(self, creature)
    if self == creature then
        if TABLE_ALIVE_BOSS == nil then
              TABLE_ALIVE_BOSS = {}
        else
       TABLE_ALIVE_BOSS[self:getName()] = Creature(self)
    end end
end

Lua:
    function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end
    local boss = TABLE_ALIVE_BOSS[param]
    if boss ~= nil then
     player:popupFYI(param .. ' exist')
     end
return false
end

blablablabla.....
or just register every boss on spawn withstorage and check on storages. You can set storage to 0 with ondeath event

Thank you, I'll see what I can do. With my limited knowledge.
 
Back
Top