package net.cobem.grizzly.habbohotel.misc.commands;

import net.cobem.grizzly.Grizzly;
import net.cobem.grizzly.habbohotel.misc.ChatCommand;
import net.cobem.grizzly.habbohotel.rooms.robots.Robot;
import net.cobem.grizzly.habbohotel.sessions.Session;

import java.util.Random;

public class CreateBot implements ChatCommand {

    @Override
    public int rank() {
        return 5;
    }

    @Override
    public void execute(Session session, String[] args) {
        //if (Integer.(Arguments[0])
        int ID = (new Random().nextInt(9999 - 9000) + 9000); //Make sure the ID's never come in contact with
        String Name = Grizzly.getHabboHotel().generateName();
        String Motto = Name + "; Owned by " + session.getHabbo().getUsername();
        String Look = Grizzly.getHabboHotel().generateLook();

        Robot Bot = new Robot(session, ID, Name, Motto, Look, session.getActor().CurrentRoom);

        Bot.X = session.getActor().CurrentRoom.getModel().DoorX;
        Bot.Y = session.getActor().CurrentRoom.getModel().DoorY;
        Bot.Rotation = session.getActor().CurrentRoom.getModel().DoorRot;

        session.getActor().CurrentRoom.generateRobot(Bot);

        session.getActor().say("Generates the bot " + Name, false);
    }

}
