From cee67918d9078b646e5a14489deedd1d6a88b806 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 20 Jan 2023 00:17:38 +0000 Subject: [PATCH] Monsterplant achievements & Name --- .../java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java | 6 +++--- .../habbo/messages/incoming/users/ChangeUserNameEvent.java | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java b/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java index 59520858..daee7dab 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java @@ -333,7 +333,7 @@ public class MonsterplantPet extends Pet implements IPetLook { if (seedBase != null) { HabboItem seed; if (ownerOne != null) { - AchievementManager.progressAchievement(ownerOne, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MonsterPlantBreeder"), 5); + AchievementManager.progressAchievement(ownerOne, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MonsterPlantBreeder"), 1); seed = Emulator.getGameEnvironment().getItemManager().createItem(ownerOne.getHabboInfo().getId(), seedBase, 0, 0, ""); ownerOne.getInventory().getItemsComponent().addItem(seed); ownerOne.getClient().sendResponse(new UnseenItemsComposer(seed)); @@ -341,7 +341,7 @@ public class MonsterplantPet extends Pet implements IPetLook { } if (ownerTwo != null) { - AchievementManager.progressAchievement(ownerTwo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MonsterPlantBreeder"), 5); + AchievementManager.progressAchievement(ownerTwo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MonsterPlantBreeder"), 1); seed = Emulator.getGameEnvironment().getItemManager().createItem(ownerTwo.getHabboInfo().getId(), seedBase, 0, 0, ""); ownerTwo.getInventory().getItemsComponent().addItem(seed); ownerTwo.getClient().sendResponse(new UnseenItemsComposer(seed)); @@ -381,7 +381,7 @@ public class MonsterplantPet extends Pet implements IPetLook { @Override public synchronized void scratched(Habbo habbo) { if (this.mayScratch()) { - AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MonsterPlantTreater"), 5); + AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MonsterPlantTreater"), 1); this.setDeathTimestamp(Emulator.getIntUnixTimestamp() + MonsterplantPet.TIME_TO_LIVE); this.addHappiness(10); this.addExperience(10); diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeUserNameEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeUserNameEvent.java index b329f8f2..241ac1c9 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeUserNameEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeUserNameEvent.java @@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.users.HabboInfo; import com.eu.habbo.habbohotel.users.HabboManager; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.rooms.users.ChangeUserNameResultMessageEvent; +import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.messages.outgoing.rooms.users.UserNameChangedMessageComposer; import com.eu.habbo.messages.outgoing.users.CheckUserNameResultMessageComposer; import com.eu.habbo.messages.outgoing.users.UserObjectComposer; @@ -35,6 +36,7 @@ public class ChangeUserNameEvent extends MessageHandler { this.client.sendResponse(new ChangeUserNameResultMessageEvent(this.client.getHabbo())); this.client.sendResponse(new UserNameChangedMessageComposer(this.client.getHabbo()).compose()); this.client.sendResponse(new UserObjectComposer(this.client.getHabbo())); + AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("Name")); return; } @@ -89,5 +91,6 @@ public class ChangeUserNameEvent extends MessageHandler { this.client.sendResponse(new CheckUserNameResultMessageComposer(CheckUserNameResultMessageComposer.TAKEN_WITH_SUGGESTIONS, name, new ArrayList<>())); } } + AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("Name")); } }