예제 #1
0
        public SpellCastTargets()
        {
            m_strTarget = "";

            m_src = new SpellDestination();
            m_dst = new SpellDestination();
        }
예제 #2
0
        public SpellCastTargets(Unit caster, SpellCastRequest spellCastRequest)
        {
            m_targetMask       = spellCastRequest.Target.Flags;
            m_objectTargetGUID = spellCastRequest.Target.Unit;
            m_itemTargetGUID   = spellCastRequest.Target.Item;
            m_strTarget        = spellCastRequest.Target.Name;

            m_src = new SpellDestination();
            m_dst = new SpellDestination();

            if (spellCastRequest.Target.SrcLocation.HasValue)
            {
                m_src.TransportGUID = spellCastRequest.Target.SrcLocation.Value.Transport;
                Position pos;
                if (!m_src.TransportGUID.IsEmpty())
                {
                    pos = m_src.TransportOffset;
                }
                else
                {
                    pos = m_src.Position;
                }

                pos.Relocate(spellCastRequest.Target.SrcLocation.Value.Location);
                if (spellCastRequest.Target.Orientation.HasValue)
                {
                    pos.SetOrientation(spellCastRequest.Target.Orientation.Value);
                }
            }

            if (spellCastRequest.Target.DstLocation.HasValue)
            {
                m_dst.TransportGUID = spellCastRequest.Target.DstLocation.Value.Transport;
                Position pos;
                if (!m_dst.TransportGUID.IsEmpty())
                {
                    pos = m_dst.TransportOffset;
                }
                else
                {
                    pos = m_dst.Position;
                }

                pos.Relocate(spellCastRequest.Target.DstLocation.Value.Location);
                if (spellCastRequest.Target.Orientation.HasValue)
                {
                    pos.SetOrientation(spellCastRequest.Target.Orientation.Value);
                }
            }

            SetPitch(spellCastRequest.MissileTrajectory.Pitch);
            SetSpeed(spellCastRequest.MissileTrajectory.Speed);

            Update(caster);
        }
예제 #3
0
 void SetDest(ref SpellDestination dest)
 {
     dest.RelocateOffset(new Position(0.0f, 0.0f, 5.5f, 0.0f));
 }
예제 #4
0
 public void ModDst(SpellDestination spellDest)
 {
     Contract.Assert(m_targetMask.HasAnyFlag(SpellCastTargetFlags.DestLocation));
     m_dst = spellDest;
 }
예제 #5
0
 public void SetDst(SpellDestination spellDest)
 {
     m_dst         = spellDest;
     m_targetMask |= SpellCastTargetFlags.DestLocation;
 }
예제 #6
0
 public void SetDst(WorldObject wObj)
 {
     m_dst         = new SpellDestination(wObj);
     m_targetMask |= SpellCastTargetFlags.DestLocation;
 }
예제 #7
0
 public void SetDst(Position pos)
 {
     m_dst         = new SpellDestination(pos);
     m_targetMask |= SpellCastTargetFlags.DestLocation;
 }
예제 #8
0
 public void SetDst(float x, float y, float z, float orientation, uint mapId = 0xFFFFFFFF)
 {
     m_dst         = new SpellDestination(x, y, z, orientation, mapId);
     m_targetMask |= SpellCastTargetFlags.DestLocation;
 }
예제 #9
0
 public void SetSrc(WorldObject wObj)
 {
     m_src         = new SpellDestination(wObj);
     m_targetMask |= SpellCastTargetFlags.SourceLocation;
 }
예제 #10
0
 void SetSrc(Position pos)
 {
     m_src         = new SpellDestination(pos);
     m_targetMask |= SpellCastTargetFlags.SourceLocation;
 }
예제 #11
0
 void SetSrc(float x, float y, float z)
 {
     m_src         = new SpellDestination(x, y, z);
     m_targetMask |= SpellCastTargetFlags.SourceLocation;
 }
예제 #12
0
 public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_spellDef    = Serialization.JsonTokenIdValue <SpellDefinition>(jsonObject, "spellDef");
     m_destination = (SpellDestination)Serialization.JsonTokenValue <int>(jsonObject, "destination", 0);
 }
예제 #13
0
 public void PopulateFromJson(JObject jsonObject)
 {
     m_spell       = Serialization.JsonTokenIdValue <SpellDefinition>(jsonObject, "spell");
     m_destination = (SpellDestination)Serialization.JsonTokenValue <int>(jsonObject, "destination", 0);
 }