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

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

?

hmm i tried this method but it doesnt reward players :/

  • 0
Posted

It should reward players.. 100%

sorry but it doesnt :/

this method works fine but it rewards x4 all classes except humans :/

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

This one doesnt reward any of races.

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

:( any ideas?

  • 0
Posted

Very strange. I have noticed once that if(a!=b) and if(!(a==b)) acted differently on some occasions. Can't really explain how that happens (has to do something with auto-boxing i guess?). So try

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

  • 0
Posted

Very strange. I have noticed once that if(a!=b) and if(!(a==b)) acted differently on some occasions. Can't really explain how that happens (has to do something with auto-boxing i guess?). So try

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

not rewarding any of race :/

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