Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2014, 05:26 AM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default GetRandomClient

Does this function not work?

I'm trying this with no luck:

Code:
	if ($timer eq "random_stun"){
		my $RandClient = $entity_list->GetRandomClient($MyX, $MyY, $MyY, 300, 0);
			$npc->CastSpell(5050,$RandClient);
I also tried this, but I added the 0 in the above example because the syntax on the perl reference is: GetRandomClient(x, y, z, range, ClientToExclude) .. thought maybe I needed to 'clienttoexclude'

Code:
my $RandClient = $entity_list->GetRandomClient($MyX, $MyY, $MyY, 300);
Reply With Quote
  #2  
Old 06-26-2014, 05:38 AM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

Pretty sure, CastSpell requires Target ID

Code:
	if ($timer eq "random_stun"){
		my $RandClient = $entity_list->GetRandomClient($MyX, $MyY, $MyY, 300, 0);
                      if ($RandomClient){
			$npc->CastSpell(5050,$RandClient->GetID());
                     }
             }
Reply With Quote
  #3  
Old 06-27-2014, 02:27 PM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Got it working, for future reference if anyone needs it:

Code:
sub EVENT_AGGRO {
	quest::shout("I was aggroed");
	quest::settimer("random_nuke", 8);
	quest::settimer("random_dot", 11);
	quest::settimer("random_stun", 3);
	}
	
	
	
sub EVENT_TIMER {	
	if ($timer eq "random_stun"){
		$x = $npc->GetX();
		$y = $npc->GetY();
		$z = $npc->GetZ();
		my $RandClient = $entity_list->GetRandomClient($x, $y, $z, 400, 0);
		my $RandName = $RandClient->GetName();
		my $RandID = $RandClient->GetID();
		$npc->CastSpell(5050,$RandID);
		quest::shout("Be stunned $RandName");
		}
	if ($timer eq "random_nuke"){
		$x = $npc->GetX();
		$y = $npc->GetY();
		$z = $npc->GetZ();
		my $RandClient = $entity_list->GetRandomClient($x, $y, $z, 400, 0);
		my $RandName = $RandClient->GetName();
		my $RandID = $RandClient->GetID();
		$npc->CastSpell(5075,$RandID);
		quest::shout("Be nuked $RandName");
		}
	if ($timer eq "random_dot"){
		$x = $npc->GetX();
		$y = $npc->GetY();
		$z = $npc->GetZ();
		my $RandClient = $entity_list->GetRandomClient($x, $y, $z, 400, 0);
		my $RandName = $RandClient->GetName();
		my $RandID = $RandClient->GetID();
		$npc->CastSpell(5049,$RandID);
		quest::shout("Be dotted $RandName");
		}
	}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:16 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3