• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Feature Reward Chest & Boss Reward [TFS 1.2]

grilo13

RAWR
Joined
Jun 17, 2011
Messages
254
Solutions
4
Reaction score
57
Location
HUEland
GitHub
mTsGrilo
@Mkalo I found a "bug", if you equip an item from reward in an occupied slot, they will be changed. And I'm using TFS 1.3 btw- master branch

6PcrIw6.gif


Crash when some1 receive too much items from 1boss (Gaz'haragoth)

How many items is "too much"?
NJTfb3e.jpg
 

Lay

TFS 1.2
Joined
Dec 7, 2012
Messages
67
Solutions
9
Reaction score
29
Aff. . sorry, false alarm! I check all now and know what crashing:
Code:
      <script>
        <event name="Gaz'haragoth heal"/>
    </script>
 

Aeronx

Intermediate OT User
Joined
Dec 17, 2015
Messages
721
Solutions
9
Reaction score
110
When a boss with more people is killed, only one gets loot in the reward bag the one that gave the last hit.
Is it normal?
Is it only happening to me or to everybody?

thank you in advance!
 

Colors

Joined
Mar 22, 2013
Messages
812
Solutions
4
Reaction score
270
I haven't look at all the code, but is there a way to transfer the damage participation from one creature to another?
 

Aeronx

Intermediate OT User
Joined
Dec 17, 2015
Messages
721
Solutions
9
Reaction score
110
  • function BossLoot:updateDamage()
  • if self.creature then
  • local tmp = {}
  • local totaldmg = 0
  • for killer, damage in pairs(self.creature:getDamageMap()) do
  • totaldmg = totaldmg+damage.total
  • tmp[killer] = damage.total
  • end
  • self.players = sort_descending(tmp)
  • self.totaldmg = totaldmg
  • else
  • error("Creature not found.")
  • end
  • end
  • function BossLoot:setRewards()
  • if self.totaldmg and self.creature then
  • if getConfigInfo("rateLoot") > 0 then
  • local mt = MonsterType(self.creature:getName())
  • for i, playertab in ipairs(self.players) do
  • local loot
  • if i == 1 then
  • loot = mt:getBossReward(playertab[2] / self.totaldmg, true)
  • else
  • loot = mt:getBossReward(playertab[2] / self.totaldmg, false)
  • end
  • table.insert(self.players, loot)



    • end



    • end



    • else



    • error("Error")



    • end



    • end
This part i think it have it. Trued to print damage but it always say the same for all character, like it doesnt share the damage. Would be awesome if someone could give some light on the issue, or at leaat tell me if its only not working fine to me! Thank you all!
 

Zombiegod

Member
Joined
Oct 22, 2009
Messages
198
Solutions
1
Reaction score
24
if you are using the latest source don't forget to move "uint32_t maxSize;" to public.
 

Kouki

Member
Joined
Feb 5, 2016
Messages
67
Solutions
4
Reaction score
13
I have this error someone know why?

Code:
src/luascript.cpp: In static member function ‘static int LuaScriptInterface::luaItemGetNameDescription(lua_State*)’:
src/luascript.cpp:11698:55: error: ‘it’ was not declared in this scope
   const std::string& name = (item ? item->getName() : it.name);
                                                       ^
src/luascript.cpp:11702:3: error: ‘s’ was not declared in this scope
   s << subType << ' ';
   ^
src/luascript.cpp:11712:3: error: ‘s’ was not declared in this scope
   s << article << ' ';
   ^
src/luascript.cpp:11716:3: error: ‘s’ was not declared in this scope
   s << name;
   ^
src/luascript.cpp:11720:3: error: ‘s’ was not declared in this scope
   s << "an item of type " << it.id;
   ^
src/luascript.cpp:11722:17: error: ‘s’ was not declared in this scope
   pushString(L, s.str());
                 ^
src/luascript.cpp: At global scope:
src/luascript.cpp:12775:10: error: expected constructor, destructor, or type conversion before ‘(’ token
  pushLoot(L, monsterType->info.lootItems);
          ^
src/luascript.cpp:12776:2: error: expected unqualified-id before ‘return’
  return 1;
  ^
src/luascript.cpp:12777:1: error: expected declaration before ‘}’ token
 }
 ^

I check everything 3 times before compiling..
I use clear TFS 1.3
 

Kouki

Member
Joined
Feb 5, 2016
Messages
67
Solutions
4
Reaction score
13
Yes, in 2nd page you have solution for tfs 1.3 ;)


Ok, just to help people with TFS 1.3

in src/depotchest.cpp:
Change

Code:
Container(type), maxDepotItems(1500) {}
TFS 1.2 was maxDepotItems = 1500;

For
Code:
Container(type), maxDepotItems(1500), depotId(0) {}

in src/monsters.h
Below...

Code:
bool hiddenHealth = false

...Add
Code:
bool rewardChest = false;

and also ignore this change

in src/monsters.cpp
Below...

Code:
           } else if (strcasecmp(attrName, "hidehealth") == 0) {

               mType->info.hiddenHealth = attr.as_bool();

...Add
Code:
           } else if (strcasecmp(attrName, "rewardchest") == 0) {
               mType->info.rewardChest = attr.as_bool();
(mType->rewardChest now is mType->info.rewardChest)

after your changes in src/luascript.cpp
Back there and change:

Code:
 pushBoolean(L, monsterType->rewardChest);

For:
Code:
  pushBoolean(L, monsterType->info.rewardChest);

Change:
Code:
parseLoot(monsterType->lootItems);

For:
Code:
parseLoot(monsterType->info.lootItems);

Everything is working fine here, with the TFS 1.3 master :)
 

Kuantikum

Member
Joined
Jul 3, 2015
Messages
215
Solutions
1
Reaction score
19
Hello guys!

I'm using this server as a base:
The Forgotten Tibia (no vocations, new skills, skills by points, dual wield, auto loot, quiver, etc)

Following this tutorial, starting with part TFS 1.2 and editing the fixes for TFS 1.3, I got the following errors:

C++:
Scanning dependencies of target theforgottentibia
[  1%] Building CXX object CMakeFiles/theforgottentibia.dir/src/actions.cpp.o
In file included from /home/novoc/src/player.h:36,
                 from /home/novoc/src/game.h:30,
                 from /home/novoc/src/actions.cpp:26:
/home/novoc/src/depotlocker.h: In member function ‘void DepotLocker::setMaxLockerItems(uint32_t)’:
/home/novoc/src/depotlocker.h:51:9: error: ‘uint32_t Container::maxSize’ is private within this context
   51 |         maxSize = maxitems;
      |         ^~~~~~~
In file included from /home/novoc/src/actions.cpp:25:
/home/novoc/src/container.h:157:12: note: declared private here
  157 |   uint32_t maxSize;
      |            ^~~~~~~
make[2]: *** [CMakeFiles/theforgottentibia.dir/build.make:91: CMakeFiles/theforgottentibia.dir/src/actions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:180: CMakeFiles/theforgottentibia.dir/all] Error 2
make: *** [Makefile:84: all] Error 2


I put at disposal all the files mentioned in the error console:

Action.cpp, container.h, depotlocker.h, game.h and player.h



I am very grateful in advance for any help! 😍😘🥰
 
Last edited:

Sopago

Member
Joined
Dec 15, 2020
Messages
32
Reaction score
11
GitHub
Sopago
Hello guys!

I'm using this server as a base:
The Forgotten Tibia (no vocations, new skills, skills by points, dual wield, auto loot, quiver, etc)

Following this tutorial, starting with part TFS 1.2 and editing the fixes for TFS 1.3, I got the following errors:

C++:
Scanning dependencies of target theforgottentibia
[  1%] Building CXX object CMakeFiles/theforgottentibia.dir/src/actions.cpp.o
In file included from /home/novoc/src/player.h:36,
                 from /home/novoc/src/game.h:30,
                 from /home/novoc/src/actions.cpp:26:
/home/novoc/src/depotlocker.h: In member function ‘void DepotLocker::setMaxLockerItems(uint32_t)’:
/home/novoc/src/depotlocker.h:51:9: error: ‘uint32_t Container::maxSize’ is private within this context
   51 |         maxSize = maxitems;
      |         ^~~~~~~
In file included from /home/novoc/src/actions.cpp:25:
/home/novoc/src/container.h:157:12: note: declared private here
  157 |   uint32_t maxSize;
      |            ^~~~~~~
make[2]: *** [CMakeFiles/theforgottentibia.dir/build.make:91: CMakeFiles/theforgottentibia.dir/src/actions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:180: CMakeFiles/theforgottentibia.dir/all] Error 2
make: *** [Makefile:84: all] Error 2


I put at disposal all the files mentioned in the error console:

Action.cpp, container.h, depotlocker.h, game.h and player.h



I am very grateful in advance for any help! 😍😘🥰
Someone else mentioned that u need to move uint32_t maxSize; from 'private' to 'public' function for it to work , perhaps that will fix the problem?
 

Sopago

Member
Joined
Dec 15, 2020
Messages
32
Reaction score
11
GitHub
Sopago
Anyone else got problems with the script? im using tfs 1.3 and its crashing after i kill the boss and then kill normal monster which doesnt have 'reward-chest' flag, anyone had similar problem?

Also should i use code provided here in the thread or the one on github? im little confused:D
 
Last edited:

deadsmelly

New Member
Joined
Apr 5, 2009
Messages
8
Reaction score
4
Anyone else got problems with the script? im using tfs 1.3 and its crashing after i kill the boss and then kill normal monster which doesnt have 'reward-chest' flag, anyone had similar problem?

@Sopago I'm also experiencing the crashing after killing a boss and then a normal mob. Did you ever figure that out?

TFS 1.3 followed all the directions for upgrading it to 1.3 and it is working. Generates loot in the chest, just crashes the server if you kill a mob, then a boss, or a boss then a mob.
 

Sopago

Member
Joined
Dec 15, 2020
Messages
32
Reaction score
11
GitHub
Sopago
@Sopago I'm also experiencing the crashing after killing a boss and then a normal mob. Did you ever figure that out?

TFS 1.3 followed all the directions for upgrading it to 1.3 and it is working. Generates loot in the chest, just crashes the server if you kill a mob, then a boss, or a boss then a mob.
I have not unfortunately :( let me know if u find any solution:D
 

wafuboe

Member
Joined
Dec 24, 2010
Messages
871
Solutions
2
Reaction score
21
works on 1.4.2??

while following the step of the tutotial i have found some diferrent steps that dont look exactly
 

sloox

New Member
Joined
Aug 13, 2007
Messages
39
Reaction score
2
everything its okay, but when i add reward bag and reward chest to items.otb its not sending items to bag :/
 
Last edited:
Top