diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDown.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDown.java index 2f601fb5..910d4563 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDown.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDown.java @@ -1,5 +1,6 @@ package com.eu.habbo.habbohotel.pets.actions; +import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.PetAction; import com.eu.habbo.habbohotel.pets.PetTasks; @@ -10,18 +11,29 @@ import com.eu.habbo.habbohotel.users.Habbo; public class ActionDown extends PetAction { public ActionDown() { super(PetTasks.DOWN, true); + this.statusToRemove.add(RoomUnitStatus.BEG); this.statusToRemove.add(RoomUnitStatus.MOVE); - this.statusToRemove.add(RoomUnitStatus.SIT); + this.statusToRemove.add(RoomUnitStatus.DEAD); } @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { - pet.getRoomUnit().setStatus(RoomUnitStatus.LAY, pet.getRoom().getStackHeight(pet.getRoomUnit().getX(), pet.getRoomUnit().getY(), false) + ""); + if (pet.getTask() != PetTasks.DOWN && !pet.getRoomUnit().hasStatus(RoomUnitStatus.LAY)) { + pet.getRoomUnit().cmdLay = true; + pet.getRoomUnit().setStatus(RoomUnitStatus.LAY, pet.getRoomUnit().getCurrentLocation().getStackHeight() + ""); - if (pet.getHappyness() > 50) - pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL)); - else - pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); + Emulator.getThreading().run(() -> { + pet.getRoomUnit().cmdLay = false; + pet.clearPosture(); + }, 4000); + + if (pet.getHappyness() > 50) + pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL)); + else + pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); + + return true; + } return true; } diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java index 767faa3f..39dff84d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java @@ -11,16 +11,14 @@ import com.eu.habbo.threading.runnables.PetFollowHabbo; public class ActionFollow extends PetAction { public ActionFollow() { - super(PetTasks.FOLLOW, true); - this.statusToRemove.add(RoomUnitStatus.MOVE); - this.statusToRemove.add(RoomUnitStatus.LAY); - this.statusToRemove.add(RoomUnitStatus.DEAD); + super(PetTasks.FOLLOW, false); } @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { - pet.clearPosture(); + pet.clearPosture(); + pet.setTask(PetTasks.FOLLOW); Emulator.getThreading().run(new PetFollowHabbo(pet, habbo, 0)); if (pet.getHappyness() > 75) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowLeft.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowLeft.java index 84b16e6a..31beb14a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowLeft.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowLeft.java @@ -10,14 +10,13 @@ import com.eu.habbo.threading.runnables.PetFollowHabbo; public class ActionFollowLeft extends PetAction { public ActionFollowLeft() { - super(PetTasks.FOLLOW, true); + super(PetTasks.FOLLOW, false); } @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { - //Follow left. pet.clearPosture(); - + pet.setTask(PetTasks.FOLLOW); Emulator.getThreading().run(new PetFollowHabbo(pet, habbo, -2)); if (pet.getHappyness() > 75) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowRight.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowRight.java index e00de028..3e51d877 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowRight.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollowRight.java @@ -10,14 +10,13 @@ import com.eu.habbo.threading.runnables.PetFollowHabbo; public class ActionFollowRight extends PetAction { public ActionFollowRight() { - super(PetTasks.FOLLOW, true); + super(PetTasks.FOLLOW, false); } @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { - //Follow right. pet.clearPosture(); - + pet.setTask(PetTasks.FOLLOW); Emulator.getThreading().run(new PetFollowHabbo(pet, habbo, +2)); if (pet.getHappyness() > 75) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionPlayDead.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionPlayDead.java index 53aae87f..94b7a1ee 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionPlayDead.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionPlayDead.java @@ -12,7 +12,6 @@ public class ActionPlayDead extends PetAction { super(PetTasks.PLAY_DEAD, true); this.statusToRemove.add(RoomUnitStatus.MOVE); this.statusToRemove.add(RoomUnitStatus.LAY); - this.statusToRemove.add(RoomUnitStatus.DEAD); } @Override diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionSit.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionSit.java index 52ef037f..b9a1b762 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionSit.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionSit.java @@ -1,5 +1,6 @@ package com.eu.habbo.habbohotel.pets.actions; +import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.PetAction; import com.eu.habbo.habbohotel.pets.PetTasks; @@ -10,12 +11,22 @@ import com.eu.habbo.habbohotel.users.Habbo; public class ActionSit extends PetAction { public ActionSit() { super(PetTasks.SIT, true); + this.statusToRemove.add(RoomUnitStatus.BEG); + this.statusToRemove.add(RoomUnitStatus.MOVE); + this.statusToRemove.add(RoomUnitStatus.LAY); + this.statusToRemove.add(RoomUnitStatus.DEAD); } @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { if (pet.getTask() != PetTasks.SIT && !pet.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) { - pet.getRoomUnit().setStatus(RoomUnitStatus.SIT, pet.getRoom().getStackHeight(pet.getRoomUnit().getX(), pet.getRoomUnit().getY(), false) - 0.50 + ""); + pet.getRoomUnit().cmdSit = true; + pet.getRoomUnit().setStatus(RoomUnitStatus.SIT, pet.getRoomUnit().getCurrentLocation().getStackHeight() + ""); + + Emulator.getThreading().run(() -> { + pet.getRoomUnit().cmdSit = false; + pet.clearPosture(); + }, 4000); if (pet.getHappyness() > 75) pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL)); diff --git a/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java b/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java index b790916f..d5a0ebe2 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java +++ b/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java @@ -39,7 +39,11 @@ public class PetFollowHabbo implements Runnable { this.pet.setTask(PetTasks.FOLLOW); } } - Emulator.getThreading().run(this, 500); + if(target.distance(this.pet.getRoomUnit().getCurrentLocation()) > 1) { + Emulator.getThreading().run(this, 500); + } else { + this.pet.setTask(PetTasks.FREE); + } } } }