55 lines
1.9 KiB
Lua
55 lines
1.9 KiB
Lua
|
|
function SpawnRevivedBoss(id)
|
|
|
|
local x = tonumber(gv("x"))
|
|
local y = tonumber(gv("y"))
|
|
|
|
x = math.random(x-50, x+50)
|
|
y = math.random(y-50, y+50)
|
|
|
|
local revivedBossID = tonumber("1"..tostring(id))
|
|
add_npc(x, y, revivedBossID, 1, 360000)
|
|
|
|
local isSpawn = math.random(1,100)
|
|
|
|
if isSpawn >= 55 then
|
|
if id == 9158002 then
|
|
add_field_prop(920013371, 300, 200220, 168521, 0)
|
|
cprint("The <b>Betrayal reward box</b> has appeared on the platform. Hurry! It disappears in 5 minutes.")
|
|
elseif id == 9170001 then
|
|
add_field_prop(920013373, 300, 200220, 152392, 0)
|
|
cprint("The <b>Ashmaw reward box</b> has appeared on the platform. Hurry! It disappears in 5 minutes.")
|
|
elseif id == 9190001 then
|
|
add_field_prop(920013372, 300, 200220, 136265, 0)
|
|
cprint("The <b>SLK reward box</b> has appeared on the platform. Hurry! It disappears in 5 minutes.")
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
function GiveRevivedBossPrize()
|
|
|
|
local itemCount = math.random(1,3)
|
|
insert_item(204655, itemCount, 0, 1, 2)
|
|
cprint("You have received <b>x"..tostring(itemCount).." "..get_item_name_by_code(204655).."</b> for killing a Revived boss!")
|
|
|
|
end
|
|
|
|
function GiveBossBox(id)
|
|
|
|
if id == 1 then
|
|
local randomEarring = math.random(427201, 427210)
|
|
insert_item(randomEarring, 1, 0, 1, 2)
|
|
cprint("You have received <b>x1 ["..get_item_name_by_code(randomEarring).."]</b> from the reward box.")
|
|
elseif id == 2 then
|
|
local randomRing = math.random(427101, 427110)
|
|
insert_item(randomRing, 1, 0, 1, 2)
|
|
cprint("You have received <b>x1 ["..get_item_name_by_code(randomRing).."]</b> from the reward box.")
|
|
elseif id == 3 then
|
|
local beltTable = {305746, 305752, 305758, 305764, 305770, 305776, 305782, 305788, 305794, 305800}
|
|
local randomBelt = beltTable[math.random(1,10)]
|
|
insert_item(randomBelt, 1, 0, 1, 2)
|
|
cprint("You have received <b>x1 ["..get_item_name_by_code(randomBelt).."]</b> from the reward box.")
|
|
end
|
|
|
|
end |