Jump to content

Recommended Posts

Posted (edited)

Custom Race Starting Items v1

 

# New players Starting Items ( Human )
# Default: False
EnableHumanReward = False
# Human Fighter
HumanFighterHelmID = 
HumanFighterChestID = 
HumanFighterLegsID = 
HumanFighterBootsID = 
HumanFighterGlovesID = 
HumanFighterWeaponID = 
# Human Mage
HumanMageHelmID = 
HumanMageChestID = 
HumanMageLegsID = 
HumanMageBootsID = 
HumanMageGlovesID = 
HumanMageWeaponID = 

# New players Starting Items ( Elf )
# Default: False
EnableElfReward = False
# Elf Fighter
ElfFighterHelmID = 
ElfFighterChestID = 
ElfFighterLegsID = 
ElfFighterBootsID = 
ElfFighterGlovesID = 
ElfFighterWeaponID = 
# Elf Mage
ElfMageHelmID = 
ElfMageChestID = 
ElfMageLegsID = 
ElfMageBootsID = 
ElfMageGlovesID = 
ElfMageWeaponID = 

# New players Starting Items ( DarkElf )
# Default: False
EnableDEReward = False
# DarkElf Fighter
DEFighterHelmID = 
DEFighterChestID = 
DEFighterLegsID = 
DEFighterBootsID = 
DEFighterGlovesID = 
DEFighterWeaponID = 
# DarkElf Mage
DEMageHelmID = 
DEMageChestID = 
DEMageLegsID = 
DEMageBootsID = 
DEMageGlovesID = 
DEMageWeaponID = 

# New players Starting Items ( Orc )
# Default: False
EnableOrcReward = False
# Orc Fighter
OrcFighterHelmID = 
OrcFighterChestID = 
OrcFighterLegsID = 
OrcFighterBootsID = 
OrcFighterGlovesID = 
OrcFighterWeaponID =
# Orc Mage
OrcMageHelmID = 
OrcMageChestID = 
OrcMageLegsID = 
OrcMageBootsID = 
OrcMageGlovesID = 
OrcMageWeaponID = 

# New players Starting Items ( Dwarf )
# Default: False
EnableDwarfReward = False
# Dwarf Fighter
DwarfFighterHelmID = 
DwarfFighterChestID = 
DwarfFighterLegsID = 
DwarfFighterBootsID = 
DwarfFighterGlovesID = 
DwarfFighterWeaponID = 

http://pastebin.com/ywGtFmGY

 

 

Credits : (Me) iSparky

Edit: Ignore this :P

 

@@ -233,8 +498,7 @@
               
                // Shortcuts
                newChar.registerShortCut(new L2ShortCut(0, 0, 3, 2, -1, 1)); // Attack
-               newChar.registerShortCut(new L2ShortCut(3, 0, 3, 5, -1, 1)); // Take
-               newChar.registerShortCut(new L2ShortCut(10, 0, 3, 0, -1, 1)); // Sit
+               newChar.registerShortCut(new L2ShortCut(1, 0, 3, 5, -1, 1)); // Take
               
                final ItemTable itemTable = ItemTable.getInstance();
                final L2Item[] items = template.getItems();
Edited by iSparky
Posted (edited)

Can you message me the better way ? :)

At me works like this :P

I know i can do it like this:

if (newChar.getRace() == Race.human || newChar.isMageClass())
{
newChar.getInventory().addItem("Start Human Mage Item", Config.HUMAN_M_HELM_ID, Config.REWARD_COUNT, newChar, null);
}
else
{
newChar.getInventory().addItem("Start Human Fighter Item", Config.HUMAN_F_HELM_ID, Config.REWARD_COUNT, newChar, null);
}

But i want to Equip this items :D

Edited by iSparky
Posted

bad coded , too much configs also but still a nice idea.. Everybody has their programming style. Others prefer a straight short code and others they achieve their idea circleing the code.. Well as an exercise its good but if you want to apply that on a project you must organize it a bit. I am not a good coder too i also sometimes add strange methods and using useless stuff.. Exercising its the best option.. Thanks for these share.

Posted (edited)

It is a good idea for starting items for each class...

But maybe is more "clean", if you put fewer lines.

For example, make all fighter race to get the same items, apart of weapon if you want.

And the same on mage...

or something better, make 2 item with name "Fighter Items" or "Mage Items" give this in inventory, and then, with 2 click give all that you want... (with class check for item).

Edited by 'Baggos'
Posted

 

or something better, make 2 item with name "Fighter Items" or "Mage Items" give this in inventory, and then, with 2 click give all that you want... (with class check for item).

 

Trust me i have do that on Live server and some people ask me "Gm why i have no items -.-"

 

and if you put items at inventory they never open the bag to watch starting items ;)

 

i think its a better way to equip the items :)

Posted (edited)

On part with fewer lines:

Do something like that... I do not give a try if will be work exactly so, just i give you my idea for fewer lines.

 

Ingore the Items... is a example...

Because i like your idea, i want to you find a easy way...

if (Config.STARTINGS_ITEMS_RACES)
   {
  if (!newChar.isMageClass())
  {
  if (newChar.getRace() == Race.Human)
        {
         newChar.getInventory().addItem("Angel Slayer", 6367, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Light", 6379, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Boots", 6380, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Gloves", 6381, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Helmet", 6382, 1, newChar, newChar);
         newChar.getInventory().addItem("TEO Necklace", 920, 1, newChar, newChar );
         newChar.getInventory().addItem("TEO Earring", 858, 2, newChar, newChar);
         newChar.getInventory().addItem("TEO Ring", 889, 2, newChar, newChar );
        }
  if (newChar.getRace() == Race.Elf)
        {
         newChar.getInventory().addItem("Angel Slayer", 6367, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Light", 6379, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Boots", 6380, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Gloves", 6381, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Helmet", 6382, 1, newChar, newChar);
         newChar.getInventory().addItem("TEO Necklace", 920, 1, newChar, newChar );
         newChar.getInventory().addItem("TEO Earring", 858, 2, newChar, newChar);
         newChar.getInventory().addItem("TEO Ring", 889, 2, newChar, newChar );
         }
   if (newChar.getRace() == Race.DarkElf)
        {
         newChar.getInventory().addItem("Angel Slayer", 6367, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Light", 6379, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Boots", 6380, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Gloves", 6381, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Helmet", 6382, 1, newChar, newChar);
         newChar.getInventory().addItem("TEO Necklace", 920, 1, newChar, newChar );
         newChar.getInventory().addItem("TEO Earring", 858, 2, newChar, newChar);
         newChar.getInventory().addItem("TEO Ring", 889, 2, newChar, newChar );
         }
   if (newChar.getRace() == Race.Orc)
        {
         newChar.getInventory().addItem("Angel Slayer", 6367, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Light", 6379, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Boots", 6380, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Gloves", 6381, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Helmet", 6382, 1, newChar, newChar);
         newChar.getInventory().addItem("TEO Necklace", 920, 1, newChar, newChar );
         newChar.getInventory().addItem("TEO Earring", 858, 2, newChar, newChar);
         newChar.getInventory().addItem("TEO Ring", 889, 2, newChar, newChar );
         }
  
   if (newChar.getRace() == Race.Dwarf)
        {
         newChar.getInventory().addItem("Angel Slayer", 6367, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Light", 6379, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Boots", 6380, 1, newChar, newChar);
         newChar.getInventory().addItem("Dragonic Gloves", 6381, 1, newChar, newChar );
         newChar.getInventory().addItem("Dragonic Helmet", 6382, 1, newChar, newChar);
         newChar.getInventory().addItem("TEO Necklace", 920, 1, newChar, newChar );
         newChar.getInventory().addItem("TEO Earring", 858, 2, newChar, newChar);
         newChar.getInventory().addItem("TEO Ring", 889, 2, newChar, newChar );
         }
  
   else
        {
         newChar.getInventory().addItem("Arcana Mace Acumen", 6608, 1, newChar, newChar);
         newChar.getInventory().addItem("DC Robe", 2407, 1, newChar, newChar );
         newChar.getInventory().addItem("DC Gloves", 5767, 1, newChar, newChar);
         newChar.getInventory().addItem("DC Boots", 5779, 1, newChar, newChar );
         newChar.getInventory().addItem("DC Helmet", 512, 1, newChar, newChar);
         newChar.getInventory().addItem("TEO Necklace", 920, 1, newChar, newChar );
         newChar.getInventory().addItem("TEO Earring", 858, 2, newChar, newChar);
         newChar.getInventory().addItem("TEO Ring", 889, 2, newChar, newChar );
        }
Edited by 'Baggos'
Posted

If you want a clean code, use xml... for example:

<?xml version="1.0" encoding="UTF-8"?>
<list>
    <template race="-1" classId="-1">
        <equipment slot="rhand" item="12345"/>
        <equipment slot="lhand" item="12345"/>
        <inventory>
            <item id="1234" count="12313" />
            <item id="567" count="2222" />
        </inventory>
        <shortCut slot="1" page="1" type="1" id="5555" level="-1" charType="1">
    </template>
</list>

Everything is optional and gives a lot more flexibility... you can set an default template which will be used by all races, you can define an special template for a specific race/class while all others uses the default, you can inherit an template and so on... the only limit will be your imagination :lol:

Posted

If you want a clean code, use xml... for example:

<?xml version="1.0" encoding="UTF-8"?>
<list>
    <template race="-1" classId="-1">
        <equipment slot="rhand" item="12345"/>
        <equipment slot="lhand" item="12345"/>
        <inventory>
            <item id="1234" count="12313" />
            <item id="567" count="2222" />
        </inventory>
        <shortCut slot="1" page="1" type="1" id="5555" level="-1" charType="1">
    </template>
</list>

Everything is optional and gives a lot more flexibility... you can set an default template which will be used by all races, you can define an special template for a specific race/class while all others uses the default, you can inherit an template and so on... the only limit will be your imagination :lol:

Yes... A better way... and equipment items! ;)

Posted

well i will exlain you what i was saying,

there will be a loop for the ids of an array. ( ids will be all ids for mage class for example )

 

on this loop you will add on players inventory one by one the items using .getInventory().addItem(..blabla.) and then force them to auto equip on character using .getInventory().equipItem(id here);

you will propably need also inventory update and broadcastUserInfo each time you loop.

 

its just an idea, and code will be much better, try it alone and if you cant do it, i will help you!

Posted

As I said before, there is no need for equip part, since it's already there, few lines below :P

 

 

            if (item.isEquipable())
            {
                if (newChar.getActiveWeaponItem() == null || !(item.getItem().getType2() != Item.TYPE2_WEAPON))
                    newChar.getInventory().equipItemAndRecord(item);
            }

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



  • Posts

    • 🔥 L2NeverPain – Opening this Friday! 🔥 The gates open 12 December 2025 – 20:00 (GMT+2). Prepare your squads, set your macros, and get ready for true StuckSub PvP.   Main +2 Sub. Balanced fights. Fresh start. Be there from the first minute.   🛡️Clan Leaders: You can register your clan on discord clan-register channel   🌐https://l2neverpain.com/ 🌐https://discord.gg/kNP3UXgkmN
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • why is he still not banned? scammer
    • Complete verification on the services you need and unlock new earning opportunities. Use our newest service in the store: Learn more Active links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock