Ejemplo n.º 1
0
        public void DismountNPC()
        {
            Creature c = Obj as Creature;

            Common.Mount_Info info = new Common.Mount_Info();

            info.Entry = 0;
            c.Mount((ushort)info.Entry);
        }
Ejemplo n.º 2
0
        public void UnMount()
        {
            if (CurrentMountInfo == null)
                return;

            Owner.StsInterface.RemoveBonusSpeed(CurrentMountInfo.Speed);
            CurrentMountInfo = null;
            SendMount(null);
        }
Ejemplo n.º 3
0
        public void SetMount(Mount_Info Info)
        {
            UnMount();
            if (Info == null)
                return;

            CurrentMountInfo = Info;
            Owner.StsInterface.AddBonusSpeed(CurrentMountInfo.Speed);
            SendMount(null);
        }
Ejemplo n.º 4
0
        public void MountNPC(Unit target, uint entry)
        {
            /*var Params = (List<object>)crea;
             *
             * Unit target = (Unit)Params[0];
             * uint Entry = (uint)Params[1];*/

            Common.Mount_Info info = new Common.Mount_Info();

            info.Entry = entry;
            target.Mount((ushort)info.Entry);
        }
Ejemplo n.º 5
0
        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.MvtInterface.CurrentMount.SetMount(Info);
                Plr.SendMessage(null, "Added mount to Database " + Info.Name, SystemData.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, SystemData.ChatLogFilters.CHATLOGFILTERS_SHOUT);
            }

            return true;
        }