Jump to content
  • 0

+1 reward [Question]How to make Reward "If player in zone" [Help]


Question

Posted

I have question, i have pvp reward system but i wanna add it, "if player is in "ArenaZone" to get reward.

Is it possible? Ofc it is :D

How?

I think i just need something like

  if player.ZoneArenazone();

Wierd ;) please help :D

 

+					
+					// reward 2
+					if (ALLOW_QUAKE_PVP)
+					{
+						String[] propertySplit = QuakeSettings.getProperty("PvPQuakeReward2", "0,0").split(";");
+						for (String rewarditem2 : propertySplit)
+						{
+							String[] reward2Split = rewarditem2.split(",");
+							if (reward2Split.length != 2)
+							{
+								ALLOW_QUAKE_PVP = false;
+								System.out.println("RewardItem2[Config.load()]: invalid config property -> Reward items \"" + rewarditem2 + "\"");
+							}
+							else
+							{
+								try
+								{
+									QUAKE_REWARD_2.add(new int[]
+									{
+										Integer.valueOf(reward2Split[0]), Integer.valueOf(reward2Split[1])
+									});
+								}
+								catch (NumberFormatException nfe)
+								{
+									if (!rewarditem2.equals(""))
+									{
+										ALLOW_QUAKE_PVP = false;
+										System.out.println("RewardItem2[Config.load()]: invalid config property -> Reward items \"" + rewarditem2 + "\"");
+									}
+								}
+							}
+						}
+					}
+					// end reward 2

 

Part of my reward system

 

I need players to get reward only in specific zone as an "ArenaZone"

14 answers to this question

Recommended Posts

  • 0
Posted

					if(player.isInsideZone(ZoneId.PVP))
				{
					//bla bla
				}

 

This is for H5 tho (unstable)

 

k thanks, i will test and +1 if it works.

  • 0
Posted

So i have to add before each " like "

 

+				{
+					case 1:
				if(player.isInsideZone(ZoneId.PVP))
				}
+						for (int[] reward1 : Config.QUAKE_REWARD_1)
+						{
                                                 
+							addItem("Loot", reward1[0], reward1[1], this, true);
+						}
+						PlaySound _snd1 = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);
+						sendPacket(_snd1);
+						sendMessage("You will be rewarded for 1,pvp kill!");
+						ExShowScreenMessage _msg1 = new ExShowScreenMessage("Frist Blood", 3333);
+						sendPacket(_msg1);
+						break;
+					case 2:

 

?

  • 0
Posted

From your case 1, it's obvious than your code is in L2PcInstance, so you don't need "player." part.

For the arena id, just search in your pack.

 

Take more than 1min to test things by yourself...

  • 0
Posted

From your case 1, it's obvious than your code is in L2PcInstance, so you don't need "player." part.

For the arena id, just search in your pack.

 

Take more than 1min to test things by yourself...

 

yup correct, i'm lazy at all ;D

  • 0
Posted

 

this is your check

 

if (Config.ALLOW_QUAKE_PVP && (isInsideZone(ZONE_PVP)))

 

 

in L2PcInstance.java

 

Tested & working, +1 for you.

Guest
This topic is now closed to further replies.


×
×
  • Create New...