mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-26 16:30:52 +01:00
Supernova
This commit is contained in:
parent
f08278b5d5
commit
9fe1fd593e
@ -45,7 +45,7 @@ public class CreditsScheduler extends Scheduler {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() == null && IGNORE_HOTEL_VIEW)
|
if (habbo.getRoomUnit().getRoom() == null && IGNORE_HOTEL_VIEW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
||||||
|
@ -15,7 +15,7 @@ public class Easter {
|
|||||||
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.getNewMotto().equalsIgnoreCase("crickey!")) {
|
if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.getNewMotto().equalsIgnoreCase("crickey!")) {
|
||||||
event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getNewMotto(), event.habbo, event.habbo, RoomChatMessageBubbles.ALERT)));
|
event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getNewMotto(), event.habbo, event.habbo, RoomChatMessageBubbles.ALERT)));
|
||||||
|
|
||||||
Room room = event.habbo.getHabboInfo().getCurrentRoom();
|
Room room = event.habbo.getRoomUnit().getRoom();
|
||||||
|
|
||||||
room.sendComposer(new UserRemoveMessageComposer(event.habbo.getRoomUnit()).compose());
|
room.sendComposer(new UserRemoveMessageComposer(event.habbo.getRoomUnit()).compose());
|
||||||
room.sendComposer(new RoomUserPetComposer(2, 1, "FFFFFF", event.habbo).compose());
|
room.sendComposer(new RoomUserPetComposer(2, 1, "FFFFFF", event.habbo).compose());
|
||||||
|
@ -45,7 +45,7 @@ public class GotwPointsScheduler extends Scheduler {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() == null && IGNORE_HOTEL_VIEW)
|
if (habbo.getRoomUnit().getRoom() == null && IGNORE_HOTEL_VIEW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
||||||
|
@ -40,7 +40,7 @@ public class PixelScheduler extends Scheduler {
|
|||||||
habbo = map.getValue();
|
habbo = map.getValue();
|
||||||
try {
|
try {
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() == null && IGNORE_HOTEL_VIEW)
|
if (habbo.getRoomUnit().getRoom() == null && IGNORE_HOTEL_VIEW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
||||||
|
@ -44,7 +44,7 @@ public class PointsScheduler extends Scheduler {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() == null && IGNORE_HOTEL_VIEW)
|
if (habbo.getRoomUnit().getRoom() == null && IGNORE_HOTEL_VIEW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
|
||||||
|
@ -22,10 +22,10 @@ public class RoomUserPetComposer extends MessageComposer {
|
|||||||
this.response.appendString(this.habbo.getHabboInfo().getUsername());
|
this.response.appendString(this.habbo.getHabboInfo().getUsername());
|
||||||
this.response.appendString("");
|
this.response.appendString("");
|
||||||
this.response.appendString(this.petType + " " + this.race + " " + this.color + " 2 2 -1 0 3 -1 0");
|
this.response.appendString(this.petType + " " + this.race + " " + this.color + " 2 2 -1 0 3 -1 0");
|
||||||
this.response.appendInt(this.habbo.getRoomUnit().getId());
|
this.response.appendInt(this.habbo.getRoomUnit().getVirtualId());
|
||||||
this.response.appendInt(this.habbo.getRoomUnit().getX());
|
this.response.appendInt(this.habbo.getRoomUnit().getCurrentPosition().getX());
|
||||||
this.response.appendInt(this.habbo.getRoomUnit().getY());
|
this.response.appendInt(this.habbo.getRoomUnit().getCurrentPosition().getY());
|
||||||
this.response.appendString(this.habbo.getRoomUnit().getZ() + "");
|
this.response.appendString(this.habbo.getRoomUnit().getCurrentZ() + "");
|
||||||
this.response.appendInt(this.habbo.getRoomUnit().getBodyRotation().getValue());
|
this.response.appendInt(this.habbo.getRoomUnit().getBodyRotation().getValue());
|
||||||
this.response.appendInt(2);
|
this.response.appendInt(2);
|
||||||
this.response.appendInt(this.petType);
|
this.response.appendInt(this.petType);
|
||||||
|
@ -4,4 +4,4 @@ public class DatabaseConstants {
|
|||||||
public static final String CAUGHT_SQL_EXCEPTION = "Caught SQL exception";
|
public static final String CAUGHT_SQL_EXCEPTION = "Caught SQL exception";
|
||||||
|
|
||||||
public final static String USER_ID = "user_id";
|
public final static String USER_ID = "user_id";
|
||||||
}
|
}
|
@ -2,9 +2,9 @@ package com.eu.habbo.habbohotel.achievements;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboBadge;
|
import com.eu.habbo.habbohotel.users.HabboBadge;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.messages.outgoing.achievements.AchievementComposer;
|
import com.eu.habbo.messages.outgoing.achievements.AchievementComposer;
|
||||||
import com.eu.habbo.messages.outgoing.achievements.AchievementUnlockedComposer;
|
import com.eu.habbo.messages.outgoing.achievements.AchievementUnlockedComposer;
|
||||||
import com.eu.habbo.messages.outgoing.achievements.talenttrack.TalentLevelUpComposer;
|
import com.eu.habbo.messages.outgoing.achievements.talenttrack.TalentLevelUpComposer;
|
||||||
@ -17,7 +17,6 @@ import com.eu.habbo.plugin.Event;
|
|||||||
import com.eu.habbo.plugin.events.users.achievements.UserAchievementLeveledEvent;
|
import com.eu.habbo.plugin.events.users.achievements.UserAchievementLeveledEvent;
|
||||||
import com.eu.habbo.plugin.events.users.achievements.UserAchievementProgressEvent;
|
import com.eu.habbo.plugin.events.users.achievements.UserAchievementProgressEvent;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
import gnu.trove.procedure.TObjectIntProcedure;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
@ -155,8 +154,8 @@ public class AchievementManager {
|
|||||||
|
|
||||||
Emulator.getThreading().run(badge);
|
Emulator.getThreading().run(badge);
|
||||||
|
|
||||||
if (badge.getSlot() > 0 && habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (badge.getSlot() > 0 && habbo.getRoomUnit().getRoom() != null) {
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new UserBadgesComposer(habbo.getInventory().getBadgesComponent().getWearingBadges(), habbo.getHabboInfo().getId()).compose());
|
habbo.getRoomUnit().getRoom().sendComposer(new UserBadgesComposer(habbo.getInventory().getBadgesComponent().getWearingBadges(), habbo.getHabboInfo().getId()).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new UnseenItemsComposer(badge.getId(), UnseenItemsComposer.AddHabboItemCategory.BADGE));
|
habbo.getClient().sendResponse(new UnseenItemsComposer(badge.getId(), UnseenItemsComposer.AddHabboItemCategory.BADGE));
|
||||||
@ -167,8 +166,8 @@ public class AchievementManager {
|
|||||||
habbo.givePoints(newLevel.getRewardType(), newLevel.getRewardAmount());
|
habbo.givePoints(newLevel.getRewardType(), newLevel.getRewardAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (habbo.getRoomUnit().getRoom() != null) {
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new UserChangeMessageComposer(habbo).compose());
|
habbo.getRoomUnit().getRoom().sendComposer(new UserChangeMessageComposer(habbo).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,7 +338,7 @@ public class AchievementManager {
|
|||||||
if (level != null) {
|
if (level != null) {
|
||||||
if (level.items != null && !level.items.isEmpty()) {
|
if (level.items != null && !level.items.isEmpty()) {
|
||||||
for (Item item : level.items) {
|
for (Item item : level.items) {
|
||||||
HabboItem rewardItem = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), item, 0, 0, "");
|
RoomItem rewardItem = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), item, 0, 0, "");
|
||||||
habbo.getInventory().getItemsComponent().addItem(rewardItem);
|
habbo.getInventory().getItemsComponent().addItem(rewardItem);
|
||||||
habbo.getClient().sendResponse(new UnseenItemsComposer(rewardItem));
|
habbo.getClient().sendResponse(new UnseenItemsComposer(rewardItem));
|
||||||
habbo.getClient().sendResponse(new FurniListInvalidateComposer());
|
habbo.getClient().sendResponse(new FurniListInvalidateComposer());
|
||||||
|
@ -3,6 +3,9 @@ package com.eu.habbo.habbohotel.bots;
|
|||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.database.DatabaseConstants;
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.rooms.*;
|
import com.eu.habbo.habbohotel.rooms.*;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.types.RoomBot;
|
||||||
|
import com.eu.habbo.habbohotel.units.Unit;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||||
@ -13,6 +16,9 @@ import com.eu.habbo.plugin.events.bots.BotShoutEvent;
|
|||||||
import com.eu.habbo.plugin.events.bots.BotTalkEvent;
|
import com.eu.habbo.plugin.events.bots.BotTalkEvent;
|
||||||
import com.eu.habbo.plugin.events.bots.BotWhisperEvent;
|
import com.eu.habbo.plugin.events.bots.BotWhisperEvent;
|
||||||
import com.eu.habbo.threading.runnables.BotFollowHabbo;
|
import com.eu.habbo.threading.runnables.BotFollowHabbo;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@ -24,7 +30,7 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Bot implements Runnable {
|
public class Bot extends Unit implements Runnable {
|
||||||
public static final String NO_CHAT_SET = "${bot.skill.chatter.configuration.text.placeholder}";
|
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(";");
|
public static String[] PLACEMENT_MESSAGES = "Yo!;Hello I'm a real party animal!;Hello!".split(";");
|
||||||
|
|
||||||
@ -37,7 +43,6 @@ public class Bot implements Runnable {
|
|||||||
private int ownerId;
|
private int ownerId;
|
||||||
private String ownerName;
|
private String ownerName;
|
||||||
private Room room;
|
private Room room;
|
||||||
private RoomUnit roomUnit;
|
|
||||||
private boolean chatAuto;
|
private boolean chatAuto;
|
||||||
private boolean chatRandom;
|
private boolean chatRandom;
|
||||||
private short chatDelay;
|
private short chatDelay;
|
||||||
@ -45,19 +50,15 @@ public class Bot implements Runnable {
|
|||||||
private int chatTimestamp;
|
private int chatTimestamp;
|
||||||
private short lastChatIndex;
|
private short lastChatIndex;
|
||||||
private final int bubble;
|
private final int bubble;
|
||||||
|
|
||||||
|
|
||||||
private final String type;
|
private final String type;
|
||||||
|
|
||||||
|
|
||||||
private int effect;
|
private int effect;
|
||||||
|
|
||||||
private transient boolean canWalk = true;
|
private transient boolean canWalk = true;
|
||||||
|
|
||||||
private boolean needsUpdate;
|
private boolean needsUpdate;
|
||||||
|
|
||||||
|
|
||||||
private transient int followingHabboId;
|
private transient int followingHabboId;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
private RoomBot roomUnit;
|
||||||
|
|
||||||
public Bot(int id, String name, String motto, String figure, HabboGender gender, int ownerId, String ownerName) {
|
public Bot(int id, String name, String motto, String figure, HabboGender gender, int ownerId, String ownerName) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -92,10 +93,11 @@ public class Bot implements Runnable {
|
|||||||
this.effect = set.getInt("effect");
|
this.effect = set.getInt("effect");
|
||||||
this.canWalk = set.getString("freeroam").equals("1");
|
this.canWalk = set.getString("freeroam").equals("1");
|
||||||
this.room = null;
|
this.room = null;
|
||||||
this.roomUnit = null;
|
|
||||||
this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay;
|
this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay;
|
||||||
this.needsUpdate = false;
|
this.needsUpdate = false;
|
||||||
this.bubble = set.getInt("bubble_id");
|
this.bubble = set.getInt("bubble_id");
|
||||||
|
|
||||||
|
this.roomUnit = new RoomBot();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bot(Bot bot) {
|
public Bot(Bot bot) {
|
||||||
@ -141,9 +143,9 @@ public class Bot implements Runnable {
|
|||||||
statement.setString(3, this.figure);
|
statement.setString(3, this.figure);
|
||||||
statement.setString(4, this.gender.toString());
|
statement.setString(4, this.gender.toString());
|
||||||
statement.setInt(5, this.ownerId);
|
statement.setInt(5, this.ownerId);
|
||||||
statement.setInt(6, this.room == null ? 0 : this.room.getId());
|
statement.setInt(6, this.room == null ? 0 : this.room.getRoomInfo().getId());
|
||||||
statement.setInt(7, this.roomUnit == null ? 0 : this.roomUnit.getBodyRotation().getValue());
|
statement.setInt(7, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getBodyRotation().getValue());
|
||||||
statement.setInt(8, this.roomUnit == null ? 0 : this.roomUnit.getDanceType().getType());
|
statement.setInt(8, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getDanceType().getType());
|
||||||
statement.setString(9, this.canWalk ? "1" : "0");
|
statement.setString(9, this.canWalk ? "1" : "0");
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
for (String s : this.chatLines) {
|
for (String s : this.chatLines) {
|
||||||
@ -165,18 +167,18 @@ public class Bot implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void cycle(boolean allowBotsWalk) {
|
public void cycle(boolean allowBotsWalk) {
|
||||||
if (this.roomUnit != null) {
|
if (this.getRoomUnit() != null) {
|
||||||
if (allowBotsWalk && this.canWalk) {
|
if (allowBotsWalk && this.canWalk) {
|
||||||
if (!this.roomUnit.isWalking()) {
|
if (!this.getRoomUnit().isWalking()) {
|
||||||
if (this.roomUnit.getWalkTimeOut() < Emulator.getIntUnixTimestamp() && this.followingHabboId == 0) {
|
if (this.getRoomUnit().getWalkTimeOut() < Emulator.getIntUnixTimestamp() && this.followingHabboId == 0) {
|
||||||
this.roomUnit.setGoalLocation(Emulator.getConfig().getBoolean("hotel.bot.limit.walking.distance", true) ? this.room.getLayout().getRandomWalkableTilesAround(this.roomUnit, this.room.getLayout().getTile(this.roomUnit.getBotStartLocation().getX(), this.roomUnit.getBotStartLocation().getY()), this.room, Emulator.getConfig().getInt("hotel.bot.limit.walking.distance.radius", 5)) : this.room.getRandomWalkableTile());
|
this.getRoomUnit().setGoalLocation(Emulator.getConfig().getBoolean("hotel.bot.limit.walking.distance", true) ? this.room.getLayout().getRandomWalkableTilesAround(this.getRoomUnit(), this.room.getLayout().getTile(this.getRoomUnit().getBotStartLocation().getX(), this.getRoomUnit().getBotStartLocation().getY()), this.room, Emulator.getConfig().getInt("hotel.bot.limit.walking.distance.radius", 5)) : this.room.getRandomWalkableTile());
|
||||||
|
|
||||||
int timeOut = Emulator.getRandom().nextInt(20) * 2;
|
int timeOut = Emulator.getRandom().nextInt(20) * 2;
|
||||||
this.roomUnit.setWalkTimeOut((timeOut < 10 ? 5 : timeOut) + Emulator.getIntUnixTimestamp());
|
this.getRoomUnit().setWalkTimeOut((timeOut < 10 ? 5 : timeOut) + Emulator.getIntUnixTimestamp());
|
||||||
}
|
}
|
||||||
}/* else {
|
}/* else {
|
||||||
for (RoomTile t : this.room.getLayout().getTilesAround(this.room.getLayout().getTile(this.getRoomUnit().getX(), this.getRoomUnit().getY()))) {
|
for (RoomTile t : this.room.getLayout().getTilesAround(this.room.getLayout().getTile(this.getRoomUnit().getX(), this.getRoomUnit().getY()))) {
|
||||||
WiredHandler.handle(WiredTriggerType.BOT_REACHED_STF, this.roomUnit, this.room, this.room.getItemsAt(t).toArray());
|
WiredHandler.handle(WiredTriggerType.BOT_REACHED_STF, this.getRoomUnit(), this.room, this.room.getItemsAt(t).toArray());
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
@ -190,11 +192,11 @@ public class Bot implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String message = this.chatLines.get(this.lastChatIndex)
|
String message = this.chatLines.get(this.lastChatIndex)
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.owner", "%owner%"), this.room.getOwnerName())
|
.replace(Emulator.getTexts().getValue("wired.variable.owner", "%owner%"), this.room.getRoomInfo().getOwnerInfo().getUsername())
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.item_count", "%item_count%"), this.room.itemCount() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.item_count", "%item_count%"), this.room.itemCount() + "")
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.name", "%name%"), this.name)
|
.replace(Emulator.getTexts().getValue("wired.variable.name", "%name%"), this.name)
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.roomname", "%roomname%"), this.room.getName())
|
.replace(Emulator.getTexts().getValue("wired.variable.roomname", "%roomname%"), this.room.getRoomInfo().getName())
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.user_count", "%user_count%"), this.room.getUserCount() + "");
|
.replace(Emulator.getTexts().getValue("wired.variable.user_count", "%user_count%"), this.room.getRoomUnitManager().getRoomHabbosCount() + "");
|
||||||
|
|
||||||
if(!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), room, new Object[]{ message })) {
|
if(!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), room, new Object[]{ message })) {
|
||||||
this.talk(message);
|
this.talk(message);
|
||||||
@ -213,10 +215,10 @@ public class Bot implements Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.chatTimestamp = Emulator.getIntUnixTimestamp();
|
this.chatTimestamp = Emulator.getIntUnixTimestamp();
|
||||||
this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
|
this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.getMessage(), this.getRoomUnit(), RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
|
||||||
|
|
||||||
if (message.equals("o/") || message.equals("_o/")) {
|
if (message.equals("o/") || message.equals("_o/")) {
|
||||||
this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose());
|
this.room.sendComposer(new ExpressionMessageComposer(this.getRoomUnit(), RoomUserAction.WAVE).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -228,10 +230,10 @@ public class Bot implements Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.chatTimestamp = Emulator.getIntUnixTimestamp();
|
this.chatTimestamp = Emulator.getIntUnixTimestamp();
|
||||||
this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
|
this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.getMessage(), this.getRoomUnit(), RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose());
|
||||||
|
|
||||||
if (message.equals("o/") || message.equals("_o/")) {
|
if (message.equals("o/") || message.equals("_o/")) {
|
||||||
this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose());
|
this.room.sendComposer(new ExpressionMessageComposer(this.getRoomUnit(), RoomUserAction.WAVE).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,13 +245,13 @@ public class Bot implements Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.chatTimestamp = Emulator.getIntUnixTimestamp();
|
this.chatTimestamp = Emulator.getIntUnixTimestamp();
|
||||||
event.getTarget().getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))));
|
event.getTarget().getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getMessage(), this.getRoomUnit(), RoomChatMessageBubbles.getBubble(this.getBubbleId()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPlace(Habbo habbo, Room room) {
|
public void onPlace(Habbo habbo, Room room) {
|
||||||
if (this.roomUnit != null) {
|
if (this.getRoomUnit() != null) {
|
||||||
room.giveEffect(this.roomUnit, this.effect, -1);
|
room.giveEffect(this.getRoomUnit(), this.effect, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(PLACEMENT_MESSAGES.length > 0) {
|
if(PLACEMENT_MESSAGES.length > 0) {
|
||||||
@ -357,14 +359,6 @@ public class Bot implements Runnable {
|
|||||||
this.room = room;
|
this.room = room;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RoomUnit getRoomUnit() {
|
|
||||||
return this.roomUnit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoomUnit(RoomUnit roomUnit) {
|
|
||||||
this.roomUnit = roomUnit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isChatAuto() {
|
public boolean isChatAuto() {
|
||||||
return this.chatAuto;
|
return this.chatAuto;
|
||||||
}
|
}
|
||||||
@ -420,9 +414,9 @@ public class Bot implements Runnable {
|
|||||||
this.effect = effect;
|
this.effect = effect;
|
||||||
this.needsUpdate = true;
|
this.needsUpdate = true;
|
||||||
|
|
||||||
if (this.roomUnit != null) {
|
if (this.getRoomUnit() != null) {
|
||||||
if (this.room != null) {
|
if (this.room != null) {
|
||||||
this.room.giveEffect(this.roomUnit, this.effect, duration);
|
this.room.giveEffect(this.getRoomUnit(), this.effect, duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -452,7 +446,7 @@ public class Bot implements Runnable {
|
|||||||
public void startFollowingHabbo(Habbo habbo) {
|
public void startFollowingHabbo(Habbo habbo) {
|
||||||
this.followingHabboId = habbo.getHabboInfo().getId();
|
this.followingHabboId = habbo.getHabboInfo().getId();
|
||||||
|
|
||||||
Emulator.getThreading().run(new BotFollowHabbo(this, habbo, habbo.getHabboInfo().getCurrentRoom()));
|
Emulator.getThreading().run(new BotFollowHabbo(this, habbo, habbo.getRoomUnit().getRoom()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopFollowingHabbo() {
|
public void stopFollowingHabbo() {
|
||||||
@ -468,16 +462,16 @@ public class Bot implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void lookAt(Habbo habbo) {
|
public void lookAt(Habbo habbo) {
|
||||||
this.lookAt(habbo.getRoomUnit().getCurrentLocation());
|
this.lookAt(habbo.getRoomUnit().getCurrentPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lookAt(RoomUnit roomUnit) {
|
public void lookAt(RoomUnit roomUnit) {
|
||||||
this.lookAt(roomUnit.getCurrentLocation());
|
this.lookAt(roomUnit.getCurrentPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lookAt(RoomTile tile) {
|
public void lookAt(RoomTile tile) {
|
||||||
this.roomUnit.lookAtPoint(tile);
|
this.getRoomUnit().lookAtPoint(tile);
|
||||||
this.roomUnit.statusUpdate(true);
|
this.getRoomUnit().setStatusUpdateNeeded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPlaceUpdate() {
|
public void onPlaceUpdate() {
|
||||||
@ -487,12 +481,12 @@ public class Bot implements Runnable {
|
|||||||
statement.setString(3, this.figure);
|
statement.setString(3, this.figure);
|
||||||
statement.setString(4, this.gender.toString());
|
statement.setString(4, this.gender.toString());
|
||||||
statement.setInt(5, this.ownerId);
|
statement.setInt(5, this.ownerId);
|
||||||
statement.setInt(6, this.room == null ? 0 : this.room.getId());
|
statement.setInt(6, this.room == null ? 0 : this.room.getRoomInfo().getId());
|
||||||
statement.setInt(7, this.roomUnit == null ? 0 : this.roomUnit.getX());
|
statement.setInt(7, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getCurrentPosition().getX());
|
||||||
statement.setInt(8, this.roomUnit == null ? 0 : this.roomUnit.getY());
|
statement.setInt(8, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getCurrentPosition().getY());
|
||||||
statement.setDouble(9, this.roomUnit == null ? 0 : this.roomUnit.getZ());
|
statement.setDouble(9, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getCurrentZ());
|
||||||
statement.setInt(10, this.roomUnit == null ? 0 : this.roomUnit.getBodyRotation().getValue());
|
statement.setInt(10, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getBodyRotation().getValue());
|
||||||
statement.setInt(11, this.roomUnit == null ? 0 : this.roomUnit.getDanceType().getType());
|
statement.setInt(11, this.getRoomUnit() == null ? 0 : this.getRoomUnit().getDanceType().getType());
|
||||||
statement.setString(12, this.canWalk ? "1" : "0");
|
statement.setString(12, this.canWalk ? "1" : "0");
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
for (String s : this.chatLines) {
|
for (String s : this.chatLines) {
|
||||||
|
@ -2,10 +2,16 @@ package com.eu.habbo.habbohotel.bots;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||||
import com.eu.habbo.habbohotel.rooms.*;
|
import com.eu.habbo.habbohotel.rooms.FurnitureMovementError;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.RoomTileState;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.RoomRotation;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnitType;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.types.RoomBot;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.BotErrorComposer;
|
import com.eu.habbo.messages.outgoing.generic.alerts.BotErrorComposer;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
||||||
@ -21,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BotManager {
|
public class BotManager {
|
||||||
|
|
||||||
@ -98,41 +105,44 @@ public class BotManager {
|
|||||||
|
|
||||||
public void placeBot(Bot bot, Habbo habbo, Room room, RoomTile location) {
|
public void placeBot(Bot bot, Habbo habbo, Room room, RoomTile location) {
|
||||||
BotPlacedEvent event = new BotPlacedEvent(bot, location, habbo);
|
BotPlacedEvent event = new BotPlacedEvent(bot, location, habbo);
|
||||||
|
|
||||||
Emulator.getPluginManager().fireEvent(event);
|
Emulator.getPluginManager().fireEvent(event);
|
||||||
|
|
||||||
if (event.isCancelled())
|
if (event.isCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (room != null && bot != null && habbo != null) {
|
if (room != null && bot != null && habbo != null) {
|
||||||
if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasRight(Permission.ACC_ANYROOMOWNER) || habbo.hasRight(Permission.ACC_PLACEFURNI)) {
|
if (room.getRoomInfo().isRoomOwner(habbo) || habbo.hasRight(Permission.ACC_ANYROOMOWNER) || habbo.hasRight(Permission.ACC_PLACEFURNI)) {
|
||||||
if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasRight(Permission.ACC_UNLIMITED_BOTS)) {
|
if (room.getRoomUnitManager().getCurrentRoomBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasRight(Permission.ACC_UNLIMITED_BOTS)) {
|
||||||
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS));
|
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.hasHabbosAt(location.getX(), location.getY()) || (!location.isWalkable() && location.getState() != RoomTileState.SIT && location.getState() != RoomTileState.LAY))
|
if (room.getRoomUnitManager().hasHabbosAt(location) || (!location.isWalkable() && location.getState() != RoomTileState.SIT && location.getState() != RoomTileState.LAY))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (room.hasBotsAt(location.getX(), location.getY())) {
|
if (!room.getRoomUnitManager().getBotsAt(location).isEmpty()) {
|
||||||
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_BOTS_SELECTED_TILE_NOT_FREE));
|
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_BOTS_SELECTED_TILE_NOT_FREE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RoomUnit roomUnit = new RoomUnit();
|
bot.setRoomUnit(new RoomBot());
|
||||||
roomUnit.setRotation(RoomUserRotation.SOUTH);
|
|
||||||
roomUnit.setLocation(location);
|
|
||||||
|
|
||||||
|
RoomBot roomBot = bot.getRoomUnit();
|
||||||
|
roomBot.setRotation(RoomRotation.SOUTH);
|
||||||
|
roomBot.setLocation(location);
|
||||||
double stackHeight = room.getTopHeightAt(location.getX(), location.getY());
|
double stackHeight = room.getTopHeightAt(location.getX(), location.getY());
|
||||||
roomUnit.setPreviousLocationZ(stackHeight);
|
roomBot.setPreviousLocationZ(stackHeight);
|
||||||
roomUnit.setZ(stackHeight);
|
roomBot.setCurrentZ(stackHeight);
|
||||||
|
roomBot.setRoom(room);
|
||||||
|
roomBot.setRoomUnitType(RoomUnitType.BOT);
|
||||||
|
roomBot.setCanWalk(room.isAllowBotsWalk());
|
||||||
|
|
||||||
roomUnit.setPathFinderRoom(room);
|
|
||||||
roomUnit.setRoomUnitType(RoomUnitType.BOT);
|
|
||||||
roomUnit.setCanWalk(room.isAllowBotsWalk());
|
|
||||||
bot.setRoomUnit(roomUnit);
|
|
||||||
bot.setRoom(room);
|
bot.setRoom(room);
|
||||||
|
|
||||||
bot.onPlaceUpdate();
|
bot.onPlaceUpdate();
|
||||||
room.addBot(bot);
|
|
||||||
|
room.getRoomUnitManager().addRoomUnit(bot);
|
||||||
Emulator.getThreading().run(bot);
|
Emulator.getThreading().run(bot);
|
||||||
room.sendComposer(new RoomUsersComposer(bot).compose());
|
room.sendComposer(new RoomUsersComposer(bot).compose());
|
||||||
room.sendComposer(new UserUpdateComposer(bot.getRoomUnit()).compose());
|
room.sendComposer(new UserUpdateComposer(bot.getRoomUnit()).compose());
|
||||||
@ -140,7 +150,7 @@ public class BotManager {
|
|||||||
habbo.getClient().sendResponse(new BotRemovedFromInventoryComposer(bot));
|
habbo.getClient().sendResponse(new BotRemovedFromInventoryComposer(bot));
|
||||||
bot.onPlace(habbo, room);
|
bot.onPlace(habbo, room);
|
||||||
|
|
||||||
HabboItem topItem = room.getTopItemAt(location.getX(), location.getY());
|
RoomItem topItem = room.getTopItemAt(location.getX(), location.getY());
|
||||||
|
|
||||||
if (topItem != null) {
|
if (topItem != null) {
|
||||||
try {
|
try {
|
||||||
@ -157,14 +167,15 @@ public class BotManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pickUpBot(int botId, Habbo habbo) {
|
public void pickUpBot(int botId, Habbo habbo, Room room) {
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (habbo.getRoomUnit().getRoom() != null) {
|
||||||
this.pickUpBot(habbo.getHabboInfo().getCurrentRoom().getBot(Math.abs(botId)), habbo);
|
this.pickUpBot(habbo.getRoomUnit().getRoom().getRoomUnitManager().getRoomBotById(Math.abs(botId)), habbo, room);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pickUpBot(Bot bot, Habbo habbo) {
|
public void pickUpBot(Bot bot, Habbo habbo, Room room) {
|
||||||
HabboInfo receiverInfo = habbo == null ? Emulator.getGameEnvironment().getHabboManager().getHabboInfo(bot.getOwnerId()) : habbo.getHabboInfo();
|
HabboInfo botOwnerInfo = habbo == null ? Emulator.getGameEnvironment().getHabboManager().getHabboInfo(bot.getOwnerId()) : habbo.getHabboInfo();
|
||||||
|
|
||||||
|
|
||||||
if (bot != null) {
|
if (bot != null) {
|
||||||
BotPickUpEvent pickedUpEvent = new BotPickUpEvent(bot, habbo);
|
BotPickUpEvent pickedUpEvent = new BotPickUpEvent(bot, habbo);
|
||||||
@ -179,15 +190,15 @@ public class BotManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bot.onPickUp(habbo, receiverInfo.getCurrentRoom());
|
bot.onPickUp(habbo, room);
|
||||||
receiverInfo.getCurrentRoom().removeBot(bot);
|
room.getRoomUnitManager().removeBot(bot);
|
||||||
bot.stopFollowingHabbo();
|
bot.stopFollowingHabbo();
|
||||||
bot.setOwnerId(receiverInfo.getId());
|
bot.setOwnerId(botOwnerInfo.getId());
|
||||||
bot.setOwnerName(receiverInfo.getUsername());
|
bot.setOwnerName(botOwnerInfo.getUsername());
|
||||||
bot.needsUpdate(true);
|
bot.needsUpdate(true);
|
||||||
Emulator.getThreading().run(bot);
|
Emulator.getThreading().run(bot);
|
||||||
|
|
||||||
Habbo receiver = habbo == null ? Emulator.getGameEnvironment().getHabboManager().getHabbo(receiverInfo.getId()) : habbo;
|
Habbo receiver = habbo == null ? Emulator.getGameEnvironment().getHabboManager().getHabbo(botOwnerInfo.getId()) : habbo;
|
||||||
if (receiver != null) {
|
if (receiver != null) {
|
||||||
receiver.getInventory().getBotsComponent().addBot(bot);
|
receiver.getInventory().getBotsComponent().addBot(bot);
|
||||||
receiver.getClient().sendResponse(new BotAddedToInventoryComposer(bot));
|
receiver.getClient().sendResponse(new BotAddedToInventoryComposer(bot));
|
||||||
|
@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
|
|||||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||||
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||||
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
||||||
|
import com.eu.habbo.messages.outgoing.rooms.users.CarryObjectMessageComposer;
|
||||||
import com.eu.habbo.plugin.events.bots.BotServerItemEvent;
|
import com.eu.habbo.plugin.events.bots.BotServerItemEvent;
|
||||||
import com.eu.habbo.threading.runnables.RoomUnitGiveHanditem;
|
import com.eu.habbo.threading.runnables.RoomUnitGiveHanditem;
|
||||||
import com.eu.habbo.threading.runnables.RoomUnitWalkToRoomUnit;
|
import com.eu.habbo.threading.runnables.RoomUnitWalkToRoomUnit;
|
||||||
@ -61,7 +62,7 @@ public class ButlerBot extends Bot {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double distanceBetweenBotAndHabbo = this.getRoomUnit().getCurrentLocation().distance(message.getHabbo().getRoomUnit().getCurrentLocation());
|
double distanceBetweenBotAndHabbo = this.getRoomUnit().getCurrentPosition().distance(message.getHabbo().getRoomUnit().getCurrentPosition());
|
||||||
|
|
||||||
if (distanceBetweenBotAndHabbo <= Emulator.getConfig().getInt("hotel.bot.butler.commanddistance")) {
|
if (distanceBetweenBotAndHabbo <= Emulator.getConfig().getInt("hotel.bot.butler.commanddistance")) {
|
||||||
|
|
||||||
@ -80,7 +81,7 @@ public class ButlerBot extends Bot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start give handitem process
|
// Start give handitem process
|
||||||
if (this.getRoomUnit().canWalk()) {
|
if (this.getRoomUnit().isCanWalk()) {
|
||||||
final String key = keyword;
|
final String key = keyword;
|
||||||
final Bot bot = this;
|
final Bot bot = this;
|
||||||
|
|
||||||
@ -89,8 +90,8 @@ public class ButlerBot extends Bot {
|
|||||||
|
|
||||||
// Step 2: Prepare tasks for when the Bot (carrying the handitem) reaches the Habbo
|
// Step 2: Prepare tasks for when the Bot (carrying the handitem) reaches the Habbo
|
||||||
final List<Runnable> tasks = new ArrayList<>();
|
final List<Runnable> tasks = new ArrayList<>();
|
||||||
tasks.add(new RoomUnitGiveHanditem(serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId()));
|
tasks.add(new RoomUnitGiveHanditem(serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getRoomUnit().getRoom(), serveEvent.getItemId()));
|
||||||
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), 0));
|
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit().getRoom(), 0));
|
||||||
|
|
||||||
tasks.add(() -> {
|
tasks.add(() -> {
|
||||||
if (this.getRoom() != null) {
|
if (this.getRoom() != null) {
|
||||||
@ -115,16 +116,17 @@ public class ButlerBot extends Bot {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Give bot the handitem that it's going to give the Habbo
|
// Give bot the handitem that it's going to give the Habbo
|
||||||
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId()));
|
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit().getRoom(), serveEvent.getItemId()));
|
||||||
|
|
||||||
if (distanceBetweenBotAndHabbo > Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)) {
|
if (distanceBetweenBotAndHabbo > Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)) {
|
||||||
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)));
|
Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getRoomUnit().getRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)));
|
||||||
} else {
|
} else {
|
||||||
Emulator.getThreading().run(failedReached.get(0), 1000);
|
Emulator.getThreading().run(failedReached.get(0), 1000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.getRoom() != null) {
|
if (this.getRoom() != null) {
|
||||||
this.getRoom().giveHandItem(serveEvent.getHabbo(), serveEvent.getItemId());
|
serveEvent.getHabbo().getRoomUnit().setHandItem(serveEvent.getItemId());
|
||||||
|
this.getRoom().sendComposer(new CarryObjectMessageComposer(serveEvent.getHabbo().getRoomUnit()).compose());
|
||||||
|
|
||||||
String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername());
|
String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername());
|
||||||
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{msg})) {
|
if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{msg})) {
|
||||||
|
@ -55,8 +55,8 @@ public class VisitorBot extends Bot {
|
|||||||
|
|
||||||
public void onUserEnter(Habbo habbo) {
|
public void onUserEnter(Habbo habbo) {
|
||||||
if (!this.showedLog) {
|
if (!this.showedLog) {
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (habbo.getRoomUnit().getRoom() != null) {
|
||||||
this.visits = Emulator.getGameEnvironment().getModToolManager().getVisitsForRoom(habbo.getHabboInfo().getCurrentRoom(), 10, true, habbo.getHabboInfo().getLastOnline(), Emulator.getIntUnixTimestamp(), habbo.getHabboInfo().getCurrentRoom().getOwnerName());
|
this.visits = Emulator.getGameEnvironment().getModToolManager().getVisitsForRoom(habbo.getRoomUnit().getRoom(), 10, true, habbo.getHabboInfo().getLastOnline(), Emulator.getIntUnixTimestamp(), habbo.getRoomUnit().getRoom().getRoomInfo().getOwnerInfo().getUsername());
|
||||||
|
|
||||||
if (this.visits.isEmpty()) {
|
if (this.visits.isEmpty()) {
|
||||||
this.talk(Emulator.getTexts().getValue("bots.visitor.no_visits"));
|
this.talk(Emulator.getTexts().getValue("bots.visitor.no_visits"));
|
||||||
|
@ -3,7 +3,7 @@ package com.eu.habbo.habbohotel.campaign;
|
|||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub;
|
import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
|
import com.eu.habbo.messages.outgoing.inventory.UnseenItemsComposer;
|
||||||
@ -71,14 +71,14 @@ public class CalendarRewardObject {
|
|||||||
Item item = getItem();
|
Item item = getItem();
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
HabboItem habboItem = Emulator.getGameEnvironment().getItemManager().createItem(
|
RoomItem roomItem = Emulator.getGameEnvironment().getItemManager().createItem(
|
||||||
habbo.getHabboInfo().getId(),
|
habbo.getHabboInfo().getId(),
|
||||||
item,
|
item,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
"");
|
"");
|
||||||
habbo.getInventory().getItemsComponent().addItem(habboItem);
|
habbo.getInventory().getItemsComponent().addItem(roomItem);
|
||||||
habbo.getClient().sendResponse(new UnseenItemsComposer(habboItem));
|
habbo.getClient().sendResponse(new UnseenItemsComposer(roomItem));
|
||||||
habbo.getClient().sendResponse(new FurniListInvalidateComposer());
|
habbo.getClient().sendResponse(new FurniListInvalidateComposer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package com.eu.habbo.habbohotel.catalog;
|
|||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -53,7 +53,7 @@ public class CatalogLimitedConfiguration implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void limitedSold(int catalogItemId, Habbo habbo, HabboItem item) {
|
public void limitedSold(int catalogItemId, Habbo habbo, RoomItem item) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE catalog_items_limited SET user_id = ?, timestamp = ?, item_id = ? WHERE catalog_item_id = ? AND number = ? AND user_id = 0 LIMIT 1")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("UPDATE catalog_items_limited SET user_id = ?, timestamp = ?, item_id = ? WHERE catalog_item_id = ? AND number = ? AND user_id = 0 LIMIT 1")) {
|
||||||
statement.setInt(1, habbo.getHabboInfo().getId());
|
statement.setInt(1, habbo.getHabboInfo().getId());
|
||||||
|
@ -17,7 +17,7 @@ import com.eu.habbo.habbohotel.pets.Pet;
|
|||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboBadge;
|
import com.eu.habbo.habbohotel.users.HabboBadge;
|
||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.messages.outgoing.catalog.*;
|
import com.eu.habbo.messages.outgoing.catalog.*;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
||||||
@ -846,7 +846,7 @@ public class CatalogManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
THashSet<HabboItem> itemsList = new THashSet<>();
|
THashSet<RoomItem> itemsList = new THashSet<>();
|
||||||
|
|
||||||
|
|
||||||
if (amount > 1 && !CatalogItem.haveOffer(item)) {
|
if (amount > 1 && !CatalogItem.haveOffer(item)) {
|
||||||
@ -980,13 +980,13 @@ public class CatalogManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (InteractionTeleport.class.isAssignableFrom(baseItem.getInteractionType().getType())) {
|
if (InteractionTeleport.class.isAssignableFrom(baseItem.getInteractionType().getType())) {
|
||||||
HabboItem teleportOne = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
RoomItem teleportOne = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
||||||
HabboItem teleportTwo = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
RoomItem teleportTwo = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
||||||
Emulator.getGameEnvironment().getItemManager().insertTeleportPair(teleportOne.getId(), teleportTwo.getId());
|
Emulator.getGameEnvironment().getItemManager().insertTeleportPair(teleportOne.getId(), teleportTwo.getId());
|
||||||
itemsList.add(teleportOne);
|
itemsList.add(teleportOne);
|
||||||
itemsList.add(teleportTwo);
|
itemsList.add(teleportTwo);
|
||||||
} else if (baseItem.getInteractionType().getType() == InteractionHopper.class) {
|
} else if (baseItem.getInteractionType().getType() == InteractionHopper.class) {
|
||||||
HabboItem hopper = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
RoomItem hopper = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
||||||
|
|
||||||
Emulator.getGameEnvironment().getItemManager().insertHopper(hopper);
|
Emulator.getGameEnvironment().getItemManager().insertHopper(hopper);
|
||||||
|
|
||||||
@ -1034,8 +1034,8 @@ public class CatalogManager {
|
|||||||
|
|
||||||
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MusicCollector"));
|
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("MusicCollector"));
|
||||||
} else {
|
} else {
|
||||||
HabboItem habboItem = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
RoomItem roomItem = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getClient().getHabbo().getHabboInfo().getId(), baseItem, limitedStack, limitedNumber, extradata);
|
||||||
itemsList.add(habboItem);
|
itemsList.add(roomItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1062,12 +1062,12 @@ public class CatalogManager {
|
|||||||
|
|
||||||
if (purchasedEvent.itemsList != null && !purchasedEvent.itemsList.isEmpty()) {
|
if (purchasedEvent.itemsList != null && !purchasedEvent.itemsList.isEmpty()) {
|
||||||
habbo.getClient().getHabbo().getInventory().getItemsComponent().addItems(purchasedEvent.itemsList);
|
habbo.getClient().getHabbo().getInventory().getItemsComponent().addItems(purchasedEvent.itemsList);
|
||||||
unseenItems.put(UnseenItemsComposer.AddHabboItemCategory.OWNED_FURNI, purchasedEvent.itemsList.stream().map(HabboItem::getId).toList());
|
unseenItems.put(UnseenItemsComposer.AddHabboItemCategory.OWNED_FURNI, purchasedEvent.itemsList.stream().map(RoomItem::getId).toList());
|
||||||
|
|
||||||
Emulator.getPluginManager().fireEvent(new UserCatalogFurnitureBoughtEvent(habbo, item, purchasedEvent.itemsList));
|
Emulator.getPluginManager().fireEvent(new UserCatalogFurnitureBoughtEvent(habbo, item, purchasedEvent.itemsList));
|
||||||
|
|
||||||
if (limitedConfiguration != null) {
|
if (limitedConfiguration != null) {
|
||||||
for (HabboItem itm : purchasedEvent.itemsList) {
|
for (RoomItem itm : purchasedEvent.itemsList) {
|
||||||
limitedConfiguration.limitedSold(item.getId(), habbo, itm);
|
limitedConfiguration.limitedSold(item.getId(), habbo, itm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1098,7 +1098,7 @@ public class CatalogManager {
|
|||||||
|
|
||||||
THashSet<String> itemIds = new THashSet<>();
|
THashSet<String> itemIds = new THashSet<>();
|
||||||
|
|
||||||
for (HabboItem ix : purchasedEvent.itemsList) {
|
for (RoomItem ix : purchasedEvent.itemsList) {
|
||||||
itemIds.add(ix.getId() + "");
|
itemIds.add(ix.getId() + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import com.eu.habbo.habbohotel.catalog.CatalogItem;
|
|||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomManager;
|
import com.eu.habbo.habbohotel.rooms.RoomManager;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.navigator.CanCreateRoomComposer;
|
import com.eu.habbo.messages.outgoing.navigator.CanCreateRoomComposer;
|
||||||
@ -40,7 +40,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
|
|
||||||
if (this.room == null) {
|
if (this.room == null) {
|
||||||
if (this.roomId > 0) {
|
if (this.roomId > 0) {
|
||||||
this.room = Emulator.getGameEnvironment().getRoomManager().loadRoom(this.roomId);
|
this.room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.roomId);
|
||||||
|
|
||||||
if (this.room != null)
|
if (this.room != null)
|
||||||
this.room.preventUnloading = true;
|
this.room.preventUnloading = true;
|
||||||
@ -73,7 +73,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
|
|
||||||
THashMap<Item, Integer> items = new THashMap<>();
|
THashMap<Item, Integer> items = new THashMap<>();
|
||||||
|
|
||||||
for (HabboItem i : this.room.getFloorItems()) {
|
for (RoomItem i : this.room.getFloorItems()) {
|
||||||
if (!items.contains(i.getBaseItem())) {
|
if (!items.contains(i.getBaseItem())) {
|
||||||
items.put(i.getBaseItem(), 0);
|
items.put(i.getBaseItem(), 0);
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
items.put(i.getBaseItem(), items.get(i.getBaseItem()) + 1);
|
items.put(i.getBaseItem(), items.get(i.getBaseItem()) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem i : this.room.getWallItems()) {
|
for (RoomItem i : this.room.getWallItems()) {
|
||||||
if (!items.contains(i.getBaseItem())) {
|
if (!items.contains(i.getBaseItem())) {
|
||||||
items.put(i.getBaseItem(), 0);
|
items.put(i.getBaseItem(), 0);
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
|
|
||||||
public void buyRoom(Habbo habbo, int userId, String userName) {
|
public void buyRoom(Habbo habbo, int userId, String userName) {
|
||||||
if (!this.loaded) {
|
if (!this.loaded) {
|
||||||
this.loadItems(Emulator.getGameEnvironment().getRoomManager().loadRoom(this.roomId));
|
this.loadItems(Emulator.getGameEnvironment().getRoomManager().getRoom(this.roomId));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
@ -141,11 +141,11 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
|
|
||||||
this.room.save();
|
this.room.save();
|
||||||
|
|
||||||
for (HabboItem item : this.room.getFloorItems()) {
|
for (RoomItem item : this.room.getFloorItems()) {
|
||||||
item.run();
|
item.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem item : this.room.getWallItems()) {
|
for (RoomItem item : this.room.getWallItems()) {
|
||||||
item.run();
|
item.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO rooms (owner_id, owner_name, name, description, model, password, state, users_max, category, paper_floor, paper_wall, paper_landscape, thickness_wall, thickness_floor, moodlight_data, override_model) (SELECT ?, ?, name, description, model, password, state, users_max, category, paper_floor, paper_wall, paper_landscape, thickness_wall, thickness_floor, moodlight_data, override_model FROM rooms WHERE id = ?)", Statement.RETURN_GENERATED_KEYS)) {
|
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO rooms (owner_id, owner_name, name, description, model, password, state, users_max, category, paper_floor, paper_wall, paper_landscape, thickness_wall, thickness_floor, moodlight_data, override_model) (SELECT ?, ?, name, description, model, password, state, users_max, category, paper_floor, paper_wall, paper_landscape, thickness_wall, thickness_floor, moodlight_data, override_model FROM rooms WHERE id = ?)", Statement.RETURN_GENERATED_KEYS)) {
|
||||||
statement.setInt(1, userId);
|
statement.setInt(1, userId);
|
||||||
statement.setString(2, userName);
|
statement.setString(2, userName);
|
||||||
statement.setInt(3, this.room.getId());
|
statement.setInt(3, this.room.getRoomInfo().getId());
|
||||||
statement.execute();
|
statement.execute();
|
||||||
try (ResultSet set = statement.getGeneratedKeys()) {
|
try (ResultSet set = statement.getGeneratedKeys()) {
|
||||||
if (set.next()) {
|
if (set.next()) {
|
||||||
@ -173,15 +173,15 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
statement.setInt(2, roomId);
|
statement.setInt(2, roomId);
|
||||||
statement.setString(3, "0:0");
|
statement.setString(3, "0:0");
|
||||||
statement.setInt(4, 0);
|
statement.setInt(4, 0);
|
||||||
statement.setInt(5, this.room.getId());
|
statement.setInt(5, this.room.getRoomInfo().getId());
|
||||||
statement.execute();
|
statement.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.room.hasCustomLayout()) {
|
if (this.room.getRoomInfo().isModelOverridden()) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO room_models_custom (id, name, door_x, door_y, door_dir, heightmap) (SELECT ?, ?, door_x, door_y, door_dir, heightmap FROM room_models_custom WHERE id = ? LIMIT 1)", Statement.RETURN_GENERATED_KEYS)) {
|
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO room_models_custom (id, name, door_x, door_y, door_dir, heightmap) (SELECT ?, ?, door_x, door_y, door_dir, heightmap FROM room_models_custom WHERE id = ? LIMIT 1)", Statement.RETURN_GENERATED_KEYS)) {
|
||||||
statement.setInt(1, roomId);
|
statement.setInt(1, roomId);
|
||||||
statement.setString(2, "custom_" + roomId);
|
statement.setString(2, "custom_" + roomId);
|
||||||
statement.setInt(3, this.room.getId());
|
statement.setInt(3, this.room.getRoomInfo().getId());
|
||||||
statement.execute();
|
statement.execute();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
@ -190,17 +190,17 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
|
|
||||||
if (Emulator.getConfig().getBoolean("bundle.bots.enabled")) {
|
if (Emulator.getConfig().getBoolean("bundle.bots.enabled")) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO bots (user_id, room_id, name, motto, figure, gender, x, y, z, chat_lines, chat_auto, chat_random, chat_delay, dance, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
|
try (PreparedStatement statement = connection.prepareStatement("INSERT INTO bots (user_id, room_id, name, motto, figure, gender, x, y, z, chat_lines, chat_auto, chat_random, chat_delay, dance, type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
|
||||||
synchronized (this.room.getCurrentBots()) {
|
synchronized (this.room.getRoomUnitManager().getCurrentRoomBots()) {
|
||||||
statement.setInt(1, userId);
|
statement.setInt(1, userId);
|
||||||
statement.setInt(2, roomId);
|
statement.setInt(2, roomId);
|
||||||
for (Bot bot : this.room.getCurrentBots().valueCollection()) {
|
for (Bot bot : this.room.getRoomUnitManager().getCurrentRoomBots().values()) {
|
||||||
statement.setString(3, bot.getName());
|
statement.setString(3, bot.getName());
|
||||||
statement.setString(4, bot.getMotto());
|
statement.setString(4, bot.getMotto());
|
||||||
statement.setString(5, bot.getFigure());
|
statement.setString(5, bot.getFigure());
|
||||||
statement.setString(6, bot.getGender().name());
|
statement.setString(6, bot.getGender().name());
|
||||||
statement.setInt(7, bot.getRoomUnit().getX());
|
statement.setInt(7, bot.getRoomUnit().getCurrentPosition().getX());
|
||||||
statement.setInt(8, bot.getRoomUnit().getY());
|
statement.setInt(8, bot.getRoomUnit().getCurrentPosition().getY());
|
||||||
statement.setDouble(9, bot.getRoomUnit().getZ());
|
statement.setDouble(9, bot.getRoomUnit().getCurrentZ());
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
for (String s : bot.getChatLines()) {
|
for (String s : bot.getChatLines()) {
|
||||||
text.append(s).append("\r");
|
text.append(s).append("\r");
|
||||||
@ -221,17 +221,17 @@ public class RoomBundleLayout extends SingleBundle {
|
|||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Room r = Emulator.getGameEnvironment().getRoomManager().loadRoom(roomId);
|
Room r = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId);
|
||||||
r.setWallHeight(this.room.getWallHeight());
|
r.getRoomInfo().setWallHeight(this.room.getRoomInfo().getWallHeight());
|
||||||
r.setFloorSize(this.room.getFloorSize());
|
r.getRoomInfo().setFloorThickness(this.room.getRoomInfo().getFloorThickness());
|
||||||
r.setWallPaint(this.room.getWallPaint());
|
r.getRoomInfo().setWallPaint(this.room.getRoomInfo().getWallPaint());
|
||||||
r.setFloorPaint(this.room.getFloorPaint());
|
r.getRoomInfo().setFloorPaint(this.room.getRoomInfo().getFloorPaint());
|
||||||
r.setScore(0);
|
r.getRoomInfo().setScore(0);
|
||||||
r.setNeedsUpdate(true);
|
r.setNeedsUpdate(true);
|
||||||
THashMap<String, String> keys = new THashMap<>();
|
THashMap<String, String> keys = new THashMap<>();
|
||||||
keys.put("ROOMNAME", r.getName());
|
keys.put("ROOMNAME", r.getRoomInfo().getName());
|
||||||
keys.put("ROOMID", r.getId() + "");
|
keys.put("ROOMID", r.getRoomInfo().getId() + "");
|
||||||
keys.put("OWNER", r.getOwnerName());
|
keys.put("OWNER", r.getRoomInfo().getOwnerInfo().getUsername());
|
||||||
keys.put("image", "${image.library.url}/notifications/room_bundle_" + this.getId() + ".png");
|
keys.put("image", "${image.library.url}/notifications/room_bundle_" + this.getId() + ".png");
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
|
@ -4,7 +4,7 @@ import com.eu.habbo.Emulator;
|
|||||||
import com.eu.habbo.database.DatabaseConstants;
|
import com.eu.habbo.database.DatabaseConstants;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
import com.eu.habbo.messages.incoming.catalog.marketplace.GetMarketplaceOffersEvent;
|
import com.eu.habbo.messages.incoming.catalog.marketplace.GetMarketplaceOffersEvent;
|
||||||
import com.eu.habbo.messages.outgoing.catalog.marketplace.MarketplaceBuyOfferResultComposer;
|
import com.eu.habbo.messages.outgoing.catalog.marketplace.MarketplaceBuyOfferResultComposer;
|
||||||
@ -97,7 +97,7 @@ public class MarketPlace {
|
|||||||
selectItem.setInt(1, offer.getSoldItemId());
|
selectItem.setInt(1, offer.getSoldItemId());
|
||||||
try (ResultSet set = selectItem.executeQuery()) {
|
try (ResultSet set = selectItem.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set);
|
RoomItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set);
|
||||||
habbo.getInventory().getItemsComponent().addItem(item);
|
habbo.getInventory().getItemsComponent().addItem(item);
|
||||||
habbo.getClient().sendResponse(new MarketplaceCancelOfferResultComposer(offer, true));
|
habbo.getClient().sendResponse(new MarketplaceCancelOfferResultComposer(offer, true));
|
||||||
habbo.getClient().sendResponse(new UnseenItemsComposer(item));
|
habbo.getClient().sendResponse(new UnseenItemsComposer(item));
|
||||||
@ -273,7 +273,7 @@ public class MarketPlace {
|
|||||||
updateOffer.execute();
|
updateOffer.execute();
|
||||||
}
|
}
|
||||||
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(set.getInt(DatabaseConstants.USER_ID));
|
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(set.getInt(DatabaseConstants.USER_ID));
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(itemSet);
|
RoomItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(itemSet);
|
||||||
|
|
||||||
MarketPlaceItemSoldEvent event = new MarketPlaceItemSoldEvent(habbo, client.getHabbo(), item, set.getInt("price"));
|
MarketPlaceItemSoldEvent event = new MarketPlaceItemSoldEvent(habbo, client.getHabbo(), item, set.getInt("price"));
|
||||||
if (Emulator.getPluginManager().fireEvent(event).isCancelled()) {
|
if (Emulator.getPluginManager().fireEvent(event).isCancelled()) {
|
||||||
@ -340,7 +340,7 @@ public class MarketPlace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean sellItem(GameClient client, HabboItem item, int price) {
|
public static boolean sellItem(GameClient client, RoomItem item, int price) {
|
||||||
if (item == null || client == null)
|
if (item == null || client == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import com.eu.habbo.Emulator;
|
|||||||
import com.eu.habbo.habbohotel.items.FurnitureType;
|
import com.eu.habbo.habbohotel.items.FurnitureType;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -60,7 +60,7 @@ public class MarketPlaceOffer implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarketPlaceOffer(HabboItem item, int price, Habbo habbo) {
|
public MarketPlaceOffer(RoomItem item, int price, Habbo habbo) {
|
||||||
this.price = price;
|
this.price = price;
|
||||||
this.baseItem = item.getBaseItem();
|
this.baseItem = item.getBaseItem();
|
||||||
this.itemId = item.getId();
|
this.itemId = item.getId();
|
||||||
|
@ -3,12 +3,25 @@ package com.eu.habbo.habbohotel.commands;
|
|||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.core.CommandLog;
|
import com.eu.habbo.core.CommandLog;
|
||||||
import com.eu.habbo.habbohotel.commands.list.*;
|
import com.eu.habbo.habbohotel.commands.list.*;
|
||||||
import com.eu.habbo.habbohotel.commands.list.badge.*;
|
import com.eu.habbo.habbohotel.commands.list.badge.BadgeCommand;
|
||||||
import com.eu.habbo.habbohotel.commands.list.bans.*;
|
import com.eu.habbo.habbohotel.commands.list.badge.MassBadgeCommand;
|
||||||
import com.eu.habbo.habbohotel.commands.list.credits.*;
|
import com.eu.habbo.habbohotel.commands.list.badge.RoomBadgeCommand;
|
||||||
import com.eu.habbo.habbohotel.commands.list.gift.*;
|
import com.eu.habbo.habbohotel.commands.list.badge.TakeBadgeCommand;
|
||||||
import com.eu.habbo.habbohotel.commands.list.pixels.*;
|
import com.eu.habbo.habbohotel.commands.list.bans.BanCommand;
|
||||||
import com.eu.habbo.habbohotel.commands.list.points.*;
|
import com.eu.habbo.habbohotel.commands.list.bans.IPBanCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.bans.MachineBanCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.bans.SuperbanCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.credits.CreditsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.credits.MassCreditsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.credits.RoomCreditsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.gift.GiftCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.gift.MassGiftCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.pixels.MassPixelsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.pixels.PixelCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.pixels.RoomPixelsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.points.MassPointsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.points.PointsCommand;
|
||||||
|
import com.eu.habbo.habbohotel.commands.list.points.RoomPointsCommand;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||||
import com.eu.habbo.habbohotel.permissions.PermissionCommand;
|
import com.eu.habbo.habbohotel.permissions.PermissionCommand;
|
||||||
@ -73,11 +86,11 @@ public class CommandsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String commandKey = parts[0];
|
String commandKey = parts[0];
|
||||||
Room currentRoom = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room currentRoom = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
boolean hasRights = currentRoom != null &&
|
boolean hasRights = currentRoom != null &&
|
||||||
(currentRoom.hasRights(gameClient.getHabbo())) ||
|
(currentRoom.hasRights(gameClient.getHabbo())) ||
|
||||||
gameClient.getHabbo().hasRight(Permission.ACC_PLACEFURNI) ||
|
gameClient.getHabbo().hasRight(Permission.ACC_PLACEFURNI) ||
|
||||||
currentRoom.getGuildId() > 0 && currentRoom.getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS);
|
currentRoom.getRoomInfo().getGuild().getId() > 0 && currentRoom.getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS);
|
||||||
|
|
||||||
|
|
||||||
if (!gameClient.getHabbo().canExecuteCommand(commandKey, hasRights)) {
|
if (!gameClient.getHabbo().canExecuteCommand(commandKey, hasRights)) {
|
||||||
@ -127,17 +140,17 @@ public class CommandsManager {
|
|||||||
private boolean handlePetCommand(GameClient gameClient, String commandLine) {
|
private boolean handlePetCommand(GameClient gameClient, String commandLine) {
|
||||||
String[] args = commandLine.split(" ");
|
String[] args = commandLine.split(" ");
|
||||||
|
|
||||||
if (args.length <= 1 || gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null) {
|
if (args.length <= 1 || gameClient.getHabbo().getRoomUnit().getRoom() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room.getCurrentPets().isEmpty()) {
|
if (room.getRoomUnitManager().getCurrentRoomPets().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Pet pet : room.getCurrentPets().valueCollection()) {
|
for(Pet pet : room.getRoomUnitManager().getCurrentRoomPets().values()) {
|
||||||
if (pet != null && pet.getName().equalsIgnoreCase(args[0])) {
|
if (pet != null && pet.getName().equalsIgnoreCase(args[0])) {
|
||||||
StringBuilder commandBuilder = new StringBuilder();
|
StringBuilder commandBuilder = new StringBuilder();
|
||||||
|
|
||||||
@ -150,7 +163,7 @@ public class CommandsManager {
|
|||||||
for (PetCommand command : pet.getPetData().getPetCommands()) {
|
for (PetCommand command : pet.getPetData().getPetCommands()) {
|
||||||
if (command.getKey().equalsIgnoreCase(commandKey)) {
|
if (command.getKey().equalsIgnoreCase(commandKey)) {
|
||||||
if (pet instanceof RideablePet rideablePet && rideablePet.getRider() != null && rideablePet.getRider().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getId()) {
|
if (pet instanceof RideablePet rideablePet && rideablePet.getRider() != null && rideablePet.getRider().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getId()) {
|
||||||
rideablePet.getRider().getHabboInfo().dismountPet();
|
rideablePet.getRider().getHabboInfo().dismountPet(room);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ public class ArcturusCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
gameClient.getHabbo().whisper("This hotel is powered by Arcturus Emulator! \r" +
|
gameClient.getHabbo().whisper("This hotel is powered by Arcturus Emulator! \r" +
|
||||||
"Cet hôtel est alimenté par Arcturus émulateur! \r" +
|
"Cet hôtel est alimenté par Arcturus émulateur! \r" +
|
||||||
"Dit hotel draait op Arcturus Emulator! \r" +
|
"Dit hotel draait op Arcturus Emulator! \r" +
|
||||||
|
@ -11,7 +11,7 @@ public class BlockAlertCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
gameClient.getHabbo().getHabboStats().setBlockStaffAlerts(!gameClient.getHabbo().getHabboStats().isBlockStaffAlerts());
|
gameClient.getHabbo().getHabboStats().setBlockStaffAlerts(!gameClient.getHabbo().getHabboStats().isBlockStaffAlerts());
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_blockalert").replace("%state%", (gameClient.getHabbo().getHabboStats().isBlockStaffAlerts() ? getTextsValue("generic.on") : getTextsValue("generic.off"))), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_blockalert").replace("%state%", (gameClient.getHabbo().getHabboStats().isBlockStaffAlerts() ? getTextsValue("generic.on") : getTextsValue("generic.off"))), RoomChatMessageBubbles.ALERT);
|
||||||
|
|
||||||
|
@ -12,12 +12,12 @@ public class BotsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null || !gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo()))
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null || !gameClient.getHabbo().getRoomUnit().getRoom().hasRights(gameClient.getHabbo()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
StringBuilder data = new StringBuilder(getTextsValue("total") + ": " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getCurrentBots().values().length);
|
StringBuilder data = new StringBuilder(getTextsValue("total") + ": " + gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getCurrentRoomBots().values().size());
|
||||||
|
|
||||||
for (Bot bot : gameClient.getHabbo().getHabboInfo().getCurrentRoom().getCurrentBots().valueCollection()) {
|
for (Bot bot : gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getCurrentRoomBots().values()) {
|
||||||
data.append("\r");
|
data.append("\r");
|
||||||
data.append("<b>");
|
data.append("<b>");
|
||||||
data.append(Emulator.getTexts().getValue("generic.bot.name"));
|
data.append(Emulator.getTexts().getValue("generic.bot.name"));
|
||||||
|
@ -12,7 +12,7 @@ public class ControlCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
if (params.length == 2) {
|
if (params.length == 2) {
|
||||||
Habbo target = getHabbo(params[1]);
|
Habbo target = getHabbo(params[1]);
|
||||||
|
|
||||||
|
@ -12,24 +12,24 @@ public class CoordsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getRoomUnit() == null || gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
|
if (gameClient.getHabbo().getRoomUnit() == null || gameClient.getHabbo().getRoomUnit().getRoom() == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (params.length == 1) {
|
if (params.length == 1) {
|
||||||
gameClient.getHabbo().alert(getTextsValue("commands.generic.cmd_coords.title") + "\r\n" +
|
gameClient.getHabbo().alert(getTextsValue("commands.generic.cmd_coords.title") + "\r\n" +
|
||||||
"x: " + gameClient.getHabbo().getRoomUnit().getX() + "\r" +
|
"x: " + gameClient.getHabbo().getRoomUnit().getCurrentPosition().getX() + "\r" +
|
||||||
"y: " + gameClient.getHabbo().getRoomUnit().getY() + "\r" +
|
"y: " + gameClient.getHabbo().getRoomUnit().getCurrentPosition().getY() + "\r" +
|
||||||
"z: " + (gameClient.getHabbo().getRoomUnit().hasStatus(RoomUnitStatus.SIT) ? gameClient.getHabbo().getRoomUnit().getStatus(RoomUnitStatus.SIT) : gameClient.getHabbo().getRoomUnit().getZ()) + "\r" +
|
"z: " + (gameClient.getHabbo().getRoomUnit().hasStatus(RoomUnitStatus.SIT) ? gameClient.getHabbo().getRoomUnit().getStatus(RoomUnitStatus.SIT) : gameClient.getHabbo().getRoomUnit().getCurrentZ()) + "\r" +
|
||||||
getTextsValue("generic.rotation.head") + ": " + gameClient.getHabbo().getRoomUnit().getHeadRotation() + "-" + gameClient.getHabbo().getRoomUnit().getHeadRotation().getValue() + "\r" +
|
getTextsValue("generic.rotation.head") + ": " + gameClient.getHabbo().getRoomUnit().getHeadRotation() + "-" + gameClient.getHabbo().getRoomUnit().getHeadRotation().getValue() + "\r" +
|
||||||
getTextsValue("generic.rotation.body") + ": " + gameClient.getHabbo().getRoomUnit().getBodyRotation() + "-" + gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() + "\r" +
|
getTextsValue("generic.rotation.body") + ": " + gameClient.getHabbo().getRoomUnit().getBodyRotation() + "-" + gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() + "\r" +
|
||||||
getTextsValue("generic.sitting") + ": " + (gameClient.getHabbo().getRoomUnit().hasStatus(RoomUnitStatus.SIT) ? getTextsValue("generic.yes") : getTextsValue("generic.no")) + "\r" +
|
getTextsValue("generic.sitting") + ": " + (gameClient.getHabbo().getRoomUnit().hasStatus(RoomUnitStatus.SIT) ? getTextsValue("generic.yes") : getTextsValue("generic.no")) + "\r" +
|
||||||
"Tile State: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).getState().name() + "\r" +
|
"Tile State: " + gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getCurrentPosition().getX(), gameClient.getHabbo().getRoomUnit().getCurrentPosition().getY()).getState().name() + "\r" +
|
||||||
"Tile Walkable: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).isWalkable() + "\r" +
|
"Tile Walkable: " + gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getCurrentPosition().getX(), gameClient.getHabbo().getRoomUnit().getCurrentPosition().getY()).isWalkable() + "\r" +
|
||||||
"Tile relative height: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).relativeHeight() + "\r" +
|
"Tile relative height: " + gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getCurrentPosition().getX(), gameClient.getHabbo().getRoomUnit().getCurrentPosition().getY()).relativeHeight() + "\r" +
|
||||||
"Tile stack height: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).getStackHeight());
|
"Tile stack height: " + gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getCurrentPosition().getX(), gameClient.getHabbo().getRoomUnit().getCurrentPosition().getY()).getStackHeight());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.parseShort(params[1]), Short.parseShort(params[2]));
|
RoomTile tile = gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTile(Short.parseShort(params[1]), Short.parseShort(params[2]));
|
||||||
|
|
||||||
if (tile != null) {
|
if (tile != null) {
|
||||||
gameClient.getHabbo().alert(getTextsValue("commands.generic.cmd_coords.title") + "\r\n" +
|
gameClient.getHabbo().alert(getTextsValue("commands.generic.cmd_coords.title") + "\r\n" +
|
||||||
|
@ -11,10 +11,10 @@ public class DiagonalCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null && gameClient.getHabbo().getRoomUnit().getRoom().hasRights(gameClient.getHabbo())) {
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().moveDiagonally(!gameClient.getHabbo().getHabboInfo().getCurrentRoom().moveDiagonally());
|
gameClient.getHabbo().getRoomUnit().getRoom().setDiagonalMoveEnabled(!gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().isDiagonalMoveEnabled());
|
||||||
|
|
||||||
if (!gameClient.getHabbo().getHabboInfo().getCurrentRoom().moveDiagonally()) {
|
if (!gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().isDiagonalMoveEnabled()) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_diagonal.disabled"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_diagonal.disabled"), RoomChatMessageBubbles.ALERT);
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_diagonal.enabled"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_diagonal.enabled"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -12,11 +12,13 @@ public class EjectAllCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room != null && (room.isOwner(gameClient.getHabbo())
|
if (room != null) {
|
||||||
|| (room.hasGuild() && room.getGuildRightLevel(gameClient.getHabbo()).equals(RoomRightLevels.GUILD_ADMIN)))) {
|
if (room.getRoomInfo().isRoomOwner(gameClient.getHabbo())
|
||||||
room.ejectAll(gameClient.getHabbo());
|
|| (room.getRoomInfo().hasGuild() && room.getGuildRightLevel(gameClient.getHabbo()).equals(RoomRightLevels.GUILD_ADMIN))) {
|
||||||
|
room.ejectAll(gameClient.getHabbo());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,8 +19,8 @@ public class EmptyBotsInventoryCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length == 1 || (params.length >= 2 && !params[1].equals(getTextsValue("generic.yes")))) {
|
if (params.length == 1 || (params.length >= 2 && !params[1].equals(getTextsValue("generic.yes")))) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getUserCount() > 10) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbosCount() > 10) {
|
||||||
gameClient.getHabbo().alert(getTextsValue("commands.succes.cmd_empty_bots.verify").replace("%generic.yes%", getTextsValue("generic.yes")));
|
gameClient.getHabbo().alert(getTextsValue("commands.succes.cmd_empty_bots.verify").replace("%generic.yes%", getTextsValue("generic.yes")));
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_empty_bots.verify").replace("%generic.yes%", getTextsValue("generic.yes")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_empty_bots.verify").replace("%generic.yes%", getTextsValue("generic.yes")), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -5,8 +5,8 @@ import com.eu.habbo.habbohotel.commands.Command;
|
|||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.messages.outgoing.inventory.FurniListComposer;
|
import com.eu.habbo.messages.outgoing.inventory.FurniListComposer;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
||||||
import com.eu.habbo.threading.runnables.QueryDeleteHabboItems;
|
import com.eu.habbo.threading.runnables.QueryDeleteHabboItems;
|
||||||
@ -21,8 +21,8 @@ public class EmptyInventoryCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length == 1 || (params.length == 2 && !params[1].equals(getTextsValue("generic.yes")))) {
|
if (params.length == 1 || (params.length == 2 && !params[1].equals(getTextsValue("generic.yes")))) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getUserCount() > 10) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbosCount() > 10) {
|
||||||
gameClient.getHabbo().alert(getTextsValue("commands.succes.cmd_empty.verify").replace("%generic.yes%", getTextsValue("generic.yes")));
|
gameClient.getHabbo().alert(getTextsValue("commands.succes.cmd_empty.verify").replace("%generic.yes%", getTextsValue("generic.yes")));
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_empty.verify").replace("%generic.yes%", getTextsValue("generic.yes")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_empty.verify").replace("%generic.yes%", getTextsValue("generic.yes")), RoomChatMessageBubbles.ALERT);
|
||||||
@ -37,7 +37,7 @@ public class EmptyInventoryCommand extends Command {
|
|||||||
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();
|
TIntObjectMap<RoomItem> items = new TIntObjectHashMap<>();
|
||||||
items.putAll(habbo.getInventory().getItemsComponent().getItems());
|
items.putAll(habbo.getInventory().getItemsComponent().getItems());
|
||||||
habbo.getInventory().getItemsComponent().getItems().clear();
|
habbo.getInventory().getItemsComponent().getItems().clear();
|
||||||
Emulator.getThreading().run(new QueryDeleteHabboItems(items));
|
Emulator.getThreading().run(new QueryDeleteHabboItems(items));
|
||||||
|
@ -19,8 +19,8 @@ public class EmptyPetsInventoryCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length == 1 || (params.length >= 2 && !params[1].equals(getTextsValue("generic.yes")))) {
|
if (params.length == 1 || (params.length >= 2 && !params[1].equals(getTextsValue("generic.yes")))) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getUserCount() > 10) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbosCount() > 10) {
|
||||||
gameClient.getHabbo().alert(getTextsValue("commands.succes.cmd_empty_pets.verify").replace("%generic.yes%", getTextsValue("generic.yes")));
|
gameClient.getHabbo().alert(getTextsValue("commands.succes.cmd_empty_pets.verify").replace("%generic.yes%", getTextsValue("generic.yes")));
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_empty_pets.verify").replace("%generic.yes%", getTextsValue("generic.yes")), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_empty_pets.verify").replace("%generic.yes%", getTextsValue("generic.yes")), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -33,13 +33,13 @@ public class EnableCommand extends Command {
|
|||||||
}
|
}
|
||||||
if (target == gameClient.getHabbo() || gameClient.getHabbo().hasRight(Permission.ACC_ENABLE_OTHERS)) {
|
if (target == gameClient.getHabbo() || gameClient.getHabbo().hasRight(Permission.ACC_ENABLE_OTHERS)) {
|
||||||
try {
|
try {
|
||||||
if (target.getHabboInfo().getCurrentRoom() != null && target.getHabboInfo().getRiding() == null) {
|
if (target.getRoomUnit().getRoom() != null && target.getHabboInfo().getRiding() == null) {
|
||||||
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, target.getHabboInfo().getPermissionGroup().getId())) {
|
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, target.getHabboInfo().getPermissionGroup().getId())) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_enable.not_allowed"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_enable.not_allowed"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
target.getHabboInfo().getCurrentRoom().giveEffect(target, effectId, -1);
|
target.getRoomUnit().getRoom().giveEffect(target, effectId, -1);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Caught exception", e);
|
log.error("Caught exception", e);
|
||||||
|
@ -18,14 +18,14 @@ public class EventCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null || params.length < 2) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null || params.length < 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
||||||
|
|
||||||
THashMap<String, String> codes = new THashMap<>();
|
THashMap<String, String> codes = new THashMap<>();
|
||||||
codes.put("ROOMNAME", gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName());
|
codes.put("ROOMNAME", gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getName());
|
||||||
codes.put("ROOMID", gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId() + "");
|
codes.put("ROOMID", gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId() + "");
|
||||||
codes.put("USERNAME", gameClient.getHabbo().getHabboInfo().getUsername());
|
codes.put("USERNAME", gameClient.getHabbo().getHabboInfo().getUsername());
|
||||||
codes.put("LOOK", gameClient.getHabbo().getHabboInfo().getLook());
|
codes.put("LOOK", gameClient.getHabbo().getHabboInfo().getLook());
|
||||||
codes.put("TIME", Emulator.getDate().toString());
|
codes.put("TIME", Emulator.getDate().toString());
|
||||||
|
@ -13,7 +13,7 @@ public class FacelessCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ public class FacelessCommand extends Command {
|
|||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().setLook(gameClient.getHabbo().getHabboInfo().getLook().replace(part, newHead));
|
gameClient.getHabbo().getHabboInfo().setLook(gameClient.getHabbo().getHabboInfo().getLook().replace(part, newHead));
|
||||||
gameClient.sendResponse(new FigureUpdateComposer(gameClient.getHabbo()));
|
gameClient.sendResponse(new FigureUpdateComposer(gameClient.getHabbo()));
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new UserChangeMessageComposer(gameClient.getHabbo()).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new UserChangeMessageComposer(gameClient.getHabbo()).compose());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@ public class FastwalkCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
//TODO Make this an event plugin which fires that can be cancelled
|
//TODO Make this an event plugin which fires that can be cancelled
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getRiding() != null)
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null && gameClient.getHabbo().getHabboInfo().getRiding() != null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Habbo habbo = gameClient.getHabbo();
|
Habbo habbo = gameClient.getHabbo();
|
||||||
@ -26,7 +26,7 @@ public class FastwalkCommand extends Command {
|
|||||||
if (habbo == null)
|
if (habbo == null)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
habbo.getRoomUnit().setFastWalk(!habbo.getRoomUnit().isFastWalk());
|
habbo.getRoomUnit().setFastWalkEnabled(!habbo.getRoomUnit().isFastWalkEnabled());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -12,14 +12,14 @@ public class FreezeBotsCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gameClient.getHabbo().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getCurrentRoom().getOwnerId()
|
if (gameClient.getHabbo().getHabboInfo().getId() == gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getOwnerInfo().getId()
|
||||||
|| gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
|| gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().setAllowBotsWalk(!gameClient.getHabbo().getHabboInfo().getCurrentRoom().isAllowBotsWalk());
|
gameClient.getHabbo().getRoomUnit().getRoom().setAllowBotsWalk(!gameClient.getHabbo().getRoomUnit().getRoom().isAllowBotsWalk());
|
||||||
gameClient.getHabbo().whisper(gameClient.getHabbo().getHabboInfo().getCurrentRoom().isAllowBotsWalk() ? getTextsValue("commands.succes.cmd_freeze_bots.unfrozen") : getTextsValue("commands.succes.cmd_freeze_bots.frozen"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(gameClient.getHabbo().getRoomUnit().getRoom().isAllowBotsWalk() ? getTextsValue("commands.succes.cmd_freeze_bots.unfrozen") : getTextsValue("commands.succes.cmd_freeze_bots.frozen"), RoomChatMessageBubbles.ALERT);
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("generic.cannot_do_that"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("generic.cannot_do_that"), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public class FreezeCommand extends Command {
|
|||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_freeze.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_freeze.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
} else {
|
} else {
|
||||||
if (habbo.getRoomUnit().canWalk()) {
|
if (habbo.getRoomUnit().isCanWalk()) {
|
||||||
habbo.getRoomUnit().setCanWalk(false);
|
habbo.getRoomUnit().setCanWalk(false);
|
||||||
habbo.whisper(getTextsValue("commands.succes.cmd_freeze.frozen"), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(getTextsValue("commands.succes.cmd_freeze.frozen"), RoomChatMessageBubbles.ALERT);
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_freeze.user_frozen"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_freeze.user_frozen"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -10,8 +10,8 @@ public class HabnamCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboStats().hasActiveClub() && gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getHabboStats().hasActiveClub() && gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().giveEffect(gameClient.getHabbo(), 140, 30);
|
gameClient.getHabbo().getRoomUnit().getRoom().giveEffect(gameClient.getHabbo(), 140, 30);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ public class HandItemCommand extends Command {
|
|||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length == 2) {
|
if (params.length == 2) {
|
||||||
try {
|
try {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
int effectId = Integer.parseInt(params[1]);
|
int effectId = Integer.parseInt(params[1]);
|
||||||
gameClient.getHabbo().getRoomUnit().setHandItem(effectId);
|
gameClient.getHabbo().getRoomUnit().setHandItem(effectId);
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new CarryObjectMessageComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new CarryObjectMessageComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//Don't handle incorrect parse exceptions :P
|
//Don't handle incorrect parse exceptions :P
|
||||||
|
@ -11,14 +11,14 @@ public class HideWiredCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
if (room == null) {
|
if (room == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.isOwner(gameClient.getHabbo())) {
|
if (room.getRoomInfo().isRoomOwner(gameClient.getHabbo())) {
|
||||||
room.setHideWired(!room.isHideWired());
|
room.setHideWired(!room.getRoomInfo().isHiddenWiredEnabled());
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_hidewired." + (room.isHideWired() ? "hidden" : "shown")));
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_hidewired." + (room.getRoomInfo().isHiddenWiredEnabled() ? "hidden" : "shown")));
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.errors.cmd_hidewired.permission"));
|
gameClient.getHabbo().whisper(getTextsValue("commands.errors.cmd_hidewired.permission"));
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package com.eu.habbo.habbohotel.commands.list;
|
|||||||
import com.eu.habbo.habbohotel.commands.Command;
|
import com.eu.habbo.habbohotel.commands.Command;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||||
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer;
|
||||||
@ -41,7 +41,7 @@ public class InvisibleCommand extends Command {
|
|||||||
|
|
||||||
roomUnit.setInvisible(true);
|
roomUnit.setInvisible(true);
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_invisible.updated"));
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_invisible.updated"));
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new UserRemoveMessageComposer(roomUnit).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new UserRemoveMessageComposer(roomUnit).compose());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import com.eu.habbo.habbohotel.commands.Command;
|
|||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUserRotation;
|
import com.eu.habbo.habbohotel.rooms.entities.RoomRotation;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.UserUpdateComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.UserUpdateComposer;
|
||||||
|
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
@ -19,24 +19,24 @@ public class LayCommand extends Command {
|
|||||||
if (gameClient.getHabbo().getRoomUnit() == null || !gameClient.getHabbo().getRoomUnit().canForcePosture())
|
if (gameClient.getHabbo().getRoomUnit() == null || !gameClient.getHabbo().getRoomUnit().canForcePosture())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
gameClient.getHabbo().getRoomUnit().setCmdLay(true);
|
gameClient.getHabbo().getRoomUnit().setCmdLayEnabled(true);
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().updateHabbo(gameClient.getHabbo());
|
gameClient.getHabbo().getRoomUnit().getRoom().updateHabbo(gameClient.getHabbo());
|
||||||
gameClient.getHabbo().getRoomUnit().setCmdSit(true);
|
gameClient.getHabbo().getRoomUnit().setCmdSitEnabled(true);
|
||||||
gameClient.getHabbo().getRoomUnit().setBodyRotation(RoomUserRotation.values()[gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() - gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() % 2]);
|
gameClient.getHabbo().getRoomUnit().setBodyRotation(RoomRotation.values()[gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() - gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() % 2]);
|
||||||
|
|
||||||
RoomTile tile = gameClient.getHabbo().getRoomUnit().getCurrentLocation();
|
RoomTile tile = gameClient.getHabbo().getRoomUnit().getCurrentPosition();
|
||||||
if (tile == null) {
|
if (tile == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IntStream.range(0, 3)
|
if (IntStream.range(0, 3)
|
||||||
.mapToObj(i -> gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(tile, gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue(), i))
|
.mapToObj(i -> gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTileInFront(tile, gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue(), i))
|
||||||
.anyMatch(t -> t == null || !t.isWalkable())) {
|
.anyMatch(t -> t == null || !t.isWalkable())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
gameClient.getHabbo().getRoomUnit().setStatus(RoomUnitStatus.LAY, 0.5 + "");
|
gameClient.getHabbo().getRoomUnit().setStatus(RoomUnitStatus.LAY, 0.5 + "");
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new UserUpdateComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new UserUpdateComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,7 +19,7 @@ public class MimicCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length == 2) {
|
if (params.length == 2) {
|
||||||
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
Habbo habbo = gameClient.getHabbo().getRoomUnit().getRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_mimic.not_found"), ""), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_mimic.not_found"), ""), RoomChatMessageBubbles.ALERT);
|
||||||
@ -39,7 +39,7 @@ public class MimicCommand extends Command {
|
|||||||
gameClient.getHabbo().getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_MIMIC ? ClothingValidationManager.validateLook(gameClient.getHabbo(), habbo.getHabboInfo().getLook(), habbo.getHabboInfo().getGender().name()) : habbo.getHabboInfo().getLook());
|
gameClient.getHabbo().getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_MIMIC ? ClothingValidationManager.validateLook(gameClient.getHabbo(), habbo.getHabboInfo().getLook(), habbo.getHabboInfo().getGender().name()) : habbo.getHabboInfo().getLook());
|
||||||
gameClient.getHabbo().getHabboInfo().setGender(habbo.getHabboInfo().getGender());
|
gameClient.getHabbo().getHabboInfo().setGender(habbo.getHabboInfo().getGender());
|
||||||
gameClient.sendResponse(new UserObjectComposer(gameClient.getHabbo()));
|
gameClient.sendResponse(new UserObjectComposer(gameClient.getHabbo()));
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new UserChangeMessageComposer(gameClient.getHabbo()).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new UserChangeMessageComposer(gameClient.getHabbo()).compose());
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_mimic.copied"), params[1]).replace("%gender_name%", getGenderName(habbo)), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_mimic.copied"), params[1]).replace("%gender_name%", getGenderName(habbo)), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,12 @@ public class MoonwalkCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboStats().hasActiveClub()) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null && gameClient.getHabbo().getHabboStats().hasActiveClub()) {
|
||||||
int effect = 136;
|
int effect = 136;
|
||||||
if (gameClient.getHabbo().getRoomUnit().getEffectId() == 136)
|
if (gameClient.getHabbo().getRoomUnit().getEffectId() == 136)
|
||||||
effect = 0;
|
effect = 0;
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().giveEffect(gameClient.getHabbo(), effect, -1);
|
gameClient.getHabbo().getRoomUnit().getRoom().giveEffect(gameClient.getHabbo(), effect, -1);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -46,8 +46,8 @@ public class MuteCommand extends Command {
|
|||||||
|
|
||||||
habbo.mute(duration, false);
|
habbo.mute(duration, false);
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (habbo.getRoomUnit().getRoom() != null) {
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new IgnoreResultMessageComposer(habbo, IgnoreResultMessageComposer.MUTED).compose()); //: RoomUserIgnoredComposer.UNIGNORED
|
habbo.getRoomUnit().getRoom().sendComposer(new IgnoreResultMessageComposer(habbo, IgnoreResultMessageComposer.MUTED).compose()); //: RoomUserIgnoredComposer.UNIGNORED
|
||||||
}
|
}
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_mute.muted"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_mute.muted"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -16,12 +16,12 @@ public class PetInfoCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_pet_info.pet_not_found"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_pet_info.pet_not_found"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
String name = params[1];
|
String name = params[1];
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getCurrentPets().forEachEntry((a, pet) -> {
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getCurrentRoomPets().forEach((a, pet) -> {
|
||||||
if (pet.getName().equalsIgnoreCase(name)) {
|
if (pet.getName().equalsIgnoreCase(name)) {
|
||||||
gameClient.getHabbo().alert("" +
|
gameClient.getHabbo().alert("" +
|
||||||
getTextsValue("commands.generic.cmd_pet_info.title") + ": " + pet.getName() + "\r\n" +
|
getTextsValue("commands.generic.cmd_pet_info.title") + ": " + pet.getName() + "\r\n" +
|
||||||
@ -37,11 +37,9 @@ public class PetInfoCommand extends Command {
|
|||||||
getTextsValue("generic.pet.level.thirst") + ": " + pet.levelThirst + "\r" +
|
getTextsValue("generic.pet.level.thirst") + ": " + pet.levelThirst + "\r" +
|
||||||
getTextsValue("generic.pet.level.hunger") + ": " + pet.levelHunger + "\r" +
|
getTextsValue("generic.pet.level.hunger") + ": " + pet.levelHunger + "\r" +
|
||||||
getTextsValue("generic.pet.current_action") + ": " + (pet.getTask() == null ? getTextsValue("generic.nothing") : pet.getTask().name()) + "\r" +
|
getTextsValue("generic.pet.current_action") + ": " + (pet.getTask() == null ? getTextsValue("generic.nothing") : pet.getTask().name()) + "\r" +
|
||||||
getTextsValue("generic.can.walk") + ": " + (pet.getRoomUnit().canWalk() ? getTextsValue("generic.yes") : getTextsValue("generic.no")) + ""
|
getTextsValue("generic.can.walk") + ": " + (pet.getRoomUnit().isCanWalk() ? getTextsValue("generic.yes") : getTextsValue("generic.no")) + ""
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,13 @@ public class PickallCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room == null) {
|
if (room == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (room.isOwner(gameClient.getHabbo())) {
|
if (room.getRoomInfo().isRoomOwner(gameClient.getHabbo())) {
|
||||||
room.ejectAll();
|
room.ejectAll();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class PullCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length != 2) return true;
|
if (params.length != 2) return true;
|
||||||
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
Habbo habbo = gameClient.getHabbo().getRoomUnit().getRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_pull.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_pull.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
@ -27,22 +27,22 @@ public class PullCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int distanceX = habbo.getRoomUnit().getX() - gameClient.getHabbo().getRoomUnit().getX();
|
int distanceX = habbo.getRoomUnit().getCurrentPosition().getX() - gameClient.getHabbo().getRoomUnit().getCurrentPosition().getX();
|
||||||
int distanceY = habbo.getRoomUnit().getY() - gameClient.getHabbo().getRoomUnit().getY();
|
int distanceY = habbo.getRoomUnit().getCurrentPosition().getY() - gameClient.getHabbo().getRoomUnit().getCurrentPosition().getY();
|
||||||
|
|
||||||
if (distanceX < -2 || distanceX > 2 || distanceY < -2 || distanceY > 2) {
|
if (distanceX < -2 || distanceX > 2 || distanceY < -2 || distanceY > 2) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_pull.cant_reach"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_pull.cant_reach"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
RoomTile tile = gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentPosition(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tile != null && tile.isWalkable()) {
|
if (tile != null && tile.isWalkable()) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile() == tile) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getDoorTile() == tile) {
|
||||||
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_pull.invalid"), params[1]));
|
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_pull.invalid"), params[1]));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
habbo.getRoomUnit().setGoalLocation(tile);
|
habbo.getRoomUnit().setGoalLocation(tile);
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(replaceUser(getTextsValue("commands.succes.cmd_pull.pull"), params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? getTextsValue("gender.him") : getTextsValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(replaceUser(getTextsValue("commands.succes.cmd_pull.pull"), params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? getTextsValue("gender.him") : getTextsValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public class PushCommand extends Command {
|
|||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length != 2) return true;
|
if (params.length != 2) return true;
|
||||||
|
|
||||||
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
Habbo habbo = gameClient.getHabbo().getRoomUnit().getRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_push.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_push.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
@ -29,19 +29,19 @@ public class PushCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_push.push_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_push.push_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
RoomTile tFront = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
RoomTile tFront = gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentPosition(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tFront != null && tFront.isWalkable()) {
|
if (tFront != null && tFront.isWalkable()) {
|
||||||
if (tFront.getX() == habbo.getRoomUnit().getX() && tFront.getY() == habbo.getRoomUnit().getY()) {
|
if (tFront.getX() == habbo.getRoomUnit().getCurrentPosition().getX() && tFront.getY() == habbo.getRoomUnit().getCurrentPosition().getY()) {
|
||||||
RoomTile tFrontTarget = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(habbo.getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
RoomTile tFrontTarget = gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTileInFront(habbo.getRoomUnit().getCurrentPosition(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tFrontTarget != null && tFrontTarget.isWalkable()) {
|
if (tFrontTarget != null && tFrontTarget.isWalkable()) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile() == tFrontTarget) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getDoorTile() == tFrontTarget) {
|
||||||
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_push.invalid"), params[1]));
|
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_push.invalid"), params[1]));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
habbo.getRoomUnit().setGoalLocation(tFrontTarget);
|
habbo.getRoomUnit().setGoalLocation(tFrontTarget);
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(
|
||||||
new ChatMessageComposer(
|
new ChatMessageComposer(
|
||||||
new RoomChatMessage(
|
new RoomChatMessage(
|
||||||
replaceUser(getTextsValue("commands.succes.cmd_push.push"), params[1])
|
replaceUser(getTextsValue("commands.succes.cmd_push.push"), params[1])
|
||||||
|
@ -4,7 +4,7 @@ import com.eu.habbo.Emulator;
|
|||||||
import com.eu.habbo.habbohotel.commands.Command;
|
import com.eu.habbo.habbohotel.commands.Command;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
||||||
import com.eu.habbo.threading.runnables.QueryDeleteHabboItems;
|
import com.eu.habbo.threading.runnables.QueryDeleteHabboItems;
|
||||||
import gnu.trove.map.TIntIntMap;
|
import gnu.trove.map.TIntIntMap;
|
||||||
@ -20,16 +20,16 @@ public class RedeemCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(final GameClient gameClient, String[] params) {
|
public boolean handle(final GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getActiveTradeForHabbo(gameClient.getHabbo()) != null)
|
if (gameClient.getHabbo().getRoomUnit().getRoom().getActiveTradeForHabbo(gameClient.getHabbo()) != null)
|
||||||
return false;
|
return false;
|
||||||
ArrayList<HabboItem> items = new ArrayList<>();
|
ArrayList<RoomItem> items = new ArrayList<>();
|
||||||
|
|
||||||
int credits = 0;
|
int credits = 0;
|
||||||
int pixels = 0;
|
int pixels = 0;
|
||||||
|
|
||||||
TIntIntMap points = new TIntIntHashMap();
|
TIntIntMap points = new TIntIntHashMap();
|
||||||
|
|
||||||
for (HabboItem item : gameClient.getHabbo().getInventory().getItemsComponent().getItemsAsValueCollection()) {
|
for (RoomItem item : gameClient.getHabbo().getInventory().getItemsComponent().getItemsAsValueCollection()) {
|
||||||
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_") || item.getBaseItem().getName().startsWith("DF_") || item.getBaseItem().getName().startsWith("PF_")) && item.getUserId() == gameClient.getHabbo().getHabboInfo().getId()) {
|
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_") || item.getBaseItem().getName().startsWith("DF_") || item.getBaseItem().getName().startsWith("PF_")) && item.getUserId() == gameClient.getHabbo().getHabboInfo().getId()) {
|
||||||
items.add(item);
|
items.add(item);
|
||||||
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) {
|
||||||
@ -63,7 +63,7 @@ public class RedeemCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TIntObjectHashMap<HabboItem> deleted = new TIntObjectHashMap<>();
|
TIntObjectHashMap<RoomItem> deleted = new TIntObjectHashMap<>();
|
||||||
items.forEach(item -> {
|
items.forEach(item -> {
|
||||||
gameClient.getHabbo().getInventory().getItemsComponent().removeHabboItem(item);
|
gameClient.getHabbo().getInventory().getItemsComponent().removeHabboItem(item);
|
||||||
deleted.put(item.getId(), item);
|
deleted.put(item.getId(), item);
|
||||||
|
@ -19,12 +19,12 @@ public class ReloadRoomCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Emulator.getThreading().run(() -> {
|
Emulator.getThreading().run(() -> {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
Collection<Habbo> habbos = new ArrayList<>(room.getHabbos());
|
Collection<Habbo> habbos = new ArrayList<>(room.getRoomUnitManager().getRoomHabbos());
|
||||||
Emulator.getGameEnvironment().getRoomManager().unloadRoom(room);
|
Emulator.getGameEnvironment().getRoomManager().unloadRoom(room);
|
||||||
room = Emulator.getGameEnvironment().getRoomManager().loadRoom(room.getId());
|
room = Emulator.getGameEnvironment().getRoomManager().getRoom(room.getRoomInfo().getId());
|
||||||
ServerMessage message = new RoomForwardMessageComposer(room.getId()).compose();
|
ServerMessage message = new RoomForwardMessageComposer(room.getRoomInfo().getId()).compose();
|
||||||
habbos.forEach(habbo -> habbo.getClient().sendResponse(message));
|
habbos.forEach(habbo -> habbo.getClient().sendResponse(message));
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
@ -28,7 +28,7 @@ public class RoomAlertCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
room.sendComposer(new IssueCloseNotificationMessageComposer(message).compose());
|
room.sendComposer(new IssueCloseNotificationMessageComposer(message).compose());
|
||||||
return true;
|
return true;
|
||||||
|
@ -30,7 +30,7 @@ public class RoomBundleCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Emulator.getGameEnvironment().getCatalogManager().getCatalogPage("room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId()) != null) {
|
if (Emulator.getGameEnvironment().getCatalogManager().getCatalogPage("room_bundle_" + gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId()) != null) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_bundle.duplicate"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_bundle.duplicate"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ public class RoomBundleCommand extends Command {
|
|||||||
points = Integer.parseInt(params[3]);
|
points = Integer.parseInt(params[3]);
|
||||||
pointsType = Integer.parseInt(params[4]);
|
pointsType = Integer.parseInt(params[4]);
|
||||||
|
|
||||||
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getPermissionGroup().getId(), parentId);
|
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getName(), "room_bundle_" + gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId(), gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getPermissionGroup().getId(), parentId);
|
||||||
|
|
||||||
if (page instanceof RoomBundleLayout roomBundleLayout) {
|
if (page instanceof RoomBundleLayout roomBundleLayout) {
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO catalog_items (page_id, item_ids, catalog_name, cost_credits, cost_points, points_type ) VALUES (?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO catalog_items (page_id, item_ids, catalog_name, cost_credits, cost_points, points_type ) VALUES (?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
|
||||||
@ -67,7 +67,7 @@ public class RoomBundleCommand extends Command {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
roomBundleLayout.loadItems(gameClient.getHabbo().getHabboInfo().getCurrentRoom());
|
roomBundleLayout.loadItems(gameClient.getHabbo().getRoomUnit().getRoom());
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_bundle").replace("%id%", roomBundleLayout.getId() + ""), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_bundle").replace("%id%", roomBundleLayout.getId() + ""), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
|
@ -28,9 +28,9 @@ public class RoomDanceCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos().forEach(habbo -> {
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos().forEach(habbo -> {
|
||||||
habbo.getRoomUnit().setDanceType(DanceType.values()[danceId]);
|
habbo.getRoomUnit().setDanceType(DanceType.values()[danceId]);
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new DanceMessageComposer(habbo.getRoomUnit()).compose());
|
habbo.getRoomUnit().getRoom().sendComposer(new DanceMessageComposer(habbo.getRoomUnit()).compose());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_danceall.no_dance"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_danceall.no_dance"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -21,8 +21,8 @@ public class RoomEffectCommand extends Command {
|
|||||||
int effectId = Integer.parseInt(params[1]);
|
int effectId = Integer.parseInt(params[1]);
|
||||||
|
|
||||||
if (effectId >= 0) {
|
if (effectId >= 0) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
room.getHabbos().forEach(habbo -> room.giveEffect(habbo, effectId, -1));
|
room.getRoomUnitManager().getRoomHabbos().forEach(habbo -> room.giveEffect(habbo, effectId, -1));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_roomeffect.positive"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_roomeffect.positive"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -29,9 +29,9 @@ public class RoomItemCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Habbo habbo : gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos()) {
|
for (Habbo habbo : gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos()) {
|
||||||
habbo.getRoomUnit().setHandItem(itemId);
|
habbo.getRoomUnit().setHandItem(itemId);
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new CarryObjectMessageComposer(habbo.getRoomUnit()).compose());
|
habbo.getRoomUnit().getRoom().sendComposer(new CarryObjectMessageComposer(habbo.getRoomUnit()).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemId > 0) {
|
if (itemId > 0) {
|
||||||
|
@ -17,15 +17,15 @@ public class RoomKickCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
final Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
if (params.length > 1) {
|
if (params.length > 1) {
|
||||||
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
||||||
room.sendComposer(new HabboBroadcastMessageComposer(message + "\r\n-" + gameClient.getHabbo().getHabboInfo().getUsername()).compose());
|
room.sendComposer(new HabboBroadcastMessageComposer(message + "\r\n-" + gameClient.getHabbo().getHabboInfo().getUsername()).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Habbo habbo : room.getHabbos()) {
|
for (Habbo habbo : room.getRoomUnitManager().getRoomHabbos()) {
|
||||||
if (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
|
if (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo))) {
|
||||||
room.kickHabbo(habbo, true);
|
room.kickHabbo(habbo, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ public class RoomMuteCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
room.setMuted(!room.isMuted());
|
room.setMuted(!room.isMuted());
|
||||||
|
@ -11,13 +11,13 @@ public class RoomSitCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos().forEach(habbo -> {
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos().forEach(habbo -> {
|
||||||
if (habbo.getRoomUnit().isWalking()) {
|
if (habbo.getRoomUnit().isWalking()) {
|
||||||
habbo.getRoomUnit().stopWalking();
|
habbo.getRoomUnit().stopWalking();
|
||||||
} else if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) {
|
} else if (habbo.getRoomUnit().hasStatus(RoomUnitStatus.SIT)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(habbo);
|
gameClient.getHabbo().getRoomUnit().getRoom().makeSit(habbo);
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -21,7 +21,7 @@ public class SayAllCommand extends Command {
|
|||||||
|
|
||||||
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos().forEach(habbo -> habbo.talk(message));
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos().forEach(habbo -> habbo.talk(message));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class SayCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_say.user_not_found"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_say.user_not_found"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (target.getHabboInfo().getCurrentRoom() == null) {
|
if (target.getRoomUnit().getRoom() == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_say.hotel_view"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_say.hotel_view"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ public class SayCommand extends Command {
|
|||||||
message = IntStream.range(2, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
message = IntStream.range(2, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
||||||
}
|
}
|
||||||
|
|
||||||
target.getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(message, target, RoomChatMessageBubbles.NORMAL)).compose());
|
target.getRoomUnit().getRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(message, target, RoomChatMessageBubbles.NORMAL)).compose());
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_say"), params[1]).replace("%message%", message), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_say"), params[1]).replace("%message%", message), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class SetMaxCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (max > 0 && max < 9999) {
|
if (max > 0 && max < 9999) {
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().setUsersMax(max);
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().setMaxUsers(max);
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.success.cmd_setmax").replace("%value%", max + ""), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.success.cmd_setmax").replace("%value%", max + ""), RoomChatMessageBubbles.ALERT);
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_setmax.invalid_number"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_setmax.invalid_number"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -17,7 +17,7 @@ public class SetPollCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null) {
|
||||||
int pollId = -1;
|
int pollId = -1;
|
||||||
try {
|
try {
|
||||||
pollId = Integer.parseInt(params[1]);
|
pollId = Integer.parseInt(params[1]);
|
||||||
@ -25,7 +25,7 @@ public class SetPollCommand extends Command {
|
|||||||
|
|
||||||
if (pollId >= 0) {
|
if (pollId >= 0) {
|
||||||
if (Emulator.getGameEnvironment().getPollManager().getPoll(pollId) != null) {
|
if (Emulator.getGameEnvironment().getPollManager().getPoll(pollId) != null) {
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().setPollId(pollId);
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().setPollId(pollId);
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_set_poll"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.succes.cmd_set_poll"), RoomChatMessageBubbles.ALERT);
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_set_poll.not_found"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_set_poll.not_found"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -13,10 +13,10 @@ public class SetSpeedCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() != null && gameClient.getHabbo().getRoomUnit().getRoom().hasRights(gameClient.getHabbo())) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
int oldSpeed = room.getRollerSpeed();
|
int oldSpeed = room.getRoomInfo().getRollerSpeed();
|
||||||
int newSpeed;
|
int newSpeed;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -22,7 +22,7 @@ public class ShoutAllCommand extends Command {
|
|||||||
|
|
||||||
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
String message = IntStream.range(1, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
||||||
|
|
||||||
for (Habbo habbo : gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos()) {
|
for (Habbo habbo : gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos()) {
|
||||||
habbo.shout(message);
|
habbo.shout(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public class ShoutCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_shout.user_not_found"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_shout.user_not_found"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (target.getHabboInfo().getCurrentRoom() == null) {
|
if (target.getRoomUnit().getRoom() == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_shout.hotel_view"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_shout.hotel_view"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ public class ShoutCommand extends Command {
|
|||||||
message = IntStream.range(2, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
message = IntStream.range(2, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining());
|
||||||
}
|
}
|
||||||
|
|
||||||
target.getHabboInfo().getCurrentRoom().sendComposer(new ShoutMessageComposer(new RoomChatMessage(message, target, RoomChatMessageBubbles.NORMAL)).compose());
|
target.getRoomUnit().getRoom().sendComposer(new ShoutMessageComposer(new RoomChatMessage(message, target, RoomChatMessageBubbles.NORMAL)).compose());
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_shout"), params[1]).replace("%message%", message), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_shout"), params[1]).replace("%message%", message), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class SitCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
|
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(gameClient.getHabbo());
|
gameClient.getHabbo().getRoomUnit().getRoom().makeSit(gameClient.getHabbo());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class SoftKickCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (params.length != 2) return true;
|
if (params.length != 2) return true;
|
||||||
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
final Habbo habbo = gameClient.getHabbo().getRoomUnit().getRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.keys.cmd_softkick_error"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.keys.cmd_softkick_error"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
@ -27,9 +27,9 @@ public class SoftKickCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
final Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room != null && (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) {
|
if (room != null && (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo)))) {
|
||||||
room.kickHabbo(habbo, false);
|
room.kickHabbo(habbo, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -13,7 +13,7 @@ public class StalkCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (params.length >= 2) {
|
if (params.length >= 2) {
|
||||||
@ -24,7 +24,7 @@ public class StalkCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() == null) {
|
if (habbo.getRoomUnit().getRoom() == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_stalk.not_room"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_stalk.not_room"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -34,12 +34,12 @@ public class StalkCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == habbo.getHabboInfo().getCurrentRoom()) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == habbo.getRoomUnit().getRoom()) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.generic.cmd_stalk.same_room"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.generic.cmd_stalk.same_room"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
gameClient.sendResponse(new GetGuestRoomResultComposer(habbo.getHabboInfo().getCurrentRoom(), gameClient.getHabbo(), true, false));
|
gameClient.sendResponse(new GetGuestRoomResultComposer(habbo.getRoomUnit().getRoom(), gameClient.getHabbo(), true, false));
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_stalk.forgot_username"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_stalk.forgot_username"), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class StandCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getRiding() == null)
|
if (gameClient.getHabbo().getHabboInfo().getRiding() == null)
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeStand(gameClient.getHabbo());
|
gameClient.getHabbo().getRoomUnit().getRoom().makeStand(gameClient.getHabbo());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class SummonCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null)
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
@ -35,23 +35,21 @@ public class SummonCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() == habbo.getHabboInfo().getCurrentRoom()) {
|
if (gameClient.getHabbo().getRoomUnit().getRoom() == habbo.getRoomUnit().getRoom()) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.generic.cmd_summon.same_room"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.generic.cmd_summon.same_room"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Room room = habbo.getHabboInfo().getCurrentRoom();
|
Room room = habbo.getRoomUnit().getRoom();
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
Emulator.getGameEnvironment().getRoomManager().logExit(habbo);
|
Emulator.getGameEnvironment().getRoomManager().logExit(habbo);
|
||||||
|
|
||||||
room.removeHabbo(habbo, true);
|
room.getRoomUnitManager().removeHabbo(habbo, true);
|
||||||
|
|
||||||
habbo.getHabboInfo().setCurrentRoom(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Emulator.getGameEnvironment().getRoomManager().enterRoom(habbo, gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), "", true);
|
Emulator.getGameEnvironment().getRoomManager().enterRoom(habbo, gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId(), "", true);
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new RoomForwardMessageComposer(gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId()));
|
habbo.getClient().sendResponse(new RoomForwardMessageComposer(gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId()));
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_summon.summoned"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_summon.summoned"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
|
|
||||||
|
@ -30,21 +30,19 @@ public class SummonRankCommand extends Command {
|
|||||||
if (habbo == gameClient.getHabbo())
|
if (habbo == gameClient.getHabbo())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() == gameClient.getHabbo().getHabboInfo().getCurrentRoom())
|
if (habbo.getRoomUnit().getRoom() == gameClient.getHabbo().getRoomUnit().getRoom())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Room room = habbo.getHabboInfo().getCurrentRoom();
|
Room room = habbo.getRoomUnit().getRoom();
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
Emulator.getGameEnvironment().getRoomManager().logExit(habbo);
|
Emulator.getGameEnvironment().getRoomManager().logExit(habbo);
|
||||||
|
|
||||||
room.removeHabbo(habbo, true);
|
room.getRoomUnitManager().removeHabbo(habbo, true);
|
||||||
|
|
||||||
habbo.getHabboInfo().setCurrentRoom(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Emulator.getGameEnvironment().getRoomManager().enterRoom(habbo, gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), "", true);
|
Emulator.getGameEnvironment().getRoomManager().enterRoom(habbo, gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId(), "", true);
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new RoomForwardMessageComposer(gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId()));
|
habbo.getClient().sendResponse(new RoomForwardMessageComposer(gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class SuperPullCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]);
|
Habbo habbo = gameClient.getHabbo().getRoomUnit().getRoom().getHabbo(params[1]);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_pull.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_pull.not_found"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
@ -29,15 +29,15 @@ public class SuperPullCommand extends Command {
|
|||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_pull.pull_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentLocation(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
RoomTile tile = gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getTileInFront(gameClient.getHabbo().getRoomUnit().getCurrentPosition(), gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue());
|
||||||
|
|
||||||
if (tile != null && tile.isWalkable()) {
|
if (tile != null && tile.isWalkable()) {
|
||||||
if (tile == gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getDoorTile()) {
|
if (tile == gameClient.getHabbo().getRoomUnit().getRoom().getLayout().getDoorTile()) {
|
||||||
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_pull.invalid"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_pull.invalid"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
habbo.getRoomUnit().setGoalLocation(tile);
|
habbo.getRoomUnit().setGoalLocation(tile);
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(replaceUser(getTextsValue("commands.succes.cmd_pull.pull"), params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? getTextsValue("gender.him") : getTextsValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new ChatMessageComposer(new RoomChatMessage(replaceUser(getTextsValue("commands.succes.cmd_pull.pull"), params[1]).replace("%gender_name%", (gameClient.getHabbo().getHabboInfo().getGender().equals(HabboGender.M) ? getTextsValue("gender.him") : getTextsValue("gender.her"))), gameClient.getHabbo(), gameClient.getHabbo(), RoomChatMessageBubbles.NORMAL)).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -16,12 +16,12 @@ public class TeleportCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gameClient.getHabbo().getRoomUnit().isCmdTeleport()) {
|
if (gameClient.getHabbo().getRoomUnit().isCmdTeleportEnabled()) {
|
||||||
gameClient.getHabbo().getRoomUnit().setCmdTeleport(false);
|
gameClient.getHabbo().getRoomUnit().setCmdTeleportEnabled(false);
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.disabled"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.disabled"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
gameClient.getHabbo().getRoomUnit().setCmdTeleport(true);
|
gameClient.getHabbo().getRoomUnit().setCmdTeleportEnabled(true);
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.enabled"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.enabled"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ import com.eu.habbo.core.RoomUserPetComposer;
|
|||||||
import com.eu.habbo.habbohotel.commands.Command;
|
import com.eu.habbo.habbohotel.commands.Command;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.pets.PetData;
|
import com.eu.habbo.habbohotel.pets.PetData;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnitType;
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnitType;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.MOTDNotificationComposer;
|
import com.eu.habbo.messages.outgoing.generic.alerts.MOTDNotificationComposer;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.UserRemoveMessageComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.UserRemoveMessageComposer;
|
||||||
|
|
||||||
@ -57,8 +57,8 @@ public class TransformCommand extends Command {
|
|||||||
gameClient.getHabbo().getHabboStats().getCache().put("pet_type", petData);
|
gameClient.getHabbo().getHabboStats().getCache().put("pet_type", petData);
|
||||||
gameClient.getHabbo().getHabboStats().getCache().put("pet_race", race);
|
gameClient.getHabbo().getHabboStats().getCache().put("pet_race", race);
|
||||||
gameClient.getHabbo().getHabboStats().getCache().put("pet_color", color);
|
gameClient.getHabbo().getHabboStats().getCache().put("pet_color", color);
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new UserRemoveMessageComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new UserRemoveMessageComposer(gameClient.getHabbo().getRoomUnit()).compose());
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomUserPetComposer(petData.getType(), race, color, gameClient.getHabbo()).compose());
|
gameClient.getHabbo().getRoomUnit().getRoom().sendComposer(new RoomUserPetComposer(petData.getType(), race, color, gameClient.getHabbo()).compose());
|
||||||
} else {
|
} else {
|
||||||
//Pet Not Found
|
//Pet Not Found
|
||||||
return true;
|
return true;
|
||||||
|
@ -13,9 +13,9 @@ public class UnloadRoomCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room != null && (room.isOwner(gameClient.getHabbo()) || (room.hasGuild() && room.getGuildRightLevel(gameClient.getHabbo()).equals(RoomRightLevels.GUILD_ADMIN))) || gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
if (room != null && (room.getRoomInfo().isRoomOwner(gameClient.getHabbo()) || (room.getRoomInfo().hasGuild() && room.getGuildRightLevel(gameClient.getHabbo()).equals(RoomRightLevels.GUILD_ADMIN))) || gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
||||||
room.dispose();
|
room.dispose();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,13 @@ public class UnmuteCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!habbo.getHabboStats().allowTalk() || (habbo.getHabboInfo().getCurrentRoom() != null && habbo.getHabboInfo().getCurrentRoom().isMuted(habbo))) {
|
if (!habbo.getHabboStats().allowTalk() || (habbo.getRoomUnit().getRoom() != null && habbo.getRoomUnit().getRoom().isMuted(habbo))) {
|
||||||
if (!habbo.getHabboStats().allowTalk()) {
|
if (!habbo.getHabboStats().allowTalk()) {
|
||||||
habbo.unMute();
|
habbo.unMute();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null && habbo.getHabboInfo().getCurrentRoom().isMuted(habbo)) {
|
if (habbo.getRoomUnit().getRoom() != null && habbo.getRoomUnit().getRoom().isMuted(habbo)) {
|
||||||
habbo.getHabboInfo().getCurrentRoom().muteHabbo(habbo, 1);
|
habbo.getRoomUnit().getRoom().muteHabbo(habbo, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_unmute"), params[1]), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.succes.cmd_unmute"), params[1]), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -19,7 +19,7 @@ public class UpdateItemsCommand extends Command {
|
|||||||
|
|
||||||
synchronized (Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
|
synchronized (Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
|
||||||
Emulator.getGameEnvironment().getRoomManager().getActiveRooms().stream()
|
Emulator.getGameEnvironment().getRoomManager().getActiveRooms().stream()
|
||||||
.filter(room -> room.isLoaded() && room.getUserCount() > 0 && room.getLayout() != null)
|
.filter(room -> room.isLoaded() && room.getRoomUnitManager().getRoomHabbosCount() > 0 && room.getLayout() != null)
|
||||||
.forEach(room -> room.sendComposer(new HeightMapComposer(room).compose()));
|
.forEach(room -> room.sendComposer(new HeightMapComposer(room).compose()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class UserInfoCommand extends Command {
|
|||||||
|
|
||||||
message.append(getTextsValue("seasonal.name." + iterator.key())).append(": ").append(iterator.value()).append("\r");
|
message.append(getTextsValue("seasonal.name." + iterator.key())).append(": ").append(iterator.value()).append("\r");
|
||||||
}
|
}
|
||||||
message.append("\r").append(onlineHabbo != null ? "<b>" + getTextsValue("command.cmd_userinfo.current_activity") + "</b>\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.room") + ": " + (onlineHabbo.getHabboInfo().getCurrentRoom() != null ? onlineHabbo.getHabboInfo().getCurrentRoom().getName() + "(" + onlineHabbo.getHabboInfo().getCurrentRoom().getId() + ")\r" : "-") : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.respect_left") + ": " + onlineHabbo.getHabboStats().getRespectPointsToGive() + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.pet_respect_left") + ": " + onlineHabbo.getHabboStats().getPetRespectPointsToGive() + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.allow_trade") + ": " + ((onlineHabbo.getHabboStats().allowTrade()) ? getTextsValue("generic.yes") : getTextsValue("generic.no")) + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.allow_follow") + ": " + ((onlineHabbo.getHabboStats().isBlockFollowing()) ? getTextsValue("generic.no") : getTextsValue("generic.yes")) + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.allow_friend_request") + ": " + ((onlineHabbo.getHabboStats().isBlockFriendRequests()) ? getTextsValue("generic.no") : getTextsValue("generic.yes")) + "\r" : "");
|
message.append("\r").append(onlineHabbo != null ? "<b>" + getTextsValue("command.cmd_userinfo.current_activity") + "</b>\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.room") + ": " + (onlineHabbo.getRoomUnit().getRoom() != null ? onlineHabbo.getRoomUnit().getRoom().getRoomInfo().getName() + "(" + onlineHabbo.getRoomUnit().getRoom().getRoomInfo().getId() + ")\r" : "-") : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.respect_left") + ": " + onlineHabbo.getHabboStats().getRespectPointsToGive() + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.pet_respect_left") + ": " + onlineHabbo.getHabboStats().getPetRespectPointsToGive() + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.allow_trade") + ": " + ((onlineHabbo.getHabboStats().allowTrade()) ? getTextsValue("generic.yes") : getTextsValue("generic.no")) + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.allow_follow") + ": " + ((onlineHabbo.getHabboStats().isBlockFollowing()) ? getTextsValue("generic.no") : getTextsValue("generic.yes")) + "\r" : "").append(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.allow_friend_request") + ": " + ((onlineHabbo.getHabboStats().isBlockFriendRequests()) ? getTextsValue("generic.no") : getTextsValue("generic.yes")) + "\r" : "");
|
||||||
|
|
||||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
List<Map.Entry<Integer, String>> nameChanges = Emulator.getGameEnvironment().getHabboManager().getNameChanges(habbo.getId(), 3);
|
List<Map.Entry<Integer, String>> nameChanges = Emulator.getGameEnvironment().getHabboManager().getNameChanges(habbo.getId(), 3);
|
||||||
|
@ -13,7 +13,7 @@ public class WordQuizCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (!gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasActiveWordQuiz()) {
|
if (!gameClient.getHabbo().getRoomUnit().getRoom().hasActiveWordQuiz()) {
|
||||||
if(params.length == 1) {
|
if(params.length == 1) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.description.cmd_word_quiz"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.description.cmd_word_quiz"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
@ -31,7 +31,7 @@ public class WordQuizCommand extends Command {
|
|||||||
question.append(" ").append(params[i]);
|
question.append(" ").append(params[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().startWordQuiz(question.toString(), duration * 1000);
|
gameClient.getHabbo().getRoomUnit().getRoom().startWordQuiz(question.toString(), duration * 1000);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class RoomBadgeCommand extends BaseBadgeCommand {
|
|||||||
if (!badge.isEmpty()) {
|
if (!badge.isEmpty()) {
|
||||||
ServerMessage message = createServerMessage(badge);
|
ServerMessage message = createServerMessage(badge);
|
||||||
|
|
||||||
gameClient.getHabbo().getRoomUnit().getRoom().getHabbos()
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos()
|
||||||
.forEach(habbo -> sendBadgeToClient(badge, message, habbo));
|
.forEach(habbo -> sendBadgeToClient(badge, message, habbo));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -41,8 +41,8 @@ public class TakeBadgeCommand extends BaseBadgeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new BadgesComposer(habbo));
|
habbo.getClient().sendResponse(new BadgesComposer(habbo));
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null) {
|
if (habbo.getRoomUnit().getRoom() != null) {
|
||||||
habbo.getHabboInfo().getCurrentRoom().sendComposer(new UserBadgesComposer(habbo.getInventory().getBadgesComponent().getWearingBadges(), habbo.getHabboInfo().getId()).compose());
|
habbo.getRoomUnit().getRoom().sendComposer(new UserBadgesComposer(habbo.getInventory().getBadgesComponent().getWearingBadges(), habbo.getHabboInfo().getId()).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class CreditsCommand extends BaseCreditsCommand {
|
|||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (credits != 0) {
|
if (credits != 0) {
|
||||||
habbo.giveCredits(credits);
|
habbo.giveCredits(credits);
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getRoomUnit().getRoom() != null)
|
||||||
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), params[2]), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), params[2]), RoomChatMessageBubbles.ALERT);
|
||||||
else
|
else
|
||||||
habbo.alert(replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), params[2]));
|
habbo.alert(replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), params[2]));
|
||||||
|
@ -32,7 +32,7 @@ public class MassCreditsCommand extends BaseCreditsCommand {
|
|||||||
habbo.giveCredits(amount);
|
habbo.giveCredits(amount);
|
||||||
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo));
|
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo));
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getRoomUnit().getRoom() != null)
|
||||||
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), amount + ""), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), amount + ""), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class RoomCreditsCommand extends BaseCreditsCommand {
|
|||||||
|
|
||||||
if (amount != 0) {
|
if (amount != 0) {
|
||||||
final String message = replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), amount + "");
|
final String message = replaceAmount(getTextsValue("commands.generic.cmd_credits.received"), amount + "");
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos().forEach(habbo -> {
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos().forEach(habbo -> {
|
||||||
habbo.giveCredits(amount);
|
habbo.giveCredits(amount);
|
||||||
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,7 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
|
|||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
import com.eu.habbo.messages.outgoing.inventory.FurniListInvalidateComposer;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -49,7 +49,7 @@ public abstract class BaseGiftCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void createGift(String finalMessage, Habbo habbo, String[] params) {
|
protected void createGift(String finalMessage, Habbo habbo, String[] params) {
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(0, getBaseItem(params), 0, 0, "");
|
RoomItem item = Emulator.getGameEnvironment().getItemManager().createItem(0, getBaseItem(params), 0, 0, "");
|
||||||
|
|
||||||
Item giftItem = Emulator.getGameEnvironment().getItemManager().getItem((Integer) Emulator.getGameEnvironment().getCatalogManager().giftFurnis.values().toArray()[Emulator.getRandom().nextInt(Emulator.getGameEnvironment().getCatalogManager().giftFurnis.size())]);
|
Item giftItem = Emulator.getGameEnvironment().getItemManager().getItem((Integer) Emulator.getGameEnvironment().getCatalogManager().giftFurnis.values().toArray()[Emulator.getRandom().nextInt(Emulator.getGameEnvironment().getCatalogManager().giftFurnis.size())]);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import com.eu.habbo.habbohotel.items.Item;
|
|||||||
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.HabboManager;
|
import com.eu.habbo.habbohotel.users.HabboManager;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
||||||
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
import com.eu.habbo.messages.outgoing.generic.alerts.NotificationDialogMessageComposer;
|
||||||
@ -55,7 +55,7 @@ public class GiftCommand extends BaseGiftCommand {
|
|||||||
|
|
||||||
String message = params.length > 3 ? IntStream.range(3, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining()) : "";
|
String message = params.length > 3 ? IntStream.range(3, params.length).mapToObj(i -> params[i] + " ").collect(Collectors.joining()) : "";
|
||||||
|
|
||||||
HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(0, baseItem, 0, 0, "");
|
RoomItem item = Emulator.getGameEnvironment().getItemManager().createItem(0, baseItem, 0, 0, "");
|
||||||
Item giftItem = Emulator.getGameEnvironment().getItemManager().getItem((Integer) Emulator.getGameEnvironment().getCatalogManager().giftFurnis.values().toArray()[Emulator.getRandom().nextInt(Emulator.getGameEnvironment().getCatalogManager().giftFurnis.size())]);
|
Item giftItem = Emulator.getGameEnvironment().getItemManager().getItem((Integer) Emulator.getGameEnvironment().getCatalogManager().giftFurnis.values().toArray()[Emulator.getRandom().nextInt(Emulator.getGameEnvironment().getCatalogManager().giftFurnis.size())]);
|
||||||
|
|
||||||
String extraData = "1\t" + item.getId() + "\t0\t0\t0\t" + message + "\t0\t0";
|
String extraData = "1\t" + item.getId() + "\t0\t0\t0\t" + message + "\t0\t0";
|
||||||
|
@ -17,7 +17,7 @@ public class RoomGiftCommand extends BaseGiftCommand {
|
|||||||
|
|
||||||
final String finalMessage = getFinalMessage(params);
|
final String finalMessage = getFinalMessage(params);
|
||||||
|
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos().forEach(habbo -> {
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos().forEach(habbo -> {
|
||||||
createGift(finalMessage, habbo, params);
|
createGift(finalMessage, habbo, params);
|
||||||
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_RECEIVED_ITEM));
|
habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_RECEIVED_ITEM));
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class MassPixelsCommand extends BasePixelsCommand {
|
|||||||
|
|
||||||
habbo.givePixels(amount);
|
habbo.givePixels(amount);
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getRoomUnit().getRoom() != null)
|
||||||
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), amount + ""), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), amount + ""), RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class PixelCommand extends BasePixelsCommand {
|
|||||||
try {
|
try {
|
||||||
if (Integer.parseInt(params[2]) != 0) {
|
if (Integer.parseInt(params[2]) != 0) {
|
||||||
habbo.givePixels(Integer.parseInt(params[2]));
|
habbo.givePixels(Integer.parseInt(params[2]));
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getRoomUnit().getRoom() != null)
|
||||||
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), params[2]), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), params[2]), RoomChatMessageBubbles.ALERT);
|
||||||
else
|
else
|
||||||
habbo.alert(replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), params[2]));
|
habbo.alert(replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), params[2]));
|
||||||
|
@ -22,7 +22,7 @@ public class RoomPixelsCommand extends BasePixelsCommand {
|
|||||||
|
|
||||||
if (amount != 0) {
|
if (amount != 0) {
|
||||||
final String message = replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), amount + "");
|
final String message = replaceAmount(getTextsValue("commands.generic.cmd_duckets.received"), amount + "");
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos().forEach(habbo -> {
|
gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos().forEach(habbo -> {
|
||||||
habbo.givePixels(amount);
|
habbo.givePixels(amount);
|
||||||
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
||||||
});
|
});
|
||||||
|
@ -58,7 +58,7 @@ public class MassPointsCommand extends BasePointsCommand {
|
|||||||
for (Habbo habbo : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().values()) {
|
for (Habbo habbo : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().values()) {
|
||||||
habbo.givePoints(type, amount);
|
habbo.givePoints(type, amount);
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getRoomUnit().getRoom() != null)
|
||||||
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
||||||
else
|
else
|
||||||
habbo.alert(message);
|
habbo.alert(message);
|
||||||
|
@ -48,7 +48,7 @@ public class PointsCommand extends BasePointsCommand {
|
|||||||
if (amount != 0) {
|
if (amount != 0) {
|
||||||
habbo.givePoints(type, amount);
|
habbo.givePoints(type, amount);
|
||||||
|
|
||||||
if (habbo.getHabboInfo().getCurrentRoom() != null)
|
if (habbo.getRoomUnit().getRoom() != null)
|
||||||
habbo.whisper(replaceAmountAndType(getTextsValue("commands.generic.cmd_points.received"), amount + "", getTextsValue("seasonal.name." + type)), RoomChatMessageBubbles.ALERT);
|
habbo.whisper(replaceAmountAndType(getTextsValue("commands.generic.cmd_points.received"), amount + "", getTextsValue("seasonal.name." + type)), RoomChatMessageBubbles.ALERT);
|
||||||
else
|
else
|
||||||
habbo.alert(replaceAmountAndType(getTextsValue("commands.generic.cmd_points.received"), amount + "", getTextsValue("seasonal.name." + type)));
|
habbo.alert(replaceAmountAndType(getTextsValue("commands.generic.cmd_points.received"), amount + "", getTextsValue("seasonal.name." + type)));
|
||||||
|
@ -55,7 +55,7 @@ public class RoomPointsCommand extends BasePointsCommand {
|
|||||||
if (amount != 0) {
|
if (amount != 0) {
|
||||||
final String message = replaceAmountAndType(getTextsValue("commands.generic.cmd_points.received"), amount + "", getTextsValue("seasonal.name." + type));
|
final String message = replaceAmountAndType(getTextsValue("commands.generic.cmd_points.received"), amount + "", getTextsValue("seasonal.name." + type));
|
||||||
|
|
||||||
for (Habbo habbo : gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbos()) {
|
for (Habbo habbo : gameClient.getHabbo().getRoomUnit().getRoom().getRoomUnitManager().getRoomHabbos()) {
|
||||||
habbo.givePoints(type, amount);
|
habbo.givePoints(type, amount);
|
||||||
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
habbo.whisper(message, RoomChatMessageBubbles.ALERT);
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredBlob;
|
|||||||
import com.eu.habbo.habbohotel.items.interactions.wired.triggers.WiredTriggerTeamLoses;
|
import com.eu.habbo.habbohotel.items.interactions.wired.triggers.WiredTriggerTeamLoses;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.wired.triggers.WiredTriggerTeamWins;
|
import com.eu.habbo.habbohotel.items.interactions.wired.triggers.WiredTriggerTeamWins;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||||
import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreDataEntry;
|
import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreDataEntry;
|
||||||
import com.eu.habbo.messages.outgoing.guides.YouArePlayingGameMessageComposer;
|
import com.eu.habbo.messages.outgoing.guides.YouArePlayingGameMessageComposer;
|
||||||
@ -120,7 +120,7 @@ public abstract class Game implements Runnable {
|
|||||||
Emulator.getPluginManager().fireEvent(gameStartedEvent);
|
Emulator.getPluginManager().fireEvent(gameStartedEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(WiredBlob.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(WiredBlob.class)) {
|
||||||
((WiredBlob) item).onGameStart(this.room);
|
((WiredBlob) item).onGameStart(this.room);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ public abstract class Game implements Runnable {
|
|||||||
|
|
||||||
int totalPointsGained = this.teams.values().stream().mapToInt(GameTeam::getTotalScore).sum();
|
int totalPointsGained = this.teams.values().stream().mapToInt(GameTeam::getTotalScore).sum();
|
||||||
|
|
||||||
Habbo roomOwner = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.room.getOwnerId());
|
Habbo roomOwner = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.room.getRoomInfo().getOwnerInfo().getId());
|
||||||
if (roomOwner != null) {
|
if (roomOwner != null) {
|
||||||
AchievementManager.progressAchievement(roomOwner, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GameAuthorExperience"), totalPointsGained);
|
AchievementManager.progressAchievement(roomOwner, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GameAuthorExperience"), totalPointsGained);
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ public abstract class Game implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (winningTeam.getMembers().size() > 0) {
|
if (winningTeam.getMembers().size() > 0) {
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
||||||
Emulator.getGameEnvironment().getItemManager().getHighscoreManager().addHighscoreData(new WiredHighscoreDataEntry(item.getId(), winningTeam.getMembers().stream().map(m -> m.getHabbo().getHabboInfo().getId()).collect(Collectors.toList()), winningTeam.getTotalScore(), true, Emulator.getIntUnixTimestamp()));
|
Emulator.getGameEnvironment().getItemManager().getHighscoreManager().addHighscoreData(new WiredHighscoreDataEntry(item.getId(), winningTeam.getMembers().stream().map(m -> m.getHabbo().getHabboInfo().getId()).collect(Collectors.toList()), winningTeam.getTotalScore(), true, Emulator.getIntUnixTimestamp()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,19 +174,19 @@ public abstract class Game implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (team.getMembers().size() > 0 && team.getTotalScore() > 0) {
|
if (team.getMembers().size() > 0 && team.getTotalScore() > 0) {
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
||||||
Emulator.getGameEnvironment().getItemManager().getHighscoreManager().addHighscoreData(new WiredHighscoreDataEntry(item.getId(), team.getMembers().stream().map(m -> m.getHabbo().getHabboInfo().getId()).collect(Collectors.toList()), team.getTotalScore(), false, Emulator.getIntUnixTimestamp()));
|
Emulator.getGameEnvironment().getItemManager().getHighscoreManager().addHighscoreData(new WiredHighscoreDataEntry(item.getId(), team.getMembers().stream().map(m -> m.getHabbo().getHabboInfo().getId()).collect(Collectors.toList()), team.getTotalScore(), false, Emulator.getIntUnixTimestamp()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionWiredHighscore.class)) {
|
||||||
((InteractionWiredHighscore) item).reloadData();
|
((InteractionWiredHighscore) item).reloadData();
|
||||||
this.room.updateItem(item);
|
this.room.updateItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(WiredBlob.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(WiredBlob.class)) {
|
||||||
((WiredBlob) item).onGameEnd(this.room);
|
((WiredBlob) item).onGameEnd(this.room);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ public abstract class Game implements Runnable {
|
|||||||
this.state = GameState.IDLE;
|
this.state = GameState.IDLE;
|
||||||
|
|
||||||
boolean gamesActive = false;
|
boolean gamesActive = false;
|
||||||
for (HabboItem timer : room.getFloorItems()) {
|
for (RoomItem timer : room.getFloorItems()) {
|
||||||
if (timer instanceof InteractionGameTimer) {
|
if (timer instanceof InteractionGameTimer) {
|
||||||
if (((InteractionGameTimer) timer).isRunning())
|
if (((InteractionGameTimer) timer).isRunning())
|
||||||
gamesActive = true;
|
gamesActive = true;
|
||||||
|
@ -24,7 +24,7 @@ public class GamePlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void addScore(int amount, boolean isWired) {
|
public synchronized void addScore(int amount, boolean isWired) {
|
||||||
if (habbo.getHabboInfo().getGamePlayer() != null && this.habbo.getHabboInfo().getCurrentGame() != null && this.habbo.getHabboInfo().getCurrentRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo) != null) {
|
if (habbo.getHabboInfo().getGamePlayer() != null && this.habbo.getHabboInfo().getCurrentGame() != null && this.habbo.getRoomUnit().getRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo) != null) {
|
||||||
this.score += amount;
|
this.score += amount;
|
||||||
|
|
||||||
if (this.score < 0) this.score = 0;
|
if (this.score < 0) this.score = 0;
|
||||||
@ -33,7 +33,7 @@ public class GamePlayer {
|
|||||||
this.wiredScore += amount;
|
this.wiredScore += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
WiredHandler.handle(WiredTriggerType.SCORE_ACHIEVED, this.habbo.getRoomUnit(), this.habbo.getHabboInfo().getCurrentRoom(), new Object[]{this.habbo.getHabboInfo().getCurrentRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo).getTotalScore(), amount});
|
WiredHandler.handle(WiredTriggerType.SCORE_ACHIEVED, this.habbo.getRoomUnit(), this.habbo.getRoomUnit().getRoom(), new Object[]{this.habbo.getRoomUnit().getRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo).getTotalScore(), amount});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import com.eu.habbo.habbohotel.rooms.Room;
|
|||||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUserAction;
|
import com.eu.habbo.habbohotel.rooms.RoomUserAction;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.ExpressionMessageComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.ExpressionMessageComposer;
|
||||||
import com.eu.habbo.threading.runnables.BattleBanzaiTilesFlicker;
|
import com.eu.habbo.threading.runnables.BattleBanzaiTilesFlicker;
|
||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
@ -35,8 +35,8 @@ public class BattleBanzaiGame extends Game {
|
|||||||
public static final int POINTS_LOCK_TILE = Emulator.getConfig().getInt("hotel.banzai.points.tile.lock", 1);
|
public static final int POINTS_LOCK_TILE = Emulator.getConfig().getInt("hotel.banzai.points.tile.lock", 1);
|
||||||
|
|
||||||
private static final ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(Emulator.getConfig().getInt("hotel.banzai.fill.threads", 2));
|
private static final ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(Emulator.getConfig().getInt("hotel.banzai.fill.threads", 2));
|
||||||
private final THashMap<GameTeamColors, THashSet<HabboItem>> lockedTiles;
|
private final THashMap<GameTeamColors, THashSet<RoomItem>> lockedTiles;
|
||||||
private final THashMap<Integer, HabboItem> gameTiles;
|
private final THashMap<Integer, RoomItem> gameTiles;
|
||||||
private int tileCount;
|
private int tileCount;
|
||||||
private int countDown;
|
private int countDown;
|
||||||
private int countDown2;
|
private int countDown2;
|
||||||
@ -69,7 +69,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
||||||
item.setExtradata("1");
|
item.setExtradata("1");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
this.countDown--;
|
this.countDown--;
|
||||||
|
|
||||||
if (this.countDown == 0) {
|
if (this.countDown == 0) {
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
||||||
item.setExtradata("1");
|
item.setExtradata("1");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
if(this.countDown2 > 0) {
|
if(this.countDown2 > 0) {
|
||||||
@ -130,7 +130,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
|
|
||||||
int total = 0;
|
int total = 0;
|
||||||
synchronized (this.lockedTiles) {
|
synchronized (this.lockedTiles) {
|
||||||
for (Map.Entry<GameTeamColors, THashSet<HabboItem>> set : this.lockedTiles.entrySet()) {
|
for (Map.Entry<GameTeamColors, THashSet<RoomItem>> set : this.lockedTiles.entrySet()) {
|
||||||
total += set.getValue().size();
|
total += set.getValue().size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (highestScore != null) {
|
if (highestScore != null) {
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
||||||
item.setExtradata((highestScore.teamColor.type + 2) + "");
|
item.setExtradata((highestScore.teamColor.type + 2) + "");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getItemsOfType(InteractionBattleBanzaiSphere.class)) {
|
||||||
item.setExtradata((6 + winningTeam.teamColor.type) + "");
|
item.setExtradata((6 + winningTeam.teamColor.type) + "");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
|
|
||||||
this.refreshGates();
|
this.refreshGates();
|
||||||
|
|
||||||
for (HabboItem tile : this.gameTiles.values()) {
|
for (RoomItem tile : this.gameTiles.values()) {
|
||||||
if (tile.getExtradata().equals("1")) {
|
if (tile.getExtradata().equals("1")) {
|
||||||
tile.setExtradata("0");
|
tile.setExtradata("0");
|
||||||
this.room.updateItem(tile);
|
this.room.updateItem(tile);
|
||||||
@ -226,7 +226,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
|
|
||||||
private synchronized void resetMap() {
|
private synchronized void resetMap() {
|
||||||
this.tileCount = 0;
|
this.tileCount = 0;
|
||||||
for (HabboItem item : this.room.getFloorItems()) {
|
for (RoomItem item : this.room.getFloorItems()) {
|
||||||
if (item instanceof InteractionBattleBanzaiTile) {
|
if (item instanceof InteractionBattleBanzaiTile) {
|
||||||
item.setExtradata("1");
|
item.setExtradata("1");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
@ -242,11 +242,11 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void tileLocked(GameTeamColors teamColor, HabboItem item, Habbo habbo) {
|
public void tileLocked(GameTeamColors teamColor, RoomItem item, Habbo habbo) {
|
||||||
this.tileLocked(teamColor, item, habbo, false);
|
this.tileLocked(teamColor, item, habbo, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tileLocked(GameTeamColors teamColor, HabboItem item, Habbo habbo, boolean doNotCheckFill) {
|
public void tileLocked(GameTeamColors teamColor, RoomItem item, Habbo habbo, boolean doNotCheckFill) {
|
||||||
synchronized (this.lockedTiles) {
|
synchronized (this.lockedTiles) {
|
||||||
if (item instanceof InteractionBattleBanzaiTile) {
|
if (item instanceof InteractionBattleBanzaiTile) {
|
||||||
if (!this.lockedTiles.containsKey(teamColor)) {
|
if (!this.lockedTiles.containsKey(teamColor)) {
|
||||||
@ -266,7 +266,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
final int y = item.getY();
|
final int y = item.getY();
|
||||||
|
|
||||||
final List<List<RoomTile>> filledAreas = new ArrayList<>();
|
final List<List<RoomTile>> filledAreas = new ArrayList<>();
|
||||||
final THashSet<HabboItem> lockedTiles = new THashSet<>(this.lockedTiles.get(teamColor));
|
final THashSet<RoomItem> lockedTiles = new THashSet<>(this.lockedTiles.get(teamColor));
|
||||||
|
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
filledAreas.add(this.floodFill(x, y - 1, lockedTiles, new ArrayList<>(), teamColor));
|
filledAreas.add(this.floodFill(x, y - 1, lockedTiles, new ArrayList<>(), teamColor));
|
||||||
@ -278,7 +278,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
|
|
||||||
if (largestAreaOfAll.isPresent()) {
|
if (largestAreaOfAll.isPresent()) {
|
||||||
for (RoomTile tile : largestAreaOfAll.get()) {
|
for (RoomTile tile : largestAreaOfAll.get()) {
|
||||||
Optional<HabboItem> tileItem = this.gameTiles.values().stream().filter(i -> i.getX() == tile.getX() && i.getY() == tile.getY() && i instanceof InteractionBattleBanzaiTile).findAny();
|
Optional<RoomItem> tileItem = this.gameTiles.values().stream().filter(i -> i.getX() == tile.getX() && i.getY() == tile.getY() && i instanceof InteractionBattleBanzaiTile).findAny();
|
||||||
|
|
||||||
tileItem.ifPresent(habboItem -> {
|
tileItem.ifPresent(habboItem -> {
|
||||||
this.tileLocked(teamColor, habboItem, habbo, true);
|
this.tileLocked(teamColor, habboItem, habbo, true);
|
||||||
@ -297,7 +297,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<RoomTile> floodFill(int x, int y, THashSet<HabboItem> lockedTiles, List<RoomTile> stack, GameTeamColors color) {
|
private List<RoomTile> floodFill(int x, int y, THashSet<RoomItem> lockedTiles, List<RoomTile> stack, GameTeamColors color) {
|
||||||
if (this.isOutOfBounds(x, y) || this.isForeignLockedTile(x, y, color)) return null;
|
if (this.isOutOfBounds(x, y) || this.isForeignLockedTile(x, y, color)) return null;
|
||||||
|
|
||||||
RoomTile tile = this.room.getLayout().getTile((short) x, (short) y);
|
RoomTile tile = this.room.getLayout().getTile((short) x, (short) y);
|
||||||
@ -320,8 +320,8 @@ public class BattleBanzaiGame extends Game {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasLockedTileAtCoordinates(int x, int y, THashSet<HabboItem> lockedTiles) {
|
private boolean hasLockedTileAtCoordinates(int x, int y, THashSet<RoomItem> lockedTiles) {
|
||||||
for (HabboItem item : lockedTiles) {
|
for (RoomItem item : lockedTiles) {
|
||||||
if (item.getX() == x && item.getY() == y) return true;
|
if (item.getX() == x && item.getY() == y) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +329,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isOutOfBounds(int x, int y) {
|
private boolean isOutOfBounds(int x, int y) {
|
||||||
for (HabboItem item : this.gameTiles.values()) {
|
for (RoomItem item : this.gameTiles.values()) {
|
||||||
if (item.getX() == x && item.getY() == y) return false;
|
if (item.getX() == x && item.getY() == y) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,10 +337,10 @@ public class BattleBanzaiGame extends Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isForeignLockedTile(int x, int y, GameTeamColors color) {
|
private boolean isForeignLockedTile(int x, int y, GameTeamColors color) {
|
||||||
for (HashMap.Entry<GameTeamColors, THashSet<HabboItem>> lockedTilesForColor : this.lockedTiles.entrySet()) {
|
for (HashMap.Entry<GameTeamColors, THashSet<RoomItem>> lockedTilesForColor : this.lockedTiles.entrySet()) {
|
||||||
if (lockedTilesForColor.getKey() == color) continue;
|
if (lockedTilesForColor.getKey() == color) continue;
|
||||||
|
|
||||||
for (HabboItem item : lockedTilesForColor.getValue()) {
|
for (RoomItem item : lockedTilesForColor.getValue()) {
|
||||||
if (item.getX() == x && item.getY() == y) return true;
|
if (item.getX() == x && item.getY() == y) return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,7 +383,7 @@ public class BattleBanzaiGame extends Game {
|
|||||||
private void refreshGates() {
|
private void refreshGates() {
|
||||||
Collection<InteractionBattleBanzaiGate> gates = this.room.getRoomSpecialTypes().getBattleBanzaiGates().values();
|
Collection<InteractionBattleBanzaiGate> gates = this.room.getRoomSpecialTypes().getBattleBanzaiGates().values();
|
||||||
THashSet<RoomTile> tilesToUpdate = new THashSet<>(gates.size());
|
THashSet<RoomTile> tilesToUpdate = new THashSet<>(gates.size());
|
||||||
for (HabboItem item : gates) {
|
for (RoomItem item : gates) {
|
||||||
tilesToUpdate.add(this.room.getLayout().getTile(item.getX(), item.getY()));
|
tilesToUpdate.add(this.room.getLayout().getTile(item.getX(), item.getY()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,10 +7,11 @@ import com.eu.habbo.habbohotel.games.GameTeamColors;
|
|||||||
import com.eu.habbo.habbohotel.games.freeze.FreezeGame;
|
import com.eu.habbo.habbohotel.games.freeze.FreezeGame;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameGate;
|
import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameGate;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.types.RoomHabbo;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
|
|
||||||
public class BattleBanzaiGameTeam extends GameTeam {
|
public class BattleBanzaiGameTeam extends GameTeam {
|
||||||
public BattleBanzaiGameTeam(GameTeamColors teamColor) {
|
public BattleBanzaiGameTeam(GameTeamColors teamColor) {
|
||||||
@ -20,25 +21,27 @@ public class BattleBanzaiGameTeam extends GameTeam {
|
|||||||
@Override
|
@Override
|
||||||
public void addMember(GamePlayer gamePlayer) {
|
public void addMember(GamePlayer gamePlayer) {
|
||||||
super.addMember(gamePlayer);
|
super.addMember(gamePlayer);
|
||||||
RoomUnit roomUnit = gamePlayer.getHabbo().getRoomUnit();
|
RoomHabbo roomHabbo = gamePlayer.getHabbo().getRoomUnit();
|
||||||
if (roomUnit.getEffectId() > 0)
|
if (roomHabbo.getEffectId() > 0) {
|
||||||
roomUnit.setPreviousEffectId(roomUnit.getEffectId(), roomUnit.getPreviousEffectEndTimestamp());
|
roomHabbo.setPreviousEffectId(roomHabbo.getEffectId());
|
||||||
|
roomHabbo.setPreviousEffectEndTimestamp(roomHabbo.getPreviousEffectEndTimestamp());
|
||||||
|
}
|
||||||
|
|
||||||
gamePlayer.getHabbo().getHabboInfo().getCurrentRoom().giveEffect(gamePlayer.getHabbo(), BattleBanzaiGame.effectId + this.teamColor.type, -1, true);
|
gamePlayer.getHabbo().getRoomUnit().getRoom().giveEffect(gamePlayer.getHabbo(), BattleBanzaiGame.effectId + this.teamColor.type, -1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeMember(GamePlayer gamePlayer) {
|
public void removeMember(GamePlayer gamePlayer) {
|
||||||
super.removeMember(gamePlayer);
|
super.removeMember(gamePlayer);
|
||||||
if (gamePlayer == null || gamePlayer.getHabbo() == null || gamePlayer.getHabbo().getHabboInfo().getCurrentRoom() == null)
|
if (gamePlayer == null || gamePlayer.getHabbo() == null || gamePlayer.getHabbo().getRoomUnit().getRoom() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Habbo habbo = gamePlayer.getHabbo();
|
Habbo habbo = gamePlayer.getHabbo();
|
||||||
Game game = habbo.getHabboInfo().getCurrentRoom().getGame(FreezeGame.class);
|
Game game = habbo.getRoomUnit().getRoom().getGame(FreezeGame.class);
|
||||||
RoomUnit roomUnit = habbo.getRoomUnit();
|
RoomUnit roomUnit = habbo.getRoomUnit();
|
||||||
Room room = roomUnit.getRoom();
|
Room room = roomUnit.getRoom();
|
||||||
if(room == null) return;
|
if(room == null) return;
|
||||||
HabboItem topItem = room.getTopItemAt(roomUnit.getCurrentLocation().getX(), roomUnit.getCurrentLocation().getY());
|
RoomItem topItem = room.getTopItemAt(roomUnit.getCurrentPosition().getX(), roomUnit.getCurrentPosition().getY());
|
||||||
int nextEffectM = 0;
|
int nextEffectM = 0;
|
||||||
int nextEffectF = 0;
|
int nextEffectF = 0;
|
||||||
int nextEffectDuration = -1;
|
int nextEffectDuration = -1;
|
||||||
|
@ -6,8 +6,8 @@ import com.eu.habbo.habbohotel.games.Game;
|
|||||||
import com.eu.habbo.habbohotel.games.GameTeamColors;
|
import com.eu.habbo.habbohotel.games.GameTeamColors;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.games.football.scoreboards.InteractionFootballScoreboard;
|
import com.eu.habbo.habbohotel.items.interactions.games.football.scoreboards.InteractionFootballScoreboard;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUserAction;
|
import com.eu.habbo.habbohotel.rooms.RoomUserAction;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.ExpressionMessageComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.ExpressionMessageComposer;
|
||||||
|
|
||||||
@ -38,8 +38,8 @@ public class FootballGame extends Game {
|
|||||||
Habbo habbo = this.room.getHabbo(kicker);
|
Habbo habbo = this.room.getHabbo(kicker);
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("FootballGoalScored"));
|
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement("FootballGoalScored"));
|
||||||
if (habbo.getHabboInfo().getId() != this.room.getOwnerId()) {
|
if (habbo.getHabboInfo().getId() != this.room.getRoomInfo().getOwnerInfo().getId()) {
|
||||||
AchievementManager.progressAchievement(this.room.getOwnerId(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("FootballGoalScoredInRoom"));
|
AchievementManager.progressAchievement(this.room.getRoomInfo().getOwnerInfo().getId(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("FootballGoalScoredInRoom"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ import com.eu.habbo.habbohotel.rooms.Room;
|
|||||||
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUserAction;
|
import com.eu.habbo.habbohotel.rooms.RoomUserAction;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
import com.eu.habbo.messages.outgoing.rooms.users.ExpressionMessageComposer;
|
import com.eu.habbo.messages.outgoing.rooms.users.ExpressionMessageComposer;
|
||||||
import com.eu.habbo.plugin.EventHandler;
|
import com.eu.habbo.plugin.EventHandler;
|
||||||
import com.eu.habbo.plugin.events.emulator.EmulatorConfigUpdatedEvent;
|
import com.eu.habbo.plugin.events.emulator.EmulatorConfigUpdatedEvent;
|
||||||
@ -78,7 +78,7 @@ public class FreezeGame extends Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized void resetMap() {
|
synchronized void resetMap() {
|
||||||
for (HabboItem item : this.room.getFloorItems()) {
|
for (RoomItem item : this.room.getFloorItems()) {
|
||||||
if (item instanceof InteractionFreezeBlock || item instanceof InteractionFreezeScoreboard) {
|
if (item instanceof InteractionFreezeBlock || item instanceof InteractionFreezeScoreboard) {
|
||||||
item.setExtradata("0");
|
item.setExtradata("0");
|
||||||
this.room.updateItemState(item);
|
this.room.updateItemState(item);
|
||||||
@ -93,7 +93,7 @@ public class FreezeGame extends Game {
|
|||||||
if (!item.getExtradata().equalsIgnoreCase("0") && !item.getExtradata().isEmpty())
|
if (!item.getExtradata().equalsIgnoreCase("0") && !item.getExtradata().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (RoomLayout.tilesAdjecent(habbo.getRoomUnit().getCurrentLocation(), this.room.getLayout().getTile(item.getX(), item.getY()))) {
|
if (RoomLayout.tilesAdjecent(habbo.getRoomUnit().getCurrentPosition(), this.room.getLayout().getTile(item.getX(), item.getY()))) {
|
||||||
if (((FreezeGamePlayer) habbo.getHabboInfo().getGamePlayer()).canThrowSnowball()) {
|
if (((FreezeGamePlayer) habbo.getHabboInfo().getGamePlayer()).canThrowSnowball()) {
|
||||||
Emulator.getThreading().run(new FreezeThrowSnowball(habbo, item, this.room));
|
Emulator.getThreading().run(new FreezeThrowSnowball(habbo, item, this.room));
|
||||||
}
|
}
|
||||||
@ -189,11 +189,11 @@ public class FreezeGame extends Game {
|
|||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
if (this.room.getRoomSpecialTypes().hasFreezeExitTile()) {
|
if (this.room.getRoomSpecialTypes().hasFreezeExitTile()) {
|
||||||
for (Habbo habbo : this.room.getHabbos()) {
|
for (Habbo habbo : this.room.getRoomUnitManager().getRoomHabbos()) {
|
||||||
if (this.getTeamForHabbo(habbo) == null) {
|
if (this.getTeamForHabbo(habbo) == null) {
|
||||||
for (HabboItem item : this.room.getItemsAt(habbo.getRoomUnit().getCurrentLocation())) {
|
for (RoomItem item : this.room.getItemsAt(habbo.getRoomUnit().getCurrentPosition())) {
|
||||||
if (item instanceof InteractionFreezeTile) {
|
if (item instanceof InteractionFreezeTile) {
|
||||||
HabboItem exitTile = this.room.getRoomSpecialTypes().getRandomFreezeExitTile();
|
RoomItem exitTile = this.room.getRoomSpecialTypes().getRandomFreezeExitTile();
|
||||||
WiredEffectTeleport.teleportUnitToTile(habbo.getRoomUnit(), this.room.getLayout().getTile(exitTile.getX(), exitTile.getY()));
|
WiredEffectTeleport.teleportUnitToTile(habbo.getRoomUnit(), this.room.getLayout().getTile(exitTile.getX(), exitTile.getY()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ public class FreezeGame extends Game {
|
|||||||
|
|
||||||
private void refreshGates() {
|
private void refreshGates() {
|
||||||
THashSet<RoomTile> tilesToUpdate = new THashSet<>();
|
THashSet<RoomTile> tilesToUpdate = new THashSet<>();
|
||||||
for (HabboItem item : this.room.getRoomSpecialTypes().getFreezeGates().values()) {
|
for (RoomItem item : this.room.getRoomSpecialTypes().getFreezeGates().values()) {
|
||||||
tilesToUpdate.add(this.room.getLayout().getTile(item.getX(), item.getY()));
|
tilesToUpdate.add(this.room.getLayout().getTile(item.getX(), item.getY()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class FreezeGamePlayer extends GamePlayer {
|
|||||||
public void addLife() {
|
public void addLife() {
|
||||||
if (this.lives < FreezeGame.MAX_LIVES) {
|
if (this.lives < FreezeGame.MAX_LIVES) {
|
||||||
this.lives++;
|
this.lives++;
|
||||||
super.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new GamePlayerValueMessageComposer(this).compose());
|
super.getHabbo().getRoomUnit().getRoom().sendComposer(new GamePlayerValueMessageComposer(this).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,13 +61,13 @@ public class FreezeGamePlayer extends GamePlayer {
|
|||||||
if (this.lives == 0) {
|
if (this.lives == 0) {
|
||||||
this.dead = true;
|
this.dead = true;
|
||||||
|
|
||||||
FreezeGame game = (FreezeGame) super.getHabbo().getHabboInfo().getCurrentRoom().getGame(FreezeGame.class);
|
FreezeGame game = (FreezeGame) super.getHabbo().getRoomUnit().getRoom().getGame(FreezeGame.class);
|
||||||
|
|
||||||
if (game != null) {
|
if (game != null) {
|
||||||
game.playerDies(this);
|
game.playerDies(this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new GamePlayerValueMessageComposer(this).compose());
|
super.getHabbo().getRoomUnit().getRoom().sendComposer(new GamePlayerValueMessageComposer(this).compose());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,6 +208,6 @@ public class FreezeGamePlayer extends GamePlayer {
|
|||||||
if (this.dead)
|
if (this.dead)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
super.getHabbo().getHabboInfo().getCurrentRoom().giveEffect(super.getHabbo(), this.correctEffectId(), -1, true);
|
super.getHabbo().getRoomUnit().getRoom().giveEffect(super.getHabbo(), this.correctEffectId(), -1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,11 @@ import com.eu.habbo.habbohotel.games.GameTeam;
|
|||||||
import com.eu.habbo.habbohotel.games.GameTeamColors;
|
import com.eu.habbo.habbohotel.games.GameTeamColors;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameGate;
|
import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameGate;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.types.RoomHabbo;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboGender;
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
|
||||||
|
|
||||||
public class FreezeGameTeam extends GameTeam {
|
public class FreezeGameTeam extends GameTeam {
|
||||||
public FreezeGameTeam(GameTeamColors teamColor) {
|
public FreezeGameTeam(GameTeamColors teamColor) {
|
||||||
@ -19,16 +20,16 @@ public class FreezeGameTeam extends GameTeam {
|
|||||||
@Override
|
@Override
|
||||||
public void removeMember(GamePlayer gamePlayer) {
|
public void removeMember(GamePlayer gamePlayer) {
|
||||||
super.removeMember(gamePlayer);
|
super.removeMember(gamePlayer);
|
||||||
if (gamePlayer == null || gamePlayer.getHabbo() == null || gamePlayer.getHabbo().getHabboInfo().getCurrentRoom() == null)
|
if (gamePlayer == null || gamePlayer.getHabbo() == null || gamePlayer.getHabbo().getRoomUnit().getRoom() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Habbo habbo = gamePlayer.getHabbo();
|
Habbo habbo = gamePlayer.getHabbo();
|
||||||
Game game = habbo.getHabboInfo().getCurrentRoom().getGame(FreezeGame.class);
|
Game game = habbo.getRoomUnit().getRoom().getGame(FreezeGame.class);
|
||||||
RoomUnit roomUnit = habbo.getRoomUnit();
|
RoomUnit roomUnit = habbo.getRoomUnit();
|
||||||
Room room = roomUnit.getRoom();
|
Room room = roomUnit.getRoom();
|
||||||
if(room == null) return;
|
if(room == null) return;
|
||||||
|
|
||||||
HabboItem topItem = room.getTopItemAt(roomUnit.getCurrentLocation().getX(), roomUnit.getCurrentLocation().getY());
|
RoomItem topItem = room.getTopItemAt(roomUnit.getCurrentPosition().getX(), roomUnit.getCurrentPosition().getY());
|
||||||
int nextEffectM = 0;
|
int nextEffectM = 0;
|
||||||
int nextEffectF = 0;
|
int nextEffectF = 0;
|
||||||
int nextEffectDuration = -1;
|
int nextEffectDuration = -1;
|
||||||
@ -64,9 +65,9 @@ public class FreezeGameTeam extends GameTeam {
|
|||||||
public void addMember(GamePlayer gamePlayer) {
|
public void addMember(GamePlayer gamePlayer) {
|
||||||
super.addMember(gamePlayer);
|
super.addMember(gamePlayer);
|
||||||
|
|
||||||
RoomUnit roomUnit = gamePlayer.getHabbo().getRoomUnit();
|
RoomHabbo roomHabbo = gamePlayer.getHabbo().getRoomUnit();
|
||||||
if (roomUnit.getEffectId() > 0)
|
if (roomHabbo.getEffectId() > 0)
|
||||||
roomUnit.setPreviousEffectId(roomUnit.getEffectId(), roomUnit.getPreviousEffectEndTimestamp());
|
roomHabbo.setPreviousEffectId(roomHabbo.getEffectId(), roomHabbo.getPreviousEffectEndTimestamp());
|
||||||
gamePlayer.getHabbo().getHabboInfo().getCurrentRoom().giveEffect(gamePlayer.getHabbo(), FreezeGame.effectId + this.teamColor.type, -1, true);
|
gamePlayer.getHabbo().getRoomUnit().getRoom().giveEffect(gamePlayer.getHabbo(), FreezeGame.effectId + this.teamColor.type, -1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user