What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

monk prevent block problem

finalnova

New Member
Joined
Feb 7, 2015
Messages
15
Reaction score
0
Im using static gen monk with high 'Trash mob pack'

so sometimes monk was blocked by "ignored mob" and monk is just die :(

so i add this script for using dashing strike when monk is blocked by monster (not mean 'in mob' this mean 'blocked by mob')

and pretty work for me

maybe devs can improve this to nice :D

Code:
Index: PlayerMover.cs
===================================================================
--- PlayerMover.cs	(revision 207)
+++ PlayerMover.cs	(working copy)
@@ -43,6 +43,8 @@
         }
 
         private static PlayerMover _instance;
+		private static Vector3 _currentDestination = Vector3.Zero;
+
         public static PlayerMover Instance
         {
             get { return _instance ?? (_instance = new PlayerMover()); }
@@ -56,8 +58,9 @@
         private const int TimeToBlockMs = 400;
         private const int TimeToCheckBlockingMs = 50;
         private static bool _isProperBlocked;
+		private static int _blockCount = 0;
 
-
+		private static Vector3 blockLastPosition = Vector3.Zero;
         internal static bool GetIsBlocked()
         {
             if (ZetaDia.Me == null || !ZetaDia.Me.IsValid || ZetaDia.Me.IsDead)
@@ -79,8 +82,63 @@
                 return false;
             }
                 
-            var testObjects = Trinity.ObjectCache.Where(o => !o.IsMe && ((o.IsTrashMob || o.IsBossOrEliteRareUnique) && o.HitPoints > 0) && o.Distance <= 8f).ToList();
+			var myPosition = ZetaDia.Me.Position;
+            var testObjects = Trinity.ObjectCache.Where(o => !o.IsMe && ((o.IsTrashMob || o.IsBossOrEliteRareUnique) && o.HitPoints > 0) && o.Distance <= 8f).ToList();			
+			
+			if (!Trinity.Player.IsGhosted 
+				&& !CombatBase.IsInCombat
+				&& testObjects.Count > 1
+				&& blockLastPosition != Vector3.Zero
+				&& blockLastPosition.Distance(myPosition) <= 4f)
+            {
+				_blockCount++;
+				//Logger.Log("Block by monster in move to destination : #{0}" + _blockCount);
 
+				if(_blockCount > 10){
+					Logger.Log("Blocked by monster!");
+	                _isProperBlocked = true;
+
+
+					if (Trinity.Player.ActorClass == ActorClass.Monk)
+					{
+						Vector3 destination = _currentDestination;
+
+						if(destination == Vector3.Zero && destination.Distance(myPosition) > 55f)
+						{
+							Logger.Log("Current Destination is so far or so close distance : {0}",destination.Distance(myPosition));
+							destination = CurrentTarget.Position;
+						}
+
+						if(destination != null && CombatBase.CanCast(SNOPower.X1_Monk_DashingStrike) && Trinity.Settings.Combat.Monk.UseDashingStrikeOOC) {
+		                    var charges = Skills.Monk.DashingStrike.Charges;
+		
+		                    if (Sets.ThousandStorms.IsSecondBonusActive && !Trinity.ShouldWaitForLootDrop &&
+		                        ((charges > 0 && Trinity.Player.PrimaryResource >= 75) || CacheData.BuffsCache.Instance.HasCastingShrine))
+		                    {	     
+								Logger.Log("Attemp to avoid stuck using Dashing Strike");
+		                        Skills.Monk.DashingStrike.Cast(destination);
+		                        return _isProperBlocked;
+		                    }
+		
+		                    if (!Sets.ThousandStorms.IsSecondBonusActive && charges > 0 && PowerManager.CanCast(Skills.Monk.DashingStrike.SNOPower) && !Trinity.ShouldWaitForLootDrop)
+		                    {
+								Logger.Log("Attemp to avoid stuck using Dashing Strike");
+		                        Skills.Monk.DashingStrike.Cast(destination);
+		                        return _isProperBlocked;
+		                    }
+						}
+	                }
+
+
+
+	                return _isProperBlocked;
+				}
+            }else
+				_blockCount = 0;
+
+			blockLastPosition = myPosition;
+
+
             //testObjects.ForEach(o => Logger.Log("testObject: {0}",o.InternalName));
 
             if (testObjects.Count < 3)
@@ -516,6 +574,8 @@
                 return;
             }
 
+			_currentDestination = destination;
+
             TimeLastUsedPlayerMover = DateTime.UtcNow;
             LastMoveToTarget = destination;
 
Very insteresting mate. xz jv come up with a somewhat simpler solution that we're currently testing, but still, nice work. We'll keep this in mind.
 
Back
Top