• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Override - A Targeting Override Plugin

    Discussion in 'Archives' started by Apoc, May 30, 2010.

    1. Sokoo

      Sokoo New Member

      Joined:
      Feb 23, 2010
      Messages:
      134
      Likes Received:
      0
      Trophy Points:
      0
      Heey it can't be compiled neither in the stable release or in the beta... :S
      This is the error given.
      Code:
      [21:47:38:908] Plugin Override.cs could not be compiled! Compiler errors:
      [21:47:38:910] File: Override.cs Line: 146 Error: Styx.Logic.Questing.PlayerQuest bevat geen definitie voor IsCompleted en er is geen extensiemethode IsCompleted gevonden waarmee het eerste argument van het type Styx.Logic.Questing.PlayerQuest wordt geaccepteerd (mogelijk ontbreekt er een gebruiksinstructie of een assembly-verwijzing)
      File: Override.cs Line: 154 Error: Styx.WoWInternals.WoWObjects.LocalPlayer bevat geen definitie voor IsInRaid en er is geen extensiemethode IsInRaid gevonden waarmee het eerste argument van het type Styx.WoWInternals.WoWObjects.LocalPlayer wordt geaccepteerd (mogelijk ontbreekt er een gebruiksinstructie of een assembly-verwijzing)
      File: Override.cs Line: 165 Error: Styx.WoWInternals.WoWObjects.LocalPlayer bevat geen definitie voor IsInRaid en er is geen extensiemethode IsInRaid gevonden waarmee het eerste argument van het type Styx.WoWInternals.WoWObjects.LocalPlayer wordt geaccepteerd (mogelijk ontbreekt er een gebruiksinstructie of een assembly-verwijzing)
      File: Override.cs Line: 165 Error: Styx.WoWInternals.WoWObjects.LocalPlayer bevat geen definitie voor IsInParty en er is geen extensiemethode IsInParty gevonden waarmee het eerste argument van het type Styx.WoWInternals.WoWObjects.LocalPlayer wordt geaccepteerd (mogelijk ontbreekt er een gebruiksinstructie of een assembly-verwijzing)
       
    2. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Since my way of getting quest objective IDs (e.g. the mobs needed to kill for a quest) is a bit dodgey (I don't have all the API I need to make it work, and I cba to wrap the stuff for a simple plugin). If you want to add/remove weight for quest mobs, find the following lines:

      Code:
                          if (questObjectiveEntries.Contains((int) u.Entry))
                              t.Weight += 100f;
      And change the 100f to something around 150f-250f. That'll add enough weight to try to stay on the mobs you want, but will (hopefully) still avoid pulling the entire pack.

      You may also want to change the following:

      Code:
                          t.Weight -= 50 * GetAggroWithin(u.Location, 15f);
      To
      Code:
                          t.Weight -= 15 * GetAggroWithin(u.Location, 15f);
      To give less of a detriment to mobs with aggroable units around it. (So it'll go through the pack, from front to back, instead of avoiding it.)

      The weighting algorithm is fairly self explanatory, just do the math with (logical) values, and you can figure out the estimated 'good' weights to use.
       
    3. TWKing

      TWKing New Member

      Joined:
      Apr 3, 2010
      Messages:
      89
      Likes Received:
      3
      Trophy Points:
      0
      Thanks Apoc. I looked through the code to get an idea of what the plugin is doing, but don't know enough to change it myself. Making your suggested changes now, will report back later with the results. Cheers
       
    4. ilyals

      ilyals Member

      Joined:
      May 26, 2010
      Messages:
      119
      Likes Received:
      3
      Trophy Points:
      18
      Some fix for Target Min/Max level

      Apoc, superb plugin, thank you!

      Just a little additions:
      It's essentialy for questing profiles to have right Min/Max levels, but plugin won't take this into account, so i've edited it a bit
      and now it selects mobs with Min/Max level specified in Profile tags <TargetMinLevel> <TargetMaxLevel>.
      Also changed pack pulling and quest mob weight (as Apoc posted).
      Test this out =)

      UPDATE: just some more: I didn't found any check if mob is tagged by other player in weight assignment function, so maybe add somthing like:
      Code:
         if (u.Tagged && !inParty && !TargetingMeOrPet(u)) // we don't want to attack mobs taged by other players, do we? ;-)
                          {
                              t.Weight = 0;
                          }
      
      after these lines in CreateTargetList() function.
      Code:
         // Check these first, since they require 0 reads.
                          if (Blacklist.Contains(guid))
                          {
                              // If the mob is blacklisted, just continue forward. We don't need to worry about it at the moment.
                              if (dist > 20)
                                  continue;
      
                              t.Weight -= 1000f;
                          }
      
      or just add this into possibleTargets, for example:
      Code:
      possibleTargets = (from o in ObjectManager.ObjectList
                                         where o is WoWUnit && !o.IsMe
                                         let dist = o.Distance
                                         let u = o.ToUnit()
                                         where !u.IsPet && dist < _settings.TargetRange
                                               && !u.Dead && u.CreatureType != WoWCreatureType.Critter && !u.IsFriendly && [B]!u.Tagged[/B]
                                               // Make sure we handle these, since we don't want them to be unreachable
                                               !u.OnTaxi && !u.IsOnTransport && !u.IsFlying &&
                                               // If we can't attack them, or select them, then ignore them.
                                               u.Attackable
                                         // Correct level range...
                                         let l = u.Level
                                         where l >= MinLevel && l <= MaxLevel
                                               // Check player targeting, obviously we only want this to run when we're not in BGs
                                               // Ordering done this way on purpose. 1 read required here.
                                               && (_settings.TargetPlayers || Battlegrounds.IsInsideBattleground || !(u is WoWPlayer))
                                         select u).ToList();
      
      but i think that wouldn't work in party
       

      Attached Files:

      Last edited: Jun 3, 2010
    5. TWKing

      TWKing New Member

      Joined:
      Apr 3, 2010
      Messages:
      89
      Likes Received:
      3
      Trophy Points:
      0
      Apoc

      Your suggestions worked superbly, thank you. Is there a way to prevent the plugin from targetting other players when not in PVP?
       
    6. Forb1d

      Forb1d New Member

      Joined:
      Jan 15, 2010
      Messages:
      152
      Likes Received:
      3
      Trophy Points:
      0
      <TargetPlayers>True</TargetPlayers>

      that is in the "OverrideTargetSettings.xml" in the Config folder (In your HB Directory). Change that to False.
       
    7. ilyals

      ilyals Member

      Joined:
      May 26, 2010
      Messages:
      119
      Likes Received:
      3
      Trophy Points:
      18
      Also it's good to skip neutral mobs if they are not quest targets and we have quests aviable:
      add this in helpers region
      Code:
      private static bool questsAreAviable()
              {
                  // Only grab incomplete quests
                  List<int> questsAviable = (from q in StyxWoW.Me.QuestLog.GetAllQuests().Where(q => !q.IsCompleted) 
                                             from o in q.GetObjectives() 
                                             select o.ID).ToList();
                  // shit code need to optimize
                  if (questsAviable.Count > 0)
                  {
                      return true;
                  }
                  return false;
              }
      
      and after
      Code:
                          // Current target gets extra weight. This avoids having the bot jump back and forth between targets.
                          if (gotTarget && targetGuid == guid)
                              t.Weight += 100f;
      
      add
      Code:
       if (u.IsNeutral && !questObjectiveEntries.Contains((int)u.Entry) && questsAreAviable()) // just skip mobs that are not quest mobs if they are neutral
                          {
                               t.Weight = 0;
                          }
      
      UPDATE: need some logic to not skip mobs that are not "kill mob quest target", but "loot some shit from mob quest target"
       
      Last edited: Jun 3, 2010
    8. pinhe1ro

      pinhe1ro New Member

      Joined:
      Jan 15, 2010
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      Bug

      Have a Elemental Shaman at lvl 38 using the profile Horde 1-60 (Originally by Bliik) and it only keeps running from hotspot to hotspot in a zone almost without mobs to kill and blacklisting for 10m the few that find, tested with 2 different classes and 2 different versions of honorbuddy, with plugin disabled the problem is solved, log attached.
       

      Attached Files:

      Last edited: Jun 4, 2010
    9. theatristformallyknownasG

      theatristformallyknownasG Active Member

      Joined:
      Jan 16, 2010
      Messages:
      3,041
      Likes Received:
      8
      Trophy Points:
      38
      Ilyals, so this just gets added to the override.cs you posted earlier in this thread ?

      G
       
    10. TWKing

      TWKing New Member

      Joined:
      Apr 3, 2010
      Messages:
      89
      Likes Received:
      3
      Trophy Points:
      0
      Forb1d - Thanks for the info. Didn't even notice the config file. No more problems with targeting player characters.
      Ilyals - Great ideas. Implemented them into the code and it's targeting quest mobs much more smoothly. Also, I added
      after
      so it wouldn't target hostile mobs if out of aggro range as long as quest mobs are available

      One thing I have noticed is that since using this plugin, my toon no longer attempts to repair. It's getting constantly caught up in mobs around it that it forgets it needs to repair it's armor. Is there a way to add a check to see if repair is needed and if it is needed, run to repair and only attack mobs that it aggros along the way?

      Thanks in advance
       
    11. kayes

      kayes Active Member

      Joined:
      Jan 15, 2010
      Messages:
      1,353
      Likes Received:
      4
      Trophy Points:
      38
      Just currious, can theese changes be implemented to HB core?

      (im not a coder)
       
    12. Kuku

      Kuku Member

      Joined:
      Jan 27, 2010
      Messages:
      451
      Likes Received:
      1
      Trophy Points:
      18
      Yes they could. But it is not needed since we have the plugin system^^ So the Community can decide which system it want to use
       
    13. laria

      laria Well-Known Member

      Joined:
      Jan 15, 2010
      Messages:
      5,386
      Likes Received:
      36
      Trophy Points:
      48
      If it is a plugin everyone can read its source and add suggestions and work on it. If its in the core, you are screwed
       
    14. Forb1d

      Forb1d New Member

      Joined:
      Jan 15, 2010
      Messages:
      152
      Likes Received:
      3
      Trophy Points:
      0
      But right now, because it is a plugin, it runs slower. HB's system still tries to run, so you have to run through the object list twice. Apoc said they were gonna see about making a way to prevent this iirc though.
       
    15. xLegendx

      xLegendx Active Member

      Joined:
      Apr 25, 2010
      Messages:
      1,050
      Likes Received:
      1
      Trophy Points:
      38
      Is it working with the newest stable version of HB for everyone?
       
    16. fhlhwow

      fhlhwow New Member

      Joined:
      Jan 15, 2010
      Messages:
      34
      Likes Received:
      0
      Trophy Points:
      0
      TWKing, can you post your latest overide.cs thanks. FWIW mine doesn't repair either when using this and the updated pluging posted a few pages back.
       
    17. haukinyau

      haukinyau New Member

      Joined:
      Apr 25, 2010
      Messages:
      286
      Likes Received:
      1
      Trophy Points:
      0
      lol, my overide will target other player... i mean, yeah its cool~ once i get my good gears and lv80~ will start using this to kill all the botter in my area, kekeke, will test the overide plugin on BG... currently the default target for HB is buggy~ i will update again ^_^
       
    18. king

      king Member

      Joined:
      Jan 15, 2010
      Messages:
      463
      Likes Received:
      1
      Trophy Points:
      18
      WoW dude impressive. I saw a 50k increase
      REP
       
    19. EliteNewbz

      EliteNewbz New Member

      Joined:
      Jun 8, 2010
      Messages:
      19
      Likes Received:
      0
      Trophy Points:
      0
      Can anyone tell me what I'm doing wrong? I just downloaded HB yesterday and installed it and it gives me this error on both a rogue and sham (Shamwow and rogue mut mut class).
      It won't target anything and I'm running a 1-60 profile and the chars are low 20's. Ony way is to be aggro'd.

      Code:
       
      Activity: Moving to hotspot
      Exception from Override:
      System.InvalidCastException: Unable to cast object of type 'Styx.WoWInternals.WoWObjects.WoWUnit' to type 'Styx.WoWInternals.WoWObjects.WoWPlayer'. ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 988, offset:0 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 1309, offset:59
         --- End of inner exception stack trace ---
         --- End of inner exception stack trace ---
         at Styx.WoWInternals.WoWObjects.WoWUnit.get_IsFriendly()
         at Apoc.Plugins.TargetOverride.Override.<CreateTargetList>b__23(<>f__AnonymousType3`2 <>h__TransparentIdentifier19) in c:****\HB\Plugins\Override.cs:line 195
         at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
         at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
         at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
         at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
         at Apoc.Plugins.TargetOverride.Override.CreateTargetList() in c:****\HB\Plugins\Override.cs:line 191
         at Apoc.Plugins.TargetOverride.Override.Targeting_OnTargetListUpdateFinished(Object context) in c:****\HB\Plugins\Override.cs:line 77
      
      Thanks.
       
    20. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      I'm gonna assume you made some changes?

      Post the new .cs file so I can take a look at it.
       

    Share This Page