• 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!

Adding BossReward to script

liqeen

Active Member
Joined
Nov 26, 2014
Messages
149
Solutions
1
Reaction score
28
Location
Poland
Hi, can someone help me add this function :
Code:
        if monster:getType():isRewardBoss() then
            monster:setReward(true)
to this script :
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
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.
 
Hi, can someone help me add this function :
Code:
        if monster:getType():isRewardBoss() then
            monster:setReward(true)
to this script :
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
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.

?
I guess you want this

Lua:
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)
                local monster = Game.createMonster(Monster.boss:lower(), targetPosition)
                monster:setReward(true)
                target:say(Monster.msg, TALKTYPE_MONSTER_SAY)
            end
        end
    end
    return true
end
 
?
I guess you want this

Lua:
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)
                local monster = Game.createMonster(Monster.boss:lower(), targetPosition)
                monster:setReward(true)
                target:say(Monster.msg, TALKTYPE_MONSTER_SAY)
            end
        end
    end
    return true
end
EXATCLY XD Thanks!
 
Back
Top