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?

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