Mariuskens
Sword Art Online 2D-MMORPG
I want to add Math.Random(1,1000) here:
local reSpawn = CreatureEvent("createBoss")
......................
local data = {
["rat"] = {spawnName = "cave rat"; --[[spawnPosition = Position(x, y, z)]]}
}
function reSpawn.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
local event = data[creature:getName():lower()]
if event then
local monster = Game.createMonster(event.spawnName, event.spawnPosition ~= nil and event.spawnPosition or creature:getPosition(), true, true)
if monster then
monster:say(event.broadcast, TALKTYPE_MONSTER_SAY)
end
end
return true
end
reSpawn:register()
is just to add a chance for example you need kill 500 demons and can be appear one Orshabaal.
Thanks you in avance
local reSpawn = CreatureEvent("createBoss")
......................
local data = {
["rat"] = {spawnName = "cave rat"; --[[spawnPosition = Position(x, y, z)]]}
}
function reSpawn.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
local event = data[creature:getName():lower()]
if event then
local monster = Game.createMonster(event.spawnName, event.spawnPosition ~= nil and event.spawnPosition or creature:getPosition(), true, true)
if monster then
monster:say(event.broadcast, TALKTYPE_MONSTER_SAY)
end
end
return true
end
reSpawn:register()
is just to add a chance for example you need kill 500 demons and can be appear one Orshabaal.
Thanks you in avance