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

[TFS 1.2] advanced drop loot system

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,391
Solutions
7
Reaction score
550
Hello again Otland!
I have made an easy to use on on death system! With it you can make players lose a percentage of their money from their bank when killed by a player, add more items to prevent money loss/item loss plus more!

Information on the system
It has an easy config section for you to customize it how you would like it! You just need to fill out the config table found in the action script (pictured below)
Code:
--- Config ---
local config = {
   noMoneyLoss = false, -- Set this to true if you dont want players to lose money by being killed by a player
   noItemLoss = false, -- Set this to true if you dont want players to lose any items.
   noVocLoss = true, -- If this is set to true, and the player has no vocation dont lose any items
   realAOL = true, -- Set this to true if you want AOL to be ignored if player has skull (Make it work like Real Tibia)
   bankLossPercent = 10, -- This is the percent of the players totoal bank balance they will lose
   
-- You can add extra items here that can prevent item loss
   itemProtection = {
     -- Amulet of loss   
     [1] = {
       item = {
         id = 2173, -- The ID of any the item
         slot = CONST_SLOT_NECKLACE, -- Slot that the item must be in
       },
     },     
   },
   
-- You can add extra items here that can prevent item Money loss
   moneyProtection = {
     -- Amulet of loss   
     [1] = {
       item = {
         id = 2173, -- The ID of any the item
         slot = CONST_SLOT_NECKLACE, -- Slot that the item must be in
       },
     },     
   },
}
-- End Config

Installation

1)
Replace your droploot.lua (Typicaly found at /data/creaturescripts/scripts/others/droploot.lua) with this:
http://pastebin.com/pKcXgvv4
https://otland.net/threads/tfs-1-2-modal-window-helper-lib.238773/

Thats it!
Enjoy =)

P.S This hasn't been thoroughly tested so if you encounter any bugs please comment them here.

Regards,
strutZ
 
This looks really nice, will be testing it when I get home. A question though, would it be possible to add the money lost on death to the corpse to the killer can loot it?
 
This looks really nice, will be testing it when I get home. A question though, would it be possible to add the money lost on death to the corpse to the killer can loot it?
of course
 
Hmm.. I keep getting an error
Code:
drop.lua:104 'end' expected (to close 'if' at line 101) near 'return'
I tried messing with it and comparing it with the default droploot.lua but I can't get it to work :( the if statement looks right to me...but I'm a noob sooo haha
 
Whoops sorry i dont think i released this finished... i dont know where i got up to.. i kind of stopped working on it lol here is what i currently have

LIB
http://pastebin.com/udC9qSnH

Test it gimme errors and i'll fix
 
Alright I copied the new pastebin and reload creaturescripts..got the same error as before. Tried removing the semicolon after break like @tetra said, same error.
So then I just removed the breaks completely and reloaded, no errors. Tested it with 10gp balance and it worked, everytime I was killed by a player I'd lose 10% of my balance regardless of aol/blessings. No gold was taken if I was killed by a mob either. The only problem is that it broke aol xD aol doesn't protect my items and doesn't disappear on death.
 
Alright I copied the new pastebin and reload creaturescripts..got the same error as before. Tried removing the semicolon after break like @tetra said, same error.
So then I just removed the breaks completely and reloaded, no errors. Tested it with 10gp balance and it worked, everytime I was killed by a player I'd lose 10% of my balance regardless of aol/blessings. No gold was taken if I was killed by a mob either. The only problem is that it broke aol xD aol doesn't protect my items and doesn't disappear on death.
Alright i'll look into this script again just for you hahah
 
Now make it so you cant have money on depot kappa
Well in my server there is no physical money... its just a number that goes into your bank... when you kill monsters money auto goes to bank.. if you got to a shop you use bank balance and if you want to give money to a player you transfer.
 
*Welcomes me to the future*
Is this a special feature of your server or is it normal? I've been away from OT since the 8.60 lol

Sorry for offTopic
 
*Welcomes me to the future*
Is this a special feature of your server or is it normal? I've been away from OT since the 8.60 lol

Sorry for offTopic
special feature =)
 
@strutZ Could you perhaps put something in the code that only allows people to drop gold from bank only if they are "x" levell.
 
C++:
std::set<uint32_t> autoLootList;

ERROR to compile:
Error C2039 'set': no es un miembro de 'std' (compilando archivo de origen ..\src\bed.cpp) theforgottenserver c:\users\juanc\dropbox\ot\src\player.h 1251

help please
 
Back
Top