1. These forums are being retired. Please ask all questions and help threads and any other type of discussions on GitHub. During this time, new threads and user registrations have been disabled.

2.1 Permabuffs 4.1.0

A TShock plugin to provide auto-renewing buffs for server players.

  1. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Permabuffs
    by Zaicon
    [ApiVersion(1,16)]​
    A TShock plugin to provide auto-renewing buffs for server players.

    Terraria Version 1.2.4.1
    Plugin Version 3.2.0.0

    Features:
    • When active, any buff is auto-renewed until the command is turned off.
    • This includes player buffs being saved even if the server is shut down.
    • Buffs are split into positive buffs, negative buffs (debuffs), and pet buffs, allowing you to only let players use one type of buff.
    • For pet buffs, the pet is NOT auto-renewed, since there is no time limit for pets.
    • For staff, there is a command to view which permabuffs players have active.
    • There are also global buffs, which affect anyone on the server at the time.
    Permissions:
    • pb.buff: Allows a player to permabuff him/herself with any postive, non-pet buff.
    • pb.pet: Allows a player to buff him/herself with any pet/mount buff.
    • pb.debuff: Allows a player to debuff him/herself.
    • pb.check: Allows a player to use /buffcheck.
    • pb.clear: Allows a player to deactivate all active buffs.
    • pb.global: Allows a player to set global buffs.
    Commands:
    • /permabuff <buff name or id>: Activates the specified buff.
    • /buffcheck <player>: Gives a list of permabuffs that the specified player has active.
    • /gpermabuff <buff name or id> <player>: Activates the specified buff for the specified player.
    • /globalbuff <buff name or id>: Activates or deactivates a global buff.
    • /clearbuffs [all]: Deactivates all active buffs for the player (or all players if "all" is used as a parameter.
    Links:
    Future:
    • Add config customization (for example, let server owners define their own groups (instead of just positive & pet groups)
    • Add offline saving for global buffs, and the ability to disable all global buffs
    • Add region buffs?
    -----

    Well, here is my first public plugin. If you notice any bugs, typos, or just inefficient code, let me know. Ideas for how to expand this plugin are also welcome.
     
    • Like Like x 7
  2. IcyPhoenix

    TShock Contributor

    Joined:
    Jul 27, 2012
    Messages:
    367
    Please don't hook onto OnUpdate, and use a timer for this. Because you seriously don't need to check this every update (since you are literally running the check 60 times a second), just have a reoccurring timer that buffs for 3 seconds that checks every second (to account for lag/delay)
     
  3. Patrikk

    TShock Mod TShock Contributor Plugin Developer

    Joined:
    May 25, 2012
    Messages:
    104
    Nice one man, keep it up! ^^
     
  4. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
  5. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    New Update (v2.2.2.3)
    • Added debuffs
    • Added /gpermabuff for staff
    • Implemented the above suggestions (timers, built-in buff converters)
     
  6. specialops0

    Plugin Developer

    Joined:
    Jul 29, 2013
    Messages:
    415
    Have you thought about updating it so if a staff member logs off permabuffed and comes back on the server will see that player has logged on and give them permabuff again?
     
  7. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    New Update (v3.1.0.0)
    • Added support for renewing buffs even after being offline (I was getting there >.>)
    • Added /clearbuffs, which deactivates all active buffs (including offline players)
     
  8. Merlany

    Merlany Level 1

    Joined:
    Jul 31, 2014
    Messages:
    13
    Could you please add a command to trigger global permabuffs? As in, /apermabuff "Well Fed" would give the entire server permanent Well Fed until /aclearbuff "Well Fed" was used?
     
  9. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    New Update (v3.2.0.0)
    • Added /globalbuff, which does exactly what it sounds like. Global buffs aren't saved if the server shuts down, though.
     
    • Like Like x 2
  10. Merlany

    Merlany Level 1

    Joined:
    Jul 31, 2014
    Messages:
    13
    Any ways to turn that off, too? Simply use it again? I'm sorry to have to ask but i can't test it here because this isn't my PC >.>
     
  11. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Yes, just use it again to turn the buff off.
     
    • Like Like x 1
  12. Ijwu

    Ijwu Level 11

    Joined:
    Apr 4, 2012
    Messages:
    647
    Approved
     
  13. Ordinary Hotdog

    Ordinary Hotdog Level 0

    Joined:
    Aug 27, 2014
    Messages:
    1
    The Github link is broken?? Please fix this! :(
     
  14. Olink

    Olink Admin note: Actually a really nice person now

    Joined:
    Jul 21, 2011
    Messages:
    1,397
    I dont get why people still put the binary in the repo, just make a release, it makes it much easier.
     
    • Like Like x 1
  15. DeRedPanda

    DeRedPanda Level 0

    Joined:
    Nov 30, 2014
    Messages:
    2
    Hi Mr. Zaicorn. I used the permabuff for Inferno. It worked fine, but when I tried to use /clearbuffs, I received an error and was told to look at the logs. I tried with different buffs and it never cleared them. This is what the logs said:
    http://pastebin.com/HdVum8BC
     
  16. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Fixed. I also changed /clearbuffs to clear only your own buffs (previously, you had to remove each individual permabuff). You can use /clearbuffs * (or /clearbuffs all) to clear everyone's buffs, if you have the permission to.
     
    • Like Like x 1
  17. DeRedPanda

    DeRedPanda Level 0

    Joined:
    Nov 30, 2014
    Messages:
    2
    Working like a charm. Thank you!
     
  18. ElleKitty

    ElleKitty Level 0

    Joined:
    Dec 14, 2014
    Messages:
    3
    Hello! I like this plugin. I registered to report an issue wiff it. It's a bit of a deal-breaker for me.

    I used permabuff commands to give buffs to my current character (Anne) and it works, but only until my friend (Santa) logs in. When Santa logs in, he gets all of my permabuffs, and my own buffs begin to expire. When I do the /buffcheck command on the two of us, the command reports that permabuffs are still mine, and that Santa does not have any permabuffs assigned.

    I used both /permabuff personally, and /gpermabuff from server, the same thing happened.

    The buffs I used were Shine, Nightowl, Spelunker. Cant let the little guys run around freely with those!

    When I checked for Tshock's /players , I could see that Santa is listed ABOVE Anne, so my guess is that Santa somehow took my slot, and is thus getting my permabuffs.

    He was inserted before me in the list when he logged in after me. Then I logged out and logged back in myself, to see if our spots will switch based on our login order, but he was still in front of me. I dont know how Tshock sorts players. Maybe he is before me in the list because his IP begins with 88 and mine begins with a local 192. Maybe Tshock sorts by groups and superadmins go last. At any rate, whenever Santa logs in, he gets my adminny buffs, and I lose all of mine.

    To sum up, this plugin can somehow give permabuffs to the wrong players on a server, while still reporting that the correct player has them!

    P.S. Looking forward to saving permabuffs across sessions, and having per-group permabuffs, although it's not as essential!
     
  19. Zaicon

    Zaicon Spam Cleaner 9000
    TShock Mod Plugin Developer

    Joined:
    Feb 15, 2014
    Messages:
    811
    Is 'Santa' is logging in with the same account as 'Anne'?
     
  20. ElleKitty

    ElleKitty Level 0

    Joined:
    Dec 14, 2014
    Messages:
    3
    We arent using any login accounts, just enter server and play; I even /auth once every session (it's actually LESS typing than a full login!). This is because I only have 2-3 players total (whom i trust) and only by personal invite, so memberships and permissions and logins would be an overkill. I'd like to mention that none of those players are local, if that matters for anything; they all come from external IPs.