Advertisement
Guest User

AccessDenied (faction aCis)

a guest
Jan 17th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.95 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 5)
  6. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  7. @@ -313,8 +313,8 @@
  8.     private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
  9.    
  10.     private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,nobless,power_grade,last_recom_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  11. -   private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,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=? WHERE obj_id=?";
  12. -   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, 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 FROM characters WHERE obj_id=?";
  13. +   private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,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=?, factionId=? WHERE obj_id=?";
  14. +   private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, 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,factionId FROM characters WHERE obj_id=?";
  15.    
  16.     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";
  17.     private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
  18. @@ -4029,6 +4029,8 @@
  19.         {
  20.             L2PcInstance pk = killer.getActingPlayer();
  21.            
  22. +           pk.setPvpKills(pk.getPvpKills() + 1);
  23. +          
  24.             // Clear resurrect xp calculation
  25.             setExpBeforeDeath(0);
  26.            
  27. @@ -4242,7 +4244,12 @@
  28.         {
  29.             // PK Points are increased only if you kill a player.
  30.             if (target instanceof L2PcInstance)
  31. +           {
  32. +               if (target.getActingPlayer().getFactionId() != 0)
  33. +                   return;
  34. +              
  35.                 setPkKills(getPkKills() + 1);
  36. +           }
  37.            
  38.             // Calculate new karma.
  39.             setKarma(getKarma() + Formulas.calculateKarmaGain(getPkKills(), target instanceof L2Summon));
  40. @@ -4257,6 +4264,9 @@
  41.         if (isInsideZone(ZoneId.PVP))
  42.             return;
  43.        
  44. +       if (getFactionId() != 0)
  45. +           return;
  46. +      
  47.         PvpFlagTaskManager.getInstance().add(this, Config.PVP_NORMAL_TIME);
  48.        
  49.         if (getPvpFlag() == 0)
  50. @@ -4272,6 +4282,9 @@
  51.         if (isInDuel() && player.getDuelId() == getDuelId())
  52.             return;
  53.        
  54. +       if (getFactionId() != 0)
  55. +           return;
  56. +      
  57.         if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0)
  58.         {
  59.             PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME);
  60. @@ -5479,6 +5492,8 @@
  61.                 player.setName(rset.getString("char_name"));
  62.                 player._lastAccess = rset.getLong("lastAccess");
  63.                
  64. +               player.setFactionId(rset.getInt("factionId"));
  65. +              
  66.                 player.getStat().setExp(rset.getLong("exp"));
  67.                 player.setExpBeforeDeath(rset.getLong("expBeforeDeath"));
  68.                 player.getStat().setLevel(rset.getByte("level"));
  69. @@ -5922,7 +5937,8 @@
  70.             statement.setLong(47, getClanCreateExpiryTime());
  71.             statement.setString(48, getName());
  72.             statement.setLong(49, getDeathPenaltyBuffLevel());
  73. -           statement.setInt(50, getObjectId());
  74. +           statement.setInt(50, getFactionId());
  75. +           statement.setInt(51, getObjectId());
  76.            
  77.             statement.execute();
  78.             statement.close();
  79. @@ -10705,4 +10721,16 @@
  80.                 break;
  81.         }
  82.     }
  83. +  
  84. +   private int _factionId;
  85. +  
  86. +   public void setFactionId(int id)
  87. +   {
  88. +       _factionId = id;
  89. +   }
  90. +  
  91. +   public int getFactionId()
  92. +   {
  93. +       return _factionId;
  94. +   }
  95.  }
  96. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement