Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -118,6 +118,10 @@ public final class Prayer {
|
|||||||
else prayerActiveTicks = 0;
|
else prayerActiveTicks = 0;
|
||||||
|
|
||||||
if(prayerActiveTicks > 0 && prayerActiveTicks % 2 == 0){
|
if(prayerActiveTicks > 0 && prayerActiveTicks % 2 == 0){
|
||||||
|
if(getPlayer().getSkills().getPrayerPoints() == 0){
|
||||||
|
reset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
double amountDrain = 0;
|
double amountDrain = 0;
|
||||||
for(PrayerType type : getActive()){
|
for(PrayerType type : getActive()){
|
||||||
double drain = type.getDrain();
|
double drain = type.getDrain();
|
||||||
@@ -131,9 +135,6 @@ public final class Prayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPlayer().getSkills().decrementPrayerPoints(amountDrain);
|
getPlayer().getSkills().decrementPrayerPoints(amountDrain);
|
||||||
if(getPlayer().getSkills().getPrayerPoints() == 0){
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,31 +108,30 @@ public final class SlayerManager {
|
|||||||
if(hasTask()) {
|
if(hasTask()) {
|
||||||
player.getSkills().addExperience(Skills.SLAYER, npc.getSkills().getMaximumLifepoints());
|
player.getSkills().addExperience(Skills.SLAYER, npc.getSkills().getMaximumLifepoints());
|
||||||
decrementAmount(1);
|
decrementAmount(1);
|
||||||
}
|
if(!hasTask()){
|
||||||
|
flags.setTaskStreak(flags.getTaskStreak() + 1);
|
||||||
if(!hasTask()){
|
flags.setCompletedTasks(flags.getCompletedTasks() + 1);
|
||||||
flags.setTaskStreak(flags.getTaskStreak() + 1);
|
if ((flags.getCompletedTasks() > 4 || flags.canEarnPoints() ) && flags.getMaster() != Master.TURAEL && flags.getPoints() < 64000) {
|
||||||
flags.setCompletedTasks(flags.getCompletedTasks() + 1);
|
int points = flags.getMaster().getTaskPoints()[0];
|
||||||
if ((flags.getCompletedTasks() > 4 || flags.canEarnPoints() ) && flags.getMaster() != Master.TURAEL && flags.getPoints() < 64000) {
|
if (flags.getTaskStreak() % 10 == 0) {
|
||||||
int points = flags.getMaster().getTaskPoints()[0];
|
points = flags.getMaster().getTaskPoints()[1];
|
||||||
if (flags.getTaskStreak() % 10 == 0) {
|
} else if (flags.getTaskStreak() % 50 == 0) {
|
||||||
points = flags.getMaster().getTaskPoints()[1];
|
points = flags.getMaster().getTaskPoints()[2];
|
||||||
} else if (flags.getTaskStreak() % 50 == 0) {
|
}
|
||||||
points = flags.getMaster().getTaskPoints()[2];
|
flags.incrementPoints(points);
|
||||||
|
if (flags.getPoints() > 64000) {
|
||||||
|
flags.setPoints(64000);
|
||||||
|
}
|
||||||
|
player.sendMessages("You've completed " + flags.getTaskStreak() + " tasks in a row and received " + points + " points, with a total of " + flags.getPoints(),"You have completed " + flags.getCompletedTasks() + " tasks in total. Return to a Slayer master.");
|
||||||
|
} else if(flags.getCompletedTasks() == 4){
|
||||||
|
player.sendMessage("You've completed your task; you will start gaining points on your next task!");
|
||||||
|
flags.flagCanEarnPoints();
|
||||||
|
} else {
|
||||||
|
player.sendMessages("You've completed your task; Complete " + (4 - flags.getCompletedTasks()) + " more task(s) to start gaining points.", "Return to a Slayer master.");
|
||||||
}
|
}
|
||||||
flags.incrementPoints(points);
|
|
||||||
if (flags.getPoints() > 64000) {
|
|
||||||
flags.setPoints(64000);
|
|
||||||
}
|
|
||||||
player.sendMessages("You've completed " + flags.getTaskStreak() + " tasks in a row and received " + points + " points, with a total of " + flags.getPoints(),"You have completed " + flags.getCompletedTasks() + " tasks in total. Return to a Slayer master.");
|
|
||||||
} else if(flags.getCompletedTasks() == 4){
|
|
||||||
player.sendMessage("You've completed your task; you will start gaining points on your next task!");
|
|
||||||
flags.flagCanEarnPoints();
|
|
||||||
} else {
|
} else {
|
||||||
player.sendMessages("You've completed your task; Complete " + (4 - flags.getCompletedTasks()) + " more task(s) to start gaining points.", "Return to a Slayer master.");
|
//player.sendMessage("You're assigned to kill " + NPCDefinition.forId((player.getSlayer().getTask().getNpcs()[0])).getName().toLowerCase() + "s; Only " + getAmount() + " more to go.");
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//player.sendMessage("You're assigned to kill " + NPCDefinition.forId((player.getSlayer().getTask().getNpcs()[0])).getName().toLowerCase() + "s; Only " + getAmount() + " more to go.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1230,4 +1230,17 @@ object ContentAPI {
|
|||||||
fun sendNews(message: String){
|
fun sendNews(message: String){
|
||||||
Repository.sendNews(message, 12, "CC6600")
|
Repository.sendNews(message, 12, "CC6600")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a given Graphics object, or graphics ID, to the given location.
|
||||||
|
* @param gfx the Graphics object, or the Integer ID of the graphics, to send. Either works.
|
||||||
|
* @param location the location to send it to
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun <G> sendGraphics(gfx: G, location: Location){
|
||||||
|
when(gfx){
|
||||||
|
is Int -> Graphics.send(Graphics(gfx),location)
|
||||||
|
is Graphics -> Graphics.send(gfx, location)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user