Jump to content
  • 0

[Help] returning targeted players pvp points as a var


Question

Posted

Hello,

  i want to modify Vago "Item reward for pvp/pk kill.":

        // Give x y for a pvp kill
	addItem("Loot", x, y, this, true);
	sendMessage("You won y x for a pvp kill!"); 

i want that y would be the amount of targetPlayer pvps so that if killed player has 10 pvps, killer would get 10 y, but it seems that i cant get targetPlayer pvps as a var.. or can i?

4 answers to this question

Recommended Posts

  • 0
Posted

well i didn't catch you, what exactly you want? Please explain me better and i will help you.

if you want y = target pvp kills so:

int y = ((L2PcInstance) getTarget()).getPvpKills();

  • 0
Posted

I want to do this:

1.For every kill player recieves a PvP point, and after the player dies, all pvps disappear and appears as pk points. (Basically, pvp points are kills in a row)
2.Player recieves as much adena as the opponent has pvp points at the exact killing time.

 

I already did the pvp to pk part, but i cant get the second part working.

Code you gaved me, in eclipse, throws me an error on int (syntax).

 

  • 0
Posted

I want to do this:

1.For every kill player recieves a PvP point, and after the player dies, all pvps disappear and appears as pk points. (Basically, pvp points are kills in a row)
2.Player recieves as much adena as the opponent has pvp points at the exact killing time.

1)you make an int pvppoints = 0; for example.

you make one method for example: increasePvpPoint() { pvppoints = pvppoints +1; }

then you create new int pkpoints = 0;

in doDie you make for example:

if(pvppoints > 0)

pkpoints = pvppoints;

pvppoints = 0;

 

2)for ex you make

int y = ((L2PcInstance) getTarget())._pvppoints;

 

and in reward pvp....

getInventory().addItem("Rward",57,y,this,null);

 

  • 0
Posted

here is what i did in  doDie

if(Config.GVE_PVP_SYSTEM)
		{
			setPkKills(getPkKills()+ getPvpKills());
			setPvpKills(0);

		}

is it possible to do it in increasePvpKills without creating a new method?

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