Jump to content

dymek1984

Members
  • Posts

    214
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by dymek1984

  1. yes, now I know. I thought at work and I thought how stupid I am, in all I thought about another place in L2PcInstance. but it still does not work. If i put this in public void increasePvpKills(L2Character target) i get error sie 06, 2012 6:29:17 PM com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket run SEVERE: Client: [Character: Suczka[268482585] - Account: suczka - IP: 127.0.0.1] - Failed running: [C] 03 EnterWorld - L2J Server Version: 5538M - DP Revision: 9035 ; null java.lang.StackOverflowError at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.getAccessLevel(L2PcInstance.java:6998) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.isGM(L2PcInstance.java:6945) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5555) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5609) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5609) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5609) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5609) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5609) at com.l2jserver.gameserver.model.actor.instance.L2PcInstance.updateRank(L2PcInstance.java:5609)......
  2. I tried so instead updateRank(getPvpPoints ()); gave updateRank(getPvpKills ()); and How do I get a 25000 pvp rank jumps to 1 which must either updateRank(getPvpPoints ()); enter in the appropriate place or my code is missing something. [pl]poprobowalem tak zamiast updateRank(getPvpPoints()); dalem updateRank(getPvpKills()); i jak zdobede 25000 pvp to rank wskakuje na 1. czyli musze albo updateRank(getPvpPoints()); wpisac w odpowiednie miejsce albo czegos mojemu code brakuje.[/pl] (Sorry Tryskell)
  3. nowhere in pcinstance not have increasePvpPoints [pl]nigdzie w pcinstance nie mam increasePvpPoints[/pl]
  4. Wlasnie nie, sprawdzalem na kilka sposobow i rank sie nie zmienia czy czekam 15 min czy sie przeloguje, poszperam jeszcze jakies cody z nameColor za pvp moze cos przeoczylem.
  5. yes i change from long to int.
  6. changed [pl]zmienilem[/pl] + statement.setLong(53, getPvpPoints()); + statement.setLong(54, getRank()); for [pl]na[/pl] + statement.setInt(53, getPvpPoints()); + statement.setInt(54, getRank()); and writes to the db works and adds points, but a rank does not work, How do I get 25 000 pvpPoints should nick color Changes and db rank jump to 1, and this does not happen, tomorrow as I have time to even testing and see. btw I have a clean log any errors. [pl]i dzialazapisuje do db i sumuje punkty ale za to rank nie dzialajak zdobede 25000 pvp points powinien kolor niku sie zmienic i w db rank wskoczycna 1, a tak sie nie dzieje jutro jak bedemial czas to jeszcze potestuje i zobacze. btw logi mam czyste zadnych bledow.[/pl] ps. also changed player.setPvpPoints(rset.getInt("rank")); for player.setRank(rset.getInt("rank")); [pl]ps. takze zmienilem player.setPvpPoints(rset.getInt("rank")); na player.setRank(rset.getInt("rank"));[/pl]
  7. [pl]Vampir nie mam co teraz testować jak mi pvppoints nie zapisuje poprawnie w bazie punkty powinny się dodawać i według nich powinien wzrastać rank a jest tak ze jak zabije gracza i dostane 23 punkty to w bazie pokazuje 23 i jak drugi raz zabije gracza i dostane 21 punktów to pokazuje 21 a powinno sumować i powinno być 44. kill.setPvpPoints(kill.getPvpPoints() + pointsToAdd); z tego wynika ze problem jest z getPvpPoints() tak mi sie wydaje. [/pl]
  8. :'( Tbh i thought that this is the end. So i need help if code is unfinished. Can u help me?
  9. Yes. you have a solution, where made a mistake
  10. Now I can not check pvppoints in the game, so I do not know. (will add info about pvp points later) Tried 10 times kill a player and in database stored only last points. that means points not add
  11. Hello i make pvp points system but some is wrong with the code can some one check it and tell me where im fail ^^ This works so that if he kills a player to give me 5% of its fame, and add as many sp and pvppoints. Everything works fine except the pvppoints. does not add points in the DB shows such as 23 pvppoints and How do I get 40 should be 63 and is 40 ;/ Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 5547) +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -286,9 +286,9 @@ private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE charId=? AND class_index=?"; // Character Character SQL String Definitions: - private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createTime) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - 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=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?"; - private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,language FROM characters WHERE charId=?"; + private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createTime,pvpPoints) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + 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=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=?,pvpPoints=?,rank=? WHERE charId=?"; + private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,language,pvpPoints,rank FROM characters WHERE charId=?"; // Character Teleport Bookmark: private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)"; @@ -413,6 +413,10 @@ /** The PK counter of the L2PcInstance (= Number of non PvP Flagged player killed) */ private int _pkKills; + private int _pvpPoints; + + private int _rank; + /** The PvP Flag state of the L2PcInstance (0=White, 1=Purple) */ private byte _pvpFlag; @@ -4343,7 +4347,67 @@ DuelManager.getInstance().broadcastToOppositTeam(this, update); } } - + public void updateRank(int pvpPoints) + { + if (Config.PVP_RANK_SYSTEM_ENABLED) + { + //Check if the character has GM access + if (isGM()) + return; + { + if ((pvpPoints >= (Config.PVP_LVL1)) && (pvpPoints <= (Config.PVP_LVL1))) + { + getActingPlayer().setRank(1); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK1); + } + else if ((pvpPoints >= (Config.PVP_LVL2)) && (pvpPoints <= (Config.PVP_LVL2))) + { + getActingPlayer().setRank(2); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK2); + } + else if ((pvpPoints >= (Config.PVP_LVL3)) && (pvpPoints <= (Config.PVP_LVL3))) + { + getActingPlayer().setRank(3); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK3); + } + else if ((pvpPoints >= (Config.PVP_LVL4)) && (pvpPoints <= (Config.PVP_LVL4))) + { + getActingPlayer().setRank(4); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK4); + } + else if ((pvpPoints >= (Config.PVP_LVL5)) && (pvpPoints <= (Config.PVP_LVL5))) + { + getActingPlayer().setRank(5); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK5); + } + else if ((pvpPoints >= (Config.PVP_LVL6)) && (pvpPoints <= (Config.PVP_LVL6))) + { + getActingPlayer().setRank(6); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK6); + } + else if ((pvpPoints >= (Config.PVP_LVL7)) && (pvpPoints <= (Config.PVP_LVL7))) + { + getActingPlayer().setRank(7); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK7); + } + else if ((pvpPoints >= (Config.PVP_LVL8)) && (pvpPoints <= (Config.PVP_LVL8))) + { + getActingPlayer().setRank(8); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK8); + } + else if ((pvpPoints >= (Config.PVP_LVL9)) && (pvpPoints <= (Config.PVP_LVL9))) + { + getActingPlayer().setRank(9); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK9); + } + else if (pvpPoints >= (Config.PVP_LVL10)) + { + getActingPlayer().setRank(10); + getAppearance().setNameColor(Config.NAME_COLOR_FOR_RANK10); + } + } + } + } /** * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR> * @@ -5337,6 +5401,50 @@ if (killer != null) { + if (killer instanceof L2PcInstance && getPvpFlag() > 0) + { + L2Party party = killer.getParty(); + L2PcInstance kill = (L2PcInstance) killer; + int pointsToAdd; + if (party == null) + { + pointsToAdd = (int) (_fame*0.05); + } + else + { + pointsToAdd = (int) (_fame*0.05/party.getMemberCount()); + } + int pointsToRemove = _fame - pointsToAdd < 0 ? 0 : _fame - pointsToAdd; + kill.setFame(kill.getFame() + pointsToAdd); + kill.setSp(kill.getSp() + pointsToAdd); + kill.setPvpPoints(kill.getPvpPoints() + pointsToAdd); + setFame(pointsToRemove); + killer.sendMessage("You have earned " + pointsToAdd + " Fame Points from " + getName() + ""); + killer.broadcastPacket(new MagicSkillUse(killer, 23021, 1, 0, 0)); + { + if(killer instanceof L2PcInstance && getPvpFlag() > 0) + { + if (party != null) + { + for(L2PcInstance PartyMember : party.getPartyMembers()) + { + if(PartyMember.isInsideRadius(this, 1600, true, false) && PartyMember != killer) + { + int numberToAdd = (int) (_fame*0.05/party.getMemberCount()); + PartyMember.setFame(PartyMember.getFame() + numberToAdd); + PartyMember.setSp(PartyMember.getSp() + numberToAdd); + PartyMember.setPvpPoints(kill.getPvpPoints() + numberToAdd); + int pointsToRemove1 = _fame - numberToAdd < 0 ? 0 : _fame - numberToAdd; + setFame(pointsToRemove1); + PartyMember.setPvpKills(PartyMember.getPvpKills() + 1); + PartyMember.sendMessage("You have earned " + numberToAdd + " Fame Points from " + getName() + ""); + PartyMember.broadcastPacket(new MagicSkillUse(PartyMember, 23021, 1, 0, 0)); + } + } + } + } + } + } L2PcInstance pk = killer.getActingPlayer(); TvTEvent.onKill(killer, this); @@ -5683,7 +5791,8 @@ { // Add karma to attacker and increase its PK counter setPvpKills(getPvpKills() + 1); - + updateRank(getPvpPoints()); + broadcastUserInfo(); // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); @@ -7026,7 +7135,11 @@ statement.setInt(35, isNoble() ? 1 :0); statement.setLong(36, 0); statement.setLong(37,getCreateTime()); + statement.setLong(38, 0); + + + statement.executeUpdate(); statement.close(); } @@ -7098,6 +7211,8 @@ player.setFame(rset.getInt("fame")); player.setPvpKills(rset.getInt("pvpkills")); player.setPkKills(rset.getInt("pkkills")); + player.setPvpPoints(rset.getInt("pvpPoints")); + player.setPvpPoints(rset.getInt("rank")); player.setOnlineTime(rset.getLong("onlinetime")); player.setNewbie(rset.getInt("newbie")); player.setNoble(rset.getInt("nobless")==1); @@ -7224,6 +7339,8 @@ // Language player.setLang(rset.getString("language")); + + // Retrieve the name and ID of the other characters assigned to this account. PreparedStatement stmt = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name=? AND charId<>?"); stmt.setString(1, player._accountName); @@ -7665,7 +7782,9 @@ statement.setInt(50, getBookMarkSlot()); statement.setInt(51, getVitalityPoints()); statement.setString(52, getLang()); - statement.setInt(53, getObjectId()); + statement.setLong(53, getPvpPoints()); + statement.setLong(54, getRank()); + statement.setInt(55, getObjectId()); statement.execute(); statement.close(); @@ -14475,7 +14594,25 @@ L2DatabaseFactory.close(con); } } + public void setPvpPoints(int points) + { + _pvpPoints = points; + } + public int getPvpPoints() + { + return _pvpPoints; + } + public void setRank(int points1) + { + _rank = points1; + } + + public int getRank() + { + return _rank; + } + public double getCollisionRadius() { if (getAppearance().getSex()) Index: java/com/l2jserver/Config.java =================================================================== --- java/com/l2jserver/Config.java (revision 5547) +++ java/com/l2jserver/Config.java (working copy) @@ -725,7 +725,27 @@ public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST; - + public static boolean PVP_RANK_SYSTEM_ENABLED; + public static int PVP_LVL1; + public static int PVP_LVL2; + public static int PVP_LVL3; + public static int PVP_LVL4; + public static int PVP_LVL5; + public static int PVP_LVL6; + public static int PVP_LVL7; + public static int PVP_LVL8; + public static int PVP_LVL9; + public static int PVP_LVL10; + public static int NAME_COLOR_FOR_RANK1; + public static int NAME_COLOR_FOR_RANK2; + public static int NAME_COLOR_FOR_RANK3; + public static int NAME_COLOR_FOR_RANK4; + public static int NAME_COLOR_FOR_RANK5; + public static int NAME_COLOR_FOR_RANK6; + public static int NAME_COLOR_FOR_RANK7; + public static int NAME_COLOR_FOR_RANK8; + public static int NAME_COLOR_FOR_RANK9; + public static int NAME_COLOR_FOR_RANK10; //-------------------------------------------------- // NPC Settings //-------------------------------------------------- @@ -2421,7 +2441,27 @@ } } } - + PVP_RANK_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnableRankSystem", "false")); + PVP_LVL1 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl1", "25000")); + PVP_LVL2 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl2", "50000")); + PVP_LVL3 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl3", "75000")); + PVP_LVL4 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl4", "100000")); + PVP_LVL5 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl5", "150000")); + PVP_LVL6 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl6", "200000")); + PVP_LVL7 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl7", "300000")); + PVP_LVL8 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl8", "400000")); + PVP_LVL9 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl9", "500000")); + PVP_LVL10 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl10", "700000")); + NAME_COLOR_FOR_RANK1 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank1", "00FF00")); + NAME_COLOR_FOR_RANK2 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank2", "00FF00")); + NAME_COLOR_FOR_RANK3 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank3", "00FF00")); + NAME_COLOR_FOR_RANK4 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank4", "00FF00")); + NAME_COLOR_FOR_RANK5 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank5", "00FF00")); + NAME_COLOR_FOR_RANK6 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank6", "00FF00")); + NAME_COLOR_FOR_RANK7 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank7", "00FF00")); + NAME_COLOR_FOR_RANK8 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank8", "00FF00")); + NAME_COLOR_FOR_RANK9 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank9", "00FF00")); + NAME_COLOR_FOR_RANK10 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForRank10", "00FF00")); BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false")); BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1")); BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000")); Index: .settings/org.eclipse.jdt.ui.prefs =================================================================== --- .settings/org.eclipse.jdt.ui.prefs (revision 5547) +++ .settings/org.eclipse.jdt.ui.prefs (working copy) @@ -1,4 +1,3 @@ -#Tue Aug 30 12:22:24 CLST 2011 cleanup.add_default_serial_version_id=true cleanup.add_generated_serial_version_id=false cleanup.add_missing_annotations=true http://pastebin.com/Ub427XYF
  12. I did as you said. 1st error - log in and see before Nick null, but only for me, others I can see normally 2nd error - prefix disappears after logoff 3rd now I think of it, however, is not a good idea, btw thx for help.
  13. have not found in UserInfo "_name = player.getName();"
  14. if i talk with NPC 2 times i will be ~VIP~~VIP~Angel and 3 times ~VIP~~VIP~~VIP~Angel?
  15. Tryskell You're right, better not to change the nickname of players, but it is a good idea. This may add a new column in characters sql "prefix" and insert in front of Nick. If it can be to do so,
  16. Hello! Trying to make scrypt to change the nickname prefix by pvp count But have little problem with that. exactly: here is the diff Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 5538) +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -4343,7 +4343,58 @@ DuelManager.getInstance().broadcastToOppositTeam(this, update); } } - + + public void updatePrefix(int pvpKills) + { + if (Config.PVP_PREFIX_SYSTEM_ENABLED) + { + //Check if the character has GM access + if (isGM()) + return; + { + if ((pvpKills >= (Config.PVP_LVL1)) && (pvpKills <= (Config.PVP_LVL1))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL1 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL2)) && (pvpKills <= (Config.PVP_LVL2))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL2 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL3)) && (pvpKills <= (Config.PVP_LVL3))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL3 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL4)) && (pvpKills <= (Config.PVP_LVL4))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL4 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL5)) && (pvpKills <= (Config.PVP_LVL5))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL5 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL6)) && (pvpKills <= (Config.PVP_LVL6))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL6 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL7)) && (pvpKills <= (Config.PVP_LVL7))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL7 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL8)) && (pvpKills <= (Config.PVP_LVL8))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL8 + getActingPlayer().getName()); + } + else if ((pvpKills >= (Config.PVP_LVL9)) && (pvpKills <= (Config.PVP_LVL9))) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL9 + getActingPlayer().getName()); + } + else if (pvpKills >= (Config.PVP_LVL10)) + { + getActingPlayer().setName(Config.NAME_PREFIX_FOR_PVP_LVL10 + getActingPlayer().getName()); + } + } + } + } /** * Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR> * @@ -5684,6 +5735,9 @@ // Add karma to attacker and increase its PK counter setPvpKills(getPvpKills() + 1); + updatePrefix(getPvpKills()); + broadcastUserInfo(); + // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); sendPacket(new ExBrExtraUserInfo(this)); Index: java/com/l2jserver/Config.java =================================================================== --- java/com/l2jserver/Config.java (revision 5538) +++ java/com/l2jserver/Config.java (working copy) @@ -725,6 +725,27 @@ public static int L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static TIntIntHashMap L2JMOD_DUALBOX_CHECK_WHITELIST; + public static boolean PVP_PREFIX_SYSTEM_ENABLED; + public static int PVP_LVL1; + public static int PVP_LVL2; + public static int PVP_LVL3; + public static int PVP_LVL4; + public static int PVP_LVL5; + public static int PVP_LVL6; + public static int PVP_LVL7; + public static int PVP_LVL8; + public static int PVP_LVL9; + public static int PVP_LVL10; + public static String NAME_PREFIX_FOR_PVP_LVL1; + public static String NAME_PREFIX_FOR_PVP_LVL2; + public static String NAME_PREFIX_FOR_PVP_LVL3; + public static String NAME_PREFIX_FOR_PVP_LVL4; + public static String NAME_PREFIX_FOR_PVP_LVL5; + public static String NAME_PREFIX_FOR_PVP_LVL6; + public static String NAME_PREFIX_FOR_PVP_LVL7; + public static String NAME_PREFIX_FOR_PVP_LVL8; + public static String NAME_PREFIX_FOR_PVP_LVL9; + public static String NAME_PREFIX_FOR_PVP_LVL10; //-------------------------------------------------- // NPC Settings @@ -2421,7 +2442,29 @@ } } } - + // PVP Name Prefix System configs - Start + PVP_PREFIX_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePrefixSystem", "false")); + PVP_LVL1 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl1", "500")); + PVP_LVL2 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl2", "1000")); + PVP_LVL3 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl3", "2000")); + PVP_LVL4 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl4", "2500")); + PVP_LVL5 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl5", "3000")); + PVP_LVL6 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl6", "350")); + PVP_LVL7 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl7", "4000")); + PVP_LVL8 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl8", "4500")); + PVP_LVL9 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl9", "5000")); + PVP_LVL10 = Integer.parseInt(L2JModSettings.getProperty("PvpLvl10", "7000")); + NAME_PREFIX_FOR_PVP_LVL1 = L2JModSettings.getProperty("PrefLvl1", "[Cadet]"); + NAME_PREFIX_FOR_PVP_LVL2 = L2JModSettings.getProperty("PrefLvl2", "[slayer]"); + NAME_PREFIX_FOR_PVP_LVL3 = L2JModSettings.getProperty("PrefLvl3", "[Corporal]"); + NAME_PREFIX_FOR_PVP_LVL4 = L2JModSettings.getProperty("PrefLvl4", "[Killer]"); + NAME_PREFIX_FOR_PVP_LVL5 = L2JModSettings.getProperty("PrefLvl5", "[Executioner]"); + NAME_PREFIX_FOR_PVP_LVL6 = L2JModSettings.getProperty("PrefLvl6", "[Most Wanted]"); + NAME_PREFIX_FOR_PVP_LVL7 = L2JModSettings.getProperty("PrefLvl7", "[Enforcer}"); + NAME_PREFIX_FOR_PVP_LVL8 = L2JModSettings.getProperty("PrefLvl8", "[Assasin}"); + NAME_PREFIX_FOR_PVP_LVL9 = L2JModSettings.getProperty("PrefLvl9", "[Exterminator]"); + NAME_PREFIX_FOR_PVP_LVL10 = L2JModSettings.getProperty("PrefLvl10", "[Lord of War]"); + // PvP Name Prefix System configs - End BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false")); BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1")); BANKING_SYSTEM_ADENA = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000")); Problem is: when the player has 500 pvp automatically appear prefix [cadet] but as I will have more pvp it appears [slayer] and nick looks like "[slayer][cadet]Nickname" jak zrobic aby usunac poprzedni prefix i dodac nowy? and code is written correctly?
  17. Formestill not working. what i need to have in config? like i say compilation was goodbuthave error in game 404 filrnotfounf "index.htm" i checked and files is in communityboard folder.
  18. [PL] Rzeszut jak tobie dziala to potpowiedz co ja zrobiem zle. W eclispe mam ok i server tez chodzi dobrze nie mam zadnych bledow. community server ustawilem dobrze bo laczy sie z gameserver, tylko jak wcisne alt+b mam napis 404: file notfound "index.htm"
  19. Give site or forum adress
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock