Exemplo n.º 1
0
Arquivo: Mount.cs Projeto: uvbs/DoR
        public void UnMount()
        {
            if (CurrentMountInfo == null)
            {
                return;
            }

            Owner.StsInterface.RemoveBonusSpeed(CurrentMountInfo.Speed);
            CurrentMountInfo = null;
            SendMount(null);
        }
Exemplo n.º 2
0
Arquivo: Mount.cs Projeto: uvbs/DoR
        public void SetMount(Mount_Info Info)
        {
            UnMount();
            if (Info == null)
            {
                return;
            }

            CurrentMountInfo = Info;
            Owner.StsInterface.AddBonusSpeed(CurrentMountInfo.Speed);
            SendMount(null);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Changes the mount of the selected unit (int Entry)
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool SetMountCommand(Player plr, ref List <string> values)
        {
            Unit target = plr.CbtInterface.GetCurrentTarget();

            if (target == null || target.IsDead)
            {
                return(false);
            }

            int entry = GetInt(ref values);

            Mount_Info info = new Mount_Info();

            info.Entry = (uint)entry;
            target.Mount((ushort)info.Entry);
            plr.SendClientMessage("Target mount : " + info.Name);

            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Adds a new mount to the database (int Entry, int Speed, string Name)
        /// </summary>
        /// <param name="plr">Player that initiated the command</param>
        /// <param name="values">List of command arguments (after command name)</param>
        /// <returns>True if command was correctly handled, false if operation was canceled</returns>
        public static bool AddMountCommand(Player plr, ref List <string> values)
        {
            Unit target = plr.CbtInterface.GetCurrentTarget();

            if (target == null || target.IsDead)
            {
                return(false);
            }

            int    entry = GetInt(ref values);
            int    speed = GetInt(ref values);
            string name  = GetString(ref values);

            Mount_Info info = WorldMgr.Database.SelectObject <Mount_Info>("Entry=" + entry);

            if (info == null)
            {
                info       = new Mount_Info();
                info.Entry = (uint)entry;
                info.Speed = (ushort)speed;
                info.Name  = name;
                WorldMgr.Database.AddObject(info);

                target.Mount((ushort)info.Entry);
                plr.SendMessage(null, "Added mount to Database " + info.Name, ChatLogFilters.CHATLOGFILTERS_SHOUT);
            }
            else
            {
                info.Entry = (uint)entry;
                info.Speed = (ushort)speed;
                info.Name  = name;
                info.Dirty = true;
                WorldMgr.Database.AddObject(info);

                plr.SendMessage(null, "Modified mount " + info.Name, ChatLogFilters.CHATLOGFILTERS_SHOUT);
            }


            return(true);
        }
Exemplo n.º 5
0
Arquivo: Mount.cs Projeto: uvbs/DoR
        public void SetMount(uint Id)
        {
            Mount_Info Info = WorldMgr.GetMount(Id);

            SetMount(Info);
        }