[swift command] bite user

Results 1 to 3 of 3
  1. #1
    DO YOU HAVE THE POWER? Power is offline
    MemberRank
    Aug 2012 Join Date
    Haverhill, SuffLocation
    248Posts

    [swift command] bite user

    hello rangezone ive codeed a zombie game

    and one off the commands is bite for the zombie

    PHP Code:
    internal void bite()
            {
                
    Room room ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().CurrentRoomId);
                
    Room roomowner ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().CurrentRoomId);
                
    RoomUser roomuser room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
                
    GameClient clientByUsername null;
                
    clientByUsername ButterflyEnvironment.GetGame().GetClientManager().GetClientByUsername(this.Params[1]);


                if (
    Session.GetHabbo().Look == "lg-3058-110.hd-3102-26.he-3239-62.ch-3203-92.cc-3007-62-62")
                    {
                        
    RoomUser roomuserTarget room.GetRoomUserManager().GetRoomUserByHabbo(Params[1]);
                        if (
    roomuserTarget == null)
                            return;

                        
    Point squareInfront CoordinationUtil.GetPointInFront(roomuser.Coordinateroomuser.RotBody);
                        List<
    RoomUserusers room.GetGameMap().GetRoomUsers(squareInfront);

                        
    Point squareInFrontOfUserInFront CoordinationUtil.GetPointInFront(squareInfrontroomuser.RotBody);
                        if (
    room.GetGameMap().CanWalk(squareInFrontOfUserInFront.XsquareInFrontOfUserInFront.Yfalse) == false)
                        {
                            
    Session.SendNotif("You can only bite people in front off you!");
                            return;
                        }

                        foreach (
    RoomUser user in users)
                        {
                            
    clientByUsername.GetHabbo().Look "lg-3058-110.hd-3102-26.he-3239-62.ch-3203-92.cc-3007-62-62";
                            
    clientByUsername.GetMessageHandler().GetResponse().Init(Outgoing.UpdateUserInformation);
                            
    clientByUsername.GetMessageHandler().GetResponse().AppendInt32(-1);
                            
    clientByUsername.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Look);
                            
    clientByUsername.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Gender.ToLower());
                            
    clientByUsername.GetMessageHandler().GetResponse().AppendString(Session.GetHabbo().Motto);
                            
    clientByUsername.GetMessageHandler().GetResponse().AppendInt32(Session.GetHabbo().AchievementPoints);
                            
    clientByUsername.GetMessageHandler().SendResponse();
                            
    ServerMessage RoomUpdate = new ServerMessage(Outgoing.UpdateUserInformation);
                            
    Room Room clientByUsername.GetHabbo().CurrentRoom;



                            
    RoomUser User Room.GetRoomUserManager().GetRoomUserByHabbo(clientByUsername.GetHabbo().Id);


                            
    RoomUpdate.AppendInt32(User.VirtualId);
                            
    RoomUpdate.AppendString(clientByUsername.GetHabbo().Look);
                            
    RoomUpdate.AppendString(clientByUsername.GetHabbo().Gender.ToLower());
                            
    RoomUpdate.AppendString(clientByUsername.GetHabbo().Motto);
                            
    RoomUpdate.AppendInt32(clientByUsername.GetHabbo().AchievementPoints);
                            
    Room.SendMessage(RoomUpdate);
                            
    clientByUsername.SendNotif("you are a zombie now bite people in front off you!");
                      
                            
    roomuser.zombie true;
                        }
                    }
                    else
                    {
                        
    Session.SendNotif("Your not a zombie?");
                    }
              
                } 
    works perfectly but i want to make a store where you can get addons to the game ect ect and one off the addons is bite someone 2 spaces in front off you i have no clue how get point works so any help? i would be greatful

    @AKllX you might have good idea ;3


  2. #2
    Unspoiled Perfection AKllX is offline
    MemberRank
    Aug 2007 Join Date
    @ akllxprojectLocation
    366Posts

    Re: [swift command] bite user

    Please notice that I will only write the parts you need, it also might not work as I won't test. But you will get the ideia.

    If you want them to be bite in a radial area to the zombie you can iterate thorugh the diagonal points of the pathfinder. If you want him to bite the user in a 2 units radius, you must define if the zombie will infect all the possible users in this 2 points in front of him. I'm assuming yes.

    //for a full radial bite
    Code:
    List<RoomUser> users = new List<RoomUser>; 
    for (int i = 0; i < HabboHotel.PathFinding.PathFinder.DiagMovePoints.Length; i++)
    {
    if(room.GetGameMap().GetRoomUsers(HabboHotel.PathFinding.PathFinder.DiagMovePoints[i]) == null)
    continue;
    users.AddRange(room.GetGameMap().GetRoomUsers(squareInfront));
    }
    For a 2 units bite (will affect all users in this range, based on the user rotation)

    Code:
            List<Point> squareInFront = new List<Point>;
           squareInFront.Add(CoordinationUtil.GetPointInFront(roomuser.Coordinate, roomuser.RotBody)); 
           squareInFront.Add(CoordinationUtil.GetPointInFront(squareInFront[0], roomuser.RotBody);
           List<RoomUser> users = new List<RoomUser>;
           foreach(int i in squareInFront)
            {        //You should check if the objected returned by GetRoomUsers is null, but It's for you to do
                users.AddRange(room.GetGameMap().GetRoomUsers(i));
             }
    You can have more than 1 user per square so I used AddRange instead.

  3. #3
    DO YOU HAVE THE POWER? Power is offline
    MemberRank
    Aug 2012 Join Date
    Haverhill, SuffLocation
    248Posts

    Re: [swift command] bite user

    Quote Originally Posted by AKllX View Post
    Please notice that I will only write the parts you need, it also might not work as I won't test. But you will get the ideia.

    If you want them to be bite in a radial area to the zombie you can iterate thorugh the diagonal points of the pathfinder. If you want him to bite the user in a 2 units radius, you must define if the zombie will infect all the possible users in this 2 points in front of him. I'm assuming yes.

    //for a full radial bite
    Code:
    List<RoomUser> users = new List<RoomUser>; 
    for (int i = 0; i < HabboHotel.PathFinding.PathFinder.DiagMovePoints.Length; i++)
    {
    if(room.GetGameMap().GetRoomUsers(HabboHotel.PathFinding.PathFinder.DiagMovePoints[i]) == null)
    continue;
    users.AddRange(room.GetGameMap().GetRoomUsers(squareInfront));
    }
    For a 2 units bite (will affect all users in this range, based on the user rotation)

    Code:
            List<Point> squareInFront = new List<Point>;
           squareInFront.Add(CoordinationUtil.GetPointInFront(roomuser.Coordinate, roomuser.RotBody)); 
           squareInFront.Add(CoordinationUtil.GetPointInFront(squareInFront[0], roomuser.RotBody);
           List<RoomUser> users = new List<RoomUser>;
           foreach(int i in squareInFront)
            {        //You should check if the objected returned by GetRoomUsers is null, but It's for you to do
                users.AddRange(room.GetGameMap().GetRoomUsers(i));
             }
    You can have more than 1 user per square so I used AddRange instead.
    thank you so much!, and thanks for explaining it two :)



Advertisement