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

Check Boss live/dead

Rycina

Member
Joined
Nov 7, 2024
Messages
59
Solutions
1
Reaction score
8
Hi there! :) I'm looking for something like this for TheForgottenServer 1.4.2, OTCv8 client, engine 10.98.

Does anyone know if such a boss check is available? Or something similar that allows you to display a table with bosses that are currently alive and those that aren't? :D

boss.webp

Thank you in advance for your help! :)
 
you can register em with event "onSpawn" and "onDeath"


LUA:
if not bossSystem then
   bossSystem = {}
end

function bossSystem:addBoss(boss)
   bossSystem[boss:getName():lower()] = boss:getId()
end

function bossSystem:getBossByName(name)
   local t = bossSystem[name:lower()]
   if not t then
      return false
   end
 
   local boss = Monster(t)
   if boss then
      return boss
   end
 
   return false
end

function bossSystem:onDeath(boss)
    bossSystem[boss:getName():lower()] = nil
end

access to boss metatable
LUA:
local boss = bossSystem:getBossByName("Orshabaal")
if boss then
  -- boss is alive and we have an access to this metatable
  -- u can do something with boss since it return the object(creature in this case)
  boss:addHealth(50) -- random code line
else
  -- boss died, creature not found
end
 
Last edited:
you can register em with event "onSpawn" and "onDeath"


LUA:
if not bossSystem then
   bossSystem = {}
end

function bossSystem:addBoss(boss)
   bossSystem[boss:getName():lower()] = boss:getId()
end

function bossSystem:getBossByName(name)
   local t = bossSystem[name:lower()]
   if not t then
      return false
   end
 
   local boss = Monster(t)
   if boss then
      return boss
   end
 
   return false
end

function bossSystem:onDeath(boss)
    bossSystem[boss:getName():lower()] = nil
end

access to boss metatable
LUA:
local boss = bossSystem:getBossByName("Orshabaal")
if boss then
  -- boss is alive and we have an access to this metatable
  -- u can do something with boss since it return the object(creature in this case)
  boss:addHealth(50) -- random code line
else
  -- boss died, creature not found
end
I would ask for that too! :D !
The script is probably good, but I will also need to somehow create this table with images + a button in the game and add this script to the table?
 
I would ask for that too! :D !
The script is probably good, but I will also need to somehow create this table with images + a button in the game and add this script to the table?
it can be straight in that new module or just simply table

LUA:
local images = {
                           ["dragon"] = "/images/dragon.gif",
                           ["rat"] = "/images/rat.gif"
                        }

then send it in opCodes, but i think

1734788956914.webp
here been used UICreature widget with setOutfit method, so all what you need to do its just create a module (window like this) with 2 labels
creatureName
creatureStatus

and then simply with opcodes change the Alive not Alive (server check for example by my code.)
 
it can be straight in that new module or just simply table

LUA:
local images = {
                           ["dragon"] = "/images/dragon.gif",
                           ["rat"] = "/images/rat.gif"
                        }

then send it in opCodes, but i think

View attachment 89037
here been used UICreature widget with setOutfit method, so all what you need to do its just create a module (window like this) with 2 labels
creatureName
creatureStatus

and then simply with opcodes change the Alive not Alive (server check for example by my code.)

I've never made tables, but I'll look for how to do it in Holland :D I don't have experience in creating them myself
 
Back
Top