Example #1
0
        public static void HandleFellowBuff(Session session, params string[] parameters)
        {
            List <CommandParameterHelpers.ACECommandParameter> aceParams = new List <CommandParameterHelpers.ACECommandParameter>()
            {
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.OnlinePlayerNameOrIid,
                    Required     = false,
                    DefaultValue = session.Player
                }
            };

            if (!CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams))
            {
                return;
            }
            if (aceParams[0].AsPlayer.Fellowship == null)
            {
                session.Player.CreateSentinelBuffPlayers(new Player[] { aceParams[0].AsPlayer }, aceParams[0].AsPlayer == session.Player);
                return;
            }

            var fellowshipMembers = aceParams[0].AsPlayer.Fellowship.GetFellowshipMembers();

            session.Player.CreateSentinelBuffPlayers(fellowshipMembers.Values,
                                                     fellowshipMembers.Count == 1 && aceParams[0].AsPlayer.Fellowship.FellowshipLeaderGuid == session.Player.Guid.Full);
        }
        public static void HandleTele(Session session, params string[] parameters)
        {
            // Used PhatAC source to implement most of this.  Thanks Pea!

            // usage: @tele [name] longitude latitude
            // This command teleports yourself (or the specified character) to the given longitude and latitude.
            // @tele - Teleports you(or a player) to some location.

            if (session.Player.IsAdvocate && session.Player.AdvocateLevel < 5)
            {
                return;
            }

            List <CommandParameterHelpers.ACECommandParameter> aceParams = new List <CommandParameterHelpers.ACECommandParameter>()
            {
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.OnlinePlayerNameOrIid,
                    Required     = false,
                    DefaultValue = session.Player
                },
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.Location,
                    Required     = true,
                    ErrorMessage = "You must supply a location to teleport to.\nExample: /tele 37s,67w"
                }
            };

            if (!CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams))
            {
                return;
            }

            // Check if water block
            var longcellid = ((ulong)session.Player.Location.Instance << 32) | aceParams[1].AsPosition.ObjCellID;
            var landblock  = LScape.get_landblock(longcellid);

            if (landblock.WaterType == LandDefs.WaterType.EntirelyWater)
            {
                ChatPacket.SendServerMessage(session, $"Landblock 0x{aceParams[1].AsPosition.Landblock:X4} is entirely filled with water, and is impassable", ChatMessageType.Broadcast);
                return;
            }

            ChatPacket.SendServerMessage(session, $"Position: [Cell: 0x{aceParams[1].AsPosition.Landblock:X4} | Offset: {aceParams[1].AsPosition.Pos.X}, " +
                                         $"{aceParams[1].AsPosition.Pos.Y}, {aceParams[1].AsPosition.Pos.Z} | Facing: {aceParams[1].AsPosition.Rotation.X}, {aceParams[1].AsPosition.Rotation.Y}, " +
                                         $"{ aceParams[1].AsPosition.Rotation.Z}, {aceParams[1].AsPosition.Rotation.W}]", ChatMessageType.Broadcast);

            aceParams[0].AsPlayer.Teleport(aceParams[1].AsPosition);
        }
Example #3
0
        public static void HandleBuff(Session session, params string[] parameters)
        {
            List <CommandParameterHelpers.ACECommandParameter> aceParams = new List <CommandParameterHelpers.ACECommandParameter>()
            {
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.Player,
                    Required     = false,
                    DefaultValue = session.Player
                }
            };

            if (!CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams))
            {
                return;
            }
            BuffPlayers(new Player[] { aceParams[0].AsPlayer }, aceParams[0].AsPlayer == session.Player);
        }
Example #4
0
 public static void HandleBuff(Session session, params string[] parameters)
 {
     List<CommandParameterHelpers.ACECommandParameter> aceParams = new List<CommandParameterHelpers.ACECommandParameter>()
     {
         new CommandParameterHelpers.ACECommandParameter() {
             Type = CommandParameterHelpers.ACECommandParameterType.OnlinePlayerNameOrIid,
             Required = false,
             DefaultValue = session.Player
         },
         new CommandParameterHelpers.ACECommandParameter()
         {
             Type = CommandParameterHelpers.ACECommandParameterType.ULong,
             Required = false,
             DefaultValue = (ulong)8
         }
     };
     if (!CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams)) return;
     session.Player.CreateSentinelBuffPlayers(new Player[] { aceParams[0].AsPlayer }, aceParams[0].AsPlayer == session.Player, aceParams[1].AsULong);
 }
Example #5
0
        public static void HandleTele(Session session, params string[] parameters)
        {
            // Used PhatAC source to implement most of this.  Thanks Pea!

            // usage: @tele [name] longitude latitude
            // This command teleports yourself (or the specified character) to the given longitude and latitude.
            // @tele - Teleports you(or a player) to some location.

            if (session.Player.IsAdvocate && session.Player.AdvocateLevel < 5)
            {
                return;
            }

            List <CommandParameterHelpers.ACECommandParameter> aceParams = new List <CommandParameterHelpers.ACECommandParameter>()
            {
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.Player,
                    Required     = false,
                    DefaultValue = session.Player
                },
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.Location,
                    Required     = true,
                    ErrorMessage = "You must supply a location to teleport to.\nExample: /tele 37s,67w"
                }
            };

            if (!CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams))
            {
                return;
            }

            // TODO: Check if water block?

            ChatPacket.SendServerMessage(session, $"Position: [Cell: 0x{aceParams[1].AsPosition.LandblockId.Landblock:X4} | Offset: {aceParams[1].AsPosition.PositionX}, " +
                                         $"{aceParams[1].AsPosition.PositionY}, {aceParams[1].AsPosition.PositionZ} | Facing: {aceParams[1].AsPosition.RotationX}, {aceParams[1].AsPosition.RotationY}, " +
                                         $"{ aceParams[1].AsPosition.RotationZ}, {aceParams[1].AsPosition.RotationW}]", ChatMessageType.Broadcast);

            aceParams[0].AsPlayer.Teleport(aceParams[1].AsPosition);
        }
Example #6
0
        public static void HandleFellowBuff(Session session, params string[] parameters)
        {
            List <CommandParameterHelpers.ACECommandParameter> aceParams = new List <CommandParameterHelpers.ACECommandParameter>()
            {
                new CommandParameterHelpers.ACECommandParameter()
                {
                    Type         = CommandParameterHelpers.ACECommandParameterType.Player,
                    Required     = false,
                    DefaultValue = session.Player
                }
            };

            if (!CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams))
            {
                return;
            }
            if (aceParams[0].AsPlayer.Fellowship == null)
            {
                session.Player.CreateSentinelBuffPlayers(new Player[] { aceParams[0].AsPlayer }, aceParams[0].AsPlayer == session.Player);
                return;
            }
            session.Player.CreateSentinelBuffPlayers(aceParams[0].AsPlayer.Fellowship.FellowshipMembers,
                                                     aceParams[0].AsPlayer.Fellowship.FellowshipMembers.Count == 1 && aceParams[0].AsPlayer.Fellowship.FellowshipMembers[0] == session.Player);
        }
Example #7
0
        public static void HandleGrantXp(Session session, params string[] parameters)
        {
            if (parameters?.Length > 0)
            {
                List <CommandParameterHelpers.ACECommandParameter> aceParams = new List <CommandParameterHelpers.ACECommandParameter>()
                {
                    new CommandParameterHelpers.ACECommandParameter()
                    {
                        Type         = CommandParameterHelpers.ACECommandParameterType.Player,
                        Required     = false,
                        DefaultValue = session.Player
                    },
                    new CommandParameterHelpers.ACECommandParameter()
                    {
                        Type         = CommandParameterHelpers.ACECommandParameterType.ULong,
                        Required     = true,
                        ErrorMessage = "You must specify the amount of xp."
                    }
                };
                if (CommandParameterHelpers.ResolveACEParameters(session, parameters, aceParams))
                {
                    try
                    {
                        var xp = (long)aceParams[1].AsULong;
                        aceParams[0].AsPlayer.GrantXP(xp);
                        return;
                    }
                    catch
                    {
                        //overflow
                    }
                }
            }

            ChatPacket.SendServerMessage(session, "Usage: /grantxp [name] 1234 (max 999999999999)", ChatMessageType.Broadcast);
        }