public SpellCastTargets() { m_strTarget = ""; m_src = new SpellDestination(); m_dst = new SpellDestination(); }
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); }
void SetDest(ref SpellDestination dest) { dest.RelocateOffset(new Position(0.0f, 0.0f, 5.5f, 0.0f)); }
public void ModDst(SpellDestination spellDest) { Contract.Assert(m_targetMask.HasAnyFlag(SpellCastTargetFlags.DestLocation)); m_dst = spellDest; }
public void SetDst(SpellDestination spellDest) { m_dst = spellDest; m_targetMask |= SpellCastTargetFlags.DestLocation; }
public void SetDst(WorldObject wObj) { m_dst = new SpellDestination(wObj); m_targetMask |= SpellCastTargetFlags.DestLocation; }
public void SetDst(Position pos) { m_dst = new SpellDestination(pos); m_targetMask |= SpellCastTargetFlags.DestLocation; }
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; }
public void SetSrc(WorldObject wObj) { m_src = new SpellDestination(wObj); m_targetMask |= SpellCastTargetFlags.SourceLocation; }
void SetSrc(Position pos) { m_src = new SpellDestination(pos); m_targetMask |= SpellCastTargetFlags.SourceLocation; }
void SetSrc(float x, float y, float z) { m_src = new SpellDestination(x, y, z); m_targetMask |= SpellCastTargetFlags.SourceLocation; }
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); }
public void PopulateFromJson(JObject jsonObject) { m_spell = Serialization.JsonTokenIdValue <SpellDefinition>(jsonObject, "spell"); m_destination = (SpellDestination)Serialization.JsonTokenValue <int>(jsonObject, "destination", 0); }