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

  • 0
Posted

I tried it many times and in different projects. Doesnt reward players. How it is working for you :/

 

-Bump-

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