• 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 Room Script Help plz

darragh11

New Member
Joined
May 31, 2012
Messages
5
Reaction score
1
So this is my script but i want it do spawn a boss then when the boss dies it waits a few seconds then spawns another. atm it spawns a monster every 30 seconds or so.
Can anyone help me plz.



local boss = 0
local room = {fromx = 31905, tox = 31940, fromy = 32376, toy = 32413, z = 10}
local spawnLoc = {x = 31924, y = 32390, z = 10}
local monsters = {"morgaroth", "ghazbaran"}
function onThink(cid, interval, lastExecution)
local choice = monsters[math.random( 1, #monsters)]
for x = room.fromx, room.tox do
for y = room.fromy, room.toy do
for z = room.z, room.z do
creature = {x = x, y = y, z = z}
mob = getTopCreature(creature).uid
if isMonster(mob) and not(isPlayer(getCreatureMaster(mob))) then
boss = 1
end
end
end
end
if boss == 1 then
return true
else
doSummonCreature(choice, spawnLoc)
end
return true
end
 
put this in the monster somewhere (I do it right under defenses)
(put in all 'bosses' you want this script to be active for)
XML:
<script>
    <event name="aaaaaaaaaa"/>
</script>

data/creaturescripts/creaturescripts.xml
XML:
<event type="death" name="aaaaaaaaaa" event="script" value="aaaaaaaaaa.lua"/>

data/creaturescripts/scripts/aaaaaaaaaa.lua
Lua:
local monsters = {"aaaaa", "bbbbb"}
local spawn_position = {x = 1000, y = 1000, z = 7}
local spawn_delay = 3 -- seconds

function onDeath(cid, corpse, deathList)
    local rand = math.random(#monsters)
    addEvent(doCreateMonster, 1000 * spawn_delay, monsters[rand], spawn_position)
    return true
end
 
Last edited:
Back
Top