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

Healthglobe trinity config

r3plic4tor

New Member
Joined
Apr 24, 2014
Messages
801
Reaction score
0
Does some1 Know which config file handle the pickup of Healthglobes ? Want to add Support for reaper wraps
 
Its weighting.cs. Below is my code for it. I modified it for it. You can change it around. The necessary file can be found in a zip pack I posted for Danetta's vault here. YOu will need weighting.cs and legendary.cs

Code:
case GObjectType.HealthGlobe:
                            {
                                if (navBlocking)
                                {
                                    objWeightInfo += " NavBlocking";
                                    cacheObject.Weight = 0;
                                    break;
                                }

                                // Weight Health Globes

                                bool witchDoctorManaLow =
                                    Player.ActorClass == ActorClass.Witchdoctor &&
                                    Player.PrimaryResourcePct <= 0.15 &&
                                    HotbarSkills.PassiveSkills.Contains(SNOPower.Witchdoctor_Passive_GruesomeFeast);

                            //    if ((Player.CurrentHealthPct >= 1 || !Settings.Combat.Misc.CollectHealthGlobe))
								if (!Settings.Combat.Misc.CollectHealthGlobe ||
									(Player.CurrentHealthPct > _playerEmergencyHealthGlobeLimit && !Legendary.ReapersWraps.IsEquipped))
                                {
                                    cacheObject.Weight = 0;
                                }
								else if ((Player.PrimaryResourcePct < 0.5 && Legendary.ReapersWraps.IsEquipped) ||
										Player.CurrentHealthPct < 0.6 )
								{
								cacheObject.Weight = 30000d;
								}
                                // Give all globes super low weight if we don't urgently need them, but are not 100% health
								// change made to add resource (change > to sign in middle to >= to pick only when needed
                                else if (!witchDoctorManaLow && (Player.CurrentHealthPct > _playerEmergencyHealthGlobeLimit) 
										//&& Player.PrimaryResourcePct > 1
										)
                                {
                                    double myHealth = Player.CurrentHealthPct;

                                    double minPartyHealth = 1d;
                                    if (ObjectCache.Any(p => p.Type == GObjectType.Player && p.RActorGuid != Player.RActorGuid))
                                        minPartyHealth = ObjectCache.Where(p => p.Type == GObjectType.Player && p.RActorGuid != Player.RActorGuid).Min(p => p.HitPointsPct);

                                    if (myHealth > 0d && myHealth < V.D("Weight.Globe.MinPlayerHealthPct"))
                                        cacheObject.Weight = (1d - myHealth) * 5000d;

                                    // Added weight for lowest health of party member
                                    if (minPartyHealth > 0d && minPartyHealth < V.D("Weight.Globe.MinPartyHealthPct"))
                                        cacheObject.Weight = (1d - minPartyHealth) * 5000d;
                                }
                                else
                                {
                                    // Ok we have globes enabled, and our health is low
                                    cacheObject.Weight = (90f - cacheObject.RadiusDistance) / 90f * 17000d;

                                    if (witchDoctorManaLow)
                                        cacheObject.Weight += 10000d; // 10k for WD's!

                                    // Point-blank items get a weight increase
                                    if (cacheObject.Distance <= 15f)
                                        cacheObject.Weight += 3000d;

                                    // Close items get a weight increase
                                    if (cacheObject.Distance <= 60f)
                                        cacheObject.Weight += 1500d;

                                    // Was already a target and is still viable, give it some free extra weight, to help stop flip-flopping between two targets
                                    if (cacheObject.RActorGuid == LastTargetRactorGUID && cacheObject.Distance <= 25f)
                                        cacheObject.Weight += 800;
                                }

                                // If there's a monster in the path-line to the item, reduce the weight by 15% for each
                                Vector3 point = cacheObject.Position;
                                foreach (CacheObstacleObject tempobstacle in CacheData.MonsterObstacles.Where(cp =>
                                    MathUtil.IntersectsPath(cp.Position, cp.Radius, Player.Position, point)))
                                {
                                    cacheObject.Weight *= 0.85;
                                }

                                if (cacheObject.Distance > 10f)
                                {
                                    // See if there's any AOE avoidance in that spot, if so reduce the weight by 10%
                                    if (CacheData.TimeBoundAvoidance.Any(cp => MathUtil.IntersectsPath(cp.Position, cp.Radius, Player.Position, cacheObject.Position)))
                                        cacheObject.Weight *= 0.9;

                                }

                                // do not collect health globes if we are kiting and health globe is too close to monster or avoidance
                                if (CombatBase.PlayerKiteDistance > 0)
                                {
                                    if (CacheData.MonsterObstacles.Any(m => m.Position.Distance(cacheObject.Position) < CombatBase.PlayerKiteDistance))
                                        cacheObject.Weight = 0;
                                    if (CacheData.TimeBoundAvoidance.Any(m => m.Position.Distance(cacheObject.Position) < CombatBase.PlayerKiteDistance))
                                        cacheObject.Weight = 0;
                                }

                                // Calculate a spot reaching a little bit further out from the globe, to help globe-movements
                                if (cacheObject.Weight > 0)
                                    cacheObject.Position = MathEx.CalculatePointFrom(cacheObject.Position, Player.Position, cacheObject.Distance + 3f);

                                break;
                            }
 
Its weighting.cs. Below is my code for it. I modified it for it. You can change it around. The necessary file can be found in a zip pack I posted for Danetta's vault here. YOu will need weighting.cs and legendary.cs

Code:
case GObjectType.HealthGlobe:
                            {
                                if (navBlocking)
                                {
                                    objWeightInfo += " NavBlocking";
                                    cacheObject.Weight = 0;
                                    break;
                                }

                                // Weight Health Globes

                                bool witchDoctorManaLow =
                                    Player.ActorClass == ActorClass.Witchdoctor &&
                                    Player.PrimaryResourcePct <= 0.15 &&
                                    HotbarSkills.PassiveSkills.Contains(SNOPower.Witchdoctor_Passive_GruesomeFeast);

                            //    if ((Player.CurrentHealthPct >= 1 || !Settings.Combat.Misc.CollectHealthGlobe))
								if (!Settings.Combat.Misc.CollectHealthGlobe ||
									(Player.CurrentHealthPct > _playerEmergencyHealthGlobeLimit && !Legendary.ReapersWraps.IsEquipped))
                                {
                                    cacheObject.Weight = 0;
                                }
								else if ((Player.PrimaryResourcePct < 0.5 && Legendary.ReapersWraps.IsEquipped) ||
										Player.CurrentHealthPct < 0.6 )
								{
								cacheObject.Weight = 30000d;
								}
                                // Give all globes super low weight if we don't urgently need them, but are not 100% health
								// change made to add resource (change > to sign in middle to >= to pick only when needed
                                else if (!witchDoctorManaLow && (Player.CurrentHealthPct > _playerEmergencyHealthGlobeLimit) 
										//&& Player.PrimaryResourcePct > 1
										)
                                {
                                    double myHealth = Player.CurrentHealthPct;

                                    double minPartyHealth = 1d;
                                    if (ObjectCache.Any(p => p.Type == GObjectType.Player && p.RActorGuid != Player.RActorGuid))
                                        minPartyHealth = ObjectCache.Where(p => p.Type == GObjectType.Player && p.RActorGuid != Player.RActorGuid).Min(p => p.HitPointsPct);

                                    if (myHealth > 0d && myHealth < V.D("Weight.Globe.MinPlayerHealthPct"))
                                        cacheObject.Weight = (1d - myHealth) * 5000d;

                                    // Added weight for lowest health of party member
                                    if (minPartyHealth > 0d && minPartyHealth < V.D("Weight.Globe.MinPartyHealthPct"))
                                        cacheObject.Weight = (1d - minPartyHealth) * 5000d;
                                }
                                else
                                {
                                    // Ok we have globes enabled, and our health is low
                                    cacheObject.Weight = (90f - cacheObject.RadiusDistance) / 90f * 17000d;

                                    if (witchDoctorManaLow)
                                        cacheObject.Weight += 10000d; // 10k for WD's!

                                    // Point-blank items get a weight increase
                                    if (cacheObject.Distance <= 15f)
                                        cacheObject.Weight += 3000d;

                                    // Close items get a weight increase
                                    if (cacheObject.Distance <= 60f)
                                        cacheObject.Weight += 1500d;

                                    // Was already a target and is still viable, give it some free extra weight, to help stop flip-flopping between two targets
                                    if (cacheObject.RActorGuid == LastTargetRactorGUID && cacheObject.Distance <= 25f)
                                        cacheObject.Weight += 800;
                                }

                                // If there's a monster in the path-line to the item, reduce the weight by 15% for each
                                Vector3 point = cacheObject.Position;
                                foreach (CacheObstacleObject tempobstacle in CacheData.MonsterObstacles.Where(cp =>
                                    MathUtil.IntersectsPath(cp.Position, cp.Radius, Player.Position, point)))
                                {
                                    cacheObject.Weight *= 0.85;
                                }

                                if (cacheObject.Distance > 10f)
                                {
                                    // See if there's any AOE avoidance in that spot, if so reduce the weight by 10%
                                    if (CacheData.TimeBoundAvoidance.Any(cp => MathUtil.IntersectsPath(cp.Position, cp.Radius, Player.Position, cacheObject.Position)))
                                        cacheObject.Weight *= 0.9;

                                }

                                // do not collect health globes if we are kiting and health globe is too close to monster or avoidance
                                if (CombatBase.PlayerKiteDistance > 0)
                                {
                                    if (CacheData.MonsterObstacles.Any(m => m.Position.Distance(cacheObject.Position) < CombatBase.PlayerKiteDistance))
                                        cacheObject.Weight = 0;
                                    if (CacheData.TimeBoundAvoidance.Any(m => m.Position.Distance(cacheObject.Position) < CombatBase.PlayerKiteDistance))
                                        cacheObject.Weight = 0;
                                }

                                // Calculate a spot reaching a little bit further out from the globe, to help globe-movements
                                if (cacheObject.Weight > 0)
                                    cacheObject.Position = MathEx.CalculatePointFrom(cacheObject.Position, Player.Position, cacheObject.Distance + 3f);

                                break;
                            }

whats your health globe % setting in trinity?
 
Back
Top