Welcome to MaxCheaters.com

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Code Procedural PvP Reward System [By cute Kara]


Recommended Posts

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Author Kara should be all... the rest code is kara.this Kara.that Kara Kara.kara.kara.java 

Nice one but I have a question.   I won't comment on the whole structure but I'm really curious about this one:   values = new Object[] { 2 }; Is this supposed to be an array one dimensional array with a length of 2?

You can also shorthand it like this:   values = new Object[]{ id, level }; There are multiple ways to clean up the code.

1 minute ago, valentin said:

can  put  this code in  https://github.com .....

 

You mean pastebin? Cause github is host no text viewer. There is no point to post a 100 line code in a host.

Share this post


Link to post
Share on other sites
2 minutes ago, valentin said:

ye  pastebin. Looks ugly the code posted on mxc

Ok next share i'm bored now.

 

PS. the boy on your photo is ugly too but i don't complain >.<

Edited by Kara`

Share this post


Link to post
Share on other sites
+public class PvPColor extends PEvent
+{
+	public PvPColor(int r, int g, int b)
+	{
+		values = new Object[3] { r, g, b };
+	}
+	
+	@Override
+	public void getEffect(L2PcInstance player)
+	{
+		player.getAppearance().setNameColor((int) values[0], (int) values[1], (int) values[2]);
+		player.broadcastUserInfo();
+	}
+}

what the...?

Share this post


Link to post
Share on other sites
11 hours ago, Kara` said:

 

You mean pastebin? Cause github is host no text viewer. There is no point to post a 100 line code in a host.

I think he means https://gist.github.com/

 

7 hours ago, xxdem said:

+public class PvPColor extends PEvent
+{
+	public PvPColor(int r, int g, int b)
+	{
+		values = new Object[3] { r, g, b };
+	}
+	
+	@Override
+	public void getEffect(L2PcInstance player)
+	{
+		player.getAppearance().setNameColor((int) values[0], (int) values[1], (int) values[2]);
+		player.broadcastUserInfo();
+	}
+}

what the...?

It was worse, check previous comments. Still, good effort.

Edited by Elfocrash

Share this post


Link to post
Share on other sites
8 hours ago, xxdem said:

+public class PvPColor extends PEvent
+{
+	public PvPColor(int r, int g, int b)
+	{
+		values = new Object[3] { r, g, b };
+	}
+	
+	@Override
+	public void getEffect(L2PcInstance player)
+	{
+		player.getAppearance().setNameColor((int) values[0], (int) values[1], (int) values[2]);
+		player.broadcastUserInfo();
+	}
+}

what the...?

Ελα ενταξει σκασε ειπα δεν χρειαζεται καν extend ενα interface μονο, το εγραφα ενω εκανα δουλεια ταυτοχρονα.

Share this post


Link to post
Share on other sites
1 hour ago, Kara` said:

Ελα ενταξει σκασε ειπα δεν χρειαζεται καν extend ενα interface μονο, το εγραφα ενω εκανα δουλεια ταυτοχρονα.

[GR] Ρε άσε τις δικαιολογίες και μην κάνεις σαν 10αχρονο. Δεν έχει σημασία πως έγραψες τον κώδικα, σημασία έχει το αποτέλεσμα που παρουσιάζεις και μόνο.

Share this post


Link to post
Share on other sites
1 hour ago, Elfocrash said:

[GR] Ρε άσε τις δικαιολογίες και μην κάνεις σαν 10αχρονο. Δεν έχει σημασία πως έγραψες τον κώδικα, σημασία έχει το αποτέλεσμα που παρουσιάζεις και μόνο.

Δικαιολογιες? Τι ειναι εδω πανεπιστημιο και δινω αυριο? Λες και με νοιαζει να απολογηθω στον Σταυρο.

 

Share this post


Link to post
Share on other sites
23 minutes ago, xxdem said:

diladi itane diskolo na kaneis declare ena int sto child class, eprepe na dialekseis ton xirotero kai pio periploko tropo gia na to paikseis eksipnos

Kai ama argotera theleis na kaneis store title as poume? 

Share this post


Link to post
Share on other sites
5 minutes ago, Kara` said:

Kai ama argotera theleis na kaneis store title as poume? 

Κάνεις ένα string field στο PvpTitle class. Δεν υπάρχει λόγος να κάνεις generalisation στο επίπεδο που το κάνεις για δύο λόγους.

Πρώτον κάνεις violate single responsibility γιατί δίνεις στο values field ιδιότητες που δεν θα έπρεπε να έχει.

Δεύτερον, δεν χρειάζεσαι κάν abstract class, μπορείς να το κάνεις με interface πολύ πιο απλά.

 

public class PvPSkill extends PEvent
{
	public PvPSkill(int id, int level)
	{
		values = new Object[2] { id, level };
	}

	@Override
	public void getEffect(L2PcInstance player)
	{
		Skill skill = SkillData.getInstance().getSkill((int) values[0], (int) values[1]);
		
		if (skill == null)
		{
			return;
		}
		
		player.addSkill(skill);
	}
}

 

public class PvPSkill implements PEvent
{
	private final int id;
	private final int level;

	public PvPSkill(int id, int level)
	{
		this.id = id;
		this.level = level;
	}

	@Override
	public void getEffect(L2PcInstance player)
	{
		Skill skill = SkillData.getInstance().getSkill(id, level);
		
		if (skill == null)
		{
			return;
		}
		
		player.addSkill(skill);
	}
}

 

 

Εσυ ποιό απο τα δύο βλέπεις σωστό?

Edited by Elfocrash
  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, Elfocrash said:

Κάνεις ένα string field στο PvpTitle class. Δεν υπάρχει λόγος να κάνεις generalisation στο επίπεδο που το κάνεις για δύο λόγους.

Πρώτον κάνεις violate single responsibility γιατί δίνεις στο values field ιδιότητες που δεν θα έπρεπε να έχει.

Δεύτερον, δεν χρειάζεσαι κάν abstract class, μπορείς να το κάνεις με interface πολύ πιο απλά.

 

abstract class kai interface kamia diafora an den se niazei melontika na kaneis implement panw apo ena

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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