Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [Lineage] Java Mods (https://secretexperience.net/forumdisplay.php?f=636)
-   -   [Outros] Skill Sistema VIP (https://secretexperience.net/showthread.php?t=34238)

Setokaiba 01-10-2013 10:30 PM

Skill Sistema VIP
 
Código:

Index: L2PcInstance.java
===================================================================
--- L2PcInstance.java  (revision 3765)
+++ L2PcInstance.java  (working copy)
@@ -2251,7 +2251,16 @@
 
            if (_log.isDebugEnabled() && skill != null) _log.debug("removed skill 'Lucky' from " + getName());
        }
-
+                if(isCharViP())
+                {
+                    L2Skill vipskill = SkillTable.getInstance().getInfo(id, lvl);
+                    addSkill(vipskill); // not saved to DB
+                }
+                if (!isCharViP())
+            {
+                L2Skill vipskill = SkillTable.getInstance().getInfo(id, lvl);
+                removeSkill(vipskill);
+            }
        // Calculate the current higher Expertise of the L2PcInstance
        for (int i = 0; i < EXPERTISE_LEVELS.length; i++)
        {


RedHoT 02-10-2013 05:28 PM

Este código não é o sistema VIP em si. É apenas um complemento que adiciona skills customizadas para os jogadores que possuirem este status.

O sistema VIP da L2jFree (que seria o código adequado para adicionar este complemento) é este:
Spoiler

Código:

Index: /trunk/L2_GameServer_c5/config/options.properties
===================================================================
--- /trunk/L2_GameServer_c5/config/options.properties        (revision 830)
+++ /trunk/L2_GameServer_c5/config/options.properties        (revision 837)
@@ -286,2 +286,9 @@
 # Check and delete unlegit skills on EnterWorld
 CheckSkillsOnEnter = False
+
+# ViP characters configuration
+# Color of ViP's name (Must be RGB html color : 00CCFF = Orange)
+# http://www.immigration-usa.com/html_colors.html
+CharViPSkipSkillsCheck = False
+CharViPAllowColor = False
+CharViPNameColor = 00CCFF
Index: /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
===================================================================
--- /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java        (revision 823)
+++ /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java        (revision 837)
@@ -165,12 +165,16 @@
                GmListTable.getInstance().addGm(activeChar);
        }
-            if(activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
-            {
-                if(Config.CLAN_LEADER_COLORED == Config.ClanLeaderColored.name)
-                    activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
-                else
-                    activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
-            }
-       
+        if(activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)
+        {
+                if(Config.CLAN_LEADER_COLORED == Config.ClanLeaderColored.name)
+                        activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);
+                else
+                        activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);
+        }
+        if (activeChar.isCharViP())
+        {
+                if(Config.CHAR_VIP_COLOR_ENABLED)
+                        activeChar.getAppearance().setNameColor(Config.CHAR_VIP_COLOR);
+        }       
       
        if (Config.PLAYER_SPAWN_PROTECTION > 0)
Index: /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java        (revision 823)
+++ /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java        (revision 837)
@@ -214,5 +214,5 @@
 
    private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,str=?,con=?,dex=?,_int=?,men=?,wit=?,face=?,hairStyle=?,hairColor=?,heading=?,x=?,y=?,z=?,exp=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,maxload=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,in_jail=?,jail_timer=?,newbie=?,nobless=?,pledge_rank=?,pledge_type=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,banchat_timer=? WHERE obj_id=?";
-    private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, banchat_timer, newbie, nobless, pledge_rank, pledge_type, last_recom_date, academy_lvl, apprentice, sponsor, varka_ketra_ally, clan_join_expiry_time,clan_create_expiry_time FROM characters WHERE obj_id=?";
+    private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, acc, crit, evasion, mAtk, mDef, mSpd, pAtk, pDef, pSpd, runSpd, walkSpd, str, con, dex, _int, men, wit, face, hairStyle, hairColor, sex, heading, x, y, z, movement_multiplier, attack_speed_multiplier, colRad, colHeight, exp, sp, karma, pvpkills, pkkills, clanid, maxload, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, in_jail, jail_timer, banchat_timer, newbie, nobless, pledge_rank, pledge_type, last_recom_date, academy_lvl, apprentice, sponsor, varka_ketra_ally, clan_join_expiry_time,clan_create_expiry_time,charViP FROM characters WHERE obj_id=?";
    private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
    private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
@@ -613,4 +613,7 @@
    /** Store object used to summon the strider you are mounting **/
    private int _mountObjectID = 0;
+   
+    /** character VIP **/
+    private boolean _charViP = false;
 
    private boolean _inJail = false;
@@ -5260,4 +5263,5 @@
 
                player.setNoble(rset.getBoolean("nobless"));
+                player.setCharViP((rset.getInt("charViP")==1) ? true : false);
                player.setPledgeType(rset.getInt("pledge_type"));
                player.setRank(rset.getInt("pledge_rank"));
@@ -6074,4 +6078,7 @@
                        if(skillid>=3000 && skillid<7000)
                                foundskill = true;
+                        //exclude VIP character
+                if(isCharViP() && Config.CHAR_VIP_SKIP_SKILLS_CHECK)
+                    foundskill = true;
                        // remove skill and do a lil log message
                        if(!foundskill)
@@ -6079,5 +6086,5 @@
                                removeSkill(skill);
                                sendMessage("Skill " + skill.getName() +" removed and gm informed!");
-                                _log.fatal("Cheater! - Character " + getName() +" of Account " + getAccountName() + " got skill " + skill.getName() +" removed!");
+                                _log.fatal("Cheater! - Character " + getName() +" of Account " + getAccountName() + " VIP status :" +isCharViP()+ " got skill " + skill.getName() +" removed!");
                        }
                }
@@ -10067,4 +10074,20 @@
        }
    }
+   
+    /**
+    * Set the _charViP Flag of the L2PcInstance.<BR><BR>
+    */
+    public void setCharViP(boolean status)
+    {
+        _charViP = status;
+    }
+
+    /**
+    * Return True if the L2PcInstance is a ViP.<BR><BR>
+    */
+    public boolean isCharViP()
+    {
+        return _charViP;
+    }
 
    private ScheduledFuture _jailTask;
Index: /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/Config.java
===================================================================
--- /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/Config.java        (revision 830)
+++ /trunk/L2_GameServer_c5/src/main/java/net/sf/l2j/Config.java        (revision 837)
@@ -924,4 +924,9 @@
    public static int      CLAN_LEADER_COLOR;
    public static int      CLAN_LEADER_COLOR_CLAN_LEVEL;
+   
+    /** VIP Characters configuration */
+    public static boolean  CHAR_VIP_SKIP_SKILLS_CHECK;
+    public static boolean  CHAR_VIP_COLOR_ENABLED;
+    public static int      CHAR_VIP_COLOR;
 
    /** 
@@ -1362,4 +1367,9 @@
                SHOW_HTML_WELCOME              = Boolean.parseBoolean(optionsSettings.getProperty("ShowHTMLWelcome", "false"));
                USE_SAY_FILTER                  = Boolean.parseBoolean(optionsSettings.getProperty("UseSayFilter", "false"));
+               
+                CHAR_VIP_SKIP_SKILLS_CHECK                = Boolean.parseBoolean(optionsSettings.getProperty("CharViPSkipSkillsCheck", "false"));
+                CHAR_VIP_COLOR_ENABLED                        = Boolean.parseBoolean(optionsSettings.getProperty("CharViPAllowColor", "false"));
+                CHAR_VIP_COLOR                                        = Integer.decode("0x" + optionsSettings.getProperty("CharViPNameColor", "00CCFF"));
+               
                if(USE_SAY_FILTER){
                    try{

Código:

Index: /trunk/L2_DataPack_c5/sql/characters.sql
===================================================================
--- /trunk/L2_DataPack_c5/sql/characters.sql        (revision 753)
+++ /trunk/L2_DataPack_c5/sql/characters.sql        (revision 838)
@@ -83,4 +83,5 @@
  clan_join_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
  clan_create_expiry_time DECIMAL(20,0) NOT NULL DEFAULT 0,
+  charViP decimal(1,0) NOT NULL DEFAULT 0,
  PRIMARY KEY  (obj_Id),
  KEY `clanid` (`clanid`)



Horários baseados na GMT -3. Agora são 12:54 AM.

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