Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JFree] PvP/PK com recompensa (https://secretexperience.net/lineage-java-mods/10317-pvp-pk-com-recompensa.html)

KaL 02-07-2009 10:27 PM

PvP/PK com recompensa
 
Este Mod dá um item ao player quando mata alguem no PvP/Pk. Feito para plataformas L2jFree. As configurações são feitas no arquivo .propertie

Código:

Index: D:/Aqua/mid-core/config/pvp.properties
===================================================================
--- D:/Aqua/mid-core/config/pvp.properties        (revision 5153)
+++ D:/Aqua/mid-core/config/pvp.properties        (working copy)
@@ -41,4 +41,29 @@
 # Length one stays in PvP mode after hitting a purple player (in ms)
 PvPVsPvPTime = 60000
 
-CursedWeaponNpcInteract = False
\ No newline at end of file
+CursedWeaponNpcInteract = False
+
+# -------------------------------------------------------------
+# Costum PVP/PK settings
+# -------------------------------------------------------------
+# Costum pvp/pk message
+# after pvp: "Good fight,enemy pwned:)"
+# after pk: "Nice kill!You are so dangerous!"
+AllowCostumPvPMessage = True
+# Pvp reward system
+AllowPvpRewardSystem = False
+# Pvp reward itemId
+PvpRewardItem = 57
+# Pvp reward amount
+PvpRewardAmount = 1
+# Pk reward system
+AllowPkRewardSystem = False
+# Pk reward itemId
+PkRewardItem = 57
+# Pk reward amount
+PkRewardAmount = 1
+# Allow the default PK system(+1 pk,+karma)
+UseDefaultSystem = True
+# Allow costum pk system (pvp point for pk,no karma)
+# UseDefaultSystem need to be False!
+UseCostumSystem = False
\ No newline at end of file
Index: D:/Aqua/mid-core/src/main/java/com/l2jfree/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- D:/Aqua/mid-core/src/main/java/com/l2jfree/gameserver/model/actor/instance/L2PcInstance.java        (revision 5153)
+++ D:/Aqua/mid-core/src/main/java/com/l2jfree/gameserver/model/actor/instance/L2PcInstance.java        (working copy)
@@ -5325,7 +5325,16 @@
 
                // Add karma to attacker and increase its PK counter
                setPvpKills(getPvpKills() + 1);
-
+                if(Config.ALLOW_PVP_REWARD)
+                {
+                        // Item Reward system
+                        addItem("Loot", Config.PVP_REWARD_ITEM, Config.PVP_REWARD_COUNT, this, true);
+                        sendMessage("You will be rewarded for pvp kill!");
+                }
+                if(Config.COSTUM_MSG_ALLOWED)
+                {
+                        sendMessage("Good fight,enemy pwned:)");
+                }
                // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
                sendPacket(new UserInfo(this));
        }
@@ -5380,9 +5389,25 @@
                        newKarma = Integer.MAX_VALUE - getKarma();
 
                // Add karma to attacker and increase its PK counter
-                setPkKills(getPkKills() + 1);
-                setKarma(getKarma() + newKarma);
-
+                if(Config.DEFAULT_PK_SYSTEM)
+                {
+                        setPkKills(getPkKills() + 1);
+                        setKarma(getKarma() + newKarma);
+                }
+                if(Config.COSTUM_PK_SYSTEM)
+                {
+                        setPvpKills(getPvpKills() + 1);
+                }
+                if(Config.ALLOW_PK_REWARD)
+                {
+                        // Item Reward system
+                        addItem("Loot", Config.PK_REWARD_ITEM, Config.PK_REWARD_COUNT, this, true);
+                        sendMessage("You will be rewarded for pk kill!");
+                }
+                if(Config.COSTUM_MSG_ALLOWED)
+                {
+                        sendMessage("Nice kill!You are so dangerous!");
+                }
                // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
                sendPacket(new UserInfo(this));
        }
Index: D:/Aqua/mid-core/src/main/java/com/l2jfree/Config.java
===================================================================
--- D:/Aqua/mid-core/src/main/java/com/l2jfree/Config.java        (revision 5153)
+++ D:/Aqua/mid-core/src/main/java/com/l2jfree/Config.java        (working copy)
@@ -689,6 +689,16 @@
        public static int                                PVP_PVP_TIME;                                                                                                                // Duration (in ms) while a player stay in PVP mode
        // after hitting a purple player
        public static boolean                        CURSED_WEAPON_NPC_INTERACT;
+       
+        public static boolean                        COSTUM_MSG_ALLOWED;
+        public static boolean                        ALLOW_PVP_REWARD;
+        public static int                                PVP_REWARD_ITEM;
+        public static int                                PVP_REWARD_COUNT;
+        public static boolean                        ALLOW_PK_REWARD;
+        public static int                                PK_REWARD_ITEM;
+        public static int                                PK_REWARD_COUNT;
+        public static boolean                        DEFAULT_PK_SYSTEM;
+        public static boolean                        COSTUM_PK_SYSTEM;
 
        // *******************************************************************************************
        public static void loadPvpConfig()
@@ -732,6 +742,18 @@
                        PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
                        PVP_TIME = PVP_NORMAL_TIME;
                        CURSED_WEAPON_NPC_INTERACT = Boolean.parseBoolean(pvpSettings.getProperty("CursedWeaponNpcInteract", "false"));
+                       
+                        //Costum PVP/PK Message - Start
+                        COSTUM_MSG_ALLOWED = Boolean.parseBoolean(IntrepidSettings.getProperty("AllowCostumPvPMessage", "True"));
+                        ALLOW_PVP_REWARD = Boolean.parseBoolean(IntrepidSettings.getProperty("AllowPvpRewardSystem", "False"));
+                        PVP_REWARD_ITEM = Integer.parseInt(IntrepidSettings.getProperty("PvpRewardItem", "57"));
+                        PVP_REWARD_COUNT = Integer.parseInt(IntrepidSettings.getProperty("PvpRewardAmount", "1"));
+                        ALLOW_PK_REWARD = Boolean.parseBoolean(IntrepidSettings.getProperty("AllowPkRewardSystem", "False"));
+                        PK_REWARD_ITEM = Integer.parseInt(IntrepidSettings.getProperty("PkRewardItem", "57"));
+                        PK_REWARD_COUNT = Integer.parseInt(IntrepidSettings.getProperty("PkRewardAmount", "1"));
+                        DEFAULT_PK_SYSTEM = Boolean.parseBoolean(IntrepidSettings.getProperty("UseDefaultSystem", "True"));
+                        COSTUM_PK_SYSTEM = Boolean.parseBoolean(IntrepidSettings.getProperty("UseCostumSystem", "False"));
+                        //Costum PVP/PK Message - End
 
                }
                catch (Exception e)

Creditos : Vago

xRodox 07-08-2009 12:01 PM

como faço pra tipo o player fizer 20 pvp ganhar algo??

Aquilis 14-09-2009 07:49 PM

Vlw. Funcionou perfeitamente.

sennocao 28-09-2009 10:44 PM

onde coloco esse codigo na minha rev 2471 interlude


codigo pvp.proprieties

Código:

#===============================================================================
# Starting L2JFREE 2741
#                -- KARMA VARS --
# ==================================================================

# Karma gain/loss
MinKarma = 240
MaxKarma = 10000
# the number to divide the xp recieved by, to calculate karma lost on xp gain/lost
XPDivider = 260
# The Minimum Karma lost if 0 karma is to be removed
BaseKarmaLost = 0

# Equipment loss
CanGMDropEquipment = False

# NOTE: Make sure the lists do NOT CONTAIN trailing spaces or spaces between the numbers!
# List of pet items we cannot drop
ListOfPetItems = 2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650
# Lists of items which should NEVER be dropped (note, adena will never be dropped) whether on this list or not
ListOfNonDroppableItems = 57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9600,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,30020,30021

# item drop related min/max
MinimumPKRequiredToDrop = 5

# Should we award a pvp point for killing a player with karma?
AwardPKKillPVPPoint = True

# player can drop adena ? false by default
PlayerCanDropAdena = False
# percentage of total adena drop. (if player had 100 adena, he drop 1 adena)
PlayerRateDropAdena = 1

# Announce PVP / PK Kills
AnnouncePk = False
# Announce this as Normal System Message
AnnouncePkNormalMessage = true

# Length one stays in PvP mode after hitting an inocent (in ms)
PvPVsNormalTime = 40000
# Length one stays in PvP mode after hitting a purple player (in ms)
PvPVsPvPTime = 20000


paytaly 28-09-2009 10:56 PM

@sennocao, coloca em qualquer lugar. Essa parte não tem importância em qual
parte do Arquivo vai ficar. Pode colocar no começo, no meio, no final. Onde lhe agradar
mais.

SaraxD 01-11-2009 09:56 AM

@Kal

Teria como eu Pegar esse codigo e trokar, em vez de a cada pvp ganhar itens
poderia ser tantos de horas jogadas, ganhava tal itens, será q teria como ?

KaL 01-11-2009 01:44 PM

Certamente, mas o código seria totalmente diferente deste, sem relação alguma com o Mod.

lelebrr 07-02-2010 08:19 AM

Alguem testou ???

acho q agora esta certo ....

Código:

//Costum PVP/PK Message - Start
                                                                COSTUM_MSG_ALLOWED = Boolean.parseBoolean(pvpSettings.getProperty("AllowCostumPvPMessage", "True"));
                                                        ALLOW_PVP_REWARD = Boolean.parseBoolean(pvpSettings.getProperty("AllowPvpRewardSystem", "False"));
                                                                PVP_REWARD_ITEM = Integer.parseInt(pvpSettings.getProperty("PvpRewardItem", "57"));
                                                        PVP_REWARD_COUNT = Integer.parseInt(pvpSettings.getProperty("PvpRewardAmount", "1"));
                                                                ALLOW_PK_REWARD = Boolean.parseBoolean(pvpSettings.getProperty("AllowPkRewardSystem", "False"));
                                                        PK_REWARD_ITEM = Integer.parseInt(pvpSettings.getProperty("PkRewardItem", "57"));
                                                                PK_REWARD_COUNT = Integer.parseInt(pvpSettings.getProperty("PkRewardAmount", "1"));
                                                                DEFAULT_PK_SYSTEM = Boolean.parseBoolean(pvpSettings.getProperty("UseDefaultSystem", "True"));
                                                                COSTUM_PK_SYSTEM = Boolean.parseBoolean(pvpSettings.getProperty("UseCostumSystem", "False"));
                                                                //Costum PVP/PK Message - End


italope 24-07-2010 04:08 PM

[SIZE="2"]Issu serve tbm para ganha skill?[/SIZE]


Horários baseados na GMT -3. Agora são 08:42 AM.

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