View Single Post
  #5  
Old 04-28-2013, 09:41 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Figured out a work around... not sure how efficient this is yet. But it works!

Checks for an Item on the player ... So if they are holding X item the swarm pet will buff itself with a nice buff!

So I guess you could make multiple different ranks of an item that make swarm pets more and more powerful.. heh

Code:
sub EVENT_SPAWN {
        quest::settimer("Buffs", 1);
}

sub EVENT_TIMER {
		my $petitem = 1733;
		my $petbuff = 27424;
		#Hostile Target of the Swarm PET!
        $KillTarg = $npc->GetTarget();
		
        if($KillTarg <= 0)
        {
			#Return if we have no target
                return;
        }
		#Grabbing all clients
		my @clientlist = $entity_list->GetClientList();
		foreach $ent (@clientlist)
		{
		my $ClientName = $ent->GetName();
		my $PlayerENT = $ent;
		my @hatelist = $KillTarg->GetHateList();    #Compare clients to those on the Hatelist of the Target
			foreach $ent (@hatelist)
			{
				my $h_ent = $ent->GetEnt();
				my $h_ent_name = $h_ent->GetName();
				if ($ClientName eq $h_ent_name)
				{
					if(plugin::check_hasitem($PlayerENT, $petitem))  #Check the clients on the hatelist for Worn Pet Buff item
					{
					my $myid = $npc->GetID();
					$npc->CastSpell($petbuff, $myid);
					quest::stoptimer("Buffs");
					return;  #Turn this on if you want it to stop after it finds ONE client with the item
					}
				}
			}
		}
}
Reply With Quote