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

Rio, dude, i know that you are trying to learn, but that's not how you do it. You don't try to parkour when you can't walk yet. You'd better get a book on java and solve all problems written there before playing with l2j core

  • 0
Posted

Rio, dude, i know that you are trying to learn, but that's not how you do it. You don't try to parkour when you can't walk yet. You'd better get a book on java and solve all problems written there before playing with l2j core

Here you are Rio

http://www.freejavaguide.com/corejava.htm

 

Just try to understand what's the deal with parenthesis, methods, statements, etc.

 

  • 0
Posted

Here you are Rio

http://www.freejavaguide.com/corejava.htm

 

Just try to understand what's the deal with parenthesis, methods, statements, etc.

 

alright guys ill start learning but i want to solve this 1st please :(

 

xAddytzu when i typed increasePvpKills(this); i got this 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

thats why i tried with that method :/

 

 

  • 0
Posted

alright guys ill start learning but i want to solve this 1st please :(

 

xAddytzu when i typed increasePvpKills(this); i got this 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

thats why i tried with that method :/

 

 

www.pastebin.com / L2PcInstance.java

  • 0
Posted

lol`d .. this is funny :D

You should leave a while Lineage2 and read some tutorials, books ! :)

 

You don't have any idea what I was talking about the method.

 

/**
    * Increase the pvp kills count and send the info to the player
    *
    */
       private int impro = 0;
       increasePvpKills(this);
   {
                       impro++;

 

More than 40% is logical

 

  • 0
Posted

not working 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:4559: cannot find symbol
   [javac] symbol  : variable getRace
   [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
   [javac]            if (getRace() == Race.human && target.getRace() == Race.darkelf || 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

i did add your confings :(

 

anyway i dont wanna trouble you anymore, also this thing gets spammy, i quit for now , see you in few weeks i guess when i get some java basic skills. thnx for your time.

  • 0
Posted

i clicked >Raw>http://pastebin.com/raw.php?i=6AZsh5z3>copy>paste in my eclipse > error:

[javac] C:\Server SVN\L2JBrasil_CORE\java\com\it\br\gameserver\model\actor\instance\L2PcInstance.java:4559: cannot find symbol
   [javac] symbol  : variable getRace
   [javac] location: class com.it.br.gameserver.model.actor.instance.L2PcInstance
   [javac]         if (getRace() == Race.human && target.getRace() == Race.darkelf || 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] 1 error

 

:(

  • 0
Posted

well i have problem here :/

// pvp class related reward

        if (getRace() == Race.human && target.getRace() == Race.darkelf || target.getRace() == Race.dwarf || target.getRace() == Race.orc || target.getRace() == Race.elf)
        {
            addItem("Loot", 6373, 1, this, true);
            sendMessage("You won 1 PvP Skull from your enemy!");
        }
        
        if (getRace() == Race.darkelf && target.getRace() == Race.human || target.getRace() == Race.dwarf || target.getRace() == Race.orc || target.getRace() == Race.elf)
        {
            addItem("Loot", 6373, 1, this, true);
            sendMessage("You won 1 PvP Skull from your enemy!");
        }
        
        if (getRace() == Race.dwarf && target.getRace() == Race.human || target.getRace() == Race.darkelf || target.getRace() == Race.orc || target.getRace() == Race.elf)
        {
            addItem("Loot", 6373, 1, this, true);
            sendMessage("You won 1 PvP Skull from your enemy!");
        }
        
        if (getRace() == Race.orc && target.getRace() == Race.human || target.getRace() == Race.darkelf || target.getRace() == Race.dwarf || target.getRace() == Race.elf)
        {
            addItem("Loot", 6373, 1, this, true);
            sendMessage("You won 1 PvP Skull from your enemy!");
        }
        
        if (getRace() == Race.elf && target.getRace() == Race.human || target.getRace() == Race.darkelf || target.getRace() == Race.dwarf || target.getRace() == Race.orc)
        {
            addItem("Loot", 6373, 1, this, true);
            sendMessage("You won 1 PvP Skull from your enemy!");
        }

 

when i kill with other classes they dont take reward, only dwarf takes and he takes 4 rewards for a kill :/

  • 0
Posted

Why don't you simply do

if (this.getRace() != target.getRace())
        {
            addItem("Loot", 6373, 1, this, true);
            sendMessage("You won 1 PvP Skull from your enemy!");
        }

?

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