Jump to content
  • 0
Sign in to follow this  
FaRM

(Resolvido) Questão De Script !

Question

[center]Bom seguinte galera, como eu já compilei a rev não vai ter como eu colocar o java mod de pvp color system...
porém eu pensei em uma coisa mas não sei se vai dar certo.
Estou com dúvida quanto a isso.

Gostaria de saber se tem como colocar o npc de color change, por preço de pvp...
Exemplo: ao invés de pagar adena pra trocar a cor do nick, pagar pvp ou pk, ou só ter a quantidade de pvp ou pk necessária...

Se alguem souber como, e ter tempo pra dar um help ai.

Obrigado.
att, FaRM [/center]


Entre e Confira!!!!:

 

NEW* - L2Blank Freya PvP Server

 

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

É possível que você tem um código para ver o que pode ser feito? ou aberta para armar tudo completo .. Veja se conseguis .. redefinir alguma coisa e eu tento ser como você diz .. ! phyton ou java seria saudações mais direcionados!

Share this post


Link to post
Share on other sites

Proteja seu servidor de ataques DDoS massivos!

VPS EPIC
  • 0

Bom se tiver que mecher com java vai complicar...
mas vou ver aqui o que posso fazer...
veja o script:

Exemplo:
[quote] if event == "1":
if st.getQuestItemsCount([color="#FF0000"]57[/color]) > [color="#FF0000"]250000[/color]:
st.takeItems([color="#FF0000"]57[/color],[color="#FF0000"]250000[/color])
st.getPlayer().getAppearance().setNameColor(0x009900)
st.getPlayer().broadcastUserInfo();
return "1.htm"[/quote]


como pode ver ele requer o id do item e quantidade.


Entre e Confira!!!!:

 

NEW* - L2Blank Freya PvP Server

 

Share this post


Link to post
Share on other sites
  • 0

String colorCode = "0xFFFF77";
if ((pvpKillAmount >= 500) && (pvpKillAmount <= 999)) colorCode = "0x006400";


que provavelmente deve pensar algo como isso .. se você receber um erro .. não ter o alforje cheio eu não posso testar localmente

Share this post


Link to post
Share on other sites
  • 0

[quote]Index: java/config/pvp.properties
===================================================================
--- java/config/pvp.properties (revision 3225)
+++ java/config/pvp.properties (working copy)
@@ -57,4 +57,141 @@

# Length one stays in PvP mode after hitting a purple player (in ms)
# Default: 60000
-PvPVsPvPTime = 60000
\ No newline at end of file
+PvPVsPvPTime = 60000
+
+# Turn announcements on for when a Player kills another Player. Default - True
+AnnounceKill = True
+
+
+# -------------------------------------------------------------------------
+# Pk Protection for Low lvl chars
+# -------------------------------------------------------------------------
+# Disables attacking char if the attacker's lvl minus victim's lvl is over
+# the specified difference number. Setting the value to 0 disables the feature.
+PkProtection = 0
+
+
+# -------------------------------------------------------------------------
+# Section: PvP Name Color & Title Change System
+# -------------------------------------------------------------------------
+# Each Amount will change the name color and title to the values defined here.
+# Example: PvpAmmount1 = 100, when a character's PvP counter reaches 100, their name color will change
+# according to the NameColorForAmount value and their title will change according to the PvPTitleForAmount value.
+# Note: Colors Must Use RBG format
+# ATTENTION!!! NEVER USE THE PvP Title Change AND THE Pk Title Change SYSTEM AT THE SAME TIME!!!!
+
+EnablePvPColorSystem = false
+EnablePvPTitleSystem = false
+
+# Pvp Amount, Name color and Title level 1.
+PvPAmount1 = 100
+NameColorForAmount1 = 00FF00
+PvPTitleForAmount1 = Title
+
+# Pvp Amount, Name color and Title level 2.
+PvpAmount2 = 125
+NameColorForAmount2 = 00FF00
+PvPTitleForAmount2 = Title
+
+# Pvp Amount, Name color and Title level 3.
+PvpAmount3 = 150
+NameColorForAmount3 = 00FF00
+PvPTitleForAmount3 = Title
+
+# Pvp Amount, Name color and Title level 4.
+PvpAmount4 = 175
+NameColorForAmount4 = 00FF00
+PvPTitleForAmount4 = Title
+
+# Pvp Amount, Name color and Title level 5.
+PvpAmount5 = 200
+NameColorForAmount5 = 00FF00
+PvPTitleForAmount5 = Title
+
+# Pvp Amount, Name color and Title level 6.
+PvpAmount6 = 225
+NameColorForAmount6 = CCFF00
+PvPTitleForAmount6 = Title
+
+# Pvp Amount, Name color and Title level 7.
+PvpAmount7 = 250
+NameColorForAmount7 = 00FF00
+PvPTitleForAmount7 = Title
+
+# Pvp Amount, Name color and Title level 8.
+PvpAmount8 = 275
+NameColorForAmount8 = 00FF00
+PvPTitleForAmount8 = Title
+
+# Pvp Amount, Name color and Title level 9.
+PvpAmount9 = 300
+NameColorForAmount9 = 00FF00
+PvPTitleForAmount9 = Title
+
+# Pvp Amount, Name color and Title level 10.
+PvpAmount10 = 500
+NameColorForAmount10 = 00FF00
+PvPTitleForAmount10 = Title
+
+
+# ---------------------------------------
+# Section: PK Title Color & Title Change System by Level
+# ---------------------------------------
+# Each Amount will change the title color and title to the values defined here.
+# Example: PkAmmount1 = 100, when a character's Pk counter reaches 100, their title color will change
+# according to the TitleColorForAmount value and their title will change according to the PkTitleForAmount value.
+# Note: Colors Must Use RBG format
+# ATTENTION!!! NEVER USE THE PvP Title Change AND THE Pk Title Change SYSTEM AT THE SAME TIME!!!!
+
+EnablePkColorSystem = false
+EnablePkTitleSystem = false
+
+# Pk Amount & Title color level 1.
+PkAmount1 = 100
+TitleColorForAmount1 = 00FF00
+PkTitleForAmount1 = Title
+
+# Pk Amount & Title color level 2.
+PkAmount2 = 125
+TitleColorForAmount2 = 00FF00
+PkTitleForAmount2 = Title
+
+# Pk Amount & Title color level 3.
+PkAmount3 = 150
+TitleColorForAmount3 = 00FF00
+PkTitleForAmount3 = Title
+
+# Pk Amount & Title color level 4.
+PkAmount4 = 175
+TitleColorForAmount4 = 00FF00
+PkTitleForAmount4 = Title
+
+# Pk Amount & Title color level 5.
+PkAmount5 = 200
+TitleColorForAmount5 = 00FF00
+PkTitleForAmount5 = Title
+
+# Pk Amount & Title color level 6.
+PkAmount6 = 225
+TitleColorForAmount6 = 00FF00
+PkTitleForAmount6 = Title
+
+# Pk Amount & Title color level 7.
+PkAmount7 = 250
+TitleColorForAmount7 = 00FF00
+PkTitleForAmount7 = Title
+
+# Pk Amount & Title color level 8.
+PkAmount8 = 275
+TitleColorForAmount8 = 00FF00
+PkTitleForAmount8 = Title
+
+# Pk Amount & Title color level 9.
+PkAmount9 = 300
+TitleColorForAmount9 = 00FF00
+PkTitleForAmount9 = Title
+
+# Pk Amount & Title color level 10.
+PkAmount10 = 500
+TitleColorForAmount10 = 00FF00
+PkTitleForAmount10 = Title
\ No newline at end of file
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 3225)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -620,6 +620,72 @@
public static String KARMA_NONDROPPABLE_ITEMS;
public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS;
public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
+ public static boolean ANNOUNCE_KILL;
+ public static int PK_PROTECTION;
+ public static boolean PVP_COLOR_SYSTEM_ENABLED;
+ public static boolean PVP_TITLE_SYSTEM_ENABLED;
+ public static int PVP_AMOUNT1;
+ public static int PVP_AMOUNT2;
+ public static int PVP_AMOUNT3;
+ public static int PVP_AMOUNT4;
+ public static int PVP_AMOUNT5;
+ public static int PVP_AMOUNT6;
+ public static int PVP_AMOUNT7;
+ public static int PVP_AMOUNT8;
+ public static int PVP_AMOUNT9;
+ public static int PVP_AMOUNT10;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT1;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT2;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT3;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT4;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT5;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT6;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT7;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT8;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT9;
+ public static int NAME_COLOR_FOR_PVP_AMOUNT10;
+ public static String TITLE_FOR_PVP_AMOUNT1;
+ public static String TITLE_FOR_PVP_AMOUNT2;
+ public static String TITLE_FOR_PVP_AMOUNT3;
+ public static String TITLE_FOR_PVP_AMOUNT4;
+ public static String TITLE_FOR_PVP_AMOUNT5;
+ public static String TITLE_FOR_PVP_AMOUNT6;
+ public static String TITLE_FOR_PVP_AMOUNT7;
+ public static String TITLE_FOR_PVP_AMOUNT8;
+ public static String TITLE_FOR_PVP_AMOUNT9;
+ public static String TITLE_FOR_PVP_AMOUNT10;
+ public static boolean PK_COLOR_SYSTEM_ENABLED;
+ public static boolean PK_TITLE_SYSTEM_ENABLED;
+ public static int PK_AMOUNT1;
+ public static int PK_AMOUNT2;
+ public static int PK_AMOUNT3;
+ public static int PK_AMOUNT4;
+ public static int PK_AMOUNT5;
+ public static int PK_AMOUNT6;
+ public static int PK_AMOUNT7;
+ public static int PK_AMOUNT8;
+ public static int PK_AMOUNT9;
+ public static int PK_AMOUNT10;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT1;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT2;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT3;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT4;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT5;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT6;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT7;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT8;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT9;
+ public static int TITLE_COLOR_FOR_PK_AMOUNT10;
+ public static String TITLE_FOR_PK_AMOUNT1;
+ public static String TITLE_FOR_PK_AMOUNT2;
+ public static String TITLE_FOR_PK_AMOUNT3;
+ public static String TITLE_FOR_PK_AMOUNT4;
+ public static String TITLE_FOR_PK_AMOUNT5;
+ public static String TITLE_FOR_PK_AMOUNT6;
+ public static String TITLE_FOR_PK_AMOUNT7;
+ public static String TITLE_FOR_PK_AMOUNT8;
+ public static String TITLE_FOR_PK_AMOUNT9;
+ public static String TITLE_FOR_PK_AMOUNT10;


//--------------------------------------------------
@@ -1886,6 +1952,72 @@

PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
+ ANNOUNCE_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AnnounceKill", "False"));
+ PK_PROTECTION = Integer.parseInt(pvpSettings.getProperty("PkProtection", "0"));
+ PVP_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(pvpSettings.getProperty("EnablePvPColorSystem", "false"));
+ PVP_TITLE_SYSTEM_ENABLED = Boolean.parseBoolean(pvpSettings.getProperty("EnablePvPTitleSystem", "false"));
+ PVP_AMOUNT1 = Integer.parseInt(pvpSettings.getProperty("PvpAmount1", "100"));
+ PVP_AMOUNT2 = Integer.parseInt(pvpSettings.getProperty("PvpAmount2", "125"));
+ PVP_AMOUNT3 = Integer.parseInt(pvpSettings.getProperty("PvpAmount3", "150"));
+ PVP_AMOUNT4 = Integer.parseInt(pvpSettings.getProperty("PvpAmount4", "175"));
+ PVP_AMOUNT5 = Integer.parseInt(pvpSettings.getProperty("PvpAmount5", "200"));
+ PVP_AMOUNT6 = Integer.parseInt(pvpSettings.getProperty("PvpAmount6", "225"));
+ PVP_AMOUNT7 = Integer.parseInt(pvpSettings.getProperty("PvpAmount7", "250"));
+ PVP_AMOUNT8 = Integer.parseInt(pvpSettings.getProperty("PvpAmount8", "275"));
+ PVP_AMOUNT9 = Integer.parseInt(pvpSettings.getProperty("PvpAmount9", "300"));
+ PVP_AMOUNT10 = Integer.parseInt(pvpSettings.getProperty("PvpAmount10", "500"));
+ NAME_COLOR_FOR_PVP_AMOUNT1 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount1", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT2 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount2", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT3 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount3", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT4 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount4", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT5 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount5", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT6 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount6", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT7 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount7", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT8 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount8", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT9 = Integer.decode("0x" + pvpSettings.getProperty("NameColorForAmount9", "00FF00"));
+ NAME_COLOR_FOR_PVP_AMOUNT10 = Integer.decode("0x" + pvpSettings.getProperty("ColorForAmount10", "00FF00"));
+ TITLE_FOR_PVP_AMOUNT1 = pvpSettings.getProperty("PvPTitleForAmount1", "Title");
+ TITLE_FOR_PVP_AMOUNT2 = pvpSettings.getProperty("PvPTitleForAmount2", "Title");
+ TITLE_FOR_PVP_AMOUNT3 = pvpSettings.getProperty("PvPTitleForAmount3", "Title");
+ TITLE_FOR_PVP_AMOUNT4 = pvpSettings.getProperty("PvPTitleForAmount4", "Title");
+ TITLE_FOR_PVP_AMOUNT5 = pvpSettings.getProperty("PvPTitleForAmount5", "Title");
+ TITLE_FOR_PVP_AMOUNT6 = pvpSettings.getProperty("PvPTitleForAmount6", "Title");
+ TITLE_FOR_PVP_AMOUNT7 = pvpSettings.getProperty("PvPTitleForAmount7", "Title");
+ TITLE_FOR_PVP_AMOUNT8 = pvpSettings.getProperty("PvPTitleForAmount8", "Title");
+ TITLE_FOR_PVP_AMOUNT9 = pvpSettings.getProperty("PvPTitleForAmount9", "Title");
+ TITLE_FOR_PVP_AMOUNT10 = pvpSettings.getProperty("PvPTitleForAmount10", "Title");
+ PK_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(pvpSettings.getProperty("EnablePkColorSystem", "false"));
+ PK_TITLE_SYSTEM_ENABLED = Boolean.parseBoolean(pvpSettings.getProperty("EnablePKTitleSystem", "false"));
+ PK_AMOUNT1 = Integer.parseInt(pvpSettings.getProperty("PkAmount1", "100"));
+ PK_AMOUNT2 = Integer.parseInt(pvpSettings.getProperty("PkAmount2", "125"));
+ PK_AMOUNT3 = Integer.parseInt(pvpSettings.getProperty("PkAmount3", "150"));
+ PK_AMOUNT4 = Integer.parseInt(pvpSettings.getProperty("PkAmount4", "175"));
+ PK_AMOUNT5 = Integer.parseInt(pvpSettings.getProperty("PkAmount5", "200"));
+ PK_AMOUNT6 = Integer.parseInt(pvpSettings.getProperty("PkAmount6", "225"));
+ PK_AMOUNT7 = Integer.parseInt(pvpSettings.getProperty("PkAmount7", "250"));
+ PK_AMOUNT8 = Integer.parseInt(pvpSettings.getProperty("PkAmount8", "275"));
+ PK_AMOUNT9 = Integer.parseInt(pvpSettings.getProperty("PkAmount9", "300"));
+ PK_AMOUNT10 = Integer.parseInt(pvpSettings.getProperty("PkAmount10", "500"));
+ TITLE_COLOR_FOR_PK_AMOUNT1 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount1", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT2 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount2", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT3 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount3", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT4 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount4", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT5 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount5", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT6 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount6", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT7 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount7", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT8 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount8", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT9 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount9", "00FF00"));
+ TITLE_COLOR_FOR_PK_AMOUNT10 = Integer.decode("0x" + pvpSettings.getProperty("TitleForAmount10", "00FF00"));
+ TITLE_FOR_PK_AMOUNT1 = pvpSettings.getProperty("PkTitleForAmount1", "Title");
+ TITLE_FOR_PK_AMOUNT2 = pvpSettings.getProperty("PkTitleForAmount2", "Title");
+ TITLE_FOR_PK_AMOUNT3 = pvpSettings.getProperty("PkTitleForAmount3", "Title");
+ TITLE_FOR_PK_AMOUNT4 = pvpSettings.getProperty("PkTitleForAmount4", "Title");
+ TITLE_FOR_PK_AMOUNT5 = pvpSettings.getProperty("PkTitleForAmount5", "Title");
+ TITLE_FOR_PK_AMOUNT6 = pvpSettings.getProperty("PkTitleForAmount6", "Title");
+ TITLE_FOR_PK_AMOUNT7 = pvpSettings.getProperty("PkTitleForAmount7", "Title");
+ TITLE_FOR_PK_AMOUNT8 = pvpSettings.getProperty("PkTitleForAmount8", "Title");
+ TITLE_FOR_PK_AMOUNT9 = pvpSettings.getProperty("PkTitleForAmount9", "Title");
+ TITLE_FOR_PK_AMOUNT10 = pvpSettings.getProperty("PkTitleForAmount10", "Title");
}
catch (Exception e)
{
@@ -2270,6 +2402,8 @@

else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
+ else if (pName.equalsIgnoreCase("AnnounceKill") ) ANNOUNCE_KILL = Boolean.valueOf(pValue);
+ else if (pName.equalsIgnoreCase("PkProtection")) PK_PROTECTION = Integer.parseInt(pValue);
else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
else if (pName.equalsIgnoreCase("TradeChat")) DEFAULT_TRADE_CHAT = pValue;
else if (pName.equalsIgnoreCase("GMAdminMenuStyle")) GM_ADMIN_MENU_STYLE = pValue;
Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 3225)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
@@ -301,6 +301,11 @@
activeChar.sendPacket(new QuestList());
loadTutorial(activeChar);

+ if (activeChar.getPvpKills()>=(Config.PVP_AMOUNT1) && (Config.PVP_COLOR_SYSTEM_ENABLED)) activeChar.updatePvPColor(activeChar.getPvpKills());
+ if (activeChar.getPvpKills()>=(Config.PVP_AMOUNT1) && (Config.PVP_TITLE_SYSTEM_ENABLED)) activeChar.updatePvPTitle(activeChar.getPvpKills());
+ if (activeChar.getPkKills()>=(Config.PK_AMOUNT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) activeChar.updatePkColor(activeChar.getPkKills());
+ if (activeChar.getPkKills()>=(Config.PK_AMOUNT1) && (Config.PK_TITLE_SYSTEM_ENABLED)) activeChar.updatePkTitle(activeChar.getPkKills());
+
if (Config.PLAYER_SPAWN_PROTECTION > 0)
activeChar.setProtection(true);

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 3225)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -35,6 +35,7 @@
import javolution.util.FastMap;
import net.sf.l2j.Config;
import net.sf.l2j.L2DatabaseFactory;
+import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.GameTimeController;
import net.sf.l2j.gameserver.GeoData;
import net.sf.l2j.gameserver.GmListTable;
@@ -315,10 +316,15 @@
@Override
public void doAttack(L2Character target)
{
+ if (target instanceof L2PcInstance &&
+ isPKProtected((L2PcInstance) target)) {
+ sendPacket(ActionFailed.STATIC_PACKET);
+ } else {
super.doAttack(target);

// cancel the recent fake-death protection instantly if the player attacks or casts spells
getPlayer().setRecentFakeDeath(false);
+ }
}

@Override
@@ -4120,6 +4126,225 @@
DuelManager.getInstance().broadcastToOppositTeam(this, update);
}
}
+
+ // Custom PVP Color System - Start
+ public void updatePvPColor(int pvpKillAmount)
+ {
+ if (Config.PVP_COLOR_SYSTEM_ENABLED)
+ {
+ //Check if the character has GM access and if so, let them be.
+ if (isGM())
+ return;
+ {
+ if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT2)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount < (Config.PVP_AMOUNT3)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount < (Config.PVP_AMOUNT4)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount < (Config.PVP_AMOUNT5)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT5)) && (pvpKillAmount < (Config.PVP_AMOUNT6)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT6)) && (pvpKillAmount < (Config.PVP_AMOUNT7)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT6);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT7)) && (pvpKillAmount < (Config.PVP_AMOUNT8)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT7);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT8)) && (pvpKillAmount < (Config.PVP_AMOUNT9)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT8);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT9)) && (pvpKillAmount < (Config.PVP_AMOUNT10)))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT9);
+ }
+ else if (pvpKillAmount >= (Config.PVP_AMOUNT10))
+ {
+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT10);
+ }
+ }
+ }
+ }
+ //Custom PVP Color System - End
+
+
+ // Custom PVP Title System - Start
+ public void updatePvPTitle(int pvpKillAmount)
+ {
+ if (Config.PVP_TITLE_SYSTEM_ENABLED)
+ {
+ //Check if the character has GM access and if so, let them be.
+ if (isGM())
+ return;
+ {
+ if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT2)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT1);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount < (Config.PVP_AMOUNT3)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT2);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount < (Config.PVP_AMOUNT4)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT3);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount < (Config.PVP_AMOUNT5)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT4);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT5)) && (pvpKillAmount < (Config.PVP_AMOUNT6)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT5);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT6)) && (pvpKillAmount < (Config.PVP_AMOUNT7)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT6);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT7)) && (pvpKillAmount < (Config.PVP_AMOUNT8)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT7);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT8)) && (pvpKillAmount < (Config.PVP_AMOUNT9)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT8);
+ }
+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT9)) && (pvpKillAmount < (Config.PVP_AMOUNT10)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT9);
+ }
+ else if (pvpKillAmount >= (Config.PVP_AMOUNT10))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PVP_AMOUNT10);
+ }
+ }
+ }
+ }
+ //Custom PVP Title System - End
+
+
+ // Custom Pk Color System - Start
+ public void updatePkColor(int pkKillAmount)
+ {
+ if (Config.PK_COLOR_SYSTEM_ENABLED)
+ {
+ //Check if the character has GM access and if so, let them be, like above.
+ if (isGM())
+ return;
+ {
+ if ((pkKillAmount >= (Config.PK_AMOUNT1)) && (pkKillAmount < (Config.PVP_AMOUNT2)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT1);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT2)) && (pkKillAmount < (Config.PVP_AMOUNT3)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT2);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT3)) && (pkKillAmount < (Config.PVP_AMOUNT4)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT3);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT4)) && (pkKillAmount < (Config.PVP_AMOUNT5)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT4);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT5)) && (pkKillAmount < (Config.PVP_AMOUNT6)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT5);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT6)) && (pkKillAmount < (Config.PVP_AMOUNT7)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT6);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT7)) && (pkKillAmount < (Config.PVP_AMOUNT8)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT7);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT8)) && (pkKillAmount < (Config.PVP_AMOUNT9)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT8);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT9)) && (pkKillAmount < (Config.PVP_AMOUNT10)))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT9);
+ }
+ else if (pkKillAmount >= (Config.PK_AMOUNT10))
+ {
+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT10);
+ }
+ }
+ }
+ }
+ //Custom Pk Color System - End
+
+
+ // Custom Pk Title System - Start
+ public void updatePkTitle(int pkKillAmount)
+ {
+ if (Config.PK_TITLE_SYSTEM_ENABLED)
+ {
+ //Check if the character has GM access and if so, let them be, like above.
+ if (isGM())
+ return;
+ {
+ if ((pkKillAmount >= (Config.PK_AMOUNT1)) && (pkKillAmount < (Config.PVP_AMOUNT2)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT1);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT2)) && (pkKillAmount < (Config.PVP_AMOUNT3)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT2);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT3)) && (pkKillAmount < (Config.PVP_AMOUNT4)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT3);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT4)) && (pkKillAmount < (Config.PVP_AMOUNT5)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT4);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT5)) && (pkKillAmount < (Config.PVP_AMOUNT6)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT5);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT6)) && (pkKillAmount < (Config.PVP_AMOUNT7)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT6);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT7)) && (pkKillAmount < (Config.PVP_AMOUNT8)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT7);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT8)) && (pkKillAmount < (Config.PVP_AMOUNT9)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT8);
+ }
+ else if ((pkKillAmount >= (Config.PK_AMOUNT9)) && (pkKillAmount < (Config.PVP_AMOUNT10)))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT9);
+ }
+ else if (pkKillAmount >= (Config.PK_AMOUNT10))
+ {
+ getAppearance().setVisibleTitle(Config.TITLE_FOR_PK_AMOUNT10);
+ }
+ }
+ }
+ }
+ //Custom Pk Title System - End

/**
* Send a Server->Client packet UserInfo to this L2PcInstance and CharInfo to all L2PcInstance in its _KnownPlayers.<BR><BR>
@@ -5309,6 +5534,14 @@
if (targetPlayer == null) return; // Target player is null
if (targetPlayer == this) return; // Target player is self

+ if (targetPlayer.isCursedWeaponEquipped())
+ {
+ increasePvpKills();
+ if ( target instanceof L2PcInstance && Config.ANNOUNCE_KILL )
+ Announcements.getInstance().announceToAll("Victory! "+this.getAppearance().getVisibleName()+" has conquered "+targetPlayer.getAppearance().getVisibleName());
+ return;
+ }
+
if (isCursedWeaponEquipped())
{
CursedWeaponsManager.getInstance().increaseKills(_cursedWeaponEquippedId);
@@ -5319,6 +5552,8 @@
// msg.addItemName(_cursedWeaponEquipedId);
// msg.addNumber(timeLeftInHours);
// sendPacket(msg);
+ if ( target instanceof L2PcInstance && Config.ANNOUNCE_KILL )
+ Announcements.getInstance().announceToAll("Beware! "+this.getAppearance().getVisibleName()+" has destroyed "+targetPlayer.getAppearance().getVisibleName());
return;
}

@@ -5342,6 +5577,9 @@
)
{
increasePvpKills();
+ if ( target instanceof L2PcInstance && Config.ANNOUNCE_KILL )
+ Announcements.getInstance().announceToAll(this.getAppearance().getVisibleName()+" has defeated "+targetPlayer.getAppearance().getVisibleName());
+ return;
}
else // Target player doesn't have pvp flag set
{
@@ -5354,6 +5592,8 @@
{
// 'Both way war' -> 'PvP Kill'
increasePvpKills();
+ if ( target instanceof L2PcInstance && Config.ANNOUNCE_KILL )
+ Announcements.getInstance().announceToAll("War Kill - "+this.getAppearance().getVisibleName()+" has defeated "+targetPlayer.getAppearance().getVisibleName());
return;
}
}
@@ -5365,11 +5605,15 @@
if ( Config.KARMA_AWARD_PK_KILL )
{
increasePvpKills();
+ if ( target instanceof L2PcInstance && Config.ANNOUNCE_KILL )
+ Announcements.getInstance().announceToAll(this.getAppearance().getVisibleName()+" has defeated "+targetPlayer.getAppearance().getVisibleName());
}
}
else if (targetPlayer.getPvpFlag() == 0) // Target player doesn't have karma
{
increasePkKillsAndKarma(targetPlayer.getLevel());
+ if ( target instanceof L2PcInstance && Config.ANNOUNCE_KILL )
+ Announcements.getInstance().announceToAll(this.getAppearance().getVisibleName()+" has slaughtered "+targetPlayer.getAppearance().getVisibleName());
//Unequip adventurer items
if(getInventory().getPaperdollItemId(7) >= 7816 && getInventory().getPaperdollItemId(7) <= 7831)
{
@@ -5398,6 +5642,14 @@
// Add karma to attacker and increase its PK counter
setPvpKills(getPvpKills() + 1);

+ //Update the character's name color if they reached any of the 10 PvP levels.
+ updatePvPColor(getPvpKills());
+ broadcastUserInfo();
+
+ //Update the character's Title if they reached any of the 10 PvP levels.
+ updatePvPTitle(getPvpKills());
+ broadcastUserInfo();
+
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
sendPacket(new UserInfo(this));
sendPacket(new ExBrExtraUserInfo(this));
@@ -5450,6 +5702,14 @@
setPkKills(getPkKills() + 1);
setKarma(getKarma() + newKarma);

+ //Update the character's title color if they reached any of the 10 PK levels.
+ updatePkColor(getPkKills());
+ broadcastUserInfo();
+
+ //Update the character's title if they reached any of the 10 PK levels.
+ updatePkTitle(getPkKills());
+ broadcastUserInfo();
+
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
sendPacket(new UserInfo(this));
sendPacket(new ExBrExtraUserInfo(this));
@@ -8278,6 +8538,13 @@
break;
}

+ if (target != this && target instanceof L2PcInstance &&
+ skill.isOffensive() && isPKProtected((L2PcInstance) target)) {
+ setIsCastingNow(false);
+ sendPacket(ActionFailed.STATIC_PACKET);
+ return;
+ }
+
// Notify the AI with AI_INTENTION_CAST and target
getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, skill, target);
}
@@ -8948,6 +9215,39 @@
return true;
}

+ /**
+ * Checks whether target is PK protected when attacking
+ * by this. Target is PK protected if it is not flagged,
+ * has no karma and difference between players lvl and
+ * target's lvl is above {@link * net.sf.l2j.Config.PK_PROTECTION}.
+ *
+ * @param target attack target
+ *
+ * @return true if target is PK protected, otherwise false
+ */
+ @SuppressWarnings("cast")
+ public boolean isPKProtected(final L2PcInstance target) {
+ if (Config.PK_PROTECTION > 0 &&
+ target instanceof L2PcInstance) {
+ final L2PcInstance targetPlayer = (L2PcInstance) target;
+
+ if (getClan() != null && targetPlayer.getClan() != null &&
+ targetPlayer.getClan().isAtWarWith(getClanId())) {
+ return false;
+ }
+
+ if (targetPlayer.getPvpFlag() == 0 &&
+ targetPlayer.getKarma() == 0 &&
+ targetPlayer.getLevel() +
+ Config.PK_PROTECTION <
+ getLevel()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/**
* Return True if the L2PcInstance is a Mage.<BR><BR>
*/
[/quote]

para ver se este é o código java ..

Share this post


Link to post
Share on other sites
  • 0

@lucario

esse codigo e pro freya l2jserver mesmo?
se for obrigado vou add ele...
mas uma pergunta: O que você fez la: (pvpKillAmount >= 500 < se funfa, ele vai perder os pvps??


obrigado por estar ajudando!


Entre e Confira!!!!:

 

NEW* - L2Blank Freya PvP Server

 

Share this post


Link to post
Share on other sites
  • 0

que o código é para freya .. exatamente! e ele funciona perfeito, eu usá-lo em uma versão .. Vou postar L2J abrangente .. eo que faria essa linha é que quando um jogador atinge 500 altera automaticamente o título pvp uma cor .. que você quer .. deverá desempenhar esta função ..

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  



×
×
  • Create New...