Skip to content

[Help] Class related pvp reward

Featured Replies

well i saw that:http://www.maxcheaters.com/forum/index.php?topic=170488.0

and wanted to make it like when human class kills ( light elf, dark elf, orc or dwarf class, gets reward for exaple 1 ls)

P.S if human kills his own race human dont take reward

How can this be done?

 

it must be smth like this

if ( class id of human ) kills ( L.ELF id , D.ELF id, ORC id, DWARF id)
       {
           addItem("Loot", 8732, 1, this, true);
           sendMessage("You won 1 lifestone for a pvp kill!");
       }

 

please help me with this code, give me human example and ill make it on my own with the other classes ty :)

        if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace() == Race.dwarf)

        {

        //do something

        }

  • Author

here we go again :/

// Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);
     // pvp class related reward
        
        if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace() == Race.dwarf)
        {
            addItem("Loot", 8732, 1, this, true);
            sendMessage("You won 1 lifestone for a pvp kill!");
        }

 

error:

[javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4559: cannot find symbol
    [javac] symbol  : variable target
    [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
    [javac]         if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace() == Race.dwarf)
    [javac]                                        ^
    [javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4559: cannot find symbol
    [javac] symbol  : variable target
    [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
    [javac]         if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace() == Race.dwarf)
    [javac]                                                                            ^
    [javac] Note: C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\GeoEngine.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 2 errors

 

  • Author

replace target with ((L2PcInstance)target) or declare in your method L2PcInstance target

 

nop not working with ((L2PcInstance)target)

error:

[javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4558: cannot find symbol
    [javac] symbol  : variable target
    [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
    [javac]         if (getRace() == Race.human && ((L2PcInstance)target).getRace() == Race.darkelf || ((L2PcInstance)target).getRace() == Race.dwarf)
    [javac]                                                       ^
    [javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4558: cannot find symbol
    [javac] symbol  : variable target
    [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
    [javac]         if (getRace() == Race.human && ((L2PcInstance)target).getRace() == Race.darkelf || ((L2PcInstance)target).getRace() == Race.dwarf)
    [javac]                                                                                                           ^
    [javac] Note: C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\GeoEngine.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 2 errors

what do you mean to declare in my method L2PcInstance target?

 

  • Author

look man while i set

public void increasePvpKills(L2PcInstance target)
   public void increasePvpKills()

i get this error

[javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4515: ';' expected
   [javac]     public void increasePvpKills(L2PcInstance target)
   [javac]                                                      ^
   [javac] 1 error

p.s i tried it in many ways:1) void increasePvpKills((L2PcInstance)target)  2)increasePvpKills((L2PcInstance)target); 3)increasePvpKills(L2PcInstance target);

 

public void increasePvpKills(L2PcInstance target)

public void increasePvpKills()

 

comm'ooooooooooon ...... your brain can't make the difference ? you need to replace the fuking method "public void increasePvpKills()" with "public void increasePvpKills(L2PcInstance target)"

  • Author

i did  tried it man but i got error :

 

[javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4464: increasePvpKills(com.it.br.gameserver.model.actor.instance.L2PcInstance) in com.it.br.gameserver.model.actor.instance.L2PcInstance cannot be applied to ()
   [javac]             increasePvpKills();
   [javac]             ^
   [javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4479: increasePvpKills(com.it.br.gameserver.model.actor.instance.L2PcInstance) in com.it.br.gameserver.model.actor.instance.L2PcInstance cannot be applied to ()
   [javac]                         increasePvpKills();
   [javac]                         ^
   [javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4494: increasePvpKills(com.it.br.gameserver.model.actor.instance.L2PcInstance) in com.it.br.gameserver.model.actor.instance.L2PcInstance cannot be applied to ()
   [javac]                     increasePvpKills();
   [javac]                     ^
   [javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4558: cannot find symbol
   [javac] symbol  : variable getRace
   [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
   [javac]         if (getRace() == Race.human && ((L2PcInstance)target).getRace() == Race.darkelf || ((L2PcInstance)target).getRace.getRace() == Race.dwarf)
   [javac]                                                                                                                  ^
   [javac] Note: C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\GeoEngine.java uses or overrides a deprecated API.
   [javac] Note: Recompile with -Xlint:deprecation for details.
   [javac] 4 errors

increasePvpKills(); replace with increasePvpKills(this);

 

and

 

if (getRace() == Race.human && ((L2PcInstance)target).getRace() == Race.darkelf || ((L2PcInstance)target).getRace.getRace() == Race.dwarf)

 

with

 

if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace.getRace() == Race.dwarf)

  • Author

error:

[javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4515: invalid method declaration; return type required
    [javac]     increasePvpKills(this);
    [javac]     ^
    [javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4515: illegal start of type
    [javac]     increasePvpKills(this);
    [javac]                      ^
    [javac] 2 errors

  • Author

public void increasePvpKills(this);

 

if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace.getRace() == Race.dwarf)
        {
            addItem("Loot", 8732, 1, this, true);
            sendMessage("You won 1 lifestone for a pvp kill!");
        }

 

 

 

 

public void increasePvpKills(this);

 

if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace.getRace() == Race.dwarf)
        {
            addItem("Loot", 8732, 1, this, true);
            sendMessage("You won 1 lifestone for a pvp kill!");
        }

 

 

 

 

lol`d

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.