This commit is contained in:
Alejandro 2019-05-27 12:12:44 +03:00
commit b198d731c5
4 changed files with 76 additions and 8 deletions

View File

@ -144,14 +144,31 @@ public class InteractionWater extends InteractionDefault {
}
@Override
public void onWalk(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
super.onWalkOn(roomUnit, room, objects);
Pet pet = room.getPet(roomUnit);
if (pet != null) {
pet.getRoomUnit().setStatus(RoomUnitStatus.DIP, "0");
if(pet == null)
return;
if (!pet.getRoomUnit().hasStatus(RoomUnitStatus.SWIM)) {
pet.getRoomUnit().setStatus(RoomUnitStatus.SWIM, "");
}
}
@Override
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
super.onWalkOff(roomUnit, room, objects);
Pet pet = room.getPet(roomUnit);
if(pet == null)
return;
pet.getRoomUnit().removeStatus(RoomUnitStatus.SWIM);
}
private void recalculate(Room room) {
THashMap<Short, TIntArrayList> tiles = new THashMap<>();

View File

@ -535,7 +535,7 @@ public class Pet implements ISerialize, Runnable {
this.level++;
this.say(this.petData.randomVocal(PetVocalsType.LEVEL_UP));
this.addHappyness(100);
this.roomUnit.setStatus(RoomUnitStatus.GESTURE, "exp");
this.roomUnit.setStatus(RoomUnitStatus.GESTURE, PetGestures.LVLUP.getKey());
this.gestureTickTimeout = Emulator.getIntUnixTimestamp();
AchievementManager.progressAchievement(Emulator.getGameEnvironment().getHabboManager().getHabbo(this.userId), Emulator.getGameEnvironment().getAchievementManager().getAchievement("PetLevelUp"));
this.room.sendComposer(new PetLevelUpdatedComposer(this).compose());

View File

@ -1,9 +1,12 @@
package com.eu.habbo.habbohotel.pets.actions;
import com.eu.habbo.habbohotel.items.interactions.InteractionPushable;
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.Room;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
public class ActionPlayFootball extends PetAction {
public ActionPlayFootball() {
@ -12,6 +15,25 @@ public class ActionPlayFootball extends PetAction {
@Override
public boolean apply(Pet pet, Habbo habbo, String[] data) {
Room room = pet.getRoom();
if(room == null || room.getLayout() == null)
return false;
HabboItem foundBall = null;
for(HabboItem item : room.getFloorItems()) {
if(item instanceof InteractionPushable) {
foundBall = item;
}
}
if(foundBall == null)
return false;
pet.getRoomUnit().setGoalLocation(room.getLayout().getTile(foundBall.getX(), foundBall.getY()));
if (pet.getHappyness() > 75)
pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL));
else

View File

@ -2,8 +2,15 @@ package com.eu.habbo.habbohotel.rooms;
public enum RoomUnitStatus {
MOVE("mv", true),
SIT_IN("sit-in"),
SIT("sit", true),
SIT_OUT("sit-out"),
LAY_IN("lay-in"),
LAY("lay", true),
LAY_OUT("lay-out"),
FLAT_CONTROL("flatctrl"),
SIGN("sign"),
GESTURE("gst"),
@ -11,11 +18,25 @@ public enum RoomUnitStatus {
TRADING("trd"),
DIP("dip"),
EAT_IN("eat-in"),
EAT("eat"),
EAT_OUT("eat-out"),
BEG("beg", true),
DEAD_IN("ded-in"),
DEAD("ded", true),
DEAD_OUT("ded-out"),
JUMP_IN("jmp-in"),
JUMP("jmp", true),
JUMP_OUT("jmp-out"),
PLAY_IN("pla-in"),
PLAY("pla", true),
PLAY_OUT("pla-out"),
SPEAK("spk"),
CROAK("crk"),
RELAX("rlx"),
@ -30,12 +51,20 @@ public enum RoomUnitStatus {
GROW_5("grw5"),
GROW_6("grw6"),
GROW_7("grw7"),
LAY_IN("lay-in"),
LAY_OUT("lay-out"),
KICK("kck"),
WAG_TAIL("wag"),
JUMP_IN("jmp-in"),
JUMP_OUT("jmp-out");
DANCE("dan"),
AMS("ams"),
SWIM("swm"),
TURN("trn"),
SRP("srp"),
SRP_IN("srp-in"),
SLEEP_IN("slp-in"),
SLEEP("slp", true),
SLEEP_OUT("slp-out");
public final String key;
public final boolean removeWhenWalking;