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

Unified GilesPlugin's Unnoficial Updates File

Status
Not open for further replies.
nice! I will pass along some Uber Priority info as well once I've properly tested out the profile. Couldn't hurt to have in there since it will properly prioritize who to attack (like Magdah's minions). Will let you know when that is available unless someone beats me to it :P
 
Jubis, how do I config the email notification. I only see 3 textbox that is email address password and BOT name. Which email the bot will send to and how does it detect the smtp server?
 
please fix potions number:

// Potion filtering
if (thisGilesItemType == GilesItemType.HealthPotion)
{
if (settings.iFilterPotions == 1 || templevel < settings.iFilterPotionLevel)
{
return false;
}
if (settings.iFilterPotions == 2)
{
// Map out all the items already in the backpack
int iTotalPotions =
(from tempitem in ZetaDia.Me.Inventory.Backpack where tempitem.BaseAddress != IntPtr.Zero where tempitem.GameBalanceId == tempbalanceid select tempitem.ItemStackQuantity).Sum();
if (iTotalPotions > 90)
 
please fix potions number:

// Potion filtering
if (thisGilesItemType == GilesItemType.HealthPotion)
{
if (settings.iFilterPotions == 1 || templevel < settings.iFilterPotionLevel)
{
return false;
}
if (settings.iFilterPotions == 2)
{
// Map out all the items already in the backpack
int iTotalPotions =
(from tempitem in ZetaDia.Me.Inventory.Backpack where tempitem.BaseAddress != IntPtr.Zero where tempitem.GameBalanceId == tempbalanceid select tempitem.ItemStackQuantity).Sum();
if (iTotalPotions > 90)

Good idea, I have potions on 100 and sometimes it still picks up 101 and waste a slot space, this will definitely fix it.
 
Why do you use GitHub for the project?

It's simple and the community can help more eazy
 
Hi!

Does latest version of this plugin work with latest Demonbuddy v1.0.1162.284 or is new beta DB version mandatory?
I ask because v0.28 does not work with fresh & clean DB (al least config window opens but nothing happens when I press 'Save' there).

Wbr
 
Jubis, how do I config the email notification. I only see 3 textbox that is email address password and BOT name. Which email the bot will send to and how does it detect the smtp server?

I'm not sure because I don't use email notification myself. You should check tbone's thread


please fix potions number:

// Potion filtering
if (thisGilesItemType == GilesItemType.HealthPotion)
{
if (settings.iFilterPotions == 1 || templevel < settings.iFilterPotionLevel)
{
return false;
}
if (settings.iFilterPotions == 2)
{
// Map out all the items already in the backpack
int iTotalPotions =
(from tempitem in ZetaDia.Me.Inventory.Backpack where tempitem.BaseAddress != IntPtr.Zero where tempitem.GameBalanceId == tempbalanceid select tempitem.ItemStackQuantity).Sum();
if (iTotalPotions > 90)
I could do that, but then people wouldn't read this and start asking me why the hell doesn't the bot pick up potions anymore

Why do you use GitHub for the project?

It's simple and the community can help more eazy
Me, darkfriend77 and vbnm are currently using assembla. If you wish to join just send a pm to darkfriend77 asking him to add you to the team


Hi!

Does latest version of this plugin work with latest Demonbuddy v1.0.1162.284 or is new beta DB version mandatory?
I ask because v0.28 does not work with fresh & clean DB (al least config window opens but nothing happens when I press 'Save' there).

Wbr
I'm using BETA and it works fine, but I see no reason why it wouldn't work with the latest stable version. Just do a fresh install and it should work fine
 
ah...Finally got a weekend to see the code.
here is some bug I figure out, maybe you should check it.

1. bUseBerserker is not working, you haven't added in condition
Code:
if (!bOOCBuff && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_WrathOfTheBerserker) &&
                        //ADD THIS
                        bUseBerserker &&
                        // Not on heart of sin after Cydaea
                        targetCurrent.iThisActorSNO != 193077 &&
                        // Make sure we are allowed to use wrath on goblins, else make sure this isn't a goblin
                        (settings.bGoblinWrath || !targetCurrent.bThisTreasureGoblin || iElitesWithinRange[RANGE_15] >= 1) &&
                        // If on a boss, only when injured
                        ((targetCurrent.bThisBoss && targetCurrent.iThisHitPoints <= 0.99 && !hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind)) ||
                        // If *NOT* on a boss, and definitely no boss in range, then judge based on any elites at all within 30 feet
                         ((!targetCurrent.bThisBoss || hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind)) &&
                           (!bAnyBossesInRange || hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind)) &&
                           ((iElitesWithinRange[RANGE_20] >= 1 || targetCurrent.bThisEliteRareUnique) && (targetCurrent.iThisHitPoints >= 0.30 || playerStatus.dCurrentHealthPct <= 0.60))
						 )) &&
                        // Don't still have the buff
                        !GilesHasBuff(SNOPower.Barbarian_WrathOfTheBerserker) &&
                        GilesUseTimer(SNOPower.Barbarian_WrathOfTheBerserker, true) && PowerManager.CanCast(SNOPower.Barbarian_WrathOfTheBerserker))
2. Sprint is spamming when waiting for wotb in azmodan, maybe you can check sprint in out-of-combat

3. I think the really problem with ZigZag is that: ZetaDia.Physics.Raycast had problem with Z before, Giles added a customized GilesCanRayCast for this. but now, if the Z is not a right position(higher or lower), this will return false!
Which means, it can hardly pass this line: // Give weight to each zigzag point, so we can find the best one to aim for

we have to give a right position to ZetaDia.Physics.Raycast instead of using GilesCanRayCast

I will pm you with my untested solution. but I don't want to release it before any test, plus I have customized my plugin too much....

4. I think keywarden can be treated like boss, why don't you add it to hashBossSNO?
 
Carefull with bUseBerserker, that's a feature I added, not Giles :p

It will ignore Wrath of the Berserker in "easy" elites, will only activated it in Arcane Enchanted, Frozen, Jailer and Molten.

My entire code was:
Code:
                        //intell -- Other dangerous: Nightmarish, Mortar, Desecrator, Fire Chains, Knockback, Electrified
						if (PowerManager.CanCast(SNOPower.Barbarian_WrathOfTheBerserker))
						{
							//WotB only used on Arcane, Frozen, Jailer and Molten elites
							if (theseaffixes.HasFlag(MonsterAffixes.ArcaneEnchanted) || theseaffixes.HasFlag(MonsterAffixes.Frozen) ||
								theseaffixes.HasFlag(MonsterAffixes.Jailer) || theseaffixes.HasFlag(MonsterAffixes.Molten) ||
								//Bosses and uber elites
								tmp_unit_bThisBoss || tmp_iThisActorSNO == 256015 || tmp_iThisActorSNO == 256000 || tmp_iThisActorSNO == 255996 ||
								//...or more than 4 elite mobs in range (only elites/rares/uniques, not minions!)
								iElitesOnlyWithinRange > 4)
									bUseBerserker = true;
						}
						else
							bUseBerserker = false;

And was defined here:
Code:
        // Goblinney things
        private static bool bUseBerserker = false;

iElitesOnlyWithinRange has to be defined previously as well.
 
Last edited:
Carefull with bUseBerserker, that's a feature I added, not Giles :p

It will ignore Wrath of the Berserker in "easy" elites, will only activated it in Arcane Enchanted, Frozen, Jailer and Molten.

My entire code was:
Code:
                        //intell -- Other dangerous: Nightmarish, Mortar, Desecrator, Fire Chains, Knockback, Electrified
						if (PowerManager.CanCast(SNOPower.Barbarian_WrathOfTheBerserker))
						{
							//WotB only used on Arcane, Frozen, Jailer and Molten elites
							if (theseaffixes.HasFlag(MonsterAffixes.ArcaneEnchanted) || theseaffixes.HasFlag(MonsterAffixes.Frozen) ||
								theseaffixes.HasFlag(MonsterAffixes.Jailer) || theseaffixes.HasFlag(MonsterAffixes.Molten) ||
								//Bosses and uber elites
								tmp_unit_bThisBoss || tmp_iThisActorSNO == 256015 || tmp_iThisActorSNO == 256000 || tmp_iThisActorSNO == 255996 ||
								//...or more than 4 elite mobs in range (only elites/rares/uniques, not minions!)
								iElitesOnlyWithinRange > 4)
									bUseBerserker = true;
						}
						else
							bUseBerserker = false;

And was defined here:
Code:
        // Goblinney things
        private static bool bUseBerserker = false;

iElitesOnlyWithinRange has to be defined previously as well.

But you only set it, you didn't add it in the condition judgement for WOTB. so it will never work.
 
here is my untested solution for zigzag. untested means I wrote it, I let DB run, and I know I didn't die and EPH was higher than before for several runs, but I never have time to see if there is any trouble.
the idea is commended with "//K: "

Code:
// Whirlwind spam as long as necessary pre-buffs are up
                    if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind) && !playerStatus.bIsIncapacitated && !playerStatus.bIsRooted &&
                        // Don't WW against goblins, units in the special SNO list
                        (!settings.bSelectiveWhirlwind || bAnyNonWWIgnoreMobsInRange || !hashActorSNOWhirlwindIgnore.Contains(targetCurrent.iThisActorSNO)) &&
                        // Only if within 15 foot of main target
                        ((targetCurrent.fRadiusDistance <= 25f || iAnythingWithinRange[RANGE_25] >= 1)) && 
                        (iAnythingWithinRange[RANGE_50] >= 2 || targetCurrent.iThisHitPoints >= 0.30 || targetCurrent.bThisBoss || targetCurrent.bThisEliteRareUnique || playerStatus.dCurrentHealthPct <= 0.60) &&
                        // Check for energy reservation amounts
                        //((playerStatus.dCurrentEnergy >= 20 && !playerStatus.bWaitingForReserveEnergy) || playerStatus.dCurrentEnergy >= iWaitingReservedAmount) &&
                        playerStatus.dCurrentEnergy >= 10 &&
                        // If they have battle-rage, make sure it's up
                        (!hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_BattleRage) || (hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_BattleRage) && GilesHasBuff(SNOPower.Barbarian_BattleRage))))
                        // If they have sprint, make sure it's up
                        //(!hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Sprint) || (hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Sprint) && GilesHasBuff(SNOPower.Barbarian_Sprint))))
                    {
                        bool bGenerateNewZigZag = (DateTime.Now.Subtract(lastChangedZigZag).TotalMilliseconds >= 1500f ||
                            (vPositionLastZigZagCheck != vNullLocation && playerStatus.vCurrentPosition == vPositionLastZigZagCheck && DateTime.Now.Subtract(lastChangedZigZag).TotalMilliseconds >= 800f) ||
                            Vector3.Distance(playerStatus.vCurrentPosition, vSideToSideTarget) <= 10f ||
                            targetCurrent.iThisACDGUID != iACDGUIDLastWhirlwind);
                        vPositionLastZigZagCheck = playerStatus.vCurrentPosition;
                        if (bGenerateNewZigZag)
                        {
                            //float fExtraDistance = targetCurrent.fCentreDistance+(targetCurrent.fCentreDistance <= 15f ? 12f : 7f);
                            //K: Direction is more important than distance, we cannot run 20f in 1500ms anyway
                            vSideToSideTarget = FindZigZagTargetLocation(targetCurrent.vThisPosition, 20f);
                            // Resetting this to ensure the "no-spam" is reset since we changed our target location
                            powerLastSnoPowerUsed = SNOPower.None;
                            iACDGUIDLastWhirlwind = targetCurrent.iThisACDGUID;
                            lastChangedZigZag = DateTime.Now;
                        }
                        return new GilesPower(SNOPower.Barbarian_Whirlwind, 20f, vSideToSideTarget, iCurrentWorldID, -1, 0, 0, USE_SLOWLY);
                    }


Code:
        // **********************************************************************************************
        // *****               Special Zig-Zag movement for whirlwind/tempest                       *****
        // **********************************************************************************************
        public static Vector3 FindZigZagTargetLocation(Vector3 vTargetLocation, float fDistanceOutreach, bool bRandomizeDistance = false, bool bNinetyDegree = false)
        {
            Vector3 vThisZigZag = vNullLocation;
            Random rndNum = new Random(int.Parse(Guid.NewGuid().ToString().Substring(0, 8), NumberStyles.HexNumber));
            float iFakeStart = 0;
            if (bRandomizeDistance)
                fDistanceOutreach += rndNum.Next(18);
            float fDirectionToTarget = FindDirectionDegree(playerStatus.vCurrentPosition, vTargetLocation);
			float fPointToTarget;

            float fHighestWeight = float.NegativeInfinity;
            Vector3 vBestLocation = vNullLocation;
			
            bool bFoundSafeSpotsFirstLoop = false;
			float fAdditionalRange = 0f;
            //K: Direction is more important than distance
            //K: 0-15 and 0-(-15) degree is the best for point to target, and Z will hardly change if distance is only 20f
            //    15-60 and -15-(-60) degree can still hit the target, but we may miss. and Z is nearly between currentposition and target position according to math(...)
            //    60-90 and -60-(-90) degree is for avoid obstacles, because we cannot get close to target with WW. but the Z cannot be estimated if the distance is too far
            //                                 we can only cast to nearby with the same Z position and shorter distance.
            for (int iMultiplier = 1; iMultiplier <= 2; iMultiplier++)
            {
                if (iMultiplier == 2)
                {
                    if (bFoundSafeSpotsFirstLoop)
                        break;
					fAdditionalRange = 150f;
					iFakeStart = (rndNum.Next(12) * 5);
                }
                float fRunDistance = fDistanceOutreach;
                for (float iDegreeChange = iFakeStart; iDegreeChange <= 30f+fAdditionalRange; iDegreeChange += 5)
                {
                    float iPosition = iDegreeChange;
                    //point to target is better, otherwise we have to avoid obstacle first 
                    if (iPosition > 105f)
						iPosition = 90f-iPosition;
					else if (iPosition > 30f)
						iPosition -= 15f;
					else if (iPosition > 15f)
						iPosition = 15f-iPosition;
                    fPointToTarget = iPosition;
                    
                    iPosition += fDirectionToTarget;
					if (iPosition < 0)
                        iPosition = 360 + iPosition;
                    if (iPosition > 360)
                        iPosition = iPosition - 360;
                    vThisZigZag = MathEx.GetPointAt(playerStatus.vCurrentPosition, fRunDistance, MathEx.ToRadians(iPosition));
                    if (fPointToTarget <= 30f || fPointToTarget >= 330f)
                    {
                        vThisZigZag.Z = vTargetLocation.Z;
                    }
                    else if (fPointToTarget <= 60f || fPointToTarget >= 300f)
                    {
                        //K: we are trying to find position that we can circle around the target
                        //   but we shouldn't run too far away from target
                        vThisZigZag.Z = (vTargetLocation.Z + playerStatus.vCurrentPosition.Z) / 2;
                        fRunDistance = fDistanceOutreach - 5f;
                    }
                    else
                    {
                        //K: don't move too far if we are not point to target, we just try to move
                        //   this can help a lot when we are near stairs
                        fRunDistance = 5f;
                    }
                        
					// Give weight to each zigzag point, so we can find the best one to aim for
                    if (ZetaDia.Physics.Raycast(playerStatus.vCurrentPosition, vThisZigZag, NavCellFlags.AllowWalk))
                    {
						//Log("Find a right location" + iPosition);
                        bool bAnyAvoidance = false;
                        float fThisWeight = 1000f;
                        if (iMultiplier == 2)
                            fThisWeight -= 80f;
                        // Remove weight for each avoidance *IN* that location
                        foreach (GilesObstacle tempobstacle in hashAvoidanceObstacleCache.Where(cp => GilesIntersectsPath(cp.vThisLocation, cp.fThisRadius, playerStatus.vCurrentPosition, vThisZigZag)))
                        {
                            bAnyAvoidance = true;
                            fThisWeight -= (float)tempobstacle.dThisWeight;
                        }
                        // Give extra weight to areas we've been inside before
                        bool bExtraSafetyWeight = hashSkipAheadAreaCache.Any(cp => cp.vThisLocation.Distance(vThisZigZag) <= cp.fThisRadius);
                        if (bExtraSafetyWeight)
                            fThisWeight += 100f;

                        // Use this one if it's more weight, or we haven't even found one yet, or if same weight as another with a random chance
                        if (fThisWeight > fHighestWeight)
                        {
                            fHighestWeight = fThisWeight;
                            vBestLocation = vThisZigZag;
                            if (!bAnyAvoidance)
                                bFoundSafeSpotsFirstLoop = true;
                        }
                    } // Can we raycast to the point at minimum?
                } // Loop through degrees
            } // Loop through multiplier
            return vBestLocation;
        }
 
Of course I added it. Look on my original wotb version, not this one here (probably jubisman forgot to copy it):

Code:
		// Wrath of the berserker, elites only (wrath of berserker)
		//intell
		if (!bOOCBuff && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_WrathOfTheBerserker) && bUseBerserker &&
                        // Not on heart of sin after Cydaea
                        targetCurrent.iThisActorSNO != 193077 &&
                        // Make sure we are allowed to use wrath on goblins, else make sure this isn't a goblin (unless an elite is nearby)
                        (settings.bGoblinWrath || !targetCurrent.bThisTreasureGoblin || iElitesWithinRange[RANGE_15] >= 1) &&
                        // If on a boss, only when injured
                        ((targetCurrent.bThisBoss && targetCurrent.iThisHitPoints <= 0.99 && !hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind)) ||
                        // If *NOT* on a boss, and definitely no boss in range, then judge based on any elites at all within 30 feet
                         ((!targetCurrent.bThisBoss || hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind)) &&
                           (!bAnyBossesInRange || hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind)) &&
                           ((iElitesWithinRange[RANGE_20] >= 1 || targetCurrent.bThisEliteRareUnique) && (targetCurrent.iThisHitPoints >= 0.30 || playerStatus.dCurrentHealthPct <= 0.60))
						 )) && targetCurrent.fCentreDistance <= 35f)
                    {
						if (playerStatus.dCurrentEnergy >= 50)
						{
							if (targetCurrent.iThisActorSNO == 255996)
								Logging.Write("[GilesTrinity] Berserk being used: Act 1 Warden, Odeg!");
							else if (targetCurrent.iThisActorSNO == 256000)
								Logging.Write("[GilesTrinity] Berserk being used: Act 2 Warden, Sokahr!");
							else if (targetCurrent.iThisActorSNO == 256015)
								Logging.Write("[GilesTrinity] Berserk being used: Act 3 Warden, Xah'rith!");
							else			
								Logging.Write("[GilesTrinity] Berserk being used!");
							bUseBerserker = false;
							return new GilesPower(SNOPower.Barbarian_WrathOfTheBerserker, 0f, vNullLocation, iCurrentWorldID, -1, 1, 1, USE_SLOWLY); //intell -- 4, 4
						}
						else
						{
							Logging.Write("[GilesTrinity] Berserk ready, waiting for fury...");
							bWaitingForSpecial = true;
						}
			}
 
Last edited:
btw, I really wonder why people don't add keywarden to hashBossSNO. Is there any loss that I failed to find?
 
You can be stuck trying to chase them... they will get 200 radius if got a boss flag :p

(all 3 uber elites are already treated as elites even in stock giles)
 
Of course I added it. Look on my original wotb version, not this one here (probably jubisman forgot to copy it):

This is probably what happened. I need to find myself a better attention span.

here is my untested solution for zigzag. untested means I wrote it, I let DB run, and I know I didn't die and EPH was higher than before for several runs, but I never have time to see if there is any trouble.
the idea is commended with "//K: "

Code:
// Whirlwind spam as long as necessary pre-buffs are up
                    if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Whirlwind) && !playerStatus.bIsIncapacitated && !playerStatus.bIsRooted &&
                        // Don't WW against goblins, units in the special SNO list
                        (!settings.bSelectiveWhirlwind || bAnyNonWWIgnoreMobsInRange || !hashActorSNOWhirlwindIgnore.Contains(targetCurrent.iThisActorSNO)) &&
                        // Only if within 15 foot of main target
                        ((targetCurrent.fRadiusDistance <= 25f || iAnythingWithinRange[RANGE_25] >= 1)) && 
                        (iAnythingWithinRange[RANGE_50] >= 2 || targetCurrent.iThisHitPoints >= 0.30 || targetCurrent.bThisBoss || targetCurrent.bThisEliteRareUnique || playerStatus.dCurrentHealthPct <= 0.60) &&
                        // Check for energy reservation amounts
                        //((playerStatus.dCurrentEnergy >= 20 && !playerStatus.bWaitingForReserveEnergy) || playerStatus.dCurrentEnergy >= iWaitingReservedAmount) &&
                        playerStatus.dCurrentEnergy >= 10 &&
                        // If they have battle-rage, make sure it's up
                        (!hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_BattleRage) || (hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_BattleRage) && GilesHasBuff(SNOPower.Barbarian_BattleRage))))
                        // If they have sprint, make sure it's up
                        //(!hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Sprint) || (hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Sprint) && GilesHasBuff(SNOPower.Barbarian_Sprint))))
                    {
                        bool bGenerateNewZigZag = (DateTime.Now.Subtract(lastChangedZigZag).TotalMilliseconds >= 1500f ||
                            (vPositionLastZigZagCheck != vNullLocation && playerStatus.vCurrentPosition == vPositionLastZigZagCheck && DateTime.Now.Subtract(lastChangedZigZag).TotalMilliseconds >= 800f) ||
                            Vector3.Distance(playerStatus.vCurrentPosition, vSideToSideTarget) <= 10f ||
                            targetCurrent.iThisACDGUID != iACDGUIDLastWhirlwind);
                        vPositionLastZigZagCheck = playerStatus.vCurrentPosition;
                        if (bGenerateNewZigZag)
                        {
                            //float fExtraDistance = targetCurrent.fCentreDistance+(targetCurrent.fCentreDistance <= 15f ? 12f : 7f);
                            //K: Direction is more important than distance, we cannot run 20f in 1500ms anyway
                            vSideToSideTarget = FindZigZagTargetLocation(targetCurrent.vThisPosition, 20f);
                            // Resetting this to ensure the "no-spam" is reset since we changed our target location
                            powerLastSnoPowerUsed = SNOPower.None;
                            iACDGUIDLastWhirlwind = targetCurrent.iThisACDGUID;
                            lastChangedZigZag = DateTime.Now;
                        }
                        return new GilesPower(SNOPower.Barbarian_Whirlwind, 20f, vSideToSideTarget, iCurrentWorldID, -1, 0, 0, USE_SLOWLY);
                    }


Code:
        // **********************************************************************************************
        // *****               Special Zig-Zag movement for whirlwind/tempest                       *****
        // **********************************************************************************************
        public static Vector3 FindZigZagTargetLocation(Vector3 vTargetLocation, float fDistanceOutreach, bool bRandomizeDistance = false, bool bNinetyDegree = false)
        {
            Vector3 vThisZigZag = vNullLocation;
            Random rndNum = new Random(int.Parse(Guid.NewGuid().ToString().Substring(0, 8), NumberStyles.HexNumber));
            float iFakeStart = 0;
            if (bRandomizeDistance)
                fDistanceOutreach += rndNum.Next(18);
            float fDirectionToTarget = FindDirectionDegree(playerStatus.vCurrentPosition, vTargetLocation);
			float fPointToTarget;

            float fHighestWeight = float.NegativeInfinity;
            Vector3 vBestLocation = vNullLocation;
			
            bool bFoundSafeSpotsFirstLoop = false;
			float fAdditionalRange = 0f;
            //K: Direction is more important than distance
            //K: 0-15 and 0-(-15) degree is the best for point to target, and Z will hardly change if distance is only 20f
            //    15-60 and -15-(-60) degree can still hit the target, but we may miss. and Z is nearly between currentposition and target position according to math(...)
            //    60-90 and -60-(-90) degree is for avoid obstacles, because we cannot get close to target with WW. but the Z cannot be estimated if the distance is too far
            //                                 we can only cast to nearby with the same Z position and shorter distance.
            for (int iMultiplier = 1; iMultiplier <= 2; iMultiplier++)
            {
                if (iMultiplier == 2)
                {
                    if (bFoundSafeSpotsFirstLoop)
                        break;
					fAdditionalRange = 150f;
					iFakeStart = (rndNum.Next(12) * 5);
                }
                float fRunDistance = fDistanceOutreach;
                for (float iDegreeChange = iFakeStart; iDegreeChange <= 30f+fAdditionalRange; iDegreeChange += 5)
                {
                    float iPosition = iDegreeChange;
                    //point to target is better, otherwise we have to avoid obstacle first 
                    if (iPosition > 105f)
						iPosition = 90f-iPosition;
					else if (iPosition > 30f)
						iPosition -= 15f;
					else if (iPosition > 15f)
						iPosition = 15f-iPosition;
                    fPointToTarget = iPosition;
                    
                    iPosition += fDirectionToTarget;
					if (iPosition < 0)
                        iPosition = 360 + iPosition;
                    if (iPosition > 360)
                        iPosition = iPosition - 360;
                    vThisZigZag = MathEx.GetPointAt(playerStatus.vCurrentPosition, fRunDistance, MathEx.ToRadians(iPosition));
                    if (fPointToTarget <= 30f || fPointToTarget >= 330f)
                    {
                        vThisZigZag.Z = vTargetLocation.Z;
                    }
                    else if (fPointToTarget <= 60f || fPointToTarget >= 300f)
                    {
                        //K: we are trying to find position that we can circle around the target
                        //   but we shouldn't run too far away from target
                        vThisZigZag.Z = (vTargetLocation.Z + playerStatus.vCurrentPosition.Z) / 2;
                        fRunDistance = fDistanceOutreach - 5f;
                    }
                    else
                    {
                        //K: don't move too far if we are not point to target, we just try to move
                        //   this can help a lot when we are near stairs
                        fRunDistance = 5f;
                    }
                        
					// Give weight to each zigzag point, so we can find the best one to aim for
                    if (ZetaDia.Physics.Raycast(playerStatus.vCurrentPosition, vThisZigZag, NavCellFlags.AllowWalk))
                    {
						//Log("Find a right location" + iPosition);
                        bool bAnyAvoidance = false;
                        float fThisWeight = 1000f;
                        if (iMultiplier == 2)
                            fThisWeight -= 80f;
                        // Remove weight for each avoidance *IN* that location
                        foreach (GilesObstacle tempobstacle in hashAvoidanceObstacleCache.Where(cp => GilesIntersectsPath(cp.vThisLocation, cp.fThisRadius, playerStatus.vCurrentPosition, vThisZigZag)))
                        {
                            bAnyAvoidance = true;
                            fThisWeight -= (float)tempobstacle.dThisWeight;
                        }
                        // Give extra weight to areas we've been inside before
                        bool bExtraSafetyWeight = hashSkipAheadAreaCache.Any(cp => cp.vThisLocation.Distance(vThisZigZag) <= cp.fThisRadius);
                        if (bExtraSafetyWeight)
                            fThisWeight += 100f;

                        // Use this one if it's more weight, or we haven't even found one yet, or if same weight as another with a random chance
                        if (fThisWeight > fHighestWeight)
                        {
                            fHighestWeight = fThisWeight;
                            vBestLocation = vThisZigZag;
                            if (!bAnyAvoidance)
                                bFoundSafeSpotsFirstLoop = true;
                        }
                    } // Can we raycast to the point at minimum?
                } // Loop through degrees
            } // Loop through multiplier
            return vBestLocation;
        }
I'll try this and see it it goes. Thanks a lot for taking interest in this, man

ksmaze: so with this new version of yours, using zigazag with variable Z coordinates shouldn't be fucked anymore, right?

edit: seems to be the case! I'll comit these changes as v0.33 right away!

An observation: ksmaze, your new zizag code seems to make the bot WW side to side very quickly over a short distance while fighting azmodan. That, however, is not such a serious issue, so I'll still implement your changes
 
Last edited:
Alright, v0.33 is up. Let me know what you guys think

bombastic: is there anything else I forgot to add from your code?

edit: taken it down momentarily
 
Last edited:
Hi guys.
Unified GilesPlugin's does not send a message to my android. What could be the problem ?
 
Hi guys.
Unified GilesPlugin's does not send a message to my android. What could be the problem ?
It sends to mine. Try a fresh install, and then set up another api key and try again

bombastic: dow do I define iElitesOnlyWithinRange?
 
Maybe you forgot to upload v33, you only have v32 as download.

Thanks for your work!
 
Status
Not open for further replies.
Back
Top