• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Reward chest system error

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,484
Solutions
9
Reaction score
217
hello folks, I'm trying to implement a reward chest system different, then I saw in github from forgottenserver a pull request, very nice code made by @Non Sequitur
I copy all to my source, but get two errors about the functions
Code:
https://github.com/otland/forgottenserver/pull/1641#discussion-diff-48067223R498
and
Code:
https://github.com/otland/forgottenserver/pull/1641#discussion-diff-48067223R501
the error says: Error container has no member "isRewardCorpse()" and Error container has no member "setRewardCorpse()"
How I can solve this?
I lost my mind trying resolve this :/ seems that is a little #include, idk :/
thanks in advice.
Regards,
Silveralol
 
hello folks, I'm trying to implement a reward chest system different, then I saw in github from forgottenserver a pull request, very nice code made by @Non Sequitur
I copy all to my source, but get two errors about the functions
Code:
https://github.com/otland/forgottenserver/pull/1641#discussion-diff-48067223R498
and
Code:
https://github.com/otland/forgottenserver/pull/1641#discussion-diff-48067223R501
the error says: Error container has no member "isRewardCorpse()" and Error container has no member "setRewardCorpse()"
How I can solve this?
I lost my mind trying resolve this :/ seems that is a little #include, idk :/
thanks in advice.
Regards,
Silveralol
The error where?? Compiling error?? Lua??

Copy the entire error...
 
The error where?? Compiling error?? Lua??

Copy the entire error...
is when I try compile it, i'm not in my own pc, then what I can tell about the error is it:
when this line https://github.com/otland/forgottenserver/pull/1641/files#diff-db869def8f9edca87c157f26f4a1d25bR343
call the function get the error
and when this line
https://github.com/otland/forgottenserver/pull/1641/files#diff-721c64f80744c3e002360fff5827e2c8R130
call the another function get errors
the errors says
"the class Container has no member isRewardCorpse()"
or
"the class Container has no member setRewardCorpse()"
 
Harnessing that silvera has created this topic.. I'm getting the error below on Windows, but on my ubuntu it works pretty fine:

IHA8-GW.png
 
Harnessing that silvera has created this topic.. I'm getting the error below on Windows, but on my ubuntu it works pretty fine:

IHA8-GW.png
in your Ubuntu, the functions setRewardCorpse() and isRewardCorpse() works?
I'm sure that when you try compile in Ubuntu same with errors like this the compiler will compile, but with just warnings :(:eek:
also, remembering something, that a line missing somewhere....
I get the same errror in the past :eek:

Change container-> to item->
making this change is almost sure that will work?
 
Last edited by a moderator:
in your Ubuntu, the functions setRewardCorpse() and isRewardCorpse() works?
I'm sure that when you try compile in Ubuntu same with errors like this the compiler will compile, but with just warnings :(:eek:
also, remembering something, that a line missing somewhere....
I get the same errror in the past :eek:

Yup, the same sources compiles on Ubuntu pretty fine without any warning or error, but it does not compile on Windows. Also, I already revised the code like ten times in the past of two months and seems I got all.
 
Yup, the same sources compiles on Ubuntu pretty fine without any warning or error, but it does not compile on Windows. Also, I already revised the code like ten times in the past of two months and seems I got all.
the line that I'm saying is a line not included at the pull request (I guess) I need solve my first problem, then I'll see if I get the same error, I'm using MVS 2013 yet ¬¬
 
@president vankk man, I try again, the resolve the problem with my two errors, I've pasted in the wrong function :oops::oops::oops: then later I compile and it work perfectly, but only with normal characters, characters with access don't work ;)
I think that you need to try copy it again, maybe you paste in the wrong function like me... :oops:
and a special thanks to:
@MatheusMkalo and @Danger II for try help me :D
 
@president vankk man, I try again, the resolve the problem with my two errors, I've pasted in the wrong function :oops::oops::oops: then later I compile and it work perfectly, but only with normal characters, characters with access don't work ;)
I think that you need to try copy it again, maybe you paste in the wrong function like me... :oops:
and a special thanks to:
@MatheusMkalo and @Danger II for try help me :D

It is perfectly and compiles on Ubuntu, lawl - but I'll give a shoot on it but now.
 
Sorry to bump an old thread, but I am trying to implement this system as well. Is the Boss supposed to drop all the loot possible, by passing the chance of drop?
 
Sorry to bump an old thread, but I am trying to implement this system as well. Is the Boss supposed to drop all the loot possible, by passing the chance of drop?
see something about "factor" in the lua part ;)
and drop the chance
and voilá
 
Boss.lua, local lootFactor = 1 already. If I lower this to 0, there is no loot

Code:
local playerLoot
            if --[[stamina > 840 and]] con.score ~= 0 then
                local lootFactor = 1
                lootFactor = lootFactor / participants ^ (1 / 3) -- tone down the loot a notch if there are many participants
                lootFactor = lootFactor * (1 + lootFactor) ^ (con.score / expectedScore) -- increase the loot multiplicatively by how many times the player surpassed the expected score
                playerLoot = monsterType:getBossReward(lootFactor, _ == 1)

                if con.player then
                    for _, p in ipairs(playerLoot) do
                        reward:addItem(p[1], p[2])
                    end
                end
            end
 
Back
Top