Jump to content
  • 0

Alternative Codes for pvp Rewards/exp


Question

Posted

Hiho i am looking for  certain java code's

 

i tried it myself allready but i am kinda new to l2java so i request some help.

 

things i am looking for.

 

pvp exp reward system that you gain  a certain ammount of exp for each level lets say from lvl 70 to  75 10% exp from 76 to 78 5% exp

 

tryed to use the death lost exp code for it :

 

i was thinking a code like

 

 

getStat than .getExpForLevel than Experience.MAX_LEVEL +5(percent)

 

another code i was thinking about was :

 

Item reward System, that you have multiply chances to recive a item from a item pool

 

here is my code :

 

			    if (Rnd.get(100) < 20)
                   {
	             addItem("Loot", x, y, this, true);
	             sendMessage("You won blabla!");
				 return;
			    }
		        if (Rnd.get(100) < 10)
                       {
	                addItem("Loot", x, y, this, true);
	                sendMessage("You won blabla!");
					Return;
			        }

 

now i am thinking if there is another way to create a random reward for a pvp kill,because if i add like 100 items its gonna be a long code.

and ofc you can recive only 1 item a time.

 

normally i wouldnt ask for help but its getting kinda messy my code. :D

 

 

3 answers to this question

Recommended Posts

  • 0
Posted

Unlocked, sorry..not in my mood today :/

 

For your random item reward.. you can use this array method.

	int[][] items = { {1770, 1}, {1373, 1} };

	int[] ar = items[Rnd.get(2)]; // gets a random array(containing itemid and count) items array

	if(ar.length < 2)
		sendMessage("Skipping item, incorrect length.");
	else
		addItem("StartUp",  ar[0], ar[1], player, true);

 

And the xp part.. i didnt get it :/

 

(Reedited the code.. I'm really not myself today lol)

  • 0
Posted

Unlocked, sorry..not in my mood today :/

 

For your random item reward.. you can use this array method.

	int[][] items = { {1770, 1}, {1373, 1} };

	int[] ar = items[Rnd.get(2)]; // gets a random array(containing itemid and count) items array

	if(ar.length < 2)
		sendMessage("Skipping item, incorrect length.");
	else
		addItem("StartUp",  ar[0], ar[1], player, true);

 

And the xp part.. i didnt get it :/

 

(Reedited the code.. I'm really not myself today lol)

 

thanks, for the exp part i am looking for a code that add exact 10% to a player from examle 70 to 75 after 75 to 78 only 5% exp.

i could do calculate it and make a code but i think there is better 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...