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

Lua Random Item Stats Action

Larb

New Member
Joined
Nov 26, 2016
Messages
85
Reaction score
1
is it possible to make this script work in a box of rewards?
where there would be a list of rare, common and trash items

like this system
 
From what I see it uses loot containers from monsters, so what you could do is create a monster with the look type of the itemID of the box, make the monster unable to move and only 1 HP - call it "Reward Box" and set loot to be what you want and it will have a chance to become magical when killed. (You can use same monster name but different XML names to create different versions of the chest)

Just a random thought that might work if you want to try it :)
 
it's a cool idea.
more I will wait if an action is possible😅

Then create action script that creates a container and drops the specific items.

Code:
if c ~= nil then
        if c:isContainer() then
            rares = rares + assign_loot_Stat(c)
            if rares > 0 then
                if rare_popup then
                    local spectators = Game.getSpectators(pos, false, true, 7, 7, 5, 5)
                    for i = 1, #spectators do
                        spectators[i]:say(rare_text, TALKTYPE_MONSTER_SAY, false, spectators[i], pos)
                    end
                end

                if rare_effect then
                    pos:sendMagicEffect(rare_effect_id)
                end
            end
            return true
        end
    end

This finds the container to modify, so if you have a script that creates a container - this should register?
Research the functions to move further or wait for someone with more knowledge in 1.X
 
Back
Top