Sign in to follow this  
Followers 0

bg_consume mapflag, "Battleground's items" that can only be used in BG

8 posts in this topic

This source modification adds a new mapflag: bg_consume, and adds an NPC (Telma) 
that sells consumable items which can only be used on maps with the 'bg_consume' mapflag.



  1. download and apply this diff patch: battlegroud.diff

create a char named "Battleground"
First you should check if that name exists:- delete their char, then create a new one

  •  use a different name
  • use the existing char (WARNING: if they rename the char named "Battleground", it will rename the "Battleground's items" too! If they delete the char named "Battleground", they will become "Unknown's item".)

When you are ready to create the char named "Battleground", use this SQL query:


  1. SQL
    INSERT INTO `char` (`name`) VALUES ('Battleground');
  2. make note of the char_id (of the char named "Battleground")
    SELECT char_id FROM `char` WHERE `name`='Battleground';
    Write this down somewhere or remember it for the next steps.
  3. edit source
    - open /src/map/battleground.h

    #define BG_CHARID 165100 // char named "Battleground"
    #define BG_TRADE 91 // trade mask of BG consumables
    - set BG_CHARID to the char_id from step #3
    - set BG_TRADE to the trade mask (trade restrictions) you want for Battleground's consumables
    (trade bits are the same as /db/item_trade.txt)

    // Trading mask values:
    // 1: Item can't be dropped
    // 2: Item can't be traded (nor vended)
    // 4: Wedded partner can override restriction 2.
    // 8: Item can't be sold to npcs
    // 16: Item can't be placed in the cart
    // 32: Item can't be placed in the storage
    // 64: Item can't be placed in the guild storage

    If you want BG potions to be ranked (ranked Condensed White Potions, ranked Blue Potions, etc.), 
    open /src/map/pc.c and uncomment this:

    // else if(BG_CHARID == char_id)
    // return 5;
  4. edit NPC script (Telma)
    - open /npc/battleground/bg_supplier.txt

    set [email protected]_CHARID, 165100; // character named "Battleground"
    - (line 43) set [email protected]_CHARID to the char_id from step #3
    - (lines 25-39) edit the menu/prices to your liking
    - (line 88) add the 'bg_consume' mapflag to any other maps you want to allow "Battleground's consumables" to be used on

  5. Save and close all files. Recompile.




Compatible Hercules/rAthena/eAthena



The original idea is from someone else, I'm just not sure who. It started in 2009 when a player showed us screenshots (from another server) of the Telma NPC and asked if we could implement something similar--Battleground's consumables that could only be used in BG. Based on the screenshots, I came up with this. Since then, several people have asked about it on eAthena but I was too lazy to update it so I just linked them to our old SVN/Trac. Finally I updated it, and here it is!

Thanks again to whoever came up with the idea!

Edited by AnnieRuru

Share this post

Link to post
Share on other sites

Very nice release! I know this feature comes with eAmod and similar, so it's possible either that player took the idea from Zephyrus' package (which is absolutely legal) or that Zeph took that same idea from elsewhere and coded it, but as long as I remember the adjustments of this feature on eAmod is in a conf file.


It's quite a helpful release, I've seen tons of servers craving to only have this mod from eAmod, so it's quite useful. Thank you for your release!

Share this post

Link to post
Share on other sites

I'm glad you like it


This helps for those who have not zephyrus Mod.
People who have some kind of problem, do not hesitate to report.



Share this post

Link to post
Share on other sites

Can someone please fix it to new revision?


Please update it for new Hercules version.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0