Monsterplant achievements & Name

This commit is contained in:
Oliver 2023-01-20 00:17:38 +00:00 committed by John
parent 0f3ca7807e
commit cee67918d9
2 changed files with 6 additions and 3 deletions

View File

@ -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);

View File

@ -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"));
}
}