From f240580c1e3b517dbc504b5a39359f0298380496 Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Wed, 5 Feb 2020 19:17:51 +0200 Subject: [PATCH] Add bot placement message --- sqlupdates/2_3_0-RC-2_TO_2_3_0.sql | 4 +++- src/main/java/com/eu/habbo/habbohotel/bots/Bot.java | 4 ++++ src/main/java/com/eu/habbo/plugin/PluginManager.java | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sqlupdates/2_3_0-RC-2_TO_2_3_0.sql b/sqlupdates/2_3_0-RC-2_TO_2_3_0.sql index 7d46d35d..866278ca 100644 --- a/sqlupdates/2_3_0-RC-2_TO_2_3_0.sql +++ b/sqlupdates/2_3_0-RC-2_TO_2_3_0.sql @@ -1,2 +1,4 @@ ALTER TABLE `users_pets` -ADD COLUMN `saddle_item_id` int(11) NULL; \ No newline at end of file +ADD COLUMN `saddle_item_id` int(11) NULL; + +INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.bot.placement.messages', 'Yo!;Hello I\'m a real party animal!;Hello!'); \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java b/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java index e6a5d900..d10ed613 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java @@ -22,6 +22,8 @@ import java.util.Arrays; public class Bot implements Runnable { public static final String NO_CHAT_SET = "${bot.skill.chatter.configuration.text.placeholder}"; + public static String[] PLACEMENT_MESSAGES = "Yo!;Hello I'm a real party animal!;Hello!".split(";"); + private final ArrayList chatLines; private transient int id; private String name; @@ -240,6 +242,8 @@ public class Bot implements Runnable { if (this.roomUnit != null) { room.giveEffect(this.roomUnit, this.effect, -1); } + + this.talk(PLACEMENT_MESSAGES[Emulator.getRandom().nextInt(PLACEMENT_MESSAGES.length)]); } public void onPickUp(Habbo habbo, Room room) { diff --git a/src/main/java/com/eu/habbo/plugin/PluginManager.java b/src/main/java/com/eu/habbo/plugin/PluginManager.java index 2a6c45f9..7edf9579 100644 --- a/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -3,6 +3,7 @@ package com.eu.habbo.plugin; import com.eu.habbo.Emulator; import com.eu.habbo.core.Easter; import com.eu.habbo.habbohotel.achievements.AchievementManager; +import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.bots.BotManager; import com.eu.habbo.habbohotel.catalog.CatalogManager; import com.eu.habbo.habbohotel.catalog.TargetOffer; @@ -82,6 +83,8 @@ public class PluginManager { BotManager.MAXIMUM_CHAT_LENGTH = Emulator.getConfig().getInt("hotel.bot.max.chatlength"); BotManager.MAXIMUM_NAME_LENGTH = Emulator.getConfig().getInt("hotel.bot.max.namelength"); BotManager.MAXIMUM_CHAT_SPEED = Emulator.getConfig().getInt("hotel.bot.max.chatdelay"); + Bot.PLACEMENT_MESSAGES = Emulator.getConfig().getValue("hotel.bot.placement.messages", "Yo!;Hello I'm a real party animal!;Hello!").split(";"); + HabboInventory.MAXIMUM_ITEMS = Emulator.getConfig().getInt("hotel.inventory.max.items"); Messenger.MAXIMUM_FRIENDS = Emulator.getConfig().getInt("hotel.max.friends"); Messenger.MAXIMUM_FRIENDS_HC = Emulator.getConfig().getInt("hotel.max.friends.hc");