Fix ActionSit

This commit is contained in:
brenoepic 2022-04-08 00:02:30 -03:00
parent 42198c46bd
commit 516560f603

View File

@ -1,5 +1,6 @@
package com.eu.habbo.habbohotel.pets.actions; 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.Pet;
import com.eu.habbo.habbohotel.pets.PetAction; import com.eu.habbo.habbohotel.pets.PetAction;
import com.eu.habbo.habbohotel.pets.PetTasks; import com.eu.habbo.habbohotel.pets.PetTasks;
@ -10,12 +11,23 @@ import com.eu.habbo.habbohotel.users.Habbo;
public class ActionSit extends PetAction { public class ActionSit extends PetAction {
public ActionSit() { public ActionSit() {
super(PetTasks.SIT, true); super(PetTasks.SIT, true);
this.statusToRemove.add(RoomUnitStatus.BEG);
this.statusToRemove.add(RoomUnitStatus.MOVE);
this.statusToRemove.add(RoomUnitStatus.LAY);
this.statusToRemove.add(RoomUnitStatus.DEAD);
this.statusToRemove.add(RoomUnitStatus.LAY);
} }
@Override @Override
public boolean apply(Pet pet, Habbo habbo, String[] data) { public boolean apply(Pet pet, Habbo habbo, String[] data) {
if (pet.getTask() != PetTasks.SIT && !pet.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) { 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) if (pet.getHappyness() > 75)
pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL)); pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL));