...
Field | Type | Attributes | Key | Null | Default | Extra | Comment' |
int(10) | unsigned |
| NO | NULL | reference | Reference to the creature_template table | |
int(10) | unsigned |
| NO | NULL |
| spell which should The ID of the spell to be cast | |
cast_flags | tinyint(3) | unsigned | NO | NULL | Who casts the spell on who, creature <=> player (values: 0-3) | ||
smallint(3) | unsigned |
| NO | 0 |
| relation Relation with summoner: 0-no 1-friendly 2-raid 3-party player can click |
...
On every spellclick event, a player and a creature "participate". This field defines who casts the spell on who.
Lower bit defines caster: 1=player, 0=creature; higher bit defines target, same mapping as caster bit.
You can use that table for the actual value:
...