Jump to content

fightclass and movement problem


camelot10

Recommended Posts

this quest http://www.wowhead.com/quest=46842

video: 2017-09-02_03-20-39.mp4

#if VISUAL_STUDIO
using robotManager.Helpful;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using wManager.Wow.Bot.Tasks;
using wManager.Wow.Class;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using wManager.Wow.Enums;
#endif

public class AStrikeattheHeart : QuestClass
{
	static Vector3 _fightPosition = new Vector3(1348.383, 1842.261, 547.1295, "None");
	static int _bossID = 119397;

	// Continent (item1), DefaultPosition (item2), DefaultPositionSearchRange (item3), NewPosition (item4)
	static List<System.Tuple<ContinentId, Vector3, float, Vector3>> positionChange = new List<System.Tuple<ContinentId, Vector3, float, Vector3>>
	{
		new System.Tuple<ContinentId, Vector3, float, Vector3>(ContinentId.Argus_1, new Vector3(1361.313, 1834.2, 537.9584, "None"), 10f, _fightPosition),
	};
	public AStrikeattheHeart()
	{
		Name = "A Strike at the Heart";
		QuestId.Add(46842);
		Step.AddRange(new[] { 1, 1 });
	}
	public override bool Pulse()
	{
		if (!Questing.ObjectiveComplete(this, 1))
		{
			var p = new Vector3(1325.474, 1902.862, 549.4163, "None");
			GoToTask.ToPositionAndIntecractWithNpc(p, 120738, 1);
			return true;
		}
		if (Questing.Attack(_bossID))
			return true;

		GoToTask.ToPosition(_fightPosition);
		return true;
	}
	public override bool PickUp()
	{
		FixFightStart();
		return base.PickUp();
	}
	public override bool TurnIn()
	{
		FixFightStop();
		return base.TurnIn();
	}
	public static void FixFightStart()
	{
		Logging.Write("fix fight start");
		wManager.wManagerSetting.CurrentSetting.CalcuCombatRange = true;
		wManager.Events.MovementEvents.OnMovementPulse -= OnMovePulse;
		wManager.Events.MovementEvents.OnMovementPulse += OnMovePulse;
		//wManager.Events.FightEvents.OnFightLoop -= FightLoop;
		//wManager.Events.FightEvents.OnFightLoop += FightLoop;
	}
	public static void FixFightStop()
	{
		Logging.Write("fix fight stop");
		wManager.wManagerSetting.CurrentSetting.CalcuCombatRange = false;
		wManager.Events.MovementEvents.OnMovementPulse -= OnMovePulse;
		//wManager.Events.FightEvents.OnFightLoop -= FightLoop;
	}
	static void OnMovePulse(List<Vector3> points, System.ComponentModel.CancelEventArgs cancelable)
	{
		var continent = (ContinentId)Usefuls.ContinentId;
		foreach (var p in points)
		{
			foreach (var pchange in positionChange)
			{
				if (p != null && pchange.Item1 == continent && p.DistanceTo(pchange.Item2) <= pchange.Item3)
				{
					Logging.WriteDebug("Change path position of " + p + " to " + pchange.Item4);
					p.X = pchange.Item4.X;
					p.Y = pchange.Item4.Y;
					p.Z = pchange.Item4.Z;
					p.Type = pchange.Item4.Type;
					p.Action = pchange.Item4.Action;
				}
			}
		}
	}
	static void FightLoop(WoWUnit unit, System.ComponentModel.CancelEventArgs cancelable)
	{
		if (unit.IsValid && unit.Entry == _bossID)
		{
			MovementManager.MoveTo(_fightPosition);
		}
	}
}

@Droidz

if use fightevent - its not work

if use movepulse - its not work

no mesh holes, navigator found path to boss without problem but inside lava

always tryed to move into lava and after some time blacklist boss

any tips ?

Link to comment
Share on other sites

Just now, Droidz said:

In your figthclass, do you use static distance (to check if target is in spell range)? Wath is the combatrange of this mob (you can get it in memory info)

regular xml fightclass Warlock Affliction (camelot10).xml

==================================
TARGET INFO:
==================================
GetUnitDynamicFlags = None
WowClass = Warrior
IsLocalPlayer = False
Position = 1361,313 ; 1834,2 ; 538,1584 ; "None"
PositionWithoutType = 1361,313 ; 1834,2 ; 538,1584 ; "None"
PositionRelativeWithoutType = 1361,313 ; 1834,2 ; 538,1584 ; "None"
Health = 31065132
MaxHealth = 31178010
MyCharacterInFrontHim = True
HealthPercent = 99
HealthRatio = 0,99
IsGoodInteractDistance = True
InteractDistance = 32,7
CombatReach = 30
IsSwimming = False
IsFlying = False
IsMovingForward = False
IsMovingBackwards = False
IsStrafingLeft = False
IsStrafingRight = False
IsTurningLeft = False
IsTurningRight = False
IsStunned = False
IsFalling = False
IsFallingFar = False
AggroDistance = 21
Rotation = 2,114788
CreatureTypeTarget = Демон
FactionTemplate = wManager.Wow.Helpers.WoWFactionTemplate
Mana = 0
MaxMana = 0
ManaPercentage = 100
Rage = 0
MaxRage = 0
RagePercentage = 0
Fury = 0
MaxFury = 0
FuryPercentage = 0
Pain = 0
MaxPain = 0
PainPercentage = 0
Focus = 0
MaxFocus = 0
FocusPercentage = 0
Energy = 0
MaxEnergy = 0
EnergyPercentage = 0
Chi = 0
MaxChi = 0
ChiPercentage = 0
Runes = 0
MaxRunes = 6
RunesPercentage = 0
RunicPower = 0
MaxRunicPower = 0
RunicPowerPercentage = 0
SoulShards = 0
MaxSoulShards = 0
SoulShardsPercentage = 0
AstralPower = 0
MaxAstralPower = 0
AstralPowerPercentage = 0
UnitClassification = elite
IsElite = True
IsWorldBoss = False
HolyPower = 0
MaxHolyPower = 0
HolyPowerPercentage = 0
Alternate = 0
MaxAlternate = 0
AlternatePercentage = 0
Maelstrom = 0
MaxMaelstrom = 0
MaelstromPercentage = 0
Insanity = 0
MaxInsanity = 0
InsanityPercentage = 0
ArcaneCharges = 0
MaxArcaneCharges = 0
ArcaneChargesPercentage = 0
Faction = 2502
DisplayId = 76028
GetMove = False
SpeedMoving = 0
GetDistance = 27,80023
GetDistance2D = 26,00065
GetDistanceZ = 9,839661
IsAlive = True
IsDead = False
IsLootable = False
IsMyPet = False
HasTarget = True
IsTargetingMe = False
IsTargetingMyPet = True
IsTargetingPartyMember = False
IsTargetingMeOrMyPet = True
IsTargetingMeOrMyPetOrPartyMember = True
IsMyTarget = True
IsMyPetTarget = True
IsPartyMemberTarget = False
IsMeOrMyPetTarget = True
IsMeOrMyPetOrPartyMemberTarget = True
Target = 0043EE01022B0BF5283CE0D0A04C6240
TargetObject = Инфернал (Unit) : 0x54E9233C : 0043EE01022B0BF5283CE0D0A04C6240 : Pet-0-3896-1669-17390-78217-01022B0BF5
Level = 110
EffectiveLevel = 0
IsBoss = False
PetNumber = 0
Name = Аггонар
DBCacheRow = 274813236
UnitFlags = PetInCombat, Combat
UnitNPCFlags = None
Skinnable = False
IsNpcSpiritHealer = False
IsNpcRepair = False
IsNpcVendor = False
IsFlightMaster = False
IsNpcInnkeeper = False
IsNpcVendorFood = False
IsAuctioneer = False
IsNpcTrainer = False
IsNpcWildPets = False
Summon = 00000000000000000000000000000000
CreatedBy = 00000000000000000000000000000000
CreatedBySpell = 0
SummonedBy = 00000000000000000000000000000000
IsPet = False
PetOwnerGuid = 00000000000000000000000000000000
InCombat = True
InCombatFlagOnly = True
InCombatWithMe = False
CastingSpellId = 0
CastingSpell =  (Id found: 0, Name found: , NameInGame found: , Know = False, IsSpellUsable = False)
CastingTimeLeft = 0
CastingTimeStartSince = 0
IsCast = False
CanInterruptCasting = False
IsMounted = False
MountDisplayId = 0
TransportGuid = 00000000000000000000000000000000
InTransport = False
Reaction = Hostile
IsTracked = False
IsOnTaxi = False
NotSelectable = False
IsAttackable = True
PlayerControlled = False
Silenced = False
Rooted = False
Root = True
Influenced = False
Confused = False
Pacified = False
Fleeing = False
Possessed = False
NpcMarkerId = 0
NpcMarker = None
IsOutdoors = True
IsIndoors = False
IsPartyMember = False
IsPartyLeader = False
GetBaseAddress = 1299998692
IsValid = True
GetDescriptorStartAddress = 1300006524
Guid = 0043EE00002A6CE1203CE0D0A0749940
Guid128 = Creature-0-3896-1669-17390-119397-00002A6CE1
Type = Unit
GetDynamicFlags = 0
IsInvisible = False
Entry = 119397
Scale = 1
BuffStack("Ghost") = 0
HaveBuff("Ghost") = False
BuffCastedBy("Ghost") = 00000000000000000000000000000000
Auras:
 -  Agony: ID=980, Stack=3, TimeLeft=13338 ms, Owner=00000000097359320819100000000000, Flag=Active, Negative, CasterLevel=110, Mask=469762052
 -  Souls of the Damned Driver: ID=199378, Stack=0, TimeLeft=175394 ms, Owner=00000000097359320819100000000000, Flag=None, CasterLevel=86, Mask=335544320
 

 

Link to comment
Share on other sites

InteractDistance = 32,7
CombatReach = 30

Seem good, try to use https://wrobot.eu/bugtracker/sizerange-calculation-is-broken-r497/?do=findComment&comment=3338 or https://wrobot.eu/bugtracker/sizerange-calculation-is-broken-r497/?do=findComment&comment=3329 in one of you spell to check if problem is not caused by your fightclass

Link to comment
Share on other sites

16 minutes ago, Droidz said:

InteractDistance = 32,7
CombatReach = 30

Seem good, try to use https://wrobot.eu/bugtracker/sizerange-calculation-is-broken-r497/?do=findComment&comment=3338 or https://wrobot.eu/bugtracker/sizerange-calculation-is-broken-r497/?do=findComment&comment=3329 in one of you spell to check if problem is not caused by your fightclass

problem not with fightclass at all. problem is - fightclass rotation not started, character stuck on trying to get in range to mob. that position inside lava and even if its reached - fightclass not started, its blacklist mob after few seconds

attached log and video how quest bugged when used as regular kill and loot for that mob

log: 2 сен 2017 15H32.log.html

video2017-09-02_15-48-43.mp4

 

update: character tryed to swimm underground underlava, i think coz boss actual position there

Edited by camelot10
Link to comment
Share on other sites

seems like that a old bug with inrange calculation with 4 footed demons. i have tons of fightclasses, its realy pain to adjust all spells in all fightclasses for custom inrange check. any other solutions ?

Link to comment
Share on other sites

@Droidz

do you fix this type of mobs hitbox bug or can we hook/handle TraceLine.TraceLineGo(from, to, CGWorldFrameHitFlags.HitTestAllWhitoutLiquid) or maybe possibility for default setting CGWorldFrameHitFlags for TraceLine

or hook/handle for Fightclass Distance/range check?

before movement in vehicle and this bug i was wrobot evangelist i think everything is possible with wrobot :biggrin:

Edited by camelot10
Link to comment
Share on other sites

What is the result when you are in good distance of:

robotManager.Helpful.Logging.Write("r = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(wManager.Wow.ObjectManager.ObjectManager.Target.Position));

I'll try to reach this mob tomorrow (or if you have more easy npc to reach with the same problem  tell me where I can found him)

Link to comment
Share on other sites

I cannot reach this mob quickly, can you target this mob and run this code (give me result):

        var tPos = wManager.Wow.ObjectManager.ObjectManager.Target.Position;
        var tCombatReach = wManager.Wow.ObjectManager.ObjectManager.Target.CombatReach;
        var pPos = wManager.Wow.ObjectManager.ObjectManager.Me.Position;
        robotManager.Helpful.Logging.Write("t = " + wManager.Wow.ObjectManager.ObjectManager.Target);
        robotManager.Helpful.Logging.Write("r1 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos));
        robotManager.Helpful.Logging.Write("r2 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, 1.5)));
        robotManager.Helpful.Logging.Write("r3 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, 2.5)));
        robotManager.Helpful.Logging.Write("r4 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0,- 1.5)));
        robotManager.Helpful.Logging.Write("r5 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, -2.5)));
        robotManager.Helpful.Logging.Write("r6 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, tCombatReach)));
        robotManager.Helpful.Logging.Write("r7 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, tCombatReach / 2)));
        robotManager.Helpful.Logging.Write("r8 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, tCombatReach / 3)));
        robotManager.Helpful.Logging.Write("r9 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(tPos + new Vector3(0, 0, tCombatReach / 4)));
        robotManager.Helpful.Logging.Write("r10 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(robotManager.Helpful.Math.GetPostion3DOfLineByDistance(pPos, tPos, pPos.DistanceTo(tPos) - tCombatReach)));
        robotManager.Helpful.Logging.Write("r11 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(robotManager.Helpful.Math.GetPostion3DOfLineByDistance(pPos, tPos, pPos.DistanceTo(tPos) - tCombatReach - 1)));
        robotManager.Helpful.Logging.Write("r12 = " + wManager.Wow.Helpers.TraceLine.TraceLineGo(robotManager.Helpful.Math.GetPostion3DOfLineByDistance(pPos, tPos, pPos.DistanceTo(tPos) - tCombatReach + 1)));

 

Link to comment
Share on other sites

1 hour ago, Droidz said:

I cannot reach this mob quickly, can you target this mob and run this code (give me result):

 

here you go:

20:22:19 - t = Аггонар (Unit) : 0x60EA9AEC : 00261B00002FF669203AE8D0A0749940 : Creature-0-3770-1669-9755-119397-00002FF669
20:22:19 - r1 = True
20:22:19 - r2 = True
20:22:19 - r3 = True
20:22:19 - r4 = True
20:22:19 - r5 = True
20:22:20 - r6 = False
20:22:20 - r7 = False
20:22:20 - r8 = False
20:22:20 - r9 = False
20:22:20 - r10 = False
20:22:20 - r11 = False
20:22:20 - r12 = False

was standing right in front on mob and hiting with autoattack 

Link to comment
Share on other sites

16 minutes ago, Droidz said:

If you can try with this file (move and replace this file in "Bin" folder), and use this file some time to check if this fix don't add new bugs.

wManager.dll

yes. its working now. attacked that mob from range and melee. tested with frost mage and vengeance demon hunter. can record video if you wish. also i can run for some time my world quests with that dll and i will report 

uVKxtbh.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...