1package com.runehive.content;
3import com.runehive.game.world.World;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.game.world.entity.mob.player.PlayerRight;
6import com.runehive.game.world.items.Item;
7import com.runehive.game.world.items.ItemDefinition;
8import com.runehive.game.world.position.Area;
9import com.runehive.net.packet.out.SendItemOnInterface;
10import com.runehive.net.packet.out.SendMessage;
11import com.runehive.net.packet.out.SendScrollbar;
12import com.runehive.net.packet.out.SendString;
13import com.runehive.util.MessageColor;
14import com.runehive.util.Utility;
16import java.util.Arrays;
17import java.util.Optional;
55 return Arrays.stream(values()).filter(a -> a.level ==
level).findAny();
58 public static Optional<RoyaltyReward>
forOrdinal(
int ordinal) {
59 return Arrays.stream(values()).filter(a -> a.ordinal() == ordinal).findAny();
70 player.royalty += increment;
71 String suffix = increment > 1 ?
"s" :
"";
74 boolean levelUp = royalty >= 100;
80 +
"</col> has just reached prestige <col=9E4629>" + player.
royaltyLevel +
"</col>.");
83 player.
send(
new SendMessage(
"You have just received <col=9E4629>" + increment +
"</col> royalty point"
84 + (suffix) +
". You now have <col=9E4629>" + player.
royalty +
"</col> point"
85 + (player.
royalty > 1 ?
"s" :
"") +
" and are level <col=9E4629>" + player.
royaltyLevel +
"</col>."));
124 for (
int index = 0,
string = 37116; index < size; index++) {
136 player.
send(
new SendString(
"The Program rewards players for their activity in game. Every 30", 37111));
138 new SendString(
"minutes everyone is awarded 1 point. Points accumulate until 100 where", 37112));
140 new SendString(
"you gain a prestige level, points will be reset and you will be eligible", 37113));
142 new SendString(
"for the rewards again. Reward amounts are multiplied by prestige level.", 37114));
Created by Daniel on 2017-07-13.
static void open(Player player)
Opens the Royalty Reward Program itemcontainer.
static void append(Player player)
Handles the royalty program reward.
static void append(Player player, int increment)
Handles the royalty program reward.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
Represents the game world.
static void sendMessage(String... messages)
Sends a global message.
void open(int identification)
Opens an interface for the player.
boolean busy()
Checks if player is busy.
This class represents a character controlled by a player.
final Inventory inventory
String getName()
Gets the name of this entity.
DialogueFactory dialogueFactory
final InterfaceManager interfaceManager
void send(OutgoingPacket encoder)
Combat< Player > getCombat()
The combat of the mob.
final PlayerAssistant playerAssistant
Represents all of an in-game Item's attributes.
static ItemDefinition get(int id)
Gets an item definition.
String getName()
Gets the item name.
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
final int getAmount()
Gets the quantity of this item.
void addOrDrop(List< Item > items)
Attempts to deposit an item to the players inventory, if there is no space it'll bank the item instea...
Handles checking if mobs are in a certain area.
static boolean inWilderness(Position position)
The OutgoingPacket that sends a message to a Players chatbox in the client.
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.
Holds all the RoyaltyReward data.
RoyaltyReward(int level, Item reward)
static Optional< RoyaltyReward > forLevel(int level)
static Optional< RoyaltyReward > forOrdinal(int ordinal)
Holds all the player right data.
static String getCrown(Player player)
Gets the crown display.
Holds an enum of colors for ease.