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

[Plugin Help] Ignore Monsters

lypnn

New Member
Joined
Jul 15, 2012
Messages
131
Reaction score
4
[Plugin] Ignore Monsters

Hello buddys,

I'd need a quick help on a new Plugin, I have some experience with C# and I have the nice GilesIgnoreStuff.cs Plugin to start with.
The only thing I'm stuck with is to find the right TargetingProvider from Demonbuddy to replace.

This is how the Loot Targeting Provider in GilesIgnoreStuff gets replaced:
LootTargeting.Instance.Provider = newTargetingProvider

I assume it must be something like CombatTargeting.Instance.Provider that I'm looking for. But then I also need to know the methods to replace. The LootTargeting has a method "GetObjectsByWeight()" which is used and I'm looking for something similar which can be used from the Combat Targeting.

Any help would be nice! I will surely post it here when its finished.

Maybe its all inside a .dll and I can use the object browser, or there is an API somewhere?
 
Last edited:
Thanks for your reply.

I took a look at the VachemQuestHelper Plugin but unfortunatly it's not what I was looking for. It is only using the OnPulse() event and setting the Profile.KillMonsters to true or false depending on which area you are currently in.

I'm still curious how you found the LootTargeting provider class and its method GetObjectsByWeight(). I think I'll have to look into the Zeta Namespace somewhere so I'm gonna mess around with the object browser later today.
 
Thanks for your reply.
I took a look at the VachemQuestHelper Plugin but unfortunatly it's not what I was looking for. It is only using the OnPulse() event and setting the Profile.KillMonsters to true or false depending on which area you are currently in.
I'm still curious how you found the LootTargeting provider class and its method GetObjectsByWeight(). I think I'll have to look into the Zeta Namespace somewhere so I'm gonna mess around with the object browser later today.

Oh, it's changed! I looked at it a couple of weeks ago to help me learn - and it was altering combat targetting almost exactly like my ignore stuff alters loot targetting. I don't think I have a copy of the original either to give you, sorry :(
 
Interesting! I might try to get the older version then, if I cannot figure it out on my own today.

What exactly are you trying to do?

I want to write a short plugin to ignore certain monsters, preferably by name. This should be very usefull for larger profiles like the champion farming where I dont want to kill every single zombie or every tree. In my case (wizard) it is a big problem because once I killed a tree and another monster comes by, it will cast on the monster while staying still and so I die from the poisoncloud of the dead tree.
 
Is there a particular string of code that can check if there are nearby elites?
 
Interesting! I might try to get the older version then, if I cannot figure it out on my own today.
I want to write a short plugin to ignore certain monsters, preferably by name. This should be very usefull for larger profiles like the champion farming where I dont want to kill every single zombie or every tree. In my case (wizard) it is a big problem because once I killed a tree and another monster comes by, it will cast on the monster while staying still and so I die from the poisoncloud of the dead tree.

TBh you can probably copy & paste my ignore stuff plugin exactly, and just do a Ctrl+F for "LootTargeting" to "CombatTargeting". And then work on the "RemoveThisItem" function, and do something like this;
Code:
        private bool RemoveThisItem(DiaObject thisobject)
        {
            bool bRemoveThis = false;
            Log("Name=" + thisobject.Name + ". IsElite=" + thisobject.CommonData.IsElite.ToString());
            if (!thisobject.CommonData.IsElite && !thisobject.CommonData.IsRare && !thisobject.CommonData.IsUnique)
                bRemoveThis = true;
            return bRemoveThis;
        }
^^ though I haven't tested any of that at all, just made that up as I wrote it in the forums, but that should get you started!
 
thanks Giles, this helped!

I got it working but then I noticed it will be necessary to not-ignore monsters when they are too close to yourself, or they will collide with your path and block you.

So I tried to get the Distance to the Unit but I cant seem to get it in yards so easily: here a snippet

if (thisobject is DiaUnit)
{
var thisunit = (DiaUnit)thisobject;

//Log("Distance to " +thisname +": " + thisunit.CommonData.Position.Distance(ZetaDia.Actors.Me.Position));
//Log("DistanceSQR to " + thisname + ": " + thisunit.CommonData.Position.DistanceSqr(ZetaDia.Actors.Me.Position));
//Log("Distance2D to " + thisname + ": " + thisunit.CommonData.Position.Distance2D(ZetaDia.Actors.Me.Position));
Log("Distance2DSQR to " + thisname + ": " + thisunit.CommonData.Position.Distance2DSqr(ZetaDia.Actors.Me.Position));

All those 4 methods give me numbers which cant be in-game yards. Monsters in melee range often give me a higher distance than the ones further away, very strange.

I think I need some help again.. or maybe I can find it in other plugins
 
Last edited:
I was thinking too complicated here. It was just thisunit.Distance :)

Here it is, it ignores monsters by name if they are not too close to yourself (default: 11 yards).
Since it is a CombatTargetingProvider it wont work in combination with Giles Monster Priority Changer.
 

Attachments

Back
Top