Jump to content

Recommended Posts

Posted (edited)

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
Posted

+ 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

  • 2 weeks later...
Posted

Locked.

 

 


- Do not post simple java strings or stupid Configuring Codes. Such topics will be immediately locked.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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