/// <summary> /// Sets a totem bar slot to the specified totem!. /// </summary> /// <remarks> /// Created 3/26/2011. /// </remarks> /// <param name = "slot">The slot.</param> /// <param name = "totem">The totem.</param> public static void SetTotemBarSlot(MultiCastSlot slot, WoWTotem totem) { // Make sure we have the totem bars to set. Highest first kthx if (slot >= MultiCastSlot.SpiritsFire && !SpellManager.HasSpell("Call of the Spirits")) { return; } if (slot >= MultiCastSlot.AncestorsFire && !SpellManager.HasSpell("Call of the Ancestors")) { return; } if (!SpellManager.HasSpell("Call of the Elements")) { return; } if (LastSetTotems.ContainsKey(slot) && LastSetTotems[slot] == totem) { return; } if (!LastSetTotems.ContainsKey(slot)) { LastSetTotems.Add(slot, totem); } else { LastSetTotems[slot] = totem; } Logger.Write("Setting totem slot Call of the" + slot.ToString().CamelToSpaced() + " to " + totem.ToString().CamelToSpaced()); Lua.DoString("SetMultiCastSpell({0}, {1})", (int)slot, totem.GetTotemSpellId()); }
/// <summary> /// check if a specific totem (ie Mana Tide Totem) exists /// </summary> /// <param name="wtcheck"></param> /// <returns></returns> public static bool Exist(WoWTotem wtcheck) { WoWTotemInfo tiexist = GetTotem(wtcheck); WoWTotem wtexist = tiexist.WoWTotem; return(wtcheck == wtexist && IsRealTotem(wtcheck)); }
/// <summary> /// Finds the max range of a specific totem, where you'll still receive the buff. /// </summary> /// <remarks> /// Created 3/26/2011. /// </remarks> /// <param name = "totem">The totem.</param> /// <returns>The calculated totem range.</returns> public static float GetTotemRange(WoWTotem totem) { switch (totem) { case WoWTotem.Tremor: return(30f); case WoWTotem.Searing: if (TalentManager.CurrentSpec == WoWSpec.ShamanElemental) { return(35f); } return(20f); case WoWTotem.Earthbind: return(10f); case WoWTotem.Grounding: case WoWTotem.Magma: return(8f); case WoWTotem.EarthElemental: case WoWTotem.FireElemental: // Not really sure about these 3. return(20f); case WoWTotem.ManaTide: // Again... not sure :S return(40f); case WoWTotem.Earthgrab: return(10f); case WoWTotem.StoneBulwark: // No idea, unlike former glyphed stoneclaw it has a 5 sec pluse shield component so range is more important return(40f); case WoWTotem.HealingStream: return(40f); case WoWTotem.HealingTide: return(40f); case WoWTotem.Cloudburst: return(40f); case WoWTotem.Capacitor: return(8f); case WoWTotem.Windwalk: return(40f); case WoWTotem.SpiritLink: return(40f); } return(0f); }
public static bool IsRealTotem(WoWTotem ti) { return(ti != WoWTotem.None && ti != WoWTotem.DummyAir && ti != WoWTotem.DummyEarth && ti != WoWTotem.DummyFire && ti != WoWTotem.DummyWater); }
public static void CallTotem(WoWTotem totem) { string spell = GetTotemSpellName(totem); if (SpellManager.CanCast(spell)) { Logger.Write("[TOTEMS] Calling " + spell); SpellManager.Cast(spell); } }
/// <summary> /// gets reference to array element in Me.Totems[] corresponding to WoWTotemType of wt. Return is always non-null and does not indicate totem existance /// </summary> /// <param name="wt">WoWTotem of slot to reference</param> /// <returns>WoWTotemInfo reference</returns> public static WoWTotemInfo GetTotem(WoWTotem wt) { WoWTotemInfo ti = GetTotem(wt.ToType()); if (ti.WoWTotem != wt) { return(null); } return(ti); }
/// <summary> /// check if a specific totem exists within its max range of a given location /// </summary> /// <param name="pt"></param> /// <param name="tt"></param> /// <returns></returns> public static bool ExistInRange(WoWPoint pt, WoWTotem tt) { if (!Exist(tt)) { return(false); } WoWTotemInfo ti = GetTotem(tt); return(ti.Unit != null && ti.Unit.Location.Distance(pt) < GetTotemRange(tt)); }
public static void CallTotems(WoWTotem fire, WoWTotem earth, WoWTotem air, WoWTotem water) { SetupTotemBar(); SetTotemBarSlot(MultiCastSlot.ElementsFire, fire); SetTotemBarSlot(MultiCastSlot.ElementsAir, air); SetTotemBarSlot(MultiCastSlot.ElementsWater, water); SetTotemBarSlot(MultiCastSlot.ElementsAir, earth); StyxWoW.SleepForLagDuration(); CallTotems(); _totemsSet = false; }
public static void SetupTotemBar() { // If the user has given specific totems to use, then use them. Otherwise, fall back to our automagical ones WoWTotem earth = SingularSettings.Instance.Shaman.EarthTotem; WoWTotem air = SingularSettings.Instance.Shaman.AirTotem; WoWTotem water = SingularSettings.Instance.Shaman.WaterTotem; SetTotemBarSlot(MultiCastSlot.ElementsEarth, earth != WoWTotem.None ? earth : GetEarthTotem()); SetTotemBarSlot(MultiCastSlot.ElementsAir, air != WoWTotem.None ? air : GetAirTotem()); SetTotemBarSlot(MultiCastSlot.ElementsWater, water != WoWTotem.None ? water : GetWaterTotem()); SetTotemBarSlot(MultiCastSlot.ElementsFire, WoWTotem.None); }
/// <summary> /// Finds the max range of a specific totem, where you'll still receive the buff. /// </summary> /// <remarks> /// Created 3/26/2011. /// </remarks> /// <param name = "totem">The totem.</param> /// <returns>The calculated totem range.</returns> public static float GetTotemRange(WoWTotem totem) { // 15% extra range if talented for Totemic Reach for each point float talentFactor = (TalentManager.GetCount(2, 7) * 0.15f) + 1; switch (totem) { case WoWTotem.Flametongue: case WoWTotem.Stoneskin: case WoWTotem.StrengthOfEarth: case WoWTotem.Windfury: case WoWTotem.WrathOfAir: case WoWTotem.ManaSpring: return(40f * talentFactor); case WoWTotem.ElementalResistance: case WoWTotem.HealingStream: case WoWTotem.TranquilMind: case WoWTotem.Tremor: return(30f * talentFactor); case WoWTotem.Searing: return(20f * talentFactor); case WoWTotem.Earthbind: return(10f * talentFactor); case WoWTotem.Grounding: case WoWTotem.Magma: return(8f * talentFactor); case WoWTotem.Stoneclaw: // stoneclaw isn't effected by Totemic Reach (according to basically everything online) return(8f); case WoWTotem.EarthElemental: case WoWTotem.FireElemental: // Not really sure about these 3. return(20f); case WoWTotem.ManaTide: // Again... not sure :S return(30f * talentFactor); } return(0f); }
/// <summary> /// gets reference to array element in Me.Totems[] corresponding to WoWTotemType of wt. Return is always non-null and does not indicate totem existance /// </summary> /// <param name="wt">WoWTotem of slot to reference</param> /// <returns>WoWTotemInfo reference</returns> public static WoWTotemInfo GetTotem(WoWTotem wt) { WoWTotemInfo ti = GetTotem(wt.ToType()); if (ti.WoWTotem != wt) return null; return ti; }
public static string GetTotemSpellName(WoWTotem totem) { string totemName = string.Empty; switch (totem) { case WoWTotem.None: break; case WoWTotem.StrengthOfEarth: totemName = "Strength of Earth Totem"; break; case WoWTotem.Earthbind: totemName = "Earthbind Totem"; break; case WoWTotem.Stoneskin: totemName = "Stoneskin Totem"; break; case WoWTotem.Tremor: totemName = "Tremor Totem"; break; case WoWTotem.EarthElemental: totemName = "Earth Elemental Totem"; break; case WoWTotem.Stoneclaw: totemName = "Stoneclaw Totem"; break; case WoWTotem.Searing: totemName = "Searing Totem"; break; case WoWTotem.Flametongue: totemName = "Flametongue Totem"; break; case WoWTotem.Magma: totemName = "Magma Totem"; break; case WoWTotem.FireElemental: totemName = "Fire Elemental Totem"; break; case WoWTotem.HealingStream: totemName = "Healing Stream Totem"; break; case WoWTotem.ManaSpring: totemName = "Mana Spring Totem"; break; case WoWTotem.ElementalResistance: totemName = "Elemental Resistance Totem"; break; case WoWTotem.TranquilMind: totemName = "Totem of the Tranquil Mind"; break; case WoWTotem.ManaTide: totemName = "Mana Tide Totem"; break; case WoWTotem.Windfury: totemName = "Windfury Totem"; break; case WoWTotem.Grounding: totemName = "Grounding Totem"; break; case WoWTotem.WrathOfAir: totemName = "Wrath of Air Totem"; break; default: throw new ArgumentOutOfRangeException("totem"); } return(totemName); }
public static bool TotemIsKnown(WoWTotem totem) { return(SpellManager.HasSpell(totem.GetTotemSpellId())); }
public static WoWTotemType ToType(this WoWTotem totem) { return((WoWTotemType)((long)totem >> 32)); }
/// <summary> /// gets reference to array element in Me.Totems[] corresponding to WoWTotemType of wt. Return is always non-null and does not indicate totem existance /// </summary> /// <param name="wt">WoWTotem of slot to reference</param> /// <returns>WoWTotemInfo reference</returns> public static WoWTotemInfo GetTotem(WoWTotem wt) { return(GetTotem(wt.ToType())); }
public static int ToSpellId(this WoWTotem totem) { return((int)(((long)totem) & ((1 << 32) - 1))); }
public static string GetTotemSpellName(WoWTotem totem) { string totemName = string.Empty; switch (totem) { case WoWTotem.None: break; case WoWTotem.StrengthOfEarth: totemName = "Strength of Earth Totem"; break; case WoWTotem.Earthbind: totemName = "Earthbind Totem"; break; case WoWTotem.Stoneskin: totemName = "Stoneskin Totem"; break; case WoWTotem.Tremor: totemName = "Tremor Totem"; break; case WoWTotem.EarthElemental: totemName = "Earth Elemental Totem"; break; case WoWTotem.Stoneclaw: totemName = "Stoneclaw Totem"; break; case WoWTotem.Searing: totemName = "Searing Totem"; break; case WoWTotem.Flametongue: totemName = "Flametongue Totem"; break; case WoWTotem.Magma: totemName = "Magma Totem"; break; case WoWTotem.FireElemental: totemName = "Fire Elemental Totem"; break; case WoWTotem.HealingStream: totemName = "Healing Stream Totem"; break; case WoWTotem.ManaSpring: totemName = "Mana Spring Totem"; break; case WoWTotem.ElementalResistance: totemName = "Elemental Resistance Totem"; break; case WoWTotem.TranquilMind: totemName = "Totem of the Tranquil Mind"; break; case WoWTotem.ManaTide: totemName = "Mana Tide Totem"; break; case WoWTotem.Windfury: totemName = "Windfury Totem"; break; case WoWTotem.Grounding: totemName = "Grounding Totem"; break; case WoWTotem.WrathOfAir: totemName = "Wrath of Air Totem"; break; default: throw new ArgumentOutOfRangeException("totem"); } return totemName; }
public static bool CanPlaceTotem(WoWTotem totem) { var spell = totem.GetTotemSpellId(); return StyxWoW.Me.GetTotemBarSpells((int)totem.GetTotemType() - 1).Any(s => s.Id == spell); }
public static bool TotemIsKnown(WoWTotem totem) { return SpellManager.HasSpell(totem.ToSpellId()); }
/// <summary> /// check if a specific totem (ie Mana Tide Totem) exists /// </summary> /// <param name="wtcheck"></param> /// <returns></returns> public static bool Exist(WoWTotem wtcheck) { WoWTotemInfo tiexist = GetTotem(wtcheck); return tiexist != null; }
/// <summary> /// Finds the max range of a specific totem, where you'll still receive the buff. /// </summary> /// <remarks> /// Created 3/26/2011. /// </remarks> /// <param name = "totem">The totem.</param> /// <returns>The calculated totem range.</returns> public static float GetTotemRange(WoWTotem totem) { // 15% extra range if talented for Totemic Reach for each point float talentFactor = (TalentManager.GetCount(2, 7) * 0.15f) + 1; switch (totem) { case WoWTotem.Flametongue: case WoWTotem.Stoneskin: case WoWTotem.StrengthOfEarth: case WoWTotem.Windfury: case WoWTotem.WrathOfAir: case WoWTotem.ManaSpring: return 40f * talentFactor; case WoWTotem.ElementalResistance: case WoWTotem.HealingStream: case WoWTotem.TranquilMind: case WoWTotem.Tremor: return 30f * talentFactor; case WoWTotem.Searing: return 20f * talentFactor; case WoWTotem.Earthbind: return 10f * talentFactor; case WoWTotem.Grounding: case WoWTotem.Magma: return 8f * talentFactor; case WoWTotem.Stoneclaw: // stoneclaw isn't effected by Totemic Reach (according to basically everything online) return 8f; case WoWTotem.EarthElemental: case WoWTotem.FireElemental: // Not really sure about these 3. return 20f; case WoWTotem.ManaTide: // Again... not sure :S return 30f * talentFactor; } return 0f; }
/// <summary> /// gets reference to array element in Me.Totems[] corresponding to WoWTotemType of wt. Return is always non-null and does not indicate totem existance /// </summary> /// <param name="wt">WoWTotem of slot to reference</param> /// <returns>WoWTotemInfo reference</returns> public static WoWTotemInfo GetTotem(WoWTotem wt) { return GetTotem(wt.ToType()); }
/// <summary> /// check if a specific totem (ie Mana Tide Totem) exists /// </summary> /// <param name="wtcheck"></param> /// <returns></returns> public static bool Exist(WoWTotem wtcheck) { WoWTotemInfo tiexist = GetTotem(wtcheck); return(tiexist != null); }
public static bool IsRealTotem(WoWTotem ti) { return ti != WoWTotem.None && ti != WoWTotem.DummyAir && ti != WoWTotem.DummyEarth && ti != WoWTotem.DummyFire && ti != WoWTotem.DummyWater; }
/// <summary> /// check if a type of totem (ie Air Totem) exists /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool Exist(WoWTotemType type) { WoWTotem wt = GetTotem(type).WoWTotem; return(IsRealTotem(wt)); }
/// <summary> /// check if a specific totem exists within its max range of a given location /// </summary> /// <param name="pt"></param> /// <param name="tt"></param> /// <returns></returns> public static bool ExistInRange(WoWPoint pt, WoWTotem tt) { if ( !Exist(tt)) return false; WoWTotemInfo ti = GetTotem(tt); return ti.Unit != null && ti.Unit.Location.Distance(pt) < GetTotemRange(tt); }
public static bool CanPlaceTotem(WoWTotem totem) { var spell = totem.GetTotemSpellId(); return(StyxWoW.Me.GetTotemBarSpells((int)totem.GetTotemType() - 1).Any(s => s.Id == spell)); }
/// <summary> /// Finds the max range of a specific totem, where you'll still receive the buff. /// </summary> /// <remarks> /// Created 3/26/2011. /// </remarks> /// <param name = "totem">The totem.</param> /// <returns>The calculated totem range.</returns> public static float GetTotemRange(WoWTotem totem) { switch (totem) { case WoWTotem.Tremor: return 30f; case WoWTotem.Searing: if (TalentManager.CurrentSpec == WoWSpec.ShamanElemental ) return 35f; return 20f; case WoWTotem.Earthbind: return 10f; case WoWTotem.Grounding: case WoWTotem.Magma: return 8f; case WoWTotem.EarthElemental: case WoWTotem.FireElemental: // Not really sure about these 3. return 20f; case WoWTotem.ManaTide: // Again... not sure :S return 40f; case WoWTotem.Earthgrab: return 10f; case WoWTotem.StoneBulwark: // No idea, unlike former glyphed stoneclaw it has a 5 sec pluse shield component so range is more important return 40f; case WoWTotem.HealingStream: return 40f; case WoWTotem.HealingTide: return 40f; case WoWTotem.Cloudburst: return 40f; case WoWTotem.Capacitor: return 8f; case WoWTotem.Windwalk: return 40f; case WoWTotem.SpiritLink: return 10f; } return 0f; }
/// <summary> /// check if a specific totem (ie Mana Tide Totem) exists /// </summary> /// <param name="wtcheck"></param> /// <returns></returns> public static bool Exist(WoWTotem wtcheck) { WoWTotemInfo tiexist = GetTotem(wtcheck); WoWTotem wtexist = tiexist.WoWTotem; return wtcheck == wtexist && IsRealTotem(wtcheck); }