View Full Version : max PC on hatelist?
Maceblade
03-16-2013, 04:05 PM
Im trying to make a mob that has a max of 6 people allowed on his hate list and anyone that tries to assist over that gets ported.
I guess i need the line check for the hate list part of it.
sorvani
03-16-2013, 05:05 PM
look at using
sub EVENT_HATE_LIST
and
$npc->GetHateList()
Maceblade
03-16-2013, 08:48 PM
Thanks, I got that part im just curious as to how you get it to remove PC 7+?
Zamthos
03-16-2013, 08:52 PM
Maybe an if statement that checks if the hatelist is over six, and if it is, it randomly selects a player and ports it away?
sorvani
03-16-2013, 08:54 PM
Walk the hate list and after you get to 6 add each new client to an array. When you are done walking the hate list, then walk you temp array and gmmove them all
Kayen
03-17-2013, 02:31 AM
my $count = 0;
my @hatelist = $npc->GetHateList();
foreach $ent (@hatelist)
{
my $h_ent = $ent->GetEnt();
$count++;
if ($h_ent)
{
if ($count >= 7)
{
$npc->GMMove(whatever)
}
}
}
sorvani
03-17-2013, 03:58 PM
thinking about this some more, I would not just walk the hate list as pets will be there too.
walk the list each time the event hits. and check if it is a client. if so add it to a list of names in an array declared at spawn.
once that array is up to 6, if GetName or GetOwner is not one of the 6 names then port them.
depending on how you want to handle a fail, you can reset the 6 names to nothing when the mob leaves combat. or set a time to reset the names if you are going to give them a chance to regroup before anyone else can do anything.
if you have any kind of massive damage ability with a range greater than the aggro range, you may want to rethink a few other things as people could easily do something like a mana burn or crit big damage spell or something in a large 1 shot blast. it will still do the damage and then add the person to the hate list which would then port them. but the damage would already be done.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.