Jump to content
  • 0
Sign in to follow this  
d3gg3rz

200m announcement 667/711 - Matrix Base

Question

Right then. I am needing some help...
I am wanting to get a server announcement out for when somebody reaches 200m xp in any skill.
I have recently done it so when someone gets 2496 total it says about comp cape, and when they have at least level 99 in all skills it says about max cape.

However, as a lot of people are getting 200m's now, I would like an announcement for that

Anybody know how to do this?


Heres the code currently used to add xp
[CODE] public void addXp(int skill, double exp) {
player.getControlerManager().trackXP(skill, (int) exp);
if (skill != ATTACK && skill != DEFENCE && skill != STRENGTH
&& skill != MAGIC && skill != RANGE && skill != HITPOINTS)
exp *= player.isDonator() ? Settings.XP_RATE + 100000 : Settings.XP_RATE;
if (player.getAuraManager().usingWisdom())
exp *= 1.025;
if (skill != PRAYER)
exp *= 75000;
int oldLevel = getLevelForXp(skill);
xp[skill] += exp;
xpCounter += exp;
refreshXpCounter();
if (xp[skill] > MAXIMUM_EXP) {
xp[skill] = MAXIMUM_EXP;
}
int newLevel = getLevelForXp(skill);
int levelDiff = newLevel - oldLevel;
if (newLevel > oldLevel) {
level[skill] += levelDiff;
player.getDialogueManager().startDialogue("L*****p", skill);
if (skill == HITPOINTS)
player.heal(levelDiff * 10);
if (skill == PRAYER)
player.getPrayer().restorePrayer(levelDiff * 10);
if (skill == SUMMONING || (skill >= ATTACK && skill <= MAGIC))
player.getAppearence().generateAppearenceData();
}
refresh(skill);
}[/CODE]

and an example of a server announcement
[CODE]
if (level == 99 || level == 120)
for (Player players : World.getPlayers()) {
players.getPackets().sendGameMessage(
"<col=11EE11><shad=000000><img=5>News: <col=ff0033>" + player.getDisplayName() + " has reached Level " + level + " in " +

name);
}
[/CODE]

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
I am Just trying to help dnt know, Just try

[CODE]
if (exp == 200000000)
for (Player players : World.getPlayers()) {
players.getPackets().sendGameMessage(
"<col=11EE11><shad=000000><img=5>News: <col=ff0033>" + player.getDisplayName() + " has reached 200M XP " + level + " in " +

name);
}
[/CODE]

Share this post


Link to post
Share on other sites
  • 0
Ive already tried that. However it only announces if you get 200m with a 99 (ie. ::master)
Thats not quite done it :/

Share this post


Link to post
Share on other sites
  • 0
bump
still wanting to have this added

Share this post


Link to post
Share on other sites
  • 0
I dont understand how you have any players.

Sent from my M865C using Tapatalk 2

Share this post


Link to post
Share on other sites
  • 0
[quote name='Rich`']I dont understand how you have any players.

Sent from my M865C using Tapatalk 2[/QUOTE]

I love reading comments like these :P

No but in all seriousness...this is just a petty thing I want sorted...I havent seen it before on a server so I thought...may aswell code it :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

×