Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [Lineage] Java Mods (https://secretexperience.net/forumdisplay.php?f=636)
-   -   [L2JServer] Vip Skills (https://secretexperience.net/showthread.php?t=33129)

allanalcantara 30-10-2011 02:55 AM

Vip Skills
 
Código:

EnableVipSystem = True
# List of Vip Skills
# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
VipSkills = 395,1


Config.java:
public static boolean ENABLE_VIP_SYSTEM;
public static Map<Integer, Integer> VIP_SKILLS;

+                                      ENABLE_VIP_SYSTEM = Boolean.parseBoolean(L2JWarsCustom.getProperty("EnableVipSystem", "True"));
+                                      //if(ENABLE_VIP_SYSTEM) //create map if system is enabled
+                                      {
+                                              String[] VipSkillsSplit = L2JWarsCustom.getProperty("VipSkills", "").split(";");
+                                              VIP_SKILLS = new FastMap<Integer, Integer>(VipSkillsSplit.length);
+                                              for (String skill : VipSkillsSplit)
+                                              {
+                                                      String[] skillSplit = skill.split(",");
+                                                      if (skillSplit.length != 2)
+                                                      {
+                                                              System.out.println("[Vip System]: invalid config property in L2JWarsCustom.properties -> VipSkills \"" + skill + "\"");
+                                                      }
+                                                      else
+                                                      {
+                                                              try
+                                                              {
+                                                                      VIP_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
+                                                              }
+                                                              catch (NumberFormatException nfe)
+                                                              {
+                                                                      if (!skill.equals(""))
+                                                                      {
+                                                                              System.out.println("[Vip System]: invalid config property in L2JWarsCustom.properties -> VipSkills \"" + skillSplit[0] + "\"" + skillSplit[1]);
+                                                                      }
+                                                              }
+                                                      }
+                                              }
+                                      //}


java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminVip.java:
public void doVip(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time)

+_player.rewardVipSkills();
_player.broadcastUserInfo();
_player.sendPacket(new EtcStatusUpdate(_player));
+_player.sendSkillList();

public void removeVip(L2PcInstance activeChar, L2PcInstance _player, String _playername)

+_player.lostVipSkills();
_player.broadcastUserInfo();
_player.sendPacket(new EtcStatusUpdate(_player));
+_player.sendSkillList();


PcInstance.java:
        public void setVip(boolean val)
        {
                _isVip = val;
-             
+
        }
-     
+
+      public void rewardVipSkills()
+      {
+              L2Skill skill;
+              for(Integer skillid : Config.VIP_SKILLS.keySet())
+              {
+                      int skilllvl = Config.VIP_SKILLS.get(skillid);
+                      skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
+                      if(skill != null)
+                      {
+                              addSkill(skill, true);
+                      }
+              }
+              sendMessage("GM give to you Vip's skills");
+      }
+
+      public void lostVipSkills()
+      {
+              L2Skill skill;
+              for(Integer skillid : Config.VIP_SKILLS.keySet())
+              {
+                      int skilllvl = Config.VIP_SKILLS.get(skillid);
+                      skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
+                      removeSkill(skill);
+              }
+      }
+

Créditos : Paulinho Souza.


Horários baseados na GMT -3. Agora são 11:28 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.