Jump to content
Sign in to follow this  
Hideki

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

Recommended Posts

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.

 

9przb6.jpgmu8hm1.jpg

  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")
    SQL
    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

    CODE
    #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)

    CODE
    // 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:

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

    CODE
    set .@BG_CHARID, 165100; // character named "Battleground"
    - (line 43) set .@BG_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

 

 

credits:
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.