forked from 2009Scape/Server
Fixed a bug with slayer
This commit is contained in:
parent
cdc3d65fe8
commit
1359a70681
2 changed files with 7 additions and 5 deletions
|
|
@ -513,7 +513,7 @@ public class NPC extends Entity {
|
|||
if (getZoneMonitor().handleDeath(killer)) {
|
||||
return;
|
||||
}
|
||||
if (task != null && killer instanceof Player && ((Player) killer).getSlayer().getTask() == task) {
|
||||
if (task != null && killer instanceof Player && ((Player) killer).getSlayer().getTask() == task && ((Player) killer).getSlayer().hasTask()) {
|
||||
((Player) killer).getSlayer().finalizeDeath(killer.asPlayer(), this);
|
||||
}
|
||||
if (killer instanceof Player && killer.getAttribute("jobs:id",null) != null) {
|
||||
|
|
|
|||
|
|
@ -105,10 +105,12 @@ public final class SlayerManager {
|
|||
* @param npc The NPC. You're currently
|
||||
*/
|
||||
public void finalizeDeath(Player player, NPC npc) {
|
||||
player.getSkills().addExperience(Skills.SLAYER,npc.getSkills().getMaximumLifepoints());
|
||||
decrementAmount(1);
|
||||
if (!hasTask()) {
|
||||
clear();
|
||||
if(hasTask()) {
|
||||
player.getSkills().addExperience(Skills.SLAYER, npc.getSkills().getMaximumLifepoints());
|
||||
decrementAmount(1);
|
||||
}
|
||||
|
||||
if(!hasTask()){
|
||||
flags.setTaskStreak(flags.getTaskStreak() + 1);
|
||||
flags.setCompletedTasks(flags.getCompletedTasks() + 1);
|
||||
if ((flags.getCompletedTasks() > 4 || flags.canEarnPoints() ) && flags.getMaster() != Master.TURAEL && flags.getPoints() < 64000) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue