Hate list

From PSwiki
Revision as of 19:04, 9 April 2013 by Magodra (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The NPC hate list is a very important thing for an npc scripter to understand. Each NPC maintains its own list of entities that it does not like, and each of these entities gets a hate score based on what the entity does to the npc. For example, an npc on startup has an empty hate list. But then a player (“Androgos”) attacks him and hits him for 10 damage:

Hate list: Androgos-10

Now Androgos is the most hated player (because he is the only one) and the npc chooses to fight him back with his <melee> operation. A few seconds later in the fight, Androgos hits him again for 12 damage and Androgos’s friend “Gronomist” casts a Fire spell on the npc also, for 25 damage.

Hate list: Androgos-22, Gronomist-25

Next time the <melee> operation is checked, Gronomist becomes the most hated person and the npc will switch his attack to focus on Gronomist. Meanwhile, a 3rd player in the group, “Djagg” is the healer of the group and heals Androgos’s wounds for 15 HP, which the NPC really hates.

Hate list: Androgos-22, Gronomist-25, Djagg-45

So now the NPC decides to go after the healer. And so on. The idea is that the tactics of the NPC can be determined by the way he reacts to different events during combat such as spells, damage and healing.

When a player dies, they are removed from the hate list. So the NPC will not recognize the reincarnated player when he comes back. This keeps the entire world from attacking players all the time, and keeps hate lists reasonably short. Likewise, when the NPC dies, his entire hate list is cleared out.

The Hate list is modified by Operations and Reactions; Attack, or Damage.