[TFS 1.2] advanced drop loot system

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by strutZ, Jun 9, 2016.

  1. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    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 (Text):
    1.  
    2. --- Config ---
    3. local config = {
    4.    noMoneyLoss = false, -- Set this to true if you dont want players to lose money by being killed by a player
    5.    noItemLoss = false, -- Set this to true if you dont want players to lose any items.
    6.    noVocLoss = true, -- If this is set to true, and the player has no vocation dont lose any items
    7.    realAOL = true, -- Set this to true if you want AOL to be ignored if player has skull (Make it work like Real Tibia)
    8.    bankLossPercent = 10, -- This is the percent of the players totoal bank balance they will lose
    9.    
    10. -- You can add extra items here that can prevent item loss
    11.    itemProtection = {
    12.      -- Amulet of loss  
    13.      [1] = {
    14.        item = {
    15.          id = 2173, -- The ID of any the item
    16.          slot = CONST_SLOT_NECKLACE, -- Slot that the item must be in
    17.        },
    18.      },    
    19.    },
    20.    
    21. -- You can add extra items here that can prevent item Money loss
    22.    moneyProtection = {
    23.      -- Amulet of loss  
    24.      [1] = {
    25.        item = {
    26.          id = 2173, -- The ID of any the item
    27.          slot = CONST_SLOT_NECKLACE, -- Slot that the item must be in
    28.        },
    29.      },    
    30.    },
    31. }
    32. -- End Config
    33.  
    Installation

    1)
    Replace your droploot.lua (Typicaly found at /data/creaturescripts/scripts/others/droploot.lua) with this:
    http://pastebin.com/pKcXgvv4


    Thats it!
    Enjoy =)

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

    Regards,
    strutZ
     
    Codinablack and tetra20 like this.
  2. Doitforthegains

    Doitforthegains Active Member

    Joined:
    Aug 30, 2014
    Messages:
    192
    Likes Received:
    53
    Best Answers:
    0
    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?
     
  3. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    of course
     
  4. Doitforthegains

    Doitforthegains Active Member

    Joined:
    Aug 30, 2014
    Messages:
    192
    Likes Received:
    53
    Best Answers:
    0
    Hmm.. I keep getting an error
    Code (Text):
    1.  
    2. drop.lua:104 'end' expected (to close 'if' at line 101) near 'return'
    3.  
    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
     
  5. tetra20

    tetra20 DD

    Joined:
    Jan 17, 2009
    Messages:
    1,287
    Likes Received:
    275
    Best Answers:
    2
    Code (Text):
    1. break;
    To
    Code (Text):
    1. break
    this is lua not C++
     
  6. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    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
     
  7. Doitforthegains

    Doitforthegains Active Member

    Joined:
    Aug 30, 2014
    Messages:
    192
    Likes Received:
    53
    Best Answers:
    0
    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.
     
  8. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    Alright i'll look into this script again just for you hahah
     
    Doitforthegains likes this.
  9. Doitforthegains

    Doitforthegains Active Member

    Joined:
    Aug 30, 2014
    Messages:
    192
    Likes Received:
    53
    Best Answers:
    0
  10. cesar10

    cesar10 Active Member

    Joined:
    Aug 4, 2009
    Messages:
    418
    Likes Received:
    36
    Best Answers:
    0
    Now make it so you cant have money on depot kappa
     
  11. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    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.
     
  12. cesar10

    cesar10 Active Member

    Joined:
    Aug 4, 2009
    Messages:
    418
    Likes Received:
    36
    Best Answers:
    0
    *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
     
  13. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    special feature =)
     
    cesar10 likes this.
  14. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,768
    Likes Received:
    576
    Best Answers:
    10
    no updates? same error :)
     
  15. strutZ

    strutZ Australian OT Member {AKA Beastn}

    Joined:
    Nov 16, 2014
    Messages:
    1,244
    Likes Received:
    440
    Best Answers:
    1
    soon little one ;)
     
  16. StreamSide

    StreamSide Joseluis Gonzalez

    Joined:
    Aug 31, 2007
    Messages:
    2,768
    Likes Received:
    576
    Best Answers:
    10
    when?
     
  17. Tinkz

    Tinkz Member

    Joined:
    Feb 14, 2012
    Messages:
    83
    Likes Received:
    9
    Best Answers:
    1
    @strutZ Could you perhaps put something in the code that only allows people to drop gold from bank only if they are "x" levell.
     
  18. elia3343

    elia3343 Hoster

    Joined:
    Oct 22, 2014
    Messages:
    154
    Likes Received:
    7
    Best Answers:
    0
    0.4?? make it!
     

Share This Page

Loading...