• 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 Reward Chest creaturescript

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,484
Solutions
9
Reaction score
217
hello folks, I want make a real reward chest system, I have the c++ stuff...
now I need make the creaturescript
how I can start?
function onKill or onDeath ?
I need to check if are in the array of the bosses
my idea to create the loot and send to player is:
Code:
target:setDropLoot(false)
then I'll create a bag, and into this bag I put the loot, the loot will are in the same script, not get from the monster ...
to player get loot he will give damage.
the mostdamagekiller will get the "ferumbras'hat" for exemple, anothers "killers" will get some loot, and this loot can be equal !!! like a gaz'haragoth, that give to all killers the blessing charms ...
Code:
local bosses {
    bossName = 'ferumbras',
    items = {
        {itemid = 5903, unique = "true"},
        {itemid = 2152, count = 58},
        {itemid = 9971, count = 2},
        {itemid = 5944, count = 9} 
    }
}
if unique is true the mostdamagekiller will take this item...
well, its ok!
now, how I create a bag to put the items, something like:
1 - create a bag
2 - create the loot by percent of damage in the boss and put into the bag
3 - send the bag to inbox for exemple


thanks!
 
if unique is true the mostdamagekiller will take this item...
well, its ok!
now, how I create a bag to put the items, something like:
1 - create a bag
2 - create the loot by percent of damage in the boss and put into the bag
3 - send the bag to inbox for exemple
thanks!

Best way to find useful bits of code is in stuff that is already made (working), if your looking for a way to add stuff into a bag then look at the npc shopmodule script.

I could just write it for you but I worked 36 hours shift and im tired :(
 
Best way to find useful bits of code is in stuff that is already made (working), if your looking for a way to add stuff into a bag then look at the npc shopmodule script.

I could just write it for you but I worked 36 hours shift and im tired :(
thanks for the idea, but the hard thing is create the loot :/ need a math functions :/
about the npc system seems too much confuse to me
I saw a function already made here in otland...
Code:
function addContainerItems(container, items)
    for k, v in pairs(items) do
        if ItemType(k):isContainer() then
            local newBag = Container(doCreateItemEx(k, 1))
            addContainerItems(newBag, v)
            container:addItemEx(newBag)
        else
            container:addItem(v[1], v[2])
        end
    end
end
 
Last edited:
Just out of curiosity.. Im pretty lazy.. Why not just do this?
Just add a storage value to the players.. that lasts 15 minutes.. then make the bosses body drop no loot and set an actionid on death.
Body would decay and everyone with the storage value could use the boss's body during the decay process.. and get random loot from a table in an actionscript. Of course you could also add different storages to the players based on their damage and stuff.. but yeah

But maybe I'm missing the bigger picture of what your looking to do though.
 
Just out of curiosity.. Im pretty lazy.. Why not just do this?
Just add a storage value to the players.. that lasts 15 minutes.. then make the bosses body drop no loot and set an actionid on death.
Body would decay and everyone with the storage value could use the boss's body during the decay process.. and get random loot from a table in an actionscript. Of course you could also add different storages to the players based on their damage and stuff.. but yeah

But maybe I'm missing the bigger picture of what your looking to do though.
ahh, this is not interesting for me
I want to do like I said, its possible just a little harder work
 

Similar threads

Back
Top