View Single Post
  #2  
Old 01-28-2009, 04:25 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by Kilralpine View Post
What is the best way to do the following...

Get Highest Hate List Target, And Cast a Spell on him
You should be able to use the quest object $mob->GetHateTop() to get the player that's on the top of the hate list. You could do something like this to have the NPC cast it on whomever's on the top of the hate list:

Code:
$npc->CastSpell($mob->GetHateTop(),12345)
You may have to cast $mob->GetHateTop() to the Entity List ID (GetID() maybe?), but that should do the trick.

Quote:
Originally Posted by ChaosSlayer View Post
I like to expand this question and add that I am looking for a simular way to work with Hate list.
Basicly some sort of a comand that allows me to select random or even sort the hate list for various purposes.

For exmaple:

-select random person on hate list
-select specific person on hate list (like 6th)
-reverse hate list (the 1st becomes last and vice-verse)
-find specific class on hate list (like cleric)
-find specific race
-find a pet
1) $mob->GetHateRandom()
2) In a roundabout way, you could probably cycle through the entity list in combination with $mob->GetHateAmount(tmob, is_dam= false) to generate the hate list, but I think it might be better (read: fewer CPU cycles) to create a new command (maybe GetHateList()?) to output the hate list as an array that you can then work with.
3) If we create a GetHateList() command, we can just reorder the array without actually changing the hate list.
4-6) Again, if we create a GetHateList() command, we can use $mob->GetClass(), $mob->GetRace(), and $mob->GetPetID() (or add $mob->IsPet()) to create a secondary or tertiary "filtered" list to select from.
__________________
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