liqeen
Active Member
Hi, can someone help me add this function :
to this script :
Now when the destabilized ferumbras dies it creates ferumbras mortal shell but he is not counted as a reward boss so loot is broken and no1 can get any items from him.
Code:
if monster:getType():isRewardBoss() then
monster:setReward(true)
Code:
local config = {
["destabilized ferumbras"] = {chance = 10000, boss = "ferumbras mortal shell", msg = "Yikes"}, --25k = 25%
}
function onKill(creature, target, player)
--print("Enter Function")
local random_chance = math.random(10000)
local targetPosition = target:getPosition()
if target:isMonster() then
--print("Checking Target")
local Monster = config[getCreatureName(target):lower()]
--print(Monster.boss)
if Monster then
--print("Checking Name")
if Monster.chance >= random_chance then
--print("Summon")
target:getPosition():sendMagicEffect(CONST_ME_POFF)
Game.createMonster(Monster.boss:lower(), targetPosition)
target:say(Monster.msg, TALKTYPE_MONSTER_SAY)
end
end
end
return true
end