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

Hah yeah that was the problem double getrace :D MULTUMESC MULT! thank you !!! c ya around dude :')

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

?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock