Jump to content

Santa Hat For New Players (Christmas Gift).


Devlin

Recommended Posts

Hello everyone!

 

Since christmas are on the way, I thought an idea. Every time that you create a character, character will equip a santa hat.

 

Coded on aCis.

 

sz0F5c2.jpg

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (revision 6)
+++ java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (working copy)
@@ -168,6 +168,16 @@
  }
  }**/
  
+ if (Config.ALLOW_SANTA_HAT_ON_NEW_CHARACTERS)
+ {
+ L2ItemInstance item = newChar.getInventory().addItem("Init", 7836, 1, newChar, null);
+ if (item.isEquipable())
+ {
+ if (newChar.getActiveWeaponItem() == null || !(item.getItem().getType2() != L2Item.TYPE2_ACCESSORY))
+ newChar.getInventory().equipItemAndRecord(item);
+ }
+ }
+
  for (L2SkillLearn skill : SkillTreeTable.getInstance().getAvailableSkills(newChar, newChar.getClassId()))
  {
  newChar.addSkill(SkillTable.getInstance().getInfo(skill.getId(), skill.getLevel()), true);
Index: config/custom.properties
===================================================================
--- config/custom.properties (revision 25)
+++ config/custom.properties (working copy)
@@ -146,4 +146,7 @@
 # Remove cubics on death.
 RemoveCubicsOnDeath = False
 # Remove debuffs on death.
-RemoveDebuffsOnDeath = True
\ No newline at end of file
+RemoveDebuffsOnDeath = True
+
+# Santa hat for new players.
+AllowSantaHatOnNewCharacters = True
\ No newline at end of file
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 25)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -771,6 +771,8 @@
 
  public static boolean REMOVE_CUBICS_ON_DEATH;
  public static boolean REMOVE_DEBUFFS_ON_DEATH;
+
+ public static boolean ALLOW_SANTA_HAT_ON_NEW_CHARACTERS;
  
  // --------------------------------------------------
  
@@ -899,6 +901,8 @@
             
          REMOVE_CUBICS_ON_DEATH = custom.getProperty("RemoveCubicsOnDeath", true);
          REMOVE_DEBUFFS_ON_DEATH = custom.getProperty("RemoveDebuffsOnDeath", true);
+         
+         ALLOW_SANTA_HAT_ON_NEW_CHARACTERS = custom.getProperty("AllowSantaHatOnNewCharacters", true);
  // ...
  
  // Clans settings
Edited by Devlin
Link to comment
Share on other sites

+ if (item.isEquipable())
+ {
+ if (newChar.getActiveWeaponItem() == null || !(item.getItem().getType2() != L2Item.TYPE2_ACCESSORY))
+ newChar.getInventory().equipItemAndRecord(item);
+ }
+ }
+

 

this is useless, since the santa hat is always TYPE2_ACCESSORY && isEquipable

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.


  • Posts

    • L2KiSS custom updater 😎 Thank You for using my support 🙏    
    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
    • I wonder, is security under consideration, at all? At the very least, they would need to have the SQL table structure of your already-implemented system or some other table and write access to it, which leaves you exposed to exploits and foul play. Just for context, you don't need the source to make core corrections, if we are talking about java-based projects.
    • Best defense is a good offense, right, gypsy? You're marked as a scammer everywhere! Guys, be careful dealing with this guy. Why'd you change your Discord, huh? :))
  • Topics

×
×
  • Create New...