Thread: NPC AoE Aggro
View Single Post
  #2  
Old 01-23-2014, 09:58 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Quote:
Originally Posted by kimura View Post
I have a boss that spawns adds...

adds are same faction as boss...

boss has an AoE that aggros the adds to him? then they fight each other...

I have tried setting the npc_aggro field to 0 and 1 on both npcs, but it doesn't change anything...I don't want to remove the AoE because it's needed for the event...

anyone have a similar problem here? any suggestions?

thanks

Kimura
No clue why, I'd have to look at it.

I wrote something up for you because I'm a bit bored waiting for my GF to finish a test. This would solve your problem if you changed that AoE to a single target spell. This way every client on the bosses hate list will be technically casting the spell on themselves. I used "SpellFinished" instead of "CastSpell" so there's no cast time. It should achieve the same effect. I copy and pasted the SpellFinished in case you aren't sure what those values mean.

Note: Since this works on the hate list.. healers hiding behind walls will get hit by this too.

Code:
sub EVENT_COMBAT {
	if($combat_state == 1) { #:: NPC is in combat
		quest::settimer("bossaoe",(int(rand(10)) + 5)); #:: random of 10 seconds +5 seconds to make sure its not chain firing.
	}
	if($combat_state == 0) { #:: NPC has left combat
		quest::stoptimer("bossaoe");
	}
}

sub EVENT_TIMER {
	my @hatelist = $npc->GetHateList();
	if($timer eq "bossaoe") {
		quest::stoptimer("bossaoe");
		#quest::settimer("bossaoe",(int(rand(10)) + 5)); #:: Not sure if you want this or not.
		foreach my $c (@hatelist) {
			$player = $c->GetEnt();
			$player->SpellFinished(92, $player, -1); #:: Currently casting "Burst of Flame" - Spell ID: 92
			#SpellFinished(spell_id, spell_target = this, mana_cost = 0)
		}
	}
}
Hope this helps!
Reply With Quote