Jump to content

Custom Tattoos At X Pvp Count.


'Baggos'

Recommended Posts

Hello members of maxcheaters!

 

I have make this idea for my test project. It's a small code.

Example: if a player is mage or fighter in x pvp count, will get Custom Tattoo. (Fighter or Mage depending in class)!

You can choose the count of pvp and Tattoo id you want on config.

 

It's for pvp server.. with this, the pvp has more interest.

I've seen in l2mora, giving an item pvp in every pvp, for to get these tattoos .. now instead be given an item pvp in each pvp, given once, with the count of pvp want.

 

I think it would be best if given like this way. To have importance the pvps and trade.

For example, players will trade, since it does not exist in the shop, and will go for pvp, instead of waiting for the vote reward!

 

An example for for stats on tattoos:

Data/stats/armor/0400-0499.xml

<item id='492' name="Tattoo of Soul">
  <for>
    <set val='500' order='0x010' stat='pAtk'/>
    <set val='300' order='0x010' stat='pAtkSpd'/>
    <set val='15' order='0x010' stat='rCrit'/>
    <add val='100' order='0x10' stat='pDef'/>
    <add val='50' order='0x010' stat='runSpd'/>
    <add val='100' order='0x10' stat='mDef'/>
    <enchant val='0' order='0x0C' stat='pDef'/>
  </for>
</item>
<item id='493' name="Tattoo of Avadon">
  <for>
    <set val='500' order='0x010' stat='mAtk'/>
    <set val='300' order='0x010' stat='mAtkSpd'/>
    <set val='15' order='0x010' stat='mCrit'/>
    <add val='50' order='0x010' stat='runSpd'/>
    <add val='100' order='0x10' stat='pDef'/>
    <add val='100' order='0x10' stat='mDef'/>
    <enchant val='0' order='0x0C' stat='pDef'/>
  </for>
</item>

NOTE: On your Lineage 2 system find armorgrp.dat and do there a edit. (With L2FileEdit). Find the tattoo's name and replace "Tattoo of soul with Fighter Tattoo" and "Tattoo of Avadon with Mage Tattoo".

 

http://pastebin.com/TjyTWj6c

Edited by 'Baggos'
Link to comment
Share on other sites

I'm sure this doesn't work as expected! :lol:

Will you try to find why?

Yes, but in private message do not fill again. :lol:

 

Or make edit your post and i'll see...

+       if (isMageClass())
+       return;

What with this? :-\  We need to get it out, and put something else?

 

this?

-       if (isMageClass())
-       return;

+       if (getClassId() == ClassId.mage)
+       return;

Or all this is wrong?

Edited by 'Baggos'
Link to comment
Share on other sites

Yes, but in private message do not fill again. :lol:

 

Or make edit your post and i'll see...

+       if (isMageClass())
+       return;

What with this? :-\  We need to get it out, and put something else?

this?

if (getClassId() == ClassId.mage)
   return;

Or all this is wrong?

mate just do it: 

 

+ if (Config.FIGHTER_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT && !isMageClass())
+ {
+ addItem(Config.TATTOO_FIGHTER_ID);
+ sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
 also here need a invetory-items update
+ }
+ else if(Config.MAGE_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT1 )
+     {
+        addItem(Config.TATTOO_MAGE_ID);
+ sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
 also here need a invetory-items update
+ }
+ }
Edited by AbSoLuTePoWeR
Link to comment
Share on other sites

Updated on this:

Thank you AbsolutePower for your replay...

Tessa Thank you also... :P :lol:

-       // Check if the character is Mage, and if is, do not give Fighter Tattoo.
-       if (isMageClass())
-        return;
-            
-       if (Config.FIGHTER_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT)
 
+       if (Config.FIGHTER_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT && !isMageClass())
 
        {
        addItem(Config.TATTOO_FIGHTER_ID);
        sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
+       getInventory().updateDatabase();
        }
-       else if(Config.MAGE_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT1 && !isMageClass())
+       else if(Config.MAGE_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT1)
        {
        addItem(Config.TATTOO_MAGE_ID);
        sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
+       getInventory().updateDatabase();
    }
}

I do not think updateDatabase be a problem ... but i put it .

Edited by 'Baggos'
Link to comment
Share on other sites

Almost done... :lol:

Now you should correct the addItem() method, because I'm not sure if your current code will give something to someone!

Yesterday i tried with fighter and gave two, as i had no class check.

Now why not? :P

The PC, does not open the second window Lineage will burn. :lol:

Yesterday i was in a friend. haha

Edited by 'Baggos'
Link to comment
Share on other sites

Are you sure?

addItem(Config.TATTOO_FIGHTER_ID);

Which pack uses only 1 argument?

 

You trying to call your own method by this... it's not a good practice to name your methods like that, addItem already exists.

Edited by Tessa
Link to comment
Share on other sites

 

mate just do it: 

 

+ if (Config.FIGHTER_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT && !isMageClass())
+ {
+ addItem(Config.TATTOO_FIGHTER_ID);
+ sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
 also here need a invetory-items update
+ }
+ else if(Config.MAGE_TATTOO_ENABLE && pvpKillCount == Config.PVP_COUNT1 )
+     {
+        addItem(Config.TATTOO_MAGE_ID);
+ sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
 also here need a invetory-items update
+ }
+ }

 

it won't work,lol.check the way he created the method he calls.

 

baggos,there's no reason to make your life harder by doing all these(which doesn't work btw) stuff for something simple.

check below,for such a code you need just a simple check in the place that pvps are increased,nothing else.

 

### Eclipse Workspace Patch 1.0
#P gameserver
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (revision 42)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
@@ -4811,6 +4811,18 @@
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);
         
+        if (getPvpKills() == 100)
+        {
+            if (!isMageClass())
+            {
+                addItem("PvP Reward", Config.REWARD_FIGHTER_ID, Config.REWARD_FIGHTER_COUNT, this, true);
+                sendMessage("You've been rewarded with a fighter tattoo");
+            }
+            else
+               {
+                addItem("PvP Reward", Config.REWARD_MAGE_ID, Config.REWARD_MAGE_COUNT, this, true);
+                    sendMessage("You've been rewarded with a mage tatoo");
+               }
+        }
+        
         PvpPkColorSystem.getInstance().checkPvpColors(this);
 
         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java    (revision 41)
+++ java/net/sf/l2j/Config.java    (working copy)
@@ -422,6 +422,11 @@
     /** Buffs */
     public static boolean STORE_SKILL_COOLTIME;
     public static byte BUFFS_MAX_AMOUNT;
+    
+    public static int REWARD_FIGHTER_ID;
+    public static int REWARD_FIGHTER_COUNT;
+    public static int REWARD_MAGE_ID;
+    public static int REWARD_MAGE_COUNT;
     
     //--------------------------------------------------
     // Server
@@ -1134,6 +1139,10 @@
                 
                 BUFFS_MAX_AMOUNT = Byte.parseByte(players.getProperty("MaxBuffsAmount","20"));
                 STORE_SKILL_COOLTIME = Boolean.parseBoolean(players.getProperty("StoreSkillCooltime", "true"));
+                REWARD_FIGHTER_ID = Integer.parseInt(players.getProperty("RewardFighterID","1"));
+                REWARD_FIGHTER_COUNT = Integer.parseInt(players.getProperty("RewardFightCount","2"));
+                REWARD_MAGE_ID = Integer.parseInt(players.getProperty("RewardMageId","3"));
+                REWARD_MAGE_COUNT = Integer.parseInt(players.getProperty("RewardMageCount","4"));
             }
             catch (Exception e)
             {
Index: config/players.properties
===================================================================
--- config/players.properties    (revision 41)
+++ config/players.properties    (working copy)
@@ -310,4 +310,10 @@
 MaxBuffsAmount = 20
 
 # Store buffs/debuffs on user logout?
-StoreSkillCooltime = True
\ No newline at end of file
+StoreSkillCooltime = True
+
+#Class Based pvp reward at 100 pvps
+RewardFighterID = 1
+RewardFighterCount = 2
+RewardMageID = 3
+RewardMageCount = 4
\ No newline at end of file
Link to comment
Share on other sites

 

it won't work,lol.check the way he created the method he calls.

 

baggos,there's no reason to make your life harder by doing all these(which doesn't work btw) stuff for something simple.

check below,for such a code you need just a simple check in the place that pvps are increased,nothing else.

### Eclipse Workspace Patch 1.0
#P gameserver
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (revision 42)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
@@ -4811,6 +4811,18 @@
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);
         
+        if (getPvpKills() == 100)
+        {
+            if (!isMageClass())
+            {
+                addItem("PvP Reward", Config.REWARD_FIGHTER_ID, Config.REWARD_FIGHTER_COUNT, this, true);
+                sendMessage("You've been rewarded with a fighter tattoo");
+            }
+            else
+               {
+                addItem("PvP Reward", Config.REWARD_MAGE_ID, Config.REWARD_MAGE_COUNT, this, true);
+                    sendMessage("You've been rewarded with a mage tatoo");
+               }
+        }
+        
         PvpPkColorSystem.getInstance().checkPvpColors(this);
 
         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java    (revision 41)
+++ java/net/sf/l2j/Config.java    (working copy)
@@ -422,6 +422,11 @@
     /** Buffs */
     public static boolean STORE_SKILL_COOLTIME;
     public static byte BUFFS_MAX_AMOUNT;
+    
+    public static int REWARD_FIGHTER_ID;
+    public static int REWARD_FIGHTER_COUNT;
+    public static int REWARD_MAGE_ID;
+    public static int REWARD_MAGE_COUNT;
     
     //--------------------------------------------------
     // Server
@@ -1134,6 +1139,10 @@
                 
                 BUFFS_MAX_AMOUNT = Byte.parseByte(players.getProperty("MaxBuffsAmount","20"));
                 STORE_SKILL_COOLTIME = Boolean.parseBoolean(players.getProperty("StoreSkillCooltime", "true"));
+                REWARD_FIGHTER_ID = Integer.parseInt(players.getProperty("RewardFighterID","1"));
+                REWARD_FIGHTER_COUNT = Integer.parseInt(players.getProperty("RewardFightCount","2"));
+                REWARD_MAGE_ID = Integer.parseInt(players.getProperty("RewardMageId","3"));
+                REWARD_MAGE_COUNT = Integer.parseInt(players.getProperty("RewardMageCount","4"));
             }
             catch (Exception e)
             {
Index: config/players.properties
===================================================================
--- config/players.properties    (revision 41)
+++ config/players.properties    (working copy)
@@ -310,4 +310,10 @@
 MaxBuffsAmount = 20
 
 # Store buffs/debuffs on user logout?
-StoreSkillCooltime = True
\ No newline at end of file
+StoreSkillCooltime = True
+
+#Class Based pvp reward at 100 pvps
+RewardFighterID = 1
+RewardFighterCount = 2
+RewardMageID = 3
+RewardMageCount = 4
\ No newline at end of file

I made my own way, because I did not want to do copy/paste, but I had to get an idea of ​​how to do it.

Yesterday I tried like you, without the "pvpkillCount" is work, and i thought all will work if i put only addItem.Configblabla.

For the reason to i create something new and not like all this is already share...

This is my false... I wanted something new. and probably needs more knowledge than i thought.

Anyway... Updated with your choose... also with ""if (getPvpKills() == Config.PVP_COUNT)"" and choose enable or not..

Thank thus nevertheless..

Link to comment
Share on other sites

nice! =)

 

As I said for something like that - i mean such small and easy2do codes - there isn't any reason to make your life harder.Just use the existing methods and you are done.

 

gl in your next ones

Link to comment
Share on other sites

That's logically wrong, kinda..

+                       // Add Fighter or Mage Tattoos
+                       if (getPvpKills() == Config.PVP_COUNT)
+                       {
+                       if (Config.FIGHTER_TATTOO_ENABLE && !isMageClass())
+                       {
+                       addItem("Tattoo", Config.TATTOO_FIGHTER_ID, Config.FIGHTER_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
+                       }
+                       else if(Config.MAGE_TATTOO_ENABLE)
+                       {
+                       addItem("Tattoo", Config.TATTOO_MAGE_ID, Config.MAGE_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
+                       }
+                       }

From my pov, first of all, you should check if the config is enabled. If yes, proceed, else do nothing. :P

Edited by SweeTs
Link to comment
Share on other sites

That's logically wrong, kinda..

+                       // Add Fighter or Mage Tattoos
+                       if (getPvpKills() == Config.PVP_COUNT)
+                       {
+                       if (Config.FIGHTER_TATTOO_ENABLE && !isMageClass())
+                       {
+                       addItem("Tattoo", Config.TATTOO_FIGHTER_ID, Config.FIGHTER_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
+                       }
+                       else if(Config.MAGE_TATTOO_ENABLE)
+                       {
+                       addItem("Tattoo", Config.TATTOO_MAGE_ID, Config.MAGE_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
+                       }
+                       }

From my pov, first of all, you should check if the config is enabled. If yes, proceed, else do nothing. :P

 

That's logically wrong, kinda..

+                       // Add Fighter or Mage Tattoos
+                       if (getPvpKills() == Config.PVP_COUNT)
+                       {
+                       if (Config.FIGHTER_TATTOO_ENABLE && !isMageClass())
+                       {
+                       addItem("Tattoo", Config.TATTOO_FIGHTER_ID, Config.FIGHTER_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
+                       }
+                       else if(Config.MAGE_TATTOO_ENABLE)
+                       {
+                       addItem("Tattoo", Config.TATTOO_MAGE_ID, Config.MAGE_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
+                       }
+                       }

From my pov, first of all, you should check if the config is enabled. If yes, proceed, else do nothing. :P

you are right,I didnt noticed it

Edited by Fanky
Link to comment
Share on other sites

That's logically wrong, kinda..

+                       // Add Fighter or Mage Tattoos
+                       if (getPvpKills() == Config.PVP_COUNT)
+                       {
+                       if (Config.FIGHTER_TATTOO_ENABLE && !isMageClass())
+                       {
+                       addItem("Tattoo", Config.TATTOO_FIGHTER_ID, Config.FIGHTER_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
+                       }
+                       else if(Config.MAGE_TATTOO_ENABLE)
+                       {
+                       addItem("Tattoo", Config.TATTOO_MAGE_ID, Config.MAGE_TATTOO_COUNT, this, true);
+                       sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
+                       }
+                       }

From my pov, first of all, you should check if the config is enabled. If yes, proceed, else do nothing. :P

 

You mean this way?

+  // Add Fighter or Mage Tattoos
+  if (Config.REWARD_TATTOOS_ENABLE && !isMageClass())
+  {
+  if (getPvpKills() == Config.PVP_COUNT)
+  {
+  addItem("Tattoo", Config.TATTOO_FIGHTER_ID, Config.FIGHTER_TATTOO_COUNT, this, true);
+  sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Fighter Tattoo.");
+  }
+  else
+  {
+  addItem("Tattoo", Config.TATTOO_MAGE_ID, Config.MAGE_TATTOO_COUNT, this, true);
+  sendMessage("Congratulations! " + Config.PVP_COUNT + "  PvP Kills! You won Mage Tattoo.");
+  }
+  }
+  }
Edited by 'Baggos'
Link to comment
Share on other sites

Wrong.. :D

 

Try to understand the code, let me explain

if (Config.FIGHTER_TATTOO_ENABLE && Config.MAGE_TATTOO_ENABLE && !isMageClass())

If fighter and mage tatto enabled and the char is not mage.

 

Also rest of the code is logically wrong as well.

 

Well, it's kinda stupid to have 2 options for fighter and mage tattoo, since why you would reward only one class, so you can make it only with one config and use Fanky version

if (Config.CUSTOM_TATTOO_ENABLE)
{
        if (getPvpKills() == 100)
        {
            if (!isMageClass())
            {
                addItem("PvP Reward", Config.REWARD_FIGHTER_ID, Config.REWARD_FIGHTER_COUNT, this, true);
                sendMessage("You've been rewarded with a fighter tattoo");
            }
            else
               {
                addItem("PvP Reward", Config.REWARD_MAGE_ID, Config.REWARD_MAGE_COUNT, this, true);
                    sendMessage("You've been rewarded with a mage tatoo");
               }
        }
}

Otherwise, you have to check 2 times the pvp count (if for example you enable fighter, and disable mage), one check for fighter and then the same shit for mage. :)

Edited by SweeTs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.




×
×
  • Create New...