Jump to content
  • 0

[Help] Class related pvp reward


Question

Posted

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 :)

Recommended Posts

  • 0
Posted

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

        {

        //do something

        }

  • 0
Posted

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

 

  • 0
Posted

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?

 

  • 0
Posted

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);

 

  • 0
Posted

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)"

  • 0
Posted

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

  • 0
Posted

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)

  • 0
Posted

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

  • 0
Posted

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!");
        }

 

 

 

 

  • 0
Posted

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

  • 0
Posted

i did smth wrong?

doh..

 

public void increasePvpKills(L2PcInstance target) LEAVE THE FUKING METHOD.. and replace increasePvpKills(); with increasePvpKills(this);

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   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...