Ir para conteúdo
  • Cadastre-se
  • 0

Dificuldade com MOD VIP


Michelle

Pergunta

Ola amigos, estou com dificuldades para add esse MOD em meu servidor, mas eu queria apenas o VIP pois já tenho MOD AIO configurado, não estou conseguindo diferenciar algumas linhas, quais fazem parte do AIO e quais fazem parte do VIP, também não consigo entender esses códigos \n, \n-, \n+, \n@@, se alguém poder me ajudar a add ela em meu servidor eu ficaria muito grata, agradeço desde já a todos, Obrigada. *-*

 

OBS.: Sou nova com Java, desculpem - me pela inocência, mas estou aqui para continuar aprendendo cada dia mais e futuramente poder ajudar o próximo assim como vocês me ajudam.

 

Atenciosamente,

 

Michelle.

 

Segue MOD em SPOILER, mas para melhor entendimento segue a fonte do post abaixo:

Link do MOD: http://www.l2jbrasil.com/index.php?/topic/49050-aio-e-vip-system-by-khayruss/

Adaptado para Interlude, Pagina 2, post #35

 

 

 

 

\n### Eclipse Workspace Patch 1.0
\n#P trunk
\nIndex: L2JFox_CORE/java/it/l2j/fox/gameserver/model/actor/instance/L2PcInstance.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/gameserver/model/actor/instance/L2PcInstance.java (revision 8)
\n+++ L2JFox_CORE/java/it/l2j/fox/gameserver/model/actor/instance/L2PcInstance.java (working copy)
\n@@ -18,8 +18,11 @@
\n*/
\npackage it.l2j.fox.gameserver.model.actor.instance;
\n
\n+import java.sql.Connection;
\nimport java.sql.PreparedStatement;
\nimport java.sql.ResultSet;
\n+import java.text.SimpleDateFormat;
\n+import java.util.ArrayList;
\nimport java.util.Calendar;
\nimport java.util.Iterator;
\nimport java.util.Collection;
\n@@ -215,8 +218,8 @@
\nprivate static final String RESTORE_SKILL_SAVE = "SELECT skill_id,skill_level,effect_count,effect_cur_time, reuse_delay FROM character_skills_save WHERE char_obj_id=? AND class_index=? AND restore_type=? ORDER BY buff_index ASC";
\nprivate static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
\n
\n- 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=?,expBeforeDeath=?,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=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,vip=?,vip_end=? WHERE obj_id=?";
\n- 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, expBeforeDeath, 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, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,vip,vip_end FROM characters WHERE obj_id=?";
\n+ 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=?,expBeforeDeath=?,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=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,vip=?,vip_end=?,aio=?,aio_end=? WHERE obj_id=?";
\n+ 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, expBeforeDeath, 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, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,vip,vip_end,aio=?,aio_end=? FROM characters WHERE obj_id=?";
\n     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";
\n     private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
\n     private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,level=?,class_id=? WHERE char_obj_id=? AND class_index =?";
\n@@ -576,6 +579,10 @@
\n
\n     private boolean _isVip = false;
\nprivate long _vip_endTime = 0;
\n+
\n+ /** Aio System */
\n+ private boolean _isAio = false;
\n+ private long _aio_endTime = 0;
\n
\n/** Event parameters */
\npublic int eventX;
\n@@ -1788,7 +1795,107 @@
\n}
\n}
\n}
\n+
\n+ /**
\n+ * check player skills and remove unlegit ones (excludes hero, noblesse and cursed weapon skills).
\n+ */
\n+ public void checkAllowedSkills()
\n+ {
\n+ boolean foundskill = false;
\n+ if(!isGM())
\n+ {
\n+ Collection<L2SkillLearn> skillTree = SkillTreeTable.getInstance().getAllowedSkills(getClassId());
\n+ // loop through all skills of player
\n+ for(L2Skill skill : getAllSkills())
\n+ {
\n+ int skillid = skill.getId();
\n+ //int skilllevel = skill.getLevel();
\n
\n+ foundskill = false;
\n+ // loop through all skills in players skilltree
\n+ for(L2SkillLearn temp : skillTree)
\n+ {
\n+ // if the skill was found and the level is possible to obtain for his class everything is ok
\n+ if(temp.getId() == skillid)
\n+ {
\n+ foundskill = true;
\n+ }
\n+ }
\n+
\n+ // exclude noble skills
\n+ if(isNoble() && skillid >= 325 && skillid <= 397)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ if(isNoble() && skillid >= 1323 && skillid <= 1327)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // exclude hero skills
\n+ if(isHero() && skillid >= 395 && skillid <= 396)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ if(isHero() && skillid >= 1374 && skillid <= 1376)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // exclude cursed weapon skills
\n+ if(isCursedWeaponEquiped() && skillid == CursedWeaponsManager.getInstance().getCursedWeapon(_cursedWeaponEquipedId).getSkillId())
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // exclude clan skills
\n+ if(getClan() != null && skillid >= 370 && skillid <= 391)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // exclude seal of ruler / build siege hq
\n+ if(getClan() != null && (skillid == 246 || skillid == 247))
\n+ if(getClan().getLeaderId() == getObjectId())
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // exclude fishing skills and common skills + dwarfen craft
\n+ if(skillid >= 1312 && skillid <= 1322)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ if(skillid >= 1368 && skillid <= 1373)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // exclude sa / enchant bonus / penality etc. skills
\n+ if(skillid >= 3000 && skillid < 7000)
\n+ {
\n+ foundskill = true;
\n+ }
\n+
\n+ // remove skill and do a lil log message
\n+ if(!foundskill)
\n+ {
\n+ removeSkill(skill);
\n+
\n+ if(Config.DEBUG){
\n+ //sendMessage("Skill " + skill.getName() + " removed and gm informed!");
\n+ _log.warning("Character " + getName() + " of Account " + getAccountName() + " got skill " + skill.getName() + ".. Removed!"/* + IllegalPlayerAction.PUNISH_KICK*/);
\n+
\n+ }
\n+ }
\n+ }
\n+ skillTree = null;
\n+ }
\n+ }
\n+
\npublic void refreshExpertisePenalty()
\n{
\nint newPenalty = 0;
\n@@ -5467,7 +5574,7 @@
\n                                 "movement_multiplier,attack_speed_multiplier,colRad,colHeight," +
\n                                 "exp,sp,karma,pvpkills,pkkills,clanid,maxload,race,classid,deletetime," +
\n                                 "cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace," +
\n-                                  "base_class,newbie,nobless,power_grade,last_recom_date,vip,vip_end) " +
\n+                                  "base_class,newbie,nobless,power_grade,last_recom_date,vip,vip_end,aio,aio_end) " +
\n"values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
\nstatement.setString(1, _accountName);
\nstatement.setInt(2, getObjectId());
\n@@ -5528,6 +5635,9 @@
\nstatement.setLong(57,System.currentTimeMillis());
\nstatement.setInt(58, isVip() ? 1 :0);
\nstatement.setLong(59, 0);
\n+ statement.setLong(60, 0);
\n+ statement.setInt(61, isAio() ? 1 :0);
\n+ statement.setLong(62, 0);
\nstatement.executeUpdate();
\nstatement.close();
\n}
\n@@ -5704,7 +5814,9 @@
\n
\n                 player.setVip(rset.getInt("vip") == 1 ? true : false);
\n                 player.setVipEndTime(rset.getLong("vip_end"));
\n-            
\n+             player.setAio(rset.getInt("aio") == 1 ? true : false);
\n+             player.setAioEndTime(rset.getLong("aio_end"));
\n+
\n// Add the L2PcInstance object in _allObjects
\n//L2World.getInstance().storeObject(player);
\n
\n@@ -6070,7 +6182,9 @@
\nstatement.setLong(56, getDeathPenaltyBuffLevel());
\nstatement.setInt(57, isVip() ? 1 : 0);
\nstatement.setLong(58, getVipEndTime());
\n- statement.setInt(59, getObjectId());
\n+ statement.setInt(59, isAio() ? 1 : 0);
\n+ statement.setLong(60, getAioEndTime());
\n+ statement.setInt(61, getObjectId());
\n
\nstatement.execute();
\nstatement.close();
\n@@ -10250,6 +10364,114 @@
\n             return _vip_endTime;
\n     }
\n    
\n+     /** Aio System Start */
\n+     public boolean isAio()
\n+     {
\n+             return _isAio;
\n+     }
\n+
\n+     public void setAio(boolean val)
\n+     {
\n+             _isAio = val;            
\n+     }
\n+
\n+     public void rewardAioSkills()
\n+     {
\n+ L2Skill skill;
\n+ for(Integer skillid : Config.AIO_SKILLS.keySet())
\n+     {
\n+ int skilllvl = Config.AIO_SKILLS.get(skillid);
\n+ skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
\n+ if(skill != null)
\n+     {
\n+ addSkill(skill, true);
\n+     }
\n+     }
\n+ sendMessage("GM give to you Aio's skills");
\n+     }
\n+
\n+     public void lostAioSkills()
\n+     {
\n+ L2Skill skill;
\n+ for(Integer skillid : Config.AIO_SKILLS.keySet())
\n+     {
\n+ int skilllvl = Config.AIO_SKILLS.get(skillid);
\n+ skill = SkillTable.getInstance().getInfo(skillid,skilllvl);
\n+ removeSkill(skill);
\n+     }
\n+     }
\n+
\n+     public void setAioEndTime(long val)
\n+     {
\n+ _aio_endTime = val;
\n+     }
\n+
\n+     public void setEndTime(String process, int val)
\n+     {
\n+ if (val > 0)
\n+     {
\n+ long end_day;
\n+ Calendar calendar = Calendar.getInstance();
\n+ if (val >= 30)
\n+     {
\n+     while(val >= 30)
\n+     {
\n+ if(calendar.get(Calendar.MONTH)== 11)
\n+ calendar.roll(Calendar.YEAR, true);
\n+ calendar.roll(Calendar.MONTH, true);
\n+ val -= 30;
\n+     }
\n+     }
\n+     if (val < 30 && val > 0)
\n+     {
\n+ while(val > 0)
\n+     {
\n+ if(calendar.get(Calendar.DATE)== 28 && calendar.get(Calendar.MONTH) == 1)
\n+ calendar.roll(Calendar.MONTH, true);                
\n+ if(calendar.get(Calendar.DATE)== 30)
\n+ {
\n+ if(calendar.get(Calendar.MONTH) == 11)
\n+ calendar.roll(Calendar.YEAR, true);
\n+ calendar.roll(Calendar.MONTH, true);
\n+                                            
\n+ }
\n+ calendar.roll(Calendar.DATE, true);
\n+ val--;
\n+     }
\n+     }
\n+
\n+     end_day = calendar.getTimeInMillis();
\n+     if(process.equals("aio"))
\n+     _aio_endTime = end_day;
\n+     else if(process.equals("vip"))
\n+     _vip_endTime = end_day;
\n+     else
\n+     {
\n+     System.out.println("process "+ process + "no Known while try set end date");
\n+     return;
\n+     }
\n+                     Date dt = new Date(end_day);
\n+                     System.out.println(""+process +" end time for player " + getName() + " is " + dt);
\n+             }
\n+             else
\n+             {
\n+                     if(process.equals("aio"))
\n+                             _aio_endTime = 0;
\n+                     else if(process.equals("vip"))
\n+                             _vip_endTime = 0;
\n+                     else
\n+                     {
\n+                             System.out.println("process "+ process + "no Known while try set end date");
\n+                             return;
\n+                     }
\n+             }
\n+     }
\n+    
\n+     public long getAioEndTime()
\n+     {
\n+ return _aio_endTime;
\n+     }
\n+
\n     public void ClanSkills()
\n     {
\nfor(Iterator i$ = Config.CLAN_SKILLS.keySet().iterator(); i$.hasNext(); broadcastUserInfo())
\n@@ -10269,59 +10491,4 @@
\n     sendMessage("GM give to you all Clan Skills");
\n     }
\n
\n-     public void setEndTime(String process, int val)
\n-     {
\n-             if (val > 0)
\n-             {
\n-                     long end_day;
\n-                     Calendar calendar = Calendar.getInstance();
\n-                     if (val >= 30)
\n-                     {
\n-                             while(val >= 30)
\n-                             {
\n-                                     if(calendar.get(Calendar.MONTH)== 11)
\n-                                             calendar.roll(Calendar.YEAR, true);
\n-                                     calendar.roll(Calendar.MONTH, true);
\n-                                     val -= 30;
\n-                             }
\n-                     }
\n-                     if (val < 30 && val > 0)
\n-                     {
\n-                             while(val > 0)
\n-                             {
\n-                                     if(calendar.get(Calendar.DATE)== 28 && calendar.get(Calendar.MONTH) == 1)
\n-                                             calendar.roll(Calendar.MONTH, true);        
\n-                                     if(calendar.get(Calendar.DATE)== 30)
\n-                                     {
\n-                                             if(calendar.get(Calendar.MONTH) == 11)
\n-                                                     calendar.roll(Calendar.YEAR, true);
\n-                                             calendar.roll(Calendar.MONTH, true);
\n-                                     }
\n-                                     calendar.roll(Calendar.DATE, true);
\n-                                     val--;
\n-                             }
\n-                     }
\n-                     end_day = calendar.getTimeInMillis();
\n-                     if(process.equals("vip"))
\n-                             _vip_endTime = end_day;
\n-                     else
\n-                     {
\n-                             System.out.println("Process " + process + " no Known while try set end date.");
\n-                             return;
\n-                     }
\n-                     Date dt = new Date(end_day);
\n-                     System.out.println("" + process + " end time for player " + getName() + " is " + dt + ".");
\n-             }
\n-             else
\n-             {
\n-                     if(process.equals("vip"))
\n-                             _vip_endTime = 0;
\n-                     else
\n-                     {
\n-                             System.out.println("Process " + process + " no Known while try set end date.");
\n-                             return;
\n-                     }
\n-             }
\n- }
\n-
\n}
\nIndex: L2JFox_CORE/java/it/l2j/fox/gameserver/clientpackets/EnterWorld.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/gameserver/clientpackets/EnterWorld.java (revision 7)
\n+++ L2JFox_CORE/java/it/l2j/fox/gameserver/clientpackets/EnterWorld.java (working copy)
\n@@ -93,7 +93,7 @@
\n
\nprivate static final SimpleDateFormat fmt = new SimpleDateFormat("HH:mm.");
\n     private long _daysleft;
\n-
\n+
\n     SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
\n
\npublic TaskPriority getPriority() { return TaskPriority.PR_URGENT; }
\n@@ -186,6 +186,24 @@
\n             activeChar.restoreEffects();
\n
\n         activeChar.sendPacket(new EtcStatusUpdate(activeChar));
\n+    
\n+     if(activeChar.isVip())
\n+     onEnterVip(activeChar);
\n+    
\n+     if(activeChar.isAio())
\n+     onEnterAio(activeChar);
\n+    
\n+     if(Config.ALLOW_VIP_NCOLOR && activeChar.isVip())
\n+     activeChar.getAppearance().setNameColor(Config.VIP_NCOLOR);
\n+    
\n+     if(Config.ALLOW_VIP_TCOLOR && activeChar.isVip())
\n+     activeChar.getAppearance().setTitleColor(Config.VIP_TCOLOR);
\n+    
\n+     if(Config.ALLOW_AIO_NCOLOR && activeChar.isAio())
\n+     activeChar.getAppearance().setNameColor(Config.AIO_NCOLOR);
\n+    
\n+     if(Config.ALLOW_AIO_TCOLOR && activeChar.isAio())
\n+     activeChar.getAppearance().setTitleColor(Config.AIO_TCOLOR);
\n
\n         // engage and notify Partner
\n         if(Config.L2JMOD_ALLOW_WEDDING)
\n@@ -193,6 +211,9 @@
\n             engage(activeChar);
\n             notifyPartner(activeChar,activeChar.getPartnerId());
\n         }
\n+    
\n+     if(!activeChar.isAio())
\n+     activeChar.checkAllowedSkills();
\n
\n         if (activeChar.getAllEffects() != null)
\n         {
\n@@ -345,6 +366,33 @@
\n         TvTEvent.onLogin(activeChar);
\n}
\n
\n+ private void onEnterAio(L2PcInstance activeChar)
\n+ {
\n+             long now = Calendar.getInstance().getTimeInMillis();
\n+             long endDay = activeChar.getAioEndTime();
\n+             if(now > endDay)
\n+     {
\n+             activeChar.setAio(false);
\n+             activeChar.setAioEndTime(0);
\n+             activeChar.lostAioSkills();
\n+             activeChar.sendMessage("Removed your Aio stats... period ends ");
\n+     }
\n+     else
\n+     {
\n+             Date dt = new Date(endDay);
\n+             _daysleft = (endDay - now)/86400000;
\n+             if(_daysleft > 30)
\n+                     activeChar.sendMessage("Aio period ends in " + df.format(dt) + ". enjoy the Game");
\n+             else if(_daysleft > 0)
\n+                     activeChar.sendMessage("left " + (int)_daysleft + " days for Aio period ends");
\n+             else if(_daysleft < 1)
\n+             {
\n+                     long hour = (endDay - now)/3600000;
\n+                     activeChar.sendMessage("left " + (int)hour + " hours to Aio period ends");
\n+             }
\n+ }
\n+ }
\n+
\nprivate void onEnterVip(L2PcInstance activeChar)
\n{
\n             long curDay = Calendar.getInstance().getTimeInMillis();
\nIndex: L2JFox_CORE/java/config/l2jmods.properties
\n===================================================================
\n--- L2JFox_CORE/java/config/l2jmods.properties (revision 8)
\n+++ L2JFox_CORE/java/config/l2jmods.properties (working copy)
\n@@ -165,3 +165,32 @@
\n
\n# Quantity Rep***tion Points Reward for usage //clanfull
\nRep***tionScore = 10000
\n+
\n+# ---------------------------------------
\n+# Aio System ( By KhayrusS )
\n+# ---------------------------------------
\n+# Enable / Disable Name Color
\n+AllowAioNameColor = True
\n+AioNameColor = 88AA88
\n+# Enable / Disable Title Color
\n+AllowAioTitleColor = True
\n+AioTitleColor = 88AA88
\n+
\n+EnableAioSystem = True
\n+# List of Aio Skills
\n+# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
\n+AioSkills = 1085,3;1304,3;1087,3;1354,1;1062,2;1005,3;1243,6;1045,6;1048,6;
\n+1311,6;168,3;213,8;1007,3;1309,3;1552,3;1006,3;1229,15;1308,3;1253,3;1284,3;
\n+1009,3;1310,4;1363,1;1362,1;1397,3;1292,6;1078,6;307,1;276,1;309,1;274,1;275,1;
\n+272,1;277,1;273,1;311,1;366,1;365,1;310,1;271,1;1242,3;1257,3;1353,3;1391,3;
\n+1352,1;229,7;228,3;1077,3;1218,33;1059,3;1219,33;1217,33;1388,3;1389,3;1240,3;
\n+1086,2;1032,3;1073,2;1036,2;1035,4;1068,3;1003,3;1282,2;1356,1;1355,1;1357,33;
\n+1044,3;1182,3;1191,3;1033,3;1189,3;1259,4;1306,6;234,23;1040,3;364,1;264,1;306,1;
\n+269,1;270,1;265,1;363,1;349,1;308,1;305,1;304,1;267,1;266,1;268,1;1390,3;1303,2;
\n+1204,2;1268,4
\n+
\n+# Ativa ou Desativar a opcao de AIO ganhar Item!
\n+AllowAIOItem = False
\n+
\n+# ID do item que vai ganhar quando virar AIO!
\n+ItemIdAio = 9945
\nIndex: L2JFox_CORE/java/it/l2j/fox/gameserver/handler/admincommandhandlers/AdminAio.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/gameserver/handler/admincommandhandlers/AdminAio.java (revision 0)
\n+++ L2JFox_CORE/java/it/l2j/fox/gameserver/handler/admincommandhandlers/AdminAio.java (working copy)
\n@@ -0,0 +1,248 @@
\n+package it.l2j.fox.gameserver.handler.admincommandhandlers;
\n+
\n+import java.sql.Connection;
\n+import java.sql.PreparedStatement;
\n+import java.sql.SQLException;
\n+import java.util.StringTokenizer;
\n+import java.util.logging.Level;
\n+import java.util.logging.Logger;
\n+
\n+import it.l2j.fox.Config;
\n+import it.l2j.fox.L2DatabaseFactory;
\n+import it.l2j.fox.gameserver.GmListTable;
\n+import it.l2j.fox.gameserver.handler.IItemHandler;
\n+import it.l2j.fox.gameserver.model.L2ItemInstance;
\n+import it.l2j.fox.gameserver.handler.IAdminCommandHandler;
\n+import it.l2j.fox.gameserver.model.L2Object;
\n+import it.l2j.fox.gameserver.model.L2World;
\n+import it.l2j.fox.gameserver.model.actor.instance.L2PcInstance;
\n+import it.l2j.fox.gameserver.network.SystemMessageId;
\n+import it.l2j.fox.gameserver.serverpackets.EtcStatusUpdate;
\n+import it.l2j.fox.gameserver.serverpackets.SystemMessage;
\n+
\n+/**
\n+ * Give / Take Status Aio to Player
\n+ * Changes name color and title color if enabled
\n+ *
\n+ * Uses:
\n+ * setaio [<player_name>] [<time_duration in days>]
\n+ * removeaio [<player_name>]
\n+ *
\n+ * If <player_name> is not specified, the current target player is used.
\n+ *
\n+ *
\n+ * @author KhayrusS
\n+ *
\n+ */
\n+public class AdminAio implements IAdminCommandHandler
\n+{
\n+     private static final int REQUIRED_LEVEL = Config.GM_AIO;
\n+
\n+     private static String[] _adminCommands = { "admin_setaio", "admin_removeaio" };
\n+     private final static Logger _log = Logger.getLogger(AdminAio.class.getName());
\n+
\n+     public boolean useAdminCommand(String command, L2PcInstance activeChar)
\n+     {
\n+             if (!Config.ALT_PRIVILEGES_ADMIN)
\n+                     if (!(checkLevel(activeChar.getAccessLevel()) && activeChar.isGM()))
\n+                     {
\n+                             GmListTable.broadcastMessageToGMs("Player "+activeChar.getName()+ " tryed illegal action set Aio stat");
\n+                             return false;
\n+                     }
\n+
\n+             if (command.startsWith("admin_setaio"))
\n+             {
\n+                     StringTokenizer str = new StringTokenizer(command);
\n+                     L2Object target = activeChar.getTarget();
\n+
\n+                     L2PcInstance player = null;
\n+                     SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
\n+
\n+                     if (target != null && target instanceof L2PcInstance)
\n+                             player = (L2PcInstance)target;
\n+                     else
\n+                             player = activeChar;
\n+
\n+                     try
\n+                     {
\n+                             str.nextToken();
\n+                             String time = str.nextToken();
\n+                             if (str.hasMoreTokens())
\n+                             {
\n+                                     String playername = time;
\n+                                     time = str.nextToken();
\n+                                     player = L2World.getInstance().getPlayer(playername);
\n+                                     doAio(activeChar, player, playername, time);
\n+                             }
\n+                             else
\n+                             {
\n+                                     String playername = player.getName();
\n+                                     doAio(activeChar, player, playername, time);
\n+                             }
\n+                             if(!time.equals("0"))
\n+                             {
\n+                                     sm.addString("You are now a Aio, Congratulations!");
\n+                                     player.sendPacket(sm);
\n+                             }
\n+                     }
\n+                     catch(Exception e)
\n+                     {
\n+                             activeChar.sendMessage("Usage: //setaio <char_name> [time](in days)");
\n+                     }
\n+
\n+                     player.broadcastUserInfo();
\n+                     if(player.isAio())
\n+                             return true;
\n+             }
\n+             else if(command.startsWith("admin_removeaio"))
\n+             {
\n+                     StringTokenizer str = new StringTokenizer(command);
\n+                     L2Object target = activeChar.getTarget();
\n+
\n+                     L2PcInstance player = null;
\n+
\n+                     if (target != null && target instanceof L2PcInstance)
\n+                             player = (L2PcInstance)target;
\n+                     else
\n+                             player = activeChar;
\n+
\n+                     try
\n+                     {
\n+                             str.nextToken();
\n+                             if (str.hasMoreTokens())
\n+                             {
\n+                                     String playername = str.nextToken();
\n+                                     player = L2World.getInstance().getPlayer(playername);
\n+                                     removeAio(activeChar, player, playername);
\n+                             }
\n+                             else
\n+                             {
\n+                                     String playername = player.getName();
\n+                                     removeAio(activeChar, player, playername);
\n+                             }
\n+                     }
\n+                     catch(Exception e)
\n+                     {
\n+                             activeChar.sendMessage("Usage: //removeaio <char_name>");
\n+                     }
\n+                     player.broadcastUserInfo();
\n+                     if(!player.isAio())
\n+                             return true;
\n+             }
\n+             return false;
\n+     }
\n+
\n+     public void doAio(L2PcInstance activeChar, L2PcInstance _player, String _playername, String _time)
\n+     {
\n+             int days = Integer.parseInt(_time);
\n+             if (_player == null)
\n+             {
\n+                     activeChar.sendMessage("not found char" + _playername);
\n+                     return;
\n+             }
\n+
\n+             if(days > 0)
\n+             {
\n+                     _player.setAio(true);
\n+                     _player.setEndTime("aio", days);
\n+                     _player.getStat().addExp(_player.getStat().getExpForLevel(81));
\n+
\n+                     Connection connection = null;
\n+                     try
\n+                     {
\n+                             connection = L2DatabaseFactory.getInstance().getConnection();
\n+
\n+                             PreparedStatement statement = connection.prepareStatement("UPDATE characters SET aio=1, aio_end=? WHERE obj_id=?");
\n+                             statement.setLong(1, _player.getAioEndTime());
\n+                             statement.setInt(2, _player.getObjectId());
\n+                             statement.execute();
\n+                             statement.close();
\n+                             connection.close();
\n+
\n+                             if(Config.ALLOW_AIO_NCOLOR && activeChar.isAio())
\n+                                     _player.getAppearance().setNameColor(Config.AIO_NCOLOR);
\n+
\n+                             if(Config.ALLOW_AIO_TCOLOR && activeChar.isAio())
\n+                                     _player.getAppearance().setTitleColor(Config.AIO_TCOLOR);
\n+
\n+                             _player.rewardAioSkills();
\n+                             if(Config.ALLOW_AIO_ITEM && activeChar.isAio())
\n+                             _player.getInventory().addItem("", Config.AIO_ITEMID, 1, _player, null);
\n+                             _player.broadcastUserInfo();
\n+                             _player.sendPacket(new EtcStatusUpdate(_player));
\n+                             _player.sendSkillList();
\n+                             GmListTable.broadcastMessageToGMs("GM "+ activeChar.getName()+ " set Aio stat for player "+ _playername + " for " + _time + " day(s)");
\n+                     }
\n+                     catch (Exception e)
\n+                     {
\n+                             _log.log(Level.WARNING,"could not set Aio stats to char:", e);
\n+                     }
\n+                     finally
\n+                     {
\n+                             try {
\n+                                     connection.close();
\n+                             } catch (SQLException e) {
\n+                                     // TODO Auto-generated catch block
\n+                                     e.printStackTrace();
\n+                             }
\n+                     }
\n+             }
\n+             else
\n+             {
\n+                     removeAio(activeChar, _player, _playername);
\n+             }
\n+     }
\n+
\n+     public void removeAio(L2PcInstance activeChar, L2PcInstance _player, String _playername)
\n+     {
\n+             _player.setAio(false);
\n+             _player.setAioEndTime(0);
\n+
\n+             Connection connection = null;
\n+             try
\n+             {
\n+                     connection = L2DatabaseFactory.getInstance().getConnection();
\n+
\n+                     PreparedStatement statement = connection.prepareStatement("UPDATE characters SET Aio=0, Aio_end=0 WHERE obj_id=?");
\n+                     statement.setInt(1, _player.getObjectId());
\n+                     statement.execute();
\n+                     statement.close();
\n+                     connection.close();
\n+
\n+                     _player.lostAioSkills();
\n+                     if(Config.ALLOW_AIO_ITEM && activeChar.isAio() == false)
\n+                     _player.getInventory().destroyItemByItemId("", Config.AIO_ITEMID, 1, _player, null);
\n+                     _player.getWarehouse().destroyItemByItemId("", Config.AIO_ITEMID, 1, _player, null);
\n+                     _player.getAppearance().setNameColor(0xFFFFFF);
\n+                     _player.getAppearance().setTitleColor(0xFFFFFF);
\n+                     _player.broadcastUserInfo();
\n+                     _player.sendPacket(new EtcStatusUpdate(_player));
\n+                     _player.sendSkillList();
\n+                     GmListTable.broadcastMessageToGMs("GM "+activeChar.getName()+" remove Aio stat of player "+ _playername);
\n+             }
\n+             catch (Exception e)
\n+             {
\n+                     _log.log(Level.WARNING,"could not remove Aio stats of char:", e);
\n+             }
\n+             finally
\n+             {
\n+                     try {
\n+                             connection.close();
\n+                     } catch (SQLException e) {
\n+                             // TODO Auto-generated catch block
\n+                             e.printStackTrace();
\n+                     }
\n+             }
\n+     }
\n+
\n+
\n+     private boolean checkLevel(int level)
\n+ {
\n+             return (level >= REQUIRED_LEVEL);
\n+ }
\n+
\n+     public String[] getAdminCommandList()
\n+     {
\n+             return _adminCommands;
\n+     }
\n+}
\nIndex: L2JFox_CORE/java/it/l2j/fox/Config.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/Config.java (revision 8)
\n+++ L2JFox_CORE/java/it/l2j/fox/Config.java (working copy)
\n@@ -436,6 +436,9 @@
\n     public static int     GM_DONT_TAKE_AGGRO;
\n
\n     public static int GM_REPAIR = 75;
\n+
\n+ public static int GM_VIP;
\n+ public static int GM_AIO;
\n
\n     /* Rate control */
\n     /** Rate for eXperience Point rewards */
\n@@ -853,6 +856,15 @@
\n     public static int L2JMOD_CHAMPION_REWARD_ID;
\n     public static int L2JMOD_CHAMPION_REWARD_QTY;
\n
\n+ /* Aio System */
\n+ public static boolean ENABLE_AIO_SYSTEM;
\n+ public static Map<Integer, Integer> AIO_SKILLS;
\n+ public static boolean ALLOW_AIO_NCOLOR;
\n+ public static int AIO_NCOLOR;
\n+ public static boolean ALLOW_AIO_TCOLOR;
\n+ public static int AIO_TCOLOR;
\n+ public static boolean ALLOW_AIO_ITEM;
\n+ public static int AIO_ITEMID;
\n     /** Mods L2JFox Pack **/
\n     public static boolean ALLOW_VIP_NCOLOR;
\n     public static int VIP_NCOLOR;
\n@@ -1867,6 +1879,40 @@
\n                 ALLOW_VIP_XPSP = Boolean.parseBoolean(L2JModSettings.getProperty("AllowVipMulXpSp", "True"));
\n                 VIP_XP = Integer.parseInt(L2JModSettings.getProperty("VipMulXp", "2"));
\n                 VIP_SP = Integer.parseInt(L2JModSettings.getProperty("VipMulSp", "2"));
\n+             ENABLE_AIO_SYSTEM = Boolean.parseBoolean(L2JModSettings.getProperty("EnableAioSystem", "True"));
\n+             ALLOW_AIO_NCOLOR = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAioNameColor", "True"));
\n+             AIO_NCOLOR = Integer.decode("0x" + L2JModSettings.getProperty("AioNameColor", "88AA88"));
\n+             ALLOW_AIO_TCOLOR = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAioTitleColor", "True"));
\n+             AIO_TCOLOR = Integer.decode("0x" + L2JModSettings.getProperty("AioTitleColor", "88AA88"));
\n+             AIO_ITEMID = Integer.parseInt(L2JModSettings.getProperty("ItemIdAio", "9945"));
\n+             ALLOW_AIO_ITEM = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAIOItem", "False"));
\n+             if(ENABLE_AIO_SYSTEM) //create map if system is enabled
\n+             {
\n+                             String[] AioSkillsSplit = L2JModSettings.getProperty("AioSkills", "").split(";");
\n+                             AIO_SKILLS = new FastMap<Integer, Integer>(AioSkillsSplit.length);
\n+                             for (String skill : AioSkillsSplit)
\n+                             {
\n+                                     String[] skillSplit = skill.split(",");
\n+                                     if (skillSplit.length != 2)
\n+                                     {
\n+                                             System.out.println("[Aio System]: invalid config property in L2JKombatMods.properties -> AioSkills "" + skill + """);
\n+                                     }
\n+                                     else
\n+                                     {
\n+                                             try
\n+                                             {
\n+                                                     AIO_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
\n+                                             }
\n+                                             catch (NumberFormatException nfe)
\n+                                             {
\n+                                                     if (!skill.equals(""))
\n+                                                     {
\n+                                                             System.out.println("[Aio System]: invalid config property in L2JKombatMods.properties -> AioSkills "" + skillSplit[0] + """ + skillSplit[1]);
\n+                                                     }
\n+                                             }
\n+                                     }
\n+                             }
\n+             }
\n                 ENABLE_CLAN_SYSTEM = Boolean.parseBoolean(L2JModSettings.getProperty("EnableClanSystem", "True"));
\n                 if(ENABLE_CLAN_SYSTEM)
\n                 {
\n@@ -1885,7 +1931,7 @@
\n                         }
\n                         try
\n                         {
\n-                         CLAN_SKILLS.put(Integer.valueOf(Integer.parseInt(skillSplit[0])), Integer.valueOf(Integer.parseInt(skillSplit[1])));
\n+                     CLAN_SKILLS.put(Integer.valueOf(Integer.parseInt(skillSplit[0])), Integer.valueOf(Integer.parseInt(skillSplit[1])));
\n                             continue;
\n                         }
\n                         catch(NumberFormatException nfe) { }
\n@@ -2067,6 +2113,8 @@
\n                 gmSettings.load(is);
\n                 is.close();
\n
\n+             GM_VIP = Integer.parseInt(gmSettings.getProperty("GMVip", "100"));
\n+             GM_AIO = Integer.parseInt(gmSettings.getProperty("GMAio", "100"));
\n                 GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
\n                 GM_MIN         = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
\n                 GM_ALTG_MIN_LEVEL = Integer.parseInt(gmSettings.getProperty("GMCanAltG", "100"));
\nIndex: L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java (revision 8)
\n+++ L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java (working copy)
\n@@ -125,6 +125,7 @@
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminUnblockIp;
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminZone;
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminVip;
\n+import it.l2j.fox.gameserver.handler.admincommandhandlers.AdminAio;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSoulShot;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSpice;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSpiritShot;
\n@@ -571,7 +572,7 @@
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminLevel());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminQuest());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminZone());
\n-     _adminCommandHandler.registerAdminCommandHandler(new AdminVip());
\n+     _adminCommandHandler.registerAdminCommandHandler(new AdminAio());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminCursedWeapons());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminGeodata());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminGeoEditor());
\n
\n

 

 

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

Posts recomendados

  • 0

Olá, esses "\n" não fazem parte do diff, por algum motivo ao postarem, acabou ficando aí. Então você pode remover. Acredito que seja até melhor usar o que está no post inicial que comentou.

 

Com relação a esses caracteres "@@ -165,3 +165,32 @@", digamos que são direcionamentos das linhas onde as modificações que aparecem abaixo deles devem ser feitas. Onde o '-165,3' significa que deve começar a remover a partir da linha 165 coluna 3 e o '+165,32' segue o mesmo raciocínio, sendo que é pra adicionar. Essas informações, na prática, acabam sendo relevantes apenas para ferramentas de "merge", pois, dependendo das alterações que já tenha feito anteriormente no código, elas não ajudam tanto.

 

Pelo que vi, no post inicial os mods de AIO e VIP estão "separados", notei que toda linha ou método que que faz parte do AIO o referencia de alguma forma (tem um "aio" nela). Só tentar ignorar essas linhas, que acredito que não vai ter muitos problemas para adicionar.

 

att[]'s.

Link para o comentário
Compartilhar em outros sites


  • 0

Olá, esses "\n" não fazem parte do diff, por algum motivo ao postarem, acabou ficando aí. Então você pode remover. Acredito que seja até melhor usar o que está no post inicial que comentou.

 

Com relação a esses caracteres "@@ -165,3 +165,32 @@", digamos que são direcionamentos das linhas onde as modificações que aparecem abaixo deles devem ser feitas. Onde o '-165,3' significa que deve começar a remover a partir da linha 165 coluna 3 e o '+165,32' segue o mesmo raciocínio, sendo que é pra adicionar. Essas informações, na prática, acabam sendo relevantes apenas para ferramentas de "merge", pois, dependendo das alterações que já tenha feito anteriormente no código, elas não ajudam tanto.

 

Pelo que vi, no post inicial os mods de AIO e VIP estão "separados", notei que toda linha ou método que que faz parte do AIO o referencia de alguma forma (tem um "aio" nela). Só tentar ignorar essas linhas, que acredito que não vai ter muitos problemas para adicionar.

 

att[]'s.

Obrigada KhayrusS, adorei a explicação, vou ver se consigo adicionar ele aqui :smile:

Obrigada KhayrusS, adorei a explicação, vou ver se consigo adicionar ele aqui :smile:

Não consegui também amigo :( e se mudasse meu sistema de vip que já vem na jfrozen para uma moeda Double clique n seria mais fácil ? assim eu criaria uma moeda com tempo por exemplo 30 dias.

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Como eu te falei no outro tópico isso não vai funcionar você precisa do MOD, em qual parte está tendo dificuldade ? é só postar, não precisa ter receio de não saber fazer, posta aí que ajudamos você.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Como eu te falei no outro tópico isso não vai funcionar você precisa do MOD, em qual parte está tendo dificuldade ? é só postar, não precisa ter receio de não saber fazer, posta aí que ajudamos você.

Na tabela do navicat tem a opção Duration, -1 e permanente eu achei que se eu arrumasse um determinado tempo ele ficaria o tempo determinado na tabela, desculpa pela ingenuidade amigo, vou começar a add de novo o mod e posto aqui as dificuldades *-*

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Vou te dar um exemplo na parte do banco de dados que é a mais difícil de entender depois que entender vai pegar a lógica e conseguir aplicar em qualquer mod.

 

- 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=?,expBeforeDeath=?,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=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,event_points=?,coupon=?,donator=?,death_penalty_level=?,koof=?,noob=? 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, expBeforeDeath, 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, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,event_points,coupon,donator,hero,death_penalty_level,koof,noob FROM characters WHERE obj_id=?";

 

+ 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=?,expBeforeDeath=?,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=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,event_points=?,coupon=?,donator=?,death_penalty_level=?,koof=?,noob=?,vip=?,vip_end=?,aio=?,aio_end=? 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, expBeforeDeath, 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, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,event_points,coupon,donator,hero,death_penalty_level,koof,noob,vip,vip_end,aio,aio_end FROM characters WHERE obj_id=?";

 

Na linha que está falando para remover é o código antigo , você procura por private static final String UPDATE e vai achar ela , a parte aonde está o (+) eu coloquei em vermelho o que tem de novo para você copiar e add na sua rev.

Editado por Tayran.JavaDev

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Vou te dar um exemplo na parte do banco de dados que é a mais difícil de entender depois que entender vai pegar a lógica e conseguir aplicar em qualquer mod.

 

 

 

Na linha que está falando para remover é o código antigo , você procura por private static final String UPDATE e vai achar ela , a parte aonde está o (+) eu coloquei em vermelho o que tem de novo para você copiar e add na sua rev.

Tayran, mas note na imagem abaixo que não tem UPDATE_CHARACTER E RESTORE_CHARACTER nas minhas private static final String UPDATE, segue imagem :

NyuPUf1.png

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

eles só estão mais abaixo , próximo a linha 460, use o ctrl + F para procurar texto dentro de uma classe.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Estou conseguindo amigo *-*, so estou com mais uma duvida nesta parte:

no meu arquivo esta assim:
 
statement.setLong(57, System.currentTimeMillis());
statement.setString(58, StringToHex(Integer.toHexString(getAppearance().getNameColor()).toUpperCase()));
statement.setString(59, StringToHex(Integer.toHexString(getAppearance().getTitleColor()).toUpperCase()));
statement.setInt(60, isAio() ? 1 : 0);
statement.setLong(61, 0);
statement.executeUpdate();
 
e no mod esta assim:
 
nstatement.setLong(57,System.currentTimeMillis());
\nstatement.setInt(58, isVip() ? 1 :0);
\nstatement.setLong(59, 0);
\n+ statement.setLong(60, 0);
\n+ statement.setInt(61, isAio() ? 1 :0);
\n+ statement.setLong(62, 0);
\nstatement.executeUpdate();
Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

 
statement.setString(58, StringToHex(Integer.toHexString(getAppearance().getNameColor()).toUpperCase()));
statement.setString(59, StringToHex(Integer.toHexString(getAppearance().getTitleColor()).toUpperCase()));
statement.setInt(60, isAio() ? 1 : 0);
statement.setLong(61, 0);
statement.setInt(62, isVip() ? 1 :0);
statement.setLong(63, 0);

statement.executeUpdate();

Vai ficar dessa forma que postei, tem que adicionar ele no final e colocar o numero sequencial dele como estava terminando no 61 colocamos ele como 62 e 63.

 

Agora nessa parte que vou te mostrar abaixo você tem que tomar cuidado por que o objectid fica sempre por último. observe :

 

 

 				// L2World.getInstance().storeObject(player);
@@ -6302,5 +6317,9 @@
 			statement.setInt(60, isKoof() ? 1 : 0);
 			statement.setInt(61, isNoob() ? 1 : 0);
-			statement.setInt(62, getObjectId());
+            statement.setInt(62, isVip() ? 1 : 0);
+            statement.setLong(63, getVipEndTime());
+            statement.setInt(64, isAio() ? 1 : 0);
+            statement.setLong(65, getAioEndTime());
+            statement.setInt(66, getObjectId());
 			statement.execute();
 			statement.close();

getObjectId é deletado no início por que ele está com número 62, então o vip pega a posição 62 e 63 e depois o aio 64 e 65 e por ultimo adicionamos novamente o objectID com sua nova ID 66.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

a segunda parte em que voce citou entao ficaria assim? segue os codigos:

no MOD:
=====================================================
\nstatement.setLong(56, getDeathPenaltyBuffLevel());
\nstatement.setInt(57, isVip() ? 1 : 0);
\nstatement.setLong(58, getVipEndTime());
\n- statement.setInt(59, getObjectId());
\n+ statement.setInt(59, isAio() ? 1 : 0);
\n+ statement.setLong(60, getAioEndTime());
\n+ statement.setInt(61, getObjectId());
\n
\nstatement.execute();
 
no meu arquivo:
======================================================
statement.setLong(56, getDeathPenaltyBuffLevel());
statement.setInt(57, getPcBangScore());
statement.setString(58, StringToHex(Integer.toHexString(_originalNameColorOffline).toUpperCase()));
statement.setString(59, StringToHex(Integer.toHexString(getAppearance().getTitleColor()).toUpperCase()));
 
// TODO allow different colors support to players store
// statement.setString(58, StringToHex(Integer.toHexString(getAppearance().getNameColor()).toUpperCase()));
// statement.setString(59, StringToHex(Integer.toHexString(getAppearance().getTitleColor()).toUpperCase()));
 
statement.setInt(60, isAio() ? 1 : 0);
statement.setLong(61, getAioEndTime());
nstatement.setInt(62, isVip() ? 1 : 0);
nstatement.setLong(63, getVipEndTime());
 
statement.setInt(64, getObjectId());

statement.execute();
Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Exatamente.

Obrigada, já estou quase cruzando a linha de chegada *-*, mas surgiram + 2 duvidas no caminho,

1* Não encontrei esse diretório aqui na frozen : L2JFox_core/java/it/l2j/fox/Config.java

2* Encontrei o diretório mas não existem as linhas citadas no MOD: L2JFox_core/java/it/l2j/fox/gameserver/GameServer.java

 

Segue as partes do MOD:

\nIndex: L2JFox_CORE/java/it/l2j/fox/Config.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/Config.java (revision 8)
\n+++ L2JFox_CORE/java/it/l2j/fox/Config.java (working copy)
\n@@ -436,6 +436,9 @@
\n     public static int     GM_DONT_TAKE_AGGRO;
\n
\n     public static int GM_REPAIR = 75;
\n+
\n+ public static int GM_VIP;
\n+ public static int GM_AIO;
\n
\n     /* Rate control */
\n     /** Rate for eXperience Point rewards */
\n@@ -853,6 +856,15 @@
\n     public static int L2JMOD_CHAMPION_REWARD_ID;
\n     public static int L2JMOD_CHAMPION_REWARD_QTY;
\n
\n+ /* Aio System */
\n+ public static boolean ENABLE_AIO_SYSTEM;
\n+ public static Map<Integer, Integer> AIO_SKILLS;
\n+ public static boolean ALLOW_AIO_NCOLOR;
\n+ public static int AIO_NCOLOR;
\n+ public static boolean ALLOW_AIO_TCOLOR;
\n+ public static int AIO_TCOLOR;
\n+ public static boolean ALLOW_AIO_ITEM;
\n+ public static int AIO_ITEMID;
\n     /** Mods L2JFox Pack **/
\n     public static boolean ALLOW_VIP_NCOLOR;
\n     public static int VIP_NCOLOR;
\n@@ -1867,6 +1879,40 @@
\n                 ALLOW_VIP_XPSP = Boolean.parseBoolean(L2JModSettings.getProperty("AllowVipMulXpSp", "True"));
\n                 VIP_XP = Integer.parseInt(L2JModSettings.getProperty("VipMulXp", "2"));
\n                 VIP_SP = Integer.parseInt(L2JModSettings.getProperty("VipMulSp", "2"));
\n+             ENABLE_AIO_SYSTEM = Boolean.parseBoolean(L2JModSettings.getProperty("EnableAioSystem", "True"));
\n+             ALLOW_AIO_NCOLOR = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAioNameColor", "True"));
\n+             AIO_NCOLOR = Integer.decode("0x" + L2JModSettings.getProperty("AioNameColor", "88AA88"));
\n+             ALLOW_AIO_TCOLOR = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAioTitleColor", "True"));
\n+             AIO_TCOLOR = Integer.decode("0x" + L2JModSettings.getProperty("AioTitleColor", "88AA88"));
\n+             AIO_ITEMID = Integer.parseInt(L2JModSettings.getProperty("ItemIdAio", "9945"));
\n+             ALLOW_AIO_ITEM = Boolean.parseBoolean(L2JModSettings.getProperty("AllowAIOItem", "False"));
\n+             if(ENABLE_AIO_SYSTEM) //create map if system is enabled
\n+             {
\n+                             String[] AioSkillsSplit = L2JModSettings.getProperty("AioSkills", "").split(";");
\n+                             AIO_SKILLS = new FastMap<Integer, Integer>(AioSkillsSplit.length);
\n+                             for (String skill : AioSkillsSplit)
\n+                             {
\n+                                     String[] skillSplit = skill.split(",");
\n+                                     if (skillSplit.length != 2)
\n+                                     {
\n+                                             System.out.println("[Aio System]: invalid config property in L2JKombatMods.properties -> AioSkills "" + skill + """);
\n+                                     }
\n+                                     else
\n+                                     {
\n+                                             try
\n+                                             {
\n+                                                     AIO_SKILLS.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
\n+                                             }
\n+                                             catch (NumberFormatException nfe)
\n+                                             {
\n+                                                     if (!skill.equals(""))
\n+                                                     {
\n+                                                             System.out.println("[Aio System]: invalid config property in L2JKombatMods.properties -> AioSkills "" + skillSplit[0] + """ + skillSplit[1]);
\n+                                                     }
\n+                                             }
\n+                                     }
\n+                             }
\n+             }
\n                 ENABLE_CLAN_SYSTEM = Boolean.parseBoolean(L2JModSettings.getProperty("EnableClanSystem", "True"));
\n                 if(ENABLE_CLAN_SYSTEM)
\n                 {
\n@@ -1885,7 +1931,7 @@
\n                         }
\n                         try
\n                         {
\n-                         CLAN_SKILLS.put(Integer.valueOf(Integer.parseInt(skillSplit[0])), Integer.valueOf(Integer.parseInt(skillSplit[1])));
\n+                     CLAN_SKILLS.put(Integer.valueOf(Integer.parseInt(skillSplit[0])), Integer.valueOf(Integer.parseInt(skillSplit[1])));
\n                             continue;
\n                         }
\n                         catch(NumberFormatException nfe) { }
\n@@ -2067,6 +2113,8 @@
\n                 gmSettings.load(is);
\n                 is.close();
\n
\n+             GM_VIP = Integer.parseInt(gmSettings.getProperty("GMVip", "100"));
\n+             GM_AIO = Integer.parseInt(gmSettings.getProperty("GMAio", "100"));
\n                 GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
\n                 GM_MIN         = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
\n                 GM_ALTG_MIN_LEVEL = Integer.parseInt(gmSettings.getProperty("GMCanAltG", "100"));
\nIndex: L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java (revision 8)
\n+++ L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java (working copy)
\n@@ -125,6 +125,7 @@
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminUnblockIp;
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminZone;
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminVip;
\n+import it.l2j.fox.gameserver.handler.admincommandhandlers.AdminAio;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSoulShot;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSpice;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSpiritShot;
\n@@ -571,7 +572,7 @@
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminLevel());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminQuest());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminZone());
\n-     _adminCommandHandler.registerAdminCommandHandler(new AdminVip());
\n+     _adminCommandHandler.registerAdminCommandHandler(new AdminAio());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminCursedWeapons());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminGeodata());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminGeoEditor());
\n
\n

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Você não está usando os atalhos de busca de arquivos que te passei , config fica em com.l2jfrozen

o registerAdminCommand fica em com.l2jfrozen.gameserver.handler.AdminCommandHandler.java

Tenta adicionar essa parte sozinha para você praticar a adaptação, lá não vai está igual no arquivo mas seguindo os exemplos dos que já estão lá é só fazer da mesma forma.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Você não está usando os atalhos de busca de arquivos que te passei , config fica em com.l2jfrozen

 

o registerAdminCommand fica em com.l2jfrozen.gameserver.handler.AdminCommandHandler.java

 

Tenta adicionar essa parte sozinha para você praticar a adaptação, lá não vai está igual no arquivo mas seguindo os exemplos dos que já estão lá é só fazer da mesma forma.

Obrigada Tayran, sinceramente esqueci dos atalhos de busca, sim vou tentar fazer sozinha para me aperfeiçoar mas se eu não conseguir eu volto puxar seu pé de novo :feliz:

Obrigada Tayran, sinceramente esqueci dos atalhos de busca, sim vou tentar fazer sozinha para me aperfeiçoar mas se eu não conseguir eu volto puxar seu pé de novo :feliz:

Nao estou conseguindo fazer esses passos Tayran :( no Config.java não existe nenhuma dessas linhas e nada parecido, e no GameServer.java estou mais perdida ainda :sad:

 

 

\nIndex: L2JFox_CORE/java/it/l2j/fox/Config.java
\n===================================================================
\n+             GM_VIP = Integer.parseInt(gmSettings.getProperty("GMVip", "100"));
\n+             GM_AIO = Integer.parseInt(gmSettings.getProperty("GMAio", "100"));
\n                 GM_ACCESSLEVEL = Integer.parseInt(gmSettings.getProperty("GMAccessLevel", "100"));
\n                 GM_MIN         = Integer.parseInt(gmSettings.getProperty("GMMinLevel", "100"));
\n                 GM_ALTG_MIN_LEVEL = Integer.parseInt(gmSettings.getProperty("GMCanAltG", "100"));
\nIndex: L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java
\n===================================================================
\n--- L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java (revision 8)
\n+++ L2JFox_CORE/java/it/l2j/fox/gameserver/GameServer.java (working copy)
\n@@ -125,6 +125,7 @@
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminUnblockIp;
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminZone;
\nimport it.l2j.fox.gameserver.handler.admincommandhandlers.AdminVip;
\n+import it.l2j.fox.gameserver.handler.admincommandhandlers.AdminAio;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSoulShot;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSpice;
\nimport it.l2j.fox.gameserver.handler.itemhandlers.BeastSpiritShot;
\n@@ -571,7 +572,7 @@
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminLevel());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminQuest());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminZone());
\n-     _adminCommandHandler.registerAdminCommandHandler(new AdminVip());
\n+     _adminCommandHandler.registerAdminCommandHandler(new AdminAio());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminCursedWeapons());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminGeodata());
\n         _adminCommandHandler.registerAdminCommandHandler(new AdminGeoEditor());
\n
\n

 

 

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Amiga eu te falei que o caminho do registerCommandHandler é outro , olhe mais atentamente minha postagem, alguns projetos o registro do comando fica no gameserver mas na frozen fica no local que te passei.

Na parte do AdminVip use esse código que já está modificado :

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.handler.admincommandhandlers;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.GmListTable;
import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate;
import com.l2jfrozen.util.CloseUtil;
import com.l2jfrozen.util.database.L2DatabaseFactory;

/**
 * Give / Take Status Vip to Player Changes name color and title color if enabled Uses: setvip [<player_name>] [<time_duration in days>] removevip [<player_name>] If <player_name> is not specified, the current target player is used.
 * @author KhayrusS
 */
public class AdminVip implements IAdminCommandHandler
{
 private final static Logger _log = Logger.getLogger(AdminVip.class.getName());
 
 private static String[] _adminCommands =
 {
  "admin_setvip",
  "admin_removevip"
 };
 
 private enum CommandEnum
 {
  admin_setvip,
  admin_removevip
 }
 
 @Override
 public boolean useAdminCommand(final String command, final L2PcInstance activeChar)
 {
  StringTokenizer st = new StringTokenizer(command);
  
  CommandEnum comm = CommandEnum.valueOf(st.nextToken());
  
  if (comm == null)
   return false;
   
  switch (comm)
  {
   case admin_setvip:
   {
    boolean no_token = false;
    
    if (st.hasMoreTokens())
    {
     String char_name = st.nextToken();
     
     L2PcInstance player = L2World.getInstance().getPlayer(char_name);
     
     if (player != null)
     {
      if (st.hasMoreTokens())
      {
       String time = st.nextToken();
       
       try
       {
        int value = Integer.parseInt(time);
        
        if (value > 0)
        {
         doVip(activeChar, player, char_name, time);
         
         if (player.isVip())
          return true;
        }
        else
        {
         activeChar.sendMessage("Time must be bigger then 0!");
         return false;
        }
       }
       catch (NumberFormatException e)
       {
        activeChar.sendMessage("Time must be a number!");
        return false;
       }
      }
      else
      {
       no_token = true;
      }
     }
     else
     {
      activeChar.sendMessage("Player must be online to set VIP status");
      no_token = true;
     }
    }
    else
    {
     no_token = true;
    }
    
    if (no_token)
    {
     activeChar.sendMessage("Usage: //setvip <char_name> [time](in days)");
     return false;
    }
   }
   
   case admin_removevip:
   {
    boolean no_token = false;
    
    if (st.hasMoreTokens())
    {
     String char_name = st.nextToken();
     
     L2PcInstance player = L2World.getInstance().getPlayer(char_name);
     
     if (player != null)
     {
      removeVip(activeChar, player, char_name);
      
      if (!player.isVip())
       return true;
     }
     else
     {
      activeChar.sendMessage("Player must be online to remove VIP status");
      no_token = true;
     }
    }
    else
    {
     no_token = true;
    }
    
    if (no_token)
    {
     activeChar.sendMessage("Usage: //removevip <char_name>");
     return false;
    }
   }
  }
  return true;
 }
 
 public void doVip(L2PcInstance activeChar, L2PcInstance player, String playername, String _time)
 {
  int days = Integer.parseInt(_time);
  if (_player == null)
  {
   activeChar.sendMessage("not found char" + _playername);
   return;
  }
  
  if (days > 0)
  {
   _player.setVip(true);
   _player.setEndTime("vip", days);
   
   Connection connection = null;
   try
   {
    connection = L2DatabaseFactory.getInstance().getConnection(false);
    
    PreparedStatement statement = connection.prepareStatement("UPDATE characters SET vip=1, vip_end=? WHERE obj_id=?");
    statement.setLong(1, _player.getVipEndTime());
    statement.setInt(2, _player.getObjectId());
    statement.execute();
    statement.close();
    connection.close();
    
    if (Config.ALLOW_VIP_NCOLOR && activeChar.isVip())
     _player.getAppearance().setNameColor(Config.VIP_NCOLOR);
     
    if (Config.ALLOW_VIP_TCOLOR && activeChar.isVip())
     _player.getAppearance().setTitleColor(Config.VIP_TCOLOR);
     
    _player.broadcastUserInfo();
    _player.sendPacket(new EtcStatusUpdate(_player));
    GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " set vip stat for player " + playername + " for " + time + " day(s)");
    _player.sendMessage("You are now an Vip, Congratulations!");
    _player.broadcastUserInfo();
   }
   catch (Exception e)
   {
    if (Config.DEBUG)
     e.printStackTrace();
     
    _log.log(Level.WARNING, "could not set vip stats of char:", e);
   }
   finally
   {
    CloseUtil.close(connection);
   }
  }
  else
  {
   removeVip(activeChar, player, playername);
  }
 }
 
 public void removeVip(L2PcInstance activeChar, L2PcInstance player, String playername)
 {
  _player.setVip(false);
  _player.setVipEndTime(0);
  
  Connection connection = null;
  try
  {
   connection = L2DatabaseFactory.getInstance().getConnection(false);
   
   PreparedStatement statement = connection.prepareStatement("UPDATE characters SET vip=0, vip_end=0 WHERE obj_id=?");
   statement.setInt(1, _player.getObjectId());
   statement.execute();
   statement.close();
   connection.close();
   
   _player.getAppearance().setTitleColor(0xFFFF77);
   _player.getAppearance().setNameColor(0xFFFFFF);
   _player.broadcastUserInfo();
   _player.sendPacket(new EtcStatusUpdate(_player));
   GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " remove vip stat of player " + _playername);
   _player.sendMessage("Now You are not an Vip..");
   _player.broadcastUserInfo();
  }
  catch (Exception e)
  {
   if (Config.DEBUG)
    e.printStackTrace();
    
   _log.log(Level.WARNING, "could not remove vip stats of char:", e);
  }
  finally
  {
   CloseUtil.close(connection);
  }
 }
 
 @Override
 public String[] getAdminCommandList()
 {
  return _adminCommands;
 }
}

 

Config.java simplificado e adaptado já removido o AIO e outra config que não utiliza nessa rev :

Index: /trunk/L2JFrozen_Core/java/com/l2jfrozen/Config.java
===================================================================
--- /trunk/L2JKombat_Core/java/com/l2jfrozen/Config.java (revision 14)
+++ /trunk/L2JKombat_Core/java/com/l2jfrozen/Config.java (revision 16)
@@ -107,4 +107,21 @@
 	public static final FloodProtectorConfig FLOOD_PROTECTOR_POTION = new FloodProtectorConfig("PotionFloodProtector");
 	public static final FloodProtectorConfig FLOOD_PROTECTOR_ENCHANT = new FloodProtectorConfig("EnchantFloodProtector");
+	/* Vip System */
+	public static boolean ALLOW_VIP_NCOLOR;
+	public static int VIP_NCOLOR;
+	public static boolean ALLOW_VIP_TCOLOR;
+	public static int VIP_TCOLOR;
+	public static boolean ALLOW_VIP_XPSP;
+	public static int VIP_XP;
+	public static int VIP_SP;
 	/** Start AltSettings.properties */
 	// Auto loots configs
@@ -2555,4 +2576,48 @@
   RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
   RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
   RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
+					// -------------------- //
+					// Aio e Vip System //
+					// -------------------- //
+	            	ALLOW_VIP_NCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipNameColor", "True"));
+	            	VIP_NCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipNameColor", "0088FF"));
+	            	ALLOW_VIP_TCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipTitleColor", "True"));
+	            	VIP_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipTitleColor", "0088FF"));
+	            	ALLOW_VIP_XPSP = Boolean.parseBoolean(otherSettings.getProperty("AllowVipMulXpSp", "True"));
+	            	VIP_XP = Integer.parseInt(otherSettings.getProperty("VipMulXp", "2"));
+	            	VIP_SP = Integer.parseInt(otherSettings.getProperty("VipMulSp", "2"));
   ENABLE_AIO_SYSTEM = Boolean.parseBoolean(otherSettings.getProperty("EnableAioSystem", "True"));
   ALLOW_AIO_NCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowAioNameColor", "True"));
   AIO_NCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioNameColor", "88AA88"));
   

 

só que agora sua config vai ficar em local diferente :

===================================================================
--- /trunk/L2JFrozen_Core/config/head/other.properties (revision 13)
+++ /trunk/L2JFrozen_Core/config/head/other.properties (revision 16)
@@ -298,2 +298,47 @@
# Enable Messages to GMs on 4-5 consecutive pvp of a player
# Why? to see if a char are farming!
EnableAntiPvpFarmMsg = true
+
+# ---------------------------------------
+# Vip System ( By KhayrusS ) 
+# ---------------------------------------
+# Enable / Disable Name Color
+AllowVipNameColor = True
+VipNameColor = 0088FF
+# Enable / Disable Title Color
+AllowVipTitleColor = True
+VipTitleColor = 0088FF
+
+# if True Player Vip gain Xp*VipMulXp and Sp*VipMulSp
+# Note only works if player not in party
+AllowVipMulXpSp = True
+VipMulXp = 2
+VipMulSp = 2
# -----------------------------------------
#  Aio System                             -
# -----------------------------------------

 

Agora ficou fácil demais , só prosseguir.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Amiga eu te falei que o caminho do registerCommandHandler é outro , olhe mais atentamente minha postagem, alguns projetos o registro do comando fica no gameserver mas na frozen fica no local que te passei.

 

Na parte do AdminVip use esse código que já está modificado :

 

 

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package com.l2jfrozen.gameserver.handler.admincommandhandlers;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.datatables.GmListTable;
import com.l2jfrozen.gameserver.handler.IAdminCommandHandler;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate;
import com.l2jfrozen.util.CloseUtil;
import com.l2jfrozen.util.database.L2DatabaseFactory;

/**
 * Give / Take Status Vip to Player Changes name color and title color if enabled Uses: setvip [<player_name>] [<time_duration in days>] removevip [<player_name>] If <player_name> is not specified, the current target player is used.
 * @author KhayrusS
 */
public class AdminVip implements IAdminCommandHandler
{
 private final static Logger _log = Logger.getLogger(AdminVip.class.getName());
 
 private static String[] _adminCommands =
 {
  "admin_setvip",
  "admin_removevip"
 };
 
 private enum CommandEnum
 {
  admin_setvip,
  admin_removevip
 }
 
 @Override
 public boolean useAdminCommand(final String command, final L2PcInstance activeChar)
 {
  StringTokenizer st = new StringTokenizer(command);
  
  CommandEnum comm = CommandEnum.valueOf(st.nextToken());
  
  if (comm == null)
   return false;
   
  switch (comm)
  {
   case admin_setvip:
   {
    boolean no_token = false;
    
    if (st.hasMoreTokens())
    {
     String char_name = st.nextToken();
     
     L2PcInstance player = L2World.getInstance().getPlayer(char_name);
     
     if (player != null)
     {
      if (st.hasMoreTokens())
      {
       String time = st.nextToken();
       
       try
       {
        int value = Integer.parseInt(time);
        
        if (value > 0)
        {
         doVip(activeChar, player, char_name, time);
         
         if (player.isVip())
          return true;
        }
        else
        {
         activeChar.sendMessage("Time must be bigger then 0!");
         return false;
        }
       }
       catch (NumberFormatException e)
       {
        activeChar.sendMessage("Time must be a number!");
        return false;
       }
      }
      else
      {
       no_token = true;
      }
     }
     else
     {
      activeChar.sendMessage("Player must be online to set VIP status");
      no_token = true;
     }
    }
    else
    {
     no_token = true;
    }
    
    if (no_token)
    {
     activeChar.sendMessage("Usage: //setvip <char_name> [time](in days)");
     return false;
    }
   }
   
   case admin_removevip:
   {
    boolean no_token = false;
    
    if (st.hasMoreTokens())
    {
     String char_name = st.nextToken();
     
     L2PcInstance player = L2World.getInstance().getPlayer(char_name);
     
     if (player != null)
     {
      removeVip(activeChar, player, char_name);
      
      if (!player.isVip())
       return true;
     }
     else
     {
      activeChar.sendMessage("Player must be online to remove VIP status");
      no_token = true;
     }
    }
    else
    {
     no_token = true;
    }
    
    if (no_token)
    {
     activeChar.sendMessage("Usage: //removevip <char_name>");
     return false;
    }
   }
  }
  return true;
 }
 
 public void doVip(L2PcInstance activeChar, L2PcInstance player, String playername, String _time)
 {
  int days = Integer.parseInt(_time);
  if (_player == null)
  {
   activeChar.sendMessage("not found char" + _playername);
   return;
  }
  
  if (days > 0)
  {
   _player.setVip(true);
   _player.setEndTime("vip", days);
   
   Connection connection = null;
   try
   {
    connection = L2DatabaseFactory.getInstance().getConnection(false);
    
    PreparedStatement statement = connection.prepareStatement("UPDATE characters SET vip=1, vip_end=? WHERE obj_id=?");
    statement.setLong(1, _player.getVipEndTime());
    statement.setInt(2, _player.getObjectId());
    statement.execute();
    statement.close();
    connection.close();
    
    if (Config.ALLOW_VIP_NCOLOR && activeChar.isVip())
     _player.getAppearance().setNameColor(Config.VIP_NCOLOR);
     
    if (Config.ALLOW_VIP_TCOLOR && activeChar.isVip())
     _player.getAppearance().setTitleColor(Config.VIP_TCOLOR);
     
    _player.broadcastUserInfo();
    _player.sendPacket(new EtcStatusUpdate(_player));
    GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " set vip stat for player " + playername + " for " + time + " day(s)");
    _player.sendMessage("You are now an Vip, Congratulations!");
    _player.broadcastUserInfo();
   }
   catch (Exception e)
   {
    if (Config.DEBUG)
     e.printStackTrace();
     
    _log.log(Level.WARNING, "could not set vip stats of char:", e);
   }
   finally
   {
    CloseUtil.close(connection);
   }
  }
  else
  {
   removeVip(activeChar, player, playername);
  }
 }
 
 public void removeVip(L2PcInstance activeChar, L2PcInstance player, String playername)
 {
  _player.setVip(false);
  _player.setVipEndTime(0);
  
  Connection connection = null;
  try
  {
   connection = L2DatabaseFactory.getInstance().getConnection(false);
   
   PreparedStatement statement = connection.prepareStatement("UPDATE characters SET vip=0, vip_end=0 WHERE obj_id=?");
   statement.setInt(1, _player.getObjectId());
   statement.execute();
   statement.close();
   connection.close();
   
   _player.getAppearance().setTitleColor(0xFFFF77);
   _player.getAppearance().setNameColor(0xFFFFFF);
   _player.broadcastUserInfo();
   _player.sendPacket(new EtcStatusUpdate(_player));
   GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " remove vip stat of player " + _playername);
   _player.sendMessage("Now You are not an Vip..");
   _player.broadcastUserInfo();
  }
  catch (Exception e)
  {
   if (Config.DEBUG)
    e.printStackTrace();
    
   _log.log(Level.WARNING, "could not remove vip stats of char:", e);
  }
  finally
  {
   CloseUtil.close(connection);
  }
 }
 
 @Override
 public String[] getAdminCommandList()
 {
  return _adminCommands;
 }
}

 

Config.java simplificado e adaptado já removido o AIO e outra config que não utiliza nessa rev :

 

 

Index: /trunk/L2JFrozen_Core/java/com/l2jfrozen/Config.java
===================================================================
--- /trunk/L2JKombat_Core/java/com/l2jfrozen/Config.java (revision 14)
+++ /trunk/L2JKombat_Core/java/com/l2jfrozen/Config.java (revision 16)
@@ -107,4 +107,21 @@
 	public static final FloodProtectorConfig FLOOD_PROTECTOR_POTION = new FloodProtectorConfig("PotionFloodProtector");
 	public static final FloodProtectorConfig FLOOD_PROTECTOR_ENCHANT = new FloodProtectorConfig("EnchantFloodProtector");
+	/* Vip System */
+	public static boolean ALLOW_VIP_NCOLOR;
+	public static int VIP_NCOLOR;
+	public static boolean ALLOW_VIP_TCOLOR;
+	public static int VIP_TCOLOR;
+	public static boolean ALLOW_VIP_XPSP;
+	public static int VIP_XP;
+	public static int VIP_SP;
 	/** Start AltSettings.properties */
 	// Auto loots configs
@@ -2555,4 +2576,48 @@
   RAID_MINION_RESPAWN_TIMER = Integer.parseInt(otherSettings.getProperty("RaidMinionRespawnTime", "300000"));
   RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMinRespawnMultiplier", "1.0"));
   RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(otherSettings.getProperty("RaidMaxRespawnMultiplier", "1.0"));
+					// -------------------- //
+					// Aio e Vip System //
+					// -------------------- //
+	            	ALLOW_VIP_NCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipNameColor", "True"));
+	            	VIP_NCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipNameColor", "0088FF"));
+	            	ALLOW_VIP_TCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipTitleColor", "True"));
+	            	VIP_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipTitleColor", "0088FF"));
+	            	ALLOW_VIP_XPSP = Boolean.parseBoolean(otherSettings.getProperty("AllowVipMulXpSp", "True"));
+	            	VIP_XP = Integer.parseInt(otherSettings.getProperty("VipMulXp", "2"));
+	            	VIP_SP = Integer.parseInt(otherSettings.getProperty("VipMulSp", "2"));
   ENABLE_AIO_SYSTEM = Boolean.parseBoolean(otherSettings.getProperty("EnableAioSystem", "True"));
   ALLOW_AIO_NCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowAioNameColor", "True"));
   AIO_NCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioNameColor", "88AA88"));
   

 

só que agora sua config vai ficar em local diferente :

 

 

===================================================================
--- /trunk/L2JFrozen_Core/config/head/other.properties (revision 13)
+++ /trunk/L2JFrozen_Core/config/head/other.properties (revision 16)
@@ -298,2 +298,47 @@
# Enable Messages to GMs on 4-5 consecutive pvp of a player
# Why? to see if a char are farming!
EnableAntiPvpFarmMsg = true
+
+# ---------------------------------------
+# Vip System ( By KhayrusS ) 
+# ---------------------------------------
+# Enable / Disable Name Color
+AllowVipNameColor = True
+VipNameColor = 0088FF
+# Enable / Disable Title Color
+AllowVipTitleColor = True
+VipTitleColor = 0088FF
+
+# if True Player Vip gain Xp*VipMulXp and Sp*VipMulSp
+# Note only works if player not in party
+AllowVipMulXpSp = True
+VipMulXp = 2
+VipMulSp = 2
# -----------------------------------------
#  Aio System                             -
# -----------------------------------------

 

Agora ficou fácil demais , só prosseguir.

Obrigada vou tentar *-*, sim eu fui no caminho correto que voce disse no post anterior, mas foi ali que eu me confundi mais hehe

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Quero que você pratica para aprender, por que vejo em você uma força de vontade que os outros não tem, a maioria tem preguiça de aprender ou não está disposto a enfrentar novos desafios, e na programação você sempre será desafiado.

Mas é bem fácil fazer a adaptação do código do gameserver para AdminCommandHandler


 							}
Index: /trunk/L2JKombat_Core/java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
===================================================================
--- /trunk/L2JKombat_Core/java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 4)
+++ /trunk/L2JKombat_Core/java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 16)
@@ -23,4 +23,5 @@
 import net.sf.l2j.Config;
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAdmin;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAio;
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAnnouncements;
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminAutoAnnouncements;
@@ -85,4 +86,5 @@
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTvTEngine;
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminUnblockIp;
+import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminVip;
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminZone;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
@@ -174,4 +176,6 @@
 		registerAdminCommandHandler(new AdminManor());
 		registerAdminCommandHandler(new AdminMassRecall());
+		registerAdminCommandHandler(new AdminAio());
+		registerAdminCommandHandler(new AdminVip());
 		_log.config("AdminCommandHandler: Loaded " + _datatable.size() + " handlers.");
 	}

Como pode ver no código já está fácil fazer isso é só seguir o exemplo do resto , cada linha aí registra um comando Admin.

Boa sorte.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Obrigada vou tentar *-*, sim eu fui no caminho correto que voce disse no post anterior, mas foi ali que eu me confundi mais hehe

Tayran eu nao tenho esse arquivo AdminVip.java, tem apenas AdminDonator.java e AdminVIPEngine.java, o resto que vc postou ja add legal *-**

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

é por que você tem que criar ele.


Clica em cima do packet no project explorer e digita ctrl + n seleciona Class coloca o nome da class e da finish e depois substitui o código dentro da class criada pelo código que você tem que substituir , dá para usar o file também dentro do ctrl + n , só que o Class é mais prático.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

é por que você tem que criar ele.

Clica em cima do packet no project explorer e digita ctrl + n seleciona Class coloca o nome da class e da finish e depois substitui o código dentro da class criada pelo código que você tem que substituir , dá para usar o file também dentro do ctrl + n , só que o Class é mais prático.

Consegui criar a AdminVip, quando eu criei apareceu umas 4 ou 5 linhas dai apaguei tudo e substitui com as suas do AdminVip e salvei, mas apareceu 11 erros, se eu clicar sobre eles aparece a seguinte opcao "Add cast to player' Obrigada por dizer que eu sou esforçada, vejo isso como uma qualidade minha realmente eu tenho vontade de aprender e passar por novos desafios. :$ :$ :$ Ainda quero chegar ao ponto de criar novos MODS e poder ajudar as pessoas assim você voce me ajuda.

OBS.: Antes apareceu um erro no EnterWord,java e na descricao do erro aparecia variable... e mais alguma coisa que nao lembro, ai eu cliquei sobre ele, e depois cliquei no x vermelho e apareceu uma opção para criar variable... eu cliquei nele e resolveu o problema, sera que fiz certo fazendo isso ? :X :rsrs:

 

Segue Imagem:

IoNYscD.png

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

 

Amiga eu estou saindo e só estarei disponível para ajudar Segunda-feira , deixa esse projeto sem mexer que te ajudo quando voltar tá ok ? obrigado.

"Tente ser uma pessoa de valor , não de sucesso" - Albert Einstein

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Olá, o que está errado são esses dois métodos:

public void doVip(L2PcInstance activeChar, L2PcInstance player, String playername, String _time)
public void removeVip(L2PcInstance activeChar, L2PcInstance player, String playername)

Apenas troque "player" por "_player", provavelmente vai corrigir a maioria desses erros.

 

att[]'s

Link para o comentário
Compartilhar em outros sites

  • 0

Amiga eu estou saindo e só estarei disponível para ajudar Segunda-feira , deixa esse projeto sem mexer que te ajudo quando voltar tá ok ? obrigado.

Tudo bem, vou deixar ele paradinho aqui, bom final de semana amigo. *-*

Olá, o que está errado são esses dois métodos:

public void doVip(L2PcInstance activeChar, L2PcInstance player, String playername, String _time)
public void removeVip(L2PcInstance activeChar, L2PcInstance player, String playername)

Apenas troque "player" por "_player", provavelmente vai corrigir a maioria desses erros.

 

att[]'s

Ola KhayrusS, tudo bem vou verificar aqui, obrigada pela atenção :smile:

Tudo bem, vou deixar ele paradinho aqui, bom final de semana amigo. *-*

Ola KhayrusS, tudo bem vou verificar aqui, obrigada pela atenção :smile:

Nao tenho essas linhas aqui no meu L2PcInstance.java amigo, percebi que no MOD não tem tbm

tem algum problema concertar o erro clicando nele? pq aparece umas opcoes e eu cliquei e resolveu todos os erros :haha: espero que eu n tenha me precipitado !!!

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

  • 0

Olá, Michelle.

 

Essas linhas que mencionei não são no L2PcInstance, são no AdminVip, que é onde está ocorrendo os erros.

 

 

 

 

tem algum problema concertar o erro clicando nele? pq aparece umas opcoes e eu cliquei e resolveu todos os erros :haha: espero que eu n tenha me precipitado !!!

 

Nesse caso, creio que não irá funcionar corrigindo com a opção que o Eclipse lhe deu. Pois apenas fez um Cast em um objeto diferente do que você realmente precisa modificar

 

att[]'s

Editado por KhayrusS
Link para o comentário
Compartilhar em outros sites

  • 0

Olá, Michelle.

 

Essas linhas que mencionei não são no L2PcInstance, são no AdminVip, que é onde está ocorrendo os erros.

 

 

 

Nesse caso, creio que não irá funcionar corrigindo com a opção que o Eclipse lhe deu. Pois apenas fez um Cast em um objeto diferente do que você realmente precisa modificar

 

att[]'s

Infelizmente nao resolveu, complilei e fui criar um novo char pra testar, da erro no console do gameserver, e tentei logar com um char existente n passa da tela de loading :(, vou fazer os procedimentos que me disse agora no AdminVip, tomara q resolva *-* espero que eu nao tenha estragado meu servidor todo :( :sad:

Editado por Michelle

"Os problemas significativos que enfrentamos não podem ser resolvidos no mesmo nível de pensamento em que estávamos quando os criamos."


Albert Einstein

Link para o comentário
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...
  • Registre-se

    Faça parte da maior e  mais antigas comunidades sobre Lineage2 da América Latina.






  • Patrocinadores

  • Quem Está Navegando

    • Nenhum usuário registrado visualizando esta página.
  • Posts

    • Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?     Teria como fazer do dusk shield e do zombie shield dessa maneira?    
    • muchas gracias muy lindos NPC 🙂
    • relaxa jovem gafanhoto, testa as quests. e posTa os erros indesejaveis.  
    • Se alguém pudesse me ensinar como codificar as missões, eu ficaria feliz em fazer isso sozinho ou pelo menos ajudar. Eu realmente quero jogar em um servidor onde todas as quests funcionem bem e melhor ainda se você puder fazer quests customizadas!
    • mas no interlude, nem todas as quests de class,  vai mostrar onde tem que ir, ate o reborn nao mostrava quando era interlude, só mostrou depois que eles colocaram client classic pra rodar, e ficou melhor ainda quando virou hellbound em diante, mas ha sim alguma chance de modificar isso direto no script para fazer igualmente, só basta te um pouco de paciencia e persistencia exato
    • 408_PathToElvenwizard dá Orion eu tive que mexer tbm, até modifiquei e consegui deixar ela igual do Classic, com a seta e a marcação no mapa. (não retail IL) Dá pra importar py de várias revs, o foda é que não da regular as quest py através do debug em tempo real, pelo menos eu não consegui rsrs
    • Hasta el momento todas las QUESTS son completables si te guias con un tutorial de youtube. El problema es que tienen bugs de locacion y de subquests que no avanzan o no te marcan correctamente a donde ir en el mapa, cosa que en Retail si se ve como corresponde.
    • estranho, mas pelo menos a galera nunca reclamo das quests quando tinha aberto 5x, geral fez class primeira e segunda job, poucos que compraram a class
    • en RUSaCis-3.5 data pack, las Quests estan en formato .java y son diferentes a como estan redactadas en jOrion y jFrozen 1.5 (ProyectX) package net.sf.l2j.gameserver.scripting.quest; import net.sf.l2j.commons.random.Rnd; import net.sf.l2j.gameserver.enums.Paperdoll; import net.sf.l2j.gameserver.enums.QuestStatus; import net.sf.l2j.gameserver.enums.actors.ClassId; import net.sf.l2j.gameserver.model.actor.Creature; import net.sf.l2j.gameserver.model.actor.Npc; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.network.serverpackets.SocialAction; import net.sf.l2j.gameserver.scripting.QuestState; public class Q224_TestOfSagittarius extends SecondClassQuest { private static final String QUEST_NAME = "Q224_TestOfSagittarius"; // Items private static final int BERNARD_INTRODUCTION = 3294; private static final int HAMIL_LETTER_1 = 3295; private static final int HAMIL_LETTER_2 = 3296; private static final int HAMIL_LETTER_3 = 3297; private static final int HUNTER_RUNE_1 = 3298; private static final int HUNTER_RUNE_2 = 3299; private static final int TALISMAN_OF_KADESH = 3300; private static final int TALISMAN_OF_SNAKE = 3301; private static final int MITHRIL_CLIP = 3302; private static final int STAKATO_CHITIN = 3303; private static final int REINFORCED_BOWSTRING = 3304; private static final int MANASHEN_HORN = 3305; private static final int BLOOD_OF_LIZARDMAN = 3306; private static final int CRESCENT_MOON_BOW = 3028; private static final int WOODEN_ARROW = 17; // Rewards private static final int MARK_OF_SAGITTARIUS = 3293; // NPCs private static final int BERNARD = 30702; private static final int HAMIL = 30626; private static final int SIR_ARON_TANFORD = 30653; private static final int VOKIAN = 30514; private static final int GAUEN = 30717; // Monsters private static final int ANT = 20079; private static final int ANT_CAPTAIN = 20080; private static final int ANT_OVERSEER = 20081; private static final int ANT_RECRUIT = 20082; private static final int ANT_PATROL = 20084; private static final int ANT_GUARD = 20086; private static final int NOBLE_ANT = 20089; private static final int NOBLE_ANT_LEADER = 20090; private static final int BREKA_ORC_SHAMAN = 20269; private static final int BREKA_ORC_OVERLORD = 20270; private static final int MARSH_STAKATO_WORKER = 20230; private static final int MARSH_STAKATO_SOLDIER = 20232; private static final int MARSH_STAKATO_DRONE = 20234; private static final int MARSH_SPIDER = 20233; private static final int ROAD_SCAVENGER = 20551; private static final int MANASHEN_GARGOYLE = 20563; private static final int LETO_LIZARDMAN = 20577; private static final int LETO_LIZARDMAN_ARCHER = 20578; private static final int LETO_LIZARDMAN_SOLDIER = 20579; private static final int LETO_LIZARDMAN_WARRIOR = 20580; private static final int LETO_LIZARDMAN_SHAMAN = 20581; private static final int LETO_LIZARDMAN_OVERLORD = 20582; private static final int SERPENT_DEMON_KADESH = 27090; public Q224_TestOfSagittarius() { super(224, "Test Of Sagittarius"); setItemsIds(BERNARD_INTRODUCTION, HAMIL_LETTER_1, HAMIL_LETTER_2, HAMIL_LETTER_3, HUNTER_RUNE_1, HUNTER_RUNE_2, TALISMAN_OF_KADESH, TALISMAN_OF_SNAKE, MITHRIL_CLIP, STAKATO_CHITIN, REINFORCED_BOWSTRING, MANASHEN_HORN, BLOOD_OF_LIZARDMAN, CRESCENT_MOON_BOW); addQuestStart(BERNARD); addTalkId(BERNARD, HAMIL, SIR_ARON_TANFORD, VOKIAN, GAUEN); addMyDying(ANT, ANT_CAPTAIN, ANT_OVERSEER, ANT_RECRUIT, ANT_PATROL, ANT_GUARD, NOBLE_ANT, NOBLE_ANT_LEADER, BREKA_ORC_SHAMAN, BREKA_ORC_OVERLORD, MARSH_STAKATO_WORKER, MARSH_STAKATO_SOLDIER, MARSH_STAKATO_DRONE, MARSH_SPIDER, ROAD_SCAVENGER, MANASHEN_GARGOYLE, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SERPENT_DEMON_KADESH); } @Override public String onAdvEvent(String event, Npc npc, Player player) { String htmltext = event; QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; // BERNARD if (event.equalsIgnoreCase("30702-04.htm")) { st.setState(QuestStatus.STARTED); st.setCond(1); playSound(player, SOUND_ACCEPT); giveItems(player, BERNARD_INTRODUCTION, 1); if (giveDimensionalDiamonds39(player)) htmltext = "30702-04a.htm"; } // HAMIL else if (event.equalsIgnoreCase("30626-03.htm")) { st.setCond(2); playSound(player, SOUND_MIDDLE); takeItems(player, BERNARD_INTRODUCTION, 1); giveItems(player, HAMIL_LETTER_1, 1); } else if (event.equalsIgnoreCase("30626-07.htm")) { st.setCond(5); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_1, 10); giveItems(player, HAMIL_LETTER_2, 1); } // SIR_ARON_TANFORD else if (event.equalsIgnoreCase("30653-02.htm")) { st.setCond(3); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_1, 1); } // VOKIAN else if (event.equalsIgnoreCase("30514-02.htm")) { st.setCond(6); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_2, 1); } return htmltext; } @Override public String onTalk(Npc npc, Player player) { String htmltext = getNoQuestMsg(); QuestState st = player.getQuestList().getQuestState(QUEST_NAME); if (st == null) return htmltext; switch (st.getState()) { case CREATED: if (player.getClassId() != ClassId.ROGUE && player.getClassId() != ClassId.ELVEN_SCOUT && player.getClassId() != ClassId.ASSASSIN) htmltext = "30702-02.htm"; else if (player.getStatus().getLevel() < 39) htmltext = "30702-01.htm"; else htmltext = "30702-03.htm"; break; case STARTED: int cond = st.getCond(); switch (npc.getNpcId()) { case BERNARD: htmltext = "30702-05.htm"; break; case HAMIL: if (cond == 1) htmltext = "30626-01.htm"; else if (cond == 2 || cond == 3) htmltext = "30626-04.htm"; else if (cond == 4) htmltext = "30626-05.htm"; else if (cond > 4 && cond < 8) htmltext = "30626-08.htm"; else if (cond == 8) { htmltext = "30626-09.htm"; st.setCond(9); playSound(player, SOUND_MIDDLE); takeItems(player, HUNTER_RUNE_2, 10); giveItems(player, HAMIL_LETTER_3, 1); } else if (cond > 8 && cond < 12) htmltext = "30626-10.htm"; else if (cond == 12) { htmltext = "30626-11.htm"; st.setCond(13); playSound(player, SOUND_MIDDLE); } else if (cond == 13) htmltext = "30626-12.htm"; else if (cond == 14) { htmltext = "30626-13.htm"; takeItems(player, BLOOD_OF_LIZARDMAN, -1); takeItems(player, CRESCENT_MOON_BOW, 1); takeItems(player, TALISMAN_OF_KADESH, 1); giveItems(player, MARK_OF_SAGITTARIUS, 1); rewardExpAndSp(player, 54726, 20250); player.broadcastPacket(new SocialAction(player, 3)); playSound(player, SOUND_FINISH); st.exitQuest(false); } break; case SIR_ARON_TANFORD: if (cond == 2) htmltext = "30653-01.htm"; else if (cond > 2) htmltext = "30653-03.htm"; break; case VOKIAN: if (cond == 5) htmltext = "30514-01.htm"; else if (cond == 6) htmltext = "30514-03.htm"; else if (cond == 7) { htmltext = "30514-04.htm"; st.setCond(8); playSound(player, SOUND_MIDDLE); takeItems(player, TALISMAN_OF_SNAKE, 1); } else if (cond > 7) htmltext = "30514-05.htm"; break; case GAUEN: if (cond == 9) { htmltext = "30717-01.htm"; st.setCond(10); playSound(player, SOUND_MIDDLE); takeItems(player, HAMIL_LETTER_3, 1); } else if (cond == 10) htmltext = "30717-03.htm"; else if (cond == 11) { htmltext = "30717-02.htm"; st.setCond(12); playSound(player, SOUND_MIDDLE); takeItems(player, MANASHEN_HORN, 1); takeItems(player, MITHRIL_CLIP, 1); takeItems(player, REINFORCED_BOWSTRING, 1); takeItems(player, STAKATO_CHITIN, 1); giveItems(player, CRESCENT_MOON_BOW, 1); giveItems(player, WOODEN_ARROW, 10); } else if (cond > 11) htmltext = "30717-04.htm"; break; } break; case COMPLETED: htmltext = getAlreadyCompletedMsg(); break; } return htmltext; } @Override public void onMyDying(Npc npc, Creature killer) { final Player player = killer.getActingPlayer(); final QuestState st = checkPlayerState(player, npc, QuestStatus.STARTED); if (st == null) return; switch (npc.getNpcId()) { case ANT: case ANT_CAPTAIN: case ANT_OVERSEER: case ANT_RECRUIT: case ANT_PATROL: case ANT_GUARD: case NOBLE_ANT: case NOBLE_ANT_LEADER: if (st.getCond() == 3 && dropItems(player, HUNTER_RUNE_1, 1, 10, 500000)) st.setCond(4); break; case BREKA_ORC_SHAMAN: case BREKA_ORC_OVERLORD: if (st.getCond() == 6 && dropItems(player, HUNTER_RUNE_2, 1, 10, 500000)) { st.setCond(7); giveItems(player, TALISMAN_OF_SNAKE, 1); } break; case MARSH_STAKATO_WORKER: case MARSH_STAKATO_SOLDIER: case MARSH_STAKATO_DRONE: if (st.getCond() == 10 && dropItems(player, STAKATO_CHITIN, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, REINFORCED_BOWSTRING)) st.setCond(11); break; case MARSH_SPIDER: if (st.getCond() == 10 && dropItems(player, REINFORCED_BOWSTRING, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case ROAD_SCAVENGER: if (st.getCond() == 10 && dropItems(player, MITHRIL_CLIP, 1, 1, 100000) && player.getInventory().hasItems(MANASHEN_HORN, REINFORCED_BOWSTRING, STAKATO_CHITIN)) st.setCond(11); break; case MANASHEN_GARGOYLE: if (st.getCond() == 10 && dropItems(player, MANASHEN_HORN, 1, 1, 100000) && player.getInventory().hasItems(REINFORCED_BOWSTRING, MITHRIL_CLIP, STAKATO_CHITIN)) st.setCond(11); break; case LETO_LIZARDMAN: case LETO_LIZARDMAN_ARCHER: case LETO_LIZARDMAN_SOLDIER: case LETO_LIZARDMAN_WARRIOR: case LETO_LIZARDMAN_SHAMAN: case LETO_LIZARDMAN_OVERLORD: if (st.getCond() == 13) { if (((player.getInventory().getItemCount(BLOOD_OF_LIZARDMAN) - 120) * 5) > Rnd.get(100)) { playSound(player, SOUND_BEFORE_BATTLE); takeItems(player, BLOOD_OF_LIZARDMAN, -1); addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } else dropItemsAlways(player, BLOOD_OF_LIZARDMAN, 1, 0); } break; case SERPENT_DEMON_KADESH: if (st.getCond() == 13) { if (player.getInventory().getItemIdFrom(Paperdoll.RHAND) == CRESCENT_MOON_BOW) { st.setCond(14); playSound(player, SOUND_MIDDLE); giveItems(player, TALISMAN_OF_KADESH, 1); } else addSpawn(SERPENT_DEMON_KADESH, player, false, 300000, true); } break; } } }  
×
×
  • Criar Novo...

Important Information

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.