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

[Help] Executing code on MobKilled event.

Invalid

New Member
Joined
Jun 12, 2010
Messages
5
Reaction score
0
I'm looking for a way to add the possibility to loot on private servers, which can be done easily by making a plugin that interacts with the currenttarget after when the mob dies.

There is already an event for this, I just need to know how to catch when this fires so that I can execute the Interact command.

I've also just tried to check if current target is dead, and lootable, then interact with it, but Honorbuddy clears the target after death, so it is impossible to tell since it is no longer the target. My first thought was to use TargetLastTarget then check, but this caused issues in Combat.

Then I tried to make a list of all the WoWCorpse objects around, but there is no way to check if the corpses are lootable...

So My question is, does anyone know what code is needed to catch the MobKilled event?
 
run a search for WoWUnits, and look for the CanLoot Property you can re-run the code again, to look for the CanSkin property as well.
 
So,

foreach (WoWunit unit in ObjectManager.ObjectList){
if(unit.IsLootable/skinnable){'Code Here'}
}
?
 
So,

foreach (WoWunit unit in ObjectManager.GetObjectsOfType&lt;WoWUnit&gt;<wowunit>()</wowunit>){
if(unit.IsLootable/skinnable){'Code Here'}
}
?

Fix'd.

I recommend you go pickup a programming book.
 
idk, i honestly think you'll have the same problem even if its done manually, i think its the Interact(), that kills it, not the way the private server handles a mob on death.
 
No I know exactly what is causing the issue, I fixed it on a bot for the mac (PocketGnome).

The problem occurs when the bot looks to find if the mob was killed by me, which the private server lacks. Therefore always being false. If you forgo the KilledByMe check, and just go for IsLootable, it works fine. The actual loot flags are the issue, Private servers(The one's I've played on) use only is lootable, they don't care who killed it.

Honorbuddy works wonders on Official servers, and I know it will on private servers as well, just need to fix the looting issue.

--You guys rock, got it working fine, just need to fine tune the timing.
 
Last edited:
the only issue I am having now, is pausing the bot while the plugin is moving to the target. I know that it requires Thread.Sleep(#); which is what I am using, but Does anyone know how to do this dynamically, or pause untill I resume it? My first idea was Thread.Suspend(); but this can cause issues if it does not continue normally. So either I need to find a way to pause it until I resume, or stick with the same target while in a for loop.

My problem arises when the foreach loop repeats, as it changes targets if there is more than one lootable corpse nearby, and starts running between the two of them. Any suggestions would be greatly appreciated, this is the only remaining bug I have...
 
Back
Top