Пример #1
0
        protected FigurineBase(NPCId id)
        {
            if (_sharedAuras == null)
            {
                _sharedAuras = new AuraCollection(this);
            }
            m_auras = _sharedAuras;
            GenerateId((uint)id);
            NPCEntry entry = NPCMgr.GetEntry(id);

            UnitFlags         = UnitFlags.SelectableNotAttackable | UnitFlags.Possessed;
            DynamicFlags      = UnitDynamicFlags.TrackUnit;
            EmoteState        = EmoteType.StateDead;
            NPCFlags         |= NPCFlags.Gossip;
            Model             = entry.GetRandomModel();
            EntryId           = entry.Id;
            m_runSpeed        = 1f;
            m_swimSpeed       = 1f;
            m_swimBackSpeed   = 1f;
            m_walkSpeed       = 1f;
            m_walkBackSpeed   = 1f;
            m_flightSpeed     = 1f;
            m_flightBackSpeed = 1f;
            SetInt32(UnitFields.MAXHEALTH, int.MaxValue);
            SetInt32(UnitFields.BASE_HEALTH, int.MaxValue);
            SetInt32(UnitFields.HEALTH, int.MaxValue);
            SetFloat(ObjectFields.SCALE_X, entry.Scale * DefaultScale);
            m_evades = true;
        }
Пример #2
0
        public override SpellFailedReason InitializeTarget(WorldObject target)
        {
            ObjectReference sharedReference = this.m_cast.CasterObject.SharedReference;
            AuraCollection  auras           = this.m_cast.CasterUnit.Auras;

            foreach (Aura aura in ((Unit)target).Auras)
            {
                if (aura.IsBeneficial && aura.CanBeStolen &&
                    (aura.TimeLeft > 100 && auras.GetAura(sharedReference, aura.Id, aura.Spell) == null))
                {
                    this.toSteal = aura;
                    return(SpellFailedReason.Ok);
                }
            }

            return(SpellFailedReason.NothingToSteal);
        }
Пример #3
0
        protected FigurineBase(NPCId id)
        {
            if (_sharedAuras == null)
            {
                _sharedAuras = new AuraCollection(this);
            }

            m_auras = _sharedAuras;

            GenerateId((uint)id);

            var entry = NPCMgr.GetEntry(id);

            UnitFlags    = UnitFlags.SelectableNotAttackable | UnitFlags.Possessed;
            DynamicFlags = UnitDynamicFlags.TrackUnit;
            EmoteState   = EmoteType.StateDead;
            NPCFlags    |= NPCFlags.Gossip;
            Model        = entry.GetRandomModel();
            EntryId      = entry.Id;

            // speed must be > 0
            // because of the way the client works
            const float speed = 1f;

            m_runSpeed        = speed;
            m_swimSpeed       = speed;
            m_swimBackSpeed   = speed;
            m_walkSpeed       = speed;
            m_walkBackSpeed   = speed;
            m_flightSpeed     = speed;
            m_flightBackSpeed = speed;

            SetInt32(UnitFields.MAXHEALTH, int.MaxValue);
            SetInt32(UnitFields.BASE_HEALTH, int.MaxValue);
            SetInt32(UnitFields.HEALTH, int.MaxValue);

            // just make a smaller version of the creature to be spawned
            SetFloat(ObjectFields.SCALE_X, entry.Scale * DefaultScale);

            m_evades = true;
        }
Пример #4
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                AuraCollection auras = trigger.Args.Target.Auras;

                if (auras != null && auras.Count > 0)
                {
                    bool flag = trigger.Text.NextBool();
                    trigger.Reply("{0}'s Auras:", (object)auras.Owner.Name);
                    foreach (Aura aura in auras)
                    {
                        if (flag || !aura.Spell.IsPassive)
                        {
                            trigger.Reply("\t{0}{1}", (object)aura.Spell,
                                          aura.HasTimeout
                  ? (object)(" [" + TimeSpan.FromMilliseconds(aura.TimeLeft).Format() + "]")
                  : (object)"");
                        }
                    }
                }
                else
                {
                    trigger.Reply("{0} has no active Auras.", (object)trigger.Args.Target.Name);
                }
            }
Пример #5
0
 public WoWUnit(IntPtr pointer)
     : base(pointer)
 {
     _auras = new AuraCollection(this);
 }
Пример #6
0
 public WoWUnit(IntPtr pointer)
     : base(pointer)
 {
     _auras = new AuraCollection(this);
 }