private static void Drawing_OnDraw(EventArgs args) { var me = ObjectMgr.LocalHero; if (!_loaded) { if (!Game.IsInGame || me == null) { return; } _loaded = true; PrintSuccess("> Spell Ranger loaded! v" + Ver); Spell[0] = new SpellSys(me.Spellbook.Spell1, false); Spell[1] = new SpellSys(me.Spellbook.Spell2, false); Spell[2] = new SpellSys(me.Spellbook.Spell3, false); Spell[3] = new SpellSys(me.Spellbook.Spell4, false); Spell[4] = new SpellSys(me.Spellbook.Spell5, false); Spell[5] = new SpellSys(me.Spellbook.Spell6, false); } if (!Game.IsInGame || me == null) { _loaded = false; PrintInfo("> Spell Ranger unLoaded"); return; } if (!Game.IsInGame || !_loaded) { return; } var start = new Vector2(); for (var i = 0; i < 6; i++) { if (Spell[i].Spell == null) { continue; } start = new Vector2(100 + i * 50, 52); DrawButton(start, new Vector2(50, 50), ref Spell[i].Show, Spell[i].Spell.CastRange > 0, new Color(100, 255, 0, 50), new Color(100, 0, 0, 50)); ParticleEffect effect; if (Spell[i].Show) { if (Effect.TryGetValue(i, out effect)) { continue; } effect = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); effect.SetControlPoint(1, new Vector3(Spell[i].Spell.CastRange, 0, 0)); Effect.Add(i, effect); } else { if (!Effect.TryGetValue(i, out effect)) { continue; } effect.Dispose(); Effect.Remove(i); } } var blink = me.FindItem("item_blink"); if (blink == null) { return; } DrawButton(start + new Vector2(70, 0), new Vector2(50, 50), ref _blink, true, new Color(100, 255, 0, 50), new Color(100, 0, 0, 50)); ParticleEffect eff; if (_blink) { if (Effect.TryGetValue(12, out eff)) { return; } eff = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); eff.SetControlPoint(1, new Vector3(1200, 0, 0)); Effect.Add(12, eff); } else { if (!Effect.TryGetValue(12, out eff)) { return; } eff.Dispose(); Effect.Remove(12); } }
private static void Drawing_OnDraw(EventArgs args) { var me = ObjectMgr.LocalHero; if (!_loaded) { if (!Game.IsInGame || me == null) { return; } _loaded = true; PrintSuccess("> Spell Ranger loaded! v" + Ver); Spell[0] = new SpellSys(me.Spellbook.Spell1, false); Spell[1] = new SpellSys(me.Spellbook.Spell2, false); Spell[2] = new SpellSys(me.Spellbook.Spell3, false); Spell[3] = new SpellSys(me.Spellbook.Spell4, false); Spell[4] = new SpellSys(me.Spellbook.Spell5, false); Spell[5] = new SpellSys(me.Spellbook.Spell6, false); } if (!Game.IsInGame || me == null) { _loaded = false; PrintInfo("> Spell Ranger unLoaded"); return; } if (!Game.IsInGame || !_loaded) return; var start = new Vector2(); for (var i = 0; i < 6; i++) { if (Spell[i].Spell == null) continue; start = new Vector2(100+i*50, 52); DrawButton(start, new Vector2(50, 50), ref Spell[i].Show, Spell[i].Spell.CastRange>0, new Color(100, 255, 0, 50), new Color(100, 0, 0, 50)); ParticleEffect effect; if (Spell[i].Show) { if (Effect.TryGetValue(i, out effect)) continue; effect = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); effect.SetControlPoint(1, new Vector3(Spell[i].Spell.CastRange, 0, 0)); Effect.Add(i, effect); } else { if (!Effect.TryGetValue(i, out effect)) continue; effect.Dispose(); Effect.Remove(i); } } var blink = me.FindItem("item_blink"); if (blink==null) return; DrawButton(start + new Vector2(70, 0), new Vector2(50, 50), ref _blink, true, new Color(100, 255, 0, 50), new Color(100, 0, 0, 50)); ParticleEffect eff; if (_blink) { if (Effect.TryGetValue(12, out eff)) return; eff = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); eff.SetControlPoint(1, new Vector3(1200, 0, 0)); Effect.Add(12, eff); } else { if (!Effect.TryGetValue(12, out eff)) return; eff.Dispose(); Effect.Remove(12); } }