From 2e2d7ae96cf81bb237678d78acd046fe4176b23d Mon Sep 17 00:00:00 2001 From: Breno Andrade <59066707+brenoepics@users.noreply.github.com> Date: Thu, 7 Apr 2022 21:42:59 -0300 Subject: [PATCH 1/7] Fix pets and bots invalid tiles --- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 09c54558..c8d41847 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -475,7 +475,8 @@ public class Room implements Comparable, ISerialize, Runnable { b.setRoomUnit(new RoomUnit()); b.getRoomUnit().setPathFinderRoom(this); b.getRoomUnit().setLocation(this.layout.getTile((short) set.getInt("x"), (short) set.getInt("y"))); - if (b.getRoomUnit().getCurrentLocation() == null) { + if (b.getRoomUnit().getCurrentLocation() == null || b.getRoomUnit().getCurrentLocation().state == RoomTileState.INVALID) { + b.getRoomUnit().setZ(this.getLayout().getDoorTile().getStackHeight()); b.getRoomUnit().setLocation(this.getLayout().getDoorTile()); b.getRoomUnit().setRotation(RoomUserRotation.fromValue(this.getLayout().getDoorDirection())); } else { @@ -510,7 +511,8 @@ public class Room implements Comparable, ISerialize, Runnable { pet.setRoomUnit(new RoomUnit()); pet.getRoomUnit().setPathFinderRoom(this); pet.getRoomUnit().setLocation(this.layout.getTile((short) set.getInt("x"), (short) set.getInt("y"))); - if (pet.getRoomUnit().getCurrentLocation() == null) { + if (pet.getRoomUnit().getCurrentLocation() == null || pet.getRoomUnit().getCurrentLocation().state == RoomTileState.INVALID) { + pet.getRoomUnit().setZ(this.getLayout().getDoorTile().getStackHeight()); pet.getRoomUnit().setLocation(this.getLayout().getDoorTile()); pet.getRoomUnit().setRotation(RoomUserRotation.fromValue(this.getLayout().getDoorDirection())); } else { From 4a68e6a4a26c8b3e1ac2a89f58e2f6dd690840ee Mon Sep 17 00:00:00 2001 From: Harmonic Date: Thu, 7 Apr 2022 17:49:47 -0700 Subject: [PATCH 2/7] Fixed Action Turn Right and Turn Left not moving the pets head. --- .../com/eu/habbo/habbohotel/pets/actions/ActionTurnLeft.java | 1 + .../com/eu/habbo/habbohotel/pets/actions/ActionTurnRight.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnLeft.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnLeft.java index de7a4d8d..a04efc81 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnLeft.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnLeft.java @@ -14,6 +14,7 @@ public class ActionTurnLeft extends PetAction { @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { pet.getRoomUnit().setBodyRotation(RoomUserRotation.values()[(pet.getRoomUnit().getBodyRotation().getValue() - 1 < 0 ? 7 : pet.getRoomUnit().getBodyRotation().getValue() - 1)]); + pet.getRoomUnit().setHeadRotation(RoomUserRotation.values()[(pet.getRoomUnit().getHeadRotation().getValue() - 1 < 0 ? 7 : pet.getRoomUnit().getHeadRotation().getValue() - 1)]); pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); return true; } diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnRight.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnRight.java index 37041721..6bb19b73 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnRight.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionTurnRight.java @@ -14,6 +14,7 @@ public class ActionTurnRight extends PetAction { @Override public boolean apply(Pet pet, Habbo habbo, String[] data) { pet.getRoomUnit().setBodyRotation(RoomUserRotation.values()[(pet.getRoomUnit().getBodyRotation().getValue() + 1 > 7 ? 0 : pet.getRoomUnit().getBodyRotation().getValue() + 1)]); + pet.getRoomUnit().setHeadRotation(RoomUserRotation.values()[(pet.getRoomUnit().getHeadRotation().getValue() + 1 > 7 ? 0 : pet.getRoomUnit().getHeadRotation().getValue() + 1)]); pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); return true; } From 6484d7f563959d406eeaed8df2cd2f0e2efb038e Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Apr 2022 15:30:26 +0000 Subject: [PATCH 3/7] Add Ring of Fire to PetManager.java --- src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java index 8294707d..d2a4013a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java @@ -62,6 +62,7 @@ public class PetManager { this.put(35, new ActionWings()); this.put(36, new ActionBreatheFire()); this.put(38, new ActionTorch()); + this.put(42, new ActionRingOfFire()); this.put(43, new ActionEat()); this.put(46, new ActionBreed()); @@ -519,4 +520,4 @@ public class PetManager { return false; } -} \ No newline at end of file +} From 66d8db7fb422a510bae203365acd5079d136de45 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Apr 2022 15:33:11 +0000 Subject: [PATCH 4/7] Add some dragon stuff to RoomUnitStatus.java --- .../java/com/eu/habbo/habbohotel/rooms/RoomUnitStatus.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitStatus.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitStatus.java index 73191762..b0108be0 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitStatus.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitStatus.java @@ -42,6 +42,11 @@ public enum RoomUnitStatus { RELAX("rlx"), WINGS("wng", true), FLAME("flm"), + RINGOFFIRE("rng"), // ring of fire for dragon, toy undone + SWING("swg"), // same as roll but less energic, related to Dragon tree toy. + HANG("hg"), // hang, related to Dragon tree toy. just hangs under the branch + ROLL("rll"), // roll, related to Dragon tree toy. rolls around the branch + RIP("rip"), GROW("grw"), GROW_1("grw1"), From 5e44354ce383439fc606e38720287bbb3ca16e20 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Apr 2022 15:34:49 +0000 Subject: [PATCH 5/7] Upload ActionRingOfFire --- .../pets/actions/ActionRingOfFire.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionRingOfFire.java diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionRingOfFire.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionRingOfFire.java new file mode 100644 index 00000000..c3f3c611 --- /dev/null +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionRingOfFire.java @@ -0,0 +1,32 @@ +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.PetVocalsType; +import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; +import com.eu.habbo.habbohotel.users.Habbo; +import com.eu.habbo.threading.runnables.PetClearPosture; + +public class ActionRingOfFire extends PetAction { + public ActionRingOfFire() { + super(null, true); + + this.minimumActionDuration = 2000; + this.statusToSet.add(RoomUnitStatus.RINGOFFIRE); + } + + // TO-DO: Make it specifically for the toy tree. I dont have the skills for that + @Override + public boolean apply(Pet pet, Habbo habbo, String[] data) { + if (pet.getHappyness() < 50) { + pet.say(pet.getPetData().randomVocal(PetVocalsType.DISOBEY)); + return false; + } else { + pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); + } + + Emulator.getThreading().run(new PetClearPosture(pet, RoomUnitStatus.RINGOFFIRE, null, false), this.minimumActionDuration); + return true; + } +} \ No newline at end of file From 12ad3adfcc1b05c522403c0c733ff0354c3cd1e3 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Apr 2022 16:19:14 +0000 Subject: [PATCH 6/7] Add Dance & Mambo --- .../habbohotel/pets/actions/ActionDance.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDance.java diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDance.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDance.java new file mode 100644 index 00000000..d3bcbc5a --- /dev/null +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionDance.java @@ -0,0 +1,32 @@ +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.PetVocalsType; +import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; +import com.eu.habbo.habbohotel.users.Habbo; +import com.eu.habbo.threading.runnables.PetClearPosture; + +public class ActionDance extends PetAction { + public ActionDance() { + super(null, true); + + this.minimumActionDuration = 3000; + this.statusToSet.add(RoomUnitStatus.DANCE); +} + + // mambojambo works better than ur dancing skills + @Override + public boolean apply(Pet pet, Habbo habbo, String[] data) { + if (pet.getHappyness() < 50) { + pet.say(pet.getPetData().randomVocal(PetVocalsType.DISOBEY)); + return false; + } else { + pet.say(pet.getPetData().randomVocal(PetVocalsType.GENERIC_NEUTRAL)); + } + + Emulator.getThreading().run(new PetClearPosture(pet, RoomUnitStatus.DANCE, null, false), this.minimumActionDuration); + return true; + } +} From fd23c73b24649fe32a25b4e330457481f1fe6f2a Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 8 Apr 2022 16:20:14 +0000 Subject: [PATCH 7/7] Add dance and Mambo to PetManager.java --- src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java index d2a4013a..f7ebf614 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java @@ -52,6 +52,7 @@ public class PetManager { this.put(15, new ActionFollowLeft()); this.put(16, new ActionFollowRight()); this.put(17, new ActionPlayFootball()); + this.put(21, new ActionDance()); this.put(24, new ActionMoveForward()); this.put(25, new ActionTurnLeft()); this.put(26, new ActionTurnRight()); @@ -59,6 +60,7 @@ public class PetManager { this.put(28, new ActionCroak()); this.put(29, new ActionDip()); this.put(30, new ActionWave()); + this.put(31, new ActionDance()); this.put(35, new ActionWings()); this.put(36, new ActionBreatheFire()); this.put(38, new ActionTorch());