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-28-2008, 03:44 PM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default NPC selecting a specific player from a group

Anyone know of a good way to code an event where an NPC who is fighting a group of people will select a player randomly out of that group and cast a spell on it?

I am not so concerned about the random part or the spell but just if there is a way to have an npc to select which player in a group it would attack.
Reply With Quote
  #2  
Old 06-28-2008, 06:50 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I don't think it is possible for it to pick anything other than it's primary target and maybe the rampage or secondary target. But, if there is a way, you probably would be best to look for it in the quest object wiki here:

http://www.eqemulator.net/wiki/wikka...a=QuestObjects
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 06-30-2008, 12:16 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

I'm not sure if this is quite what you're looking for, but you could use a Quest Global to select someone at random from the Hate List:

Code:
$mob->GetHateRandom();
I think you could then use another Quest Global to cast the spell on them:

Code:
$mob->CastSpell(123, $mob->GetHateRandom());
That should cast a spell with a Spell ID of 123 on a random person in the hate list.

You might be able to find a way to work back from that Client ID given by GetHateRandom to get the group ID, then find out who's in it, but I wasn't able to find anything like that just browsing through the quest globals.

Hope this helps.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #4  
Old 06-30-2008, 05:38 PM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

I've changed up GroupCount to account for names and also used count and member id of group to do something like this. Basically, if you're number 2 in a group of 4, I'd have a random integer of 1-GroupCount if Group. Get the client name and perform the action. It can make raid encounters a little sticky;p I'm trying to dig up the code, but no dice yet. Will keep it posted.
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 11:49 AM.


 

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