private void CountKills() { if (Skandia.Me.GotTarget && Skandia.Me.CurrentTarget.IsValid && Skandia.Me.CurrentTarget.Template != null && Skandia.Me.CurrentTarget.Template.Id == EntityID && !(Skandia.Me.CurrentTarget.Template.TargetType == TargetType.Elite) && !PreviousTargets.Exists(x => x.Guid == Skandia.Me.CurrentTarget.Guid)) { PreviousTargets.Add(new Target(Skandia.Me.CurrentTarget.Guid, Skandia.Me.CurrentTarget.Template.Id, Skandia.Me.CurrentTarget.Info.IsDead)); } if (Main.Manager.GetCurrentDailyAchievement().Type == DailyAchievementType.TopKills && lastTarget != null && !lastTarget.IsValid) { MobsKilled++; H.Log("[SF]" + "Targets " + MobsKilled.ToString() + "/" + MobsToKill.ToString(), true); PreviousTargets.Clear(); lastTarget = null; } else if (Main.Manager.GetCurrentDailyAchievement().Type == DailyAchievementType.WipeOut) { var TargetsToRemove = new List <Target>(); foreach (var _target in PreviousTargets) { if (ObjectManager.ObjectList.Exists(x => x.IsValid && x.Guid == _target.Guid && x.Info.IsDead)) { TargetsToRemove.Add(_target); } } foreach (var item in TargetsToRemove) { MobsKilled++; PreviousTargets.Remove(item); H.Log("[SF]" + ObjectManager.GetTemplateInfo(EntityID).Name + " " + MobsKilled.ToString() + "/" + MobsToKill.ToString(), true); } } }
private void FightTarget() { if (QuotaMet()) { return; } var newTarget = ObjectManager.ObjectList.FirstOrDefault(x => x.IsValid && x.Template != null && x.Template.Id == EntityID && x.Info.IsAlive); if (HasValidTarget() && Main.Manager.GetCurrentDailyAchievement().Type == DailyAchievementType.WipeOut) { lastTarget = Skandia.Me.CurrentTarget; Fight(); H.Log("[SF]Current target is valid", true); } else if (Main.Manager.GetCurrentDailyAchievement().Type == DailyAchievementType.TopKills && ((HasValidTarget() && Skandia.Me.CurrentTarget.Distance > 5) || newTarget != null && newTarget.Distance > 5)) { if (HasValidTarget()) { Main.Manager.AddMoveState(new StateMove(Skandia.Me.CurrentTarget.Location3D, ObjectManager.GetCurrentMapInfo().Id, 7)); } else if (newTarget != null) { Main.Manager.AddMoveState(new StateMove(newTarget.Location3D, ObjectManager.GetCurrentMapInfo().Id, 7)); } H.Log("[SF]Elite found, moving closer", true); } else if (newTarget != null) { Skandia.Me.SetTarget(newTarget.Guid); lastTarget = Skandia.Me.CurrentTarget; Fight(); H.Log("[SF]Selected new target", true); } else if (newTarget == null) { if (Main.Manager.GetCurrentDailyAchievement().Type == DailyAchievementType.WipeOut) { Main.Manager.AddMoveState(new StateMove(EntityID)); } else if (Main.Manager.GetCurrentDailyAchievement().Type == DailyAchievementType.TopKills) { Main.Manager.AddChannelSwitchState(6); var locations = ObjectManager.GetEntityLocationsById(EntityID); foreach (var location in locations) { Main.Manager.AddMoveState(new StateMove(location.Location, location.MapId, 7)); } } H.Log("[SF]Found no valid targets", true); } }
private void CountGatheredItems() { foreach (var loc in LocationsToGather.ToList()) { if (Skandia.Me.Location3D.Distance(loc) < 2) { LocationsToGather.Remove(loc); } } if (PreviousTarget != null && !PreviousTarget.IsValid) { PreviousTarget = null; ItemsGathered++; H.Log("[SG]" + ObjectManager.GetTemplateInfo(EntityID).Name + " " + ItemsGathered.ToString() + "/" + ItemsToGather.ToString(), true); } }
private void Gather() { var target = ObjectManager.GatherableList.FirstOrDefault(x => x.IsValid && x.Template != null && x.Template.Id == EntityID && x.Distance < 3); if (target == null) { if (LocationsToGather.Count == 0) { return; } var targetLocation = LocationsToGather.First(); if (Skandia.Me.Location3D.Distance(targetLocation) > 2) { Main.Manager.AddMoveState(new StateMove(targetLocation, (uint)Skandia.Me.Map, 8, true)); return; } } Skandia.Me.SetTarget(target.Guid); PreviousTarget = Skandia.Me.CurrentTarget; if (target.TypeId == 0x8 && target.Info.Type == EntityType.Npc) { if ((Skandia.Me.GotTarget && Skandia.Me.CurrentTarget.Template != null && Skandia.Me.CurrentTarget.Template.Id != EntityID) || !Skandia.Me.GotTarget) { Skandia.Me.SetTarget(target.Guid); } foreach (var PickAxeItem in Skandia.Me.Inventory.Where(x => x.IsValid() && x.Id == 11670)) { if (!PickAxeTimer.IsRunning) { PickAxeTimer.Start(); } if (PickAxeTimer.ElapsedMilliseconds < 2250) { return; } PickAxeItem.Use(); PickAxeTimer.Restart(); } } else { target.Collect(); } }