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. |
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 |
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(); Code:
$mob->CastSpell(123, $mob->GetHateRandom()); 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. |
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.
|
All times are GMT -4. The time now is 07:23 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.