myalitth
New Member
- Joined
- Jan 13, 2013
- Messages
- 69
- Reaction score
- 3
Now this script only summon a demon, can i change this to summon a random boss like (Demon, Orshaabal, etc)?
Lua:
local bossId = nil
function addBoss()
local monster = Game.createMonster("Demon", Position(32201, 32198, 7), false, true)
bossId = monster and monster:getId() or nil
end
function removeBoss()
local monster = Monster(bossId)
if monster then
monster:remove()
end
end
function bossExists()
return Monster(bossId) and true or false
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not bossExists() then
Game.broadcastMessage("You Have 15 minutes to kill him!", MESSAGE_STATUS_WARNING)
addEvent(addBoss, 0 * 60 * 100)
addEvent(removeBoss, 2 * 60 * 1000)
else
player:sendCancelMessage("The boss is already spawned!")
end
return true
end