From b0e46101d9c445804bbfd8f8e1c6f21231d2fc4f Mon Sep 17 00:00:00 2001 From: Yordi Date: Thu, 12 Jan 2023 10:10:48 +0100 Subject: [PATCH] Goodbye Happyness, welcome Happiness. Now where's my cup of tea, Elizabeth? --- sqlupdates/3_5_0 to 4_0_0.sql | 11 ++++++++--- sqlupdates/4_0_0_pets_EN.sql | 4 ++-- sqlupdates/4_0_0_pets_NL.sql | 4 ++-- .../eu/habbo/habbohotel/commands/PetInfoCommand.java | 2 +- src/main/java/com/eu/habbo/habbohotel/pets/Pet.java | 6 +++--- .../java/com/eu/habbo/habbohotel/pets/PetCommand.java | 2 +- .../outgoing/rooms/pets/PetInfoMessageComposer.java | 2 +- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/sqlupdates/3_5_0 to 4_0_0.sql b/sqlupdates/3_5_0 to 4_0_0.sql index 8845bc9b..fab7b232 100644 --- a/sqlupdates/3_5_0 to 4_0_0.sql +++ b/sqlupdates/3_5_0 to 4_0_0.sql @@ -2,9 +2,14 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_change INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_changename.done', 'Successfully toggled the name change for the Habbo %user%.'); INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.succes.cmd_changename.received', 'Hotel staff requests for you to change your name.\n Please click on your Habbo then click on the "Change Your Name" button.'); -ALTER TABLE `achievements` -ADD `visible` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1' COMMENT 'Is the achievement in use and/or obtainable?'; +ALTER TABLE `achievements` ADD `visible` enum('0','1') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1' COMMENT 'Is the achievement in use and/or obtainable?'; -UPDATE pet_commands_data SET required_level=1 WHERE command_id=35; +UPDATE `pet_commands_data` SET `required_level` = '1' WHERE `command_id` = '35'; INSERT IGNORE INTO `emulator_settings` (`key`, `value`) VALUES ('encryption.forced', '0'); + +UPDATE `emulator_texts` SET `key` = 'generic.pet.happiness', `value` = 'Happiness' WHERE `key` = 'generic.pet.happyness'; + +ALTER TABLE `pet_commands_data` CHANGE `cost_happyness` `cost_happiness` int(11) NOT NULL DEFAULT '0'; + +ALTER TABLE `users_pets` CHANGE `happyness` `happiness` int(11) NOT NULL DEFAULT '100'; diff --git a/sqlupdates/4_0_0_pets_EN.sql b/sqlupdates/4_0_0_pets_EN.sql index d4253866..48153eb9 100644 --- a/sqlupdates/4_0_0_pets_EN.sql +++ b/sqlupdates/4_0_0_pets_EN.sql @@ -63,12 +63,12 @@ CREATE TABLE IF NOT EXISTS `pet_commands_data` ( `text` varchar(25) NOT NULL, `required_level` int(11) NOT NULL, `reward_xp` int(11) NOT NULL DEFAULT 5, - `cost_happyness` int(11) NOT NULL DEFAULT 0, + `cost_happiness` int(11) NOT NULL DEFAULT 0, `cost_energy` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`command_id`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; -INSERT INTO `pet_commands_data` (`command_id`, `text`, `required_level`, `reward_xp`, `cost_happyness`, `cost_energy`) VALUES +INSERT INTO `pet_commands_data` (`command_id`, `text`, `required_level`, `reward_xp`, `cost_happiness`, `cost_energy`) VALUES (0, 'Free', 1, 5, 0, 0), (1, 'Sit', 1, 5, 0, 0), (2, 'Down', 2, 10, 0, 0), diff --git a/sqlupdates/4_0_0_pets_NL.sql b/sqlupdates/4_0_0_pets_NL.sql index e5a4c207..c1deac95 100644 --- a/sqlupdates/4_0_0_pets_NL.sql +++ b/sqlupdates/4_0_0_pets_NL.sql @@ -63,12 +63,12 @@ CREATE TABLE IF NOT EXISTS `pet_commands_data` ( `text` varchar(25) NOT NULL, `required_level` int(11) NOT NULL, `reward_xp` int(11) NOT NULL DEFAULT 5, - `cost_happyness` int(11) NOT NULL DEFAULT 0, + `cost_happiness` int(11) NOT NULL DEFAULT 0, `cost_energy` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`command_id`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; -INSERT INTO `pet_commands_data` (`command_id`, `text`, `required_level`, `reward_xp`, `cost_happyness`, `cost_energy`) VALUES +INSERT INTO `pet_commands_data` (`command_id`, `text`, `required_level`, `reward_xp`, `cost_happiness`, `cost_energy`) VALUES (0, 'Geen', 1, 0, 0, 0), (1, 'Zit', 1, 10, 0, 0), (2, 'Lig', 2, 10, 0, 0), diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java index 2c53adb6..1c74d9f5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java @@ -30,7 +30,7 @@ public class PetInfoCommand extends Command { Emulator.getTexts().getValue("commands.generic.cmd_pet_info.stats") + "\r\n" + Emulator.getTexts().getValue("generic.pet.scratches") + ": " + pet.getRespect() + "\r" + Emulator.getTexts().getValue("generic.pet.energy") + ": " + pet.getEnergy() + "/" + PetManager.maxEnergy(pet.getLevel()) + "\r" + - Emulator.getTexts().getValue("generic.pet.happyness") + ": " + pet.getHappiness() + "\r" + + Emulator.getTexts().getValue("generic.pet.happiness") + ": " + pet.getHappiness() + "\r" + Emulator.getTexts().getValue("generic.pet.level.thirst") + ": " + pet.levelThirst + "\r" + Emulator.getTexts().getValue("generic.pet.level.hunger") + ": " + pet.levelHunger + "\r" + Emulator.getTexts().getValue("generic.pet.current_action") + ": " + (pet.getTask() == null ? Emulator.getTexts().getValue("generic.nothing") : pet.getTask().name()) + "\r" + diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java b/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java index fc73d940..56cd7ceb 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java @@ -149,7 +149,7 @@ public class Pet implements ISerialize, Runnable { } this.race = set.getInt("race"); this.experience = set.getInt("experience"); - this.happiness = set.getInt("happyness"); + this.happiness = set.getInt("happiness"); this.energy = set.getInt("energy"); this.respect = set.getInt("respect"); this.created = set.getInt("created"); @@ -284,7 +284,7 @@ public class Pet implements ISerialize, Runnable { if (this.isNeedsUpdate()) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) { if (this.id > 0) { - try (PreparedStatement statement = connection.prepareStatement("UPDATE users_pets SET room_id = ?, experience = ?, energy = ?, respect = ?, x = ?, y = ?, z = ?, rot = ?, hunger = ?, thirst = ?, happyness = ?, created = ? WHERE id = ?")) { + try (PreparedStatement statement = connection.prepareStatement("UPDATE users_pets SET room_id = ?, experience = ?, energy = ?, respect = ?, x = ?, y = ?, z = ?, rot = ?, hunger = ?, thirst = ?, happiness = ?, created = ? WHERE id = ?")) { statement.setInt(1, (this.room == null ? 0 : this.room.getId())); statement.setInt(2, this.experience); statement.setInt(3, this.energy); @@ -774,7 +774,7 @@ public class Pet implements ISerialize, Runnable { } /** - * Increases the pet's happyness level when it is scratched. + * Increases the pet's happiness level when it is scratched. * * @param habbo the habbo who scratched the pet */ diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/PetCommand.java b/src/main/java/com/eu/habbo/habbohotel/pets/PetCommand.java index 319654a1..3fb62674 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/PetCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/PetCommand.java @@ -32,7 +32,7 @@ public class PetCommand implements Comparable { this.level = set.getInt("required_level"); this.xp = set.getInt("reward_xp"); this.energyCost = set.getInt("cost_energy"); - this.happinessCost = set.getInt("cost_happyness"); + this.happinessCost = set.getInt("cost_happiness"); this.action = action; } diff --git a/src/main/java/com/eu/habbo/messages/outgoing/rooms/pets/PetInfoMessageComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/rooms/pets/PetInfoMessageComposer.java index 061a3afa..205c9ae2 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/rooms/pets/PetInfoMessageComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/rooms/pets/PetInfoMessageComposer.java @@ -40,7 +40,7 @@ public class PetInfoMessageComposer extends MessageComposer { } this.response.appendInt(this.pet.getEnergy()); this.response.appendInt(this.pet.getMaxEnergy()); //Max energy - this.response.appendInt(this.pet.getHappiness()); //this.pet.getHappyness() + this.response.appendInt(this.pet.getHappiness()); this.response.appendInt(100); this.response.appendInt(this.pet.getRespect()); this.response.appendInt(this.pet.getUserId());