Arcturus-Community/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotPlaceEvent.java

27 lines
892 B
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.messages.incoming.rooms.bots;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.messages.incoming.MessageHandler;
2019-05-26 20:14:53 +02:00
public class BotPlaceEvent extends MessageHandler {
2018-07-06 15:30:00 +02:00
@Override
2019-05-26 20:14:53 +02:00
public void handle() throws Exception {
2018-07-06 15:30:00 +02:00
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
2019-05-26 20:14:53 +02:00
if (room == null)
2018-07-06 15:30:00 +02:00
return;
Bot bot = this.client.getHabbo().getInventory().getBotsComponent().getBot(this.packet.readInt());
2019-05-26 20:14:53 +02:00
if (bot == null)
2018-07-06 15:30:00 +02:00
return;
int x = this.packet.readInt();
int y = this.packet.readInt();
Emulator.getGameEnvironment().getBotManager().placeBot(bot, this.client.getHabbo(), this.client.getHabbo().getHabboInfo().getCurrentRoom(), room.getLayout().getTile((short) x, (short) y));
}
}