Esempio n. 1
0
 public override void OnTick()
 {
     if (Leader.IsValid)
     {
         if (Helper.InCombat)
         {
             if (FollowingLeader)
             {
                 WoWScript.ExecuteNoResults("MoveForwardStop()");
                 FollowingLeader = false;
             }
             if (Leader.IsCasting && !Manager.LocalPlayer.IsCasting)
             {
                 var id = Leader.CastingId;
                 if (id == 0)
                 {
                     id = Leader.ChanneledCastingId;
                 }
                 var spell = WoWSpell.GetSpell(id);
                 if (spell.IsValid)
                 {
                     var target = Leader.Target;
                     if (target.IsValid)
                     {
                         if (Manager.LocalPlayer.Target != target)
                         {
                             target.Select();
                         }
                         spell.Cast(target as WoWUnit);
                         Print("Casting {0} on {1}", spell.Name, target.Name);
                     }
                     else
                     {
                         spell.Cast(Manager.LocalPlayer);
                         Print("Casting {0} on self", spell.Name);
                     }
                 }
             }
         }
         else
         {
             if (!FollowingLeader)
             {
                 Leader.Select();
                 WoWScript.ExecuteNoResults("FollowUnit(\"target\")");
                 FollowingLeader = true;
             }
         }
     }
 }