begin
// if hotkey H was pressed then yell for help
if hotkey H was pressed then
verbalize that I'm hurt on screen (to acknowledge the hotkey press)
call for help (which will result in everyone that can hear me running to me)
continue
// if I am poisoned then cure it
// try potions first, they are fastest and always work
// sometimes the spells fail
// CheckState(Myself,STATE_POISONED) does NOT work
if I am hit by poison then
try these in this order:
1. drink an antidote potion
2. use my innate ability to slow poison on myself
3. cast the cleric spell neutralize poison on myself
4. cast the cleric spell slow poison on myself
5. otherwise shout I'm POISONED
// if someone else is poisoned cure them
// CheckState(LastHeardBy(Myself),STATE_POISONED) does NOT work
if I heard that someone else is POISONED then
try these in this order:
1. use my innate ability to slow poison on them
2. cast the cleric spell neutralize poison on them
3. cast the cleric spell slow poison on them
// heal myself
if my hit points are less than 35%/50% then
try these in this order:
1. use my innate ability to lay on hands on myself
2. use my innate ability to cure light wounds on myself
3. cast the cleric spell cure critical wounds on myself
4. cast the cleric spell cure serious wounds on myself
5. cast the cleric spell cure light wounds on myself
6. drink a healing potion
7. otherwise if I am less than 35% then every 2 seconds shout I'm HURT
// if someone else is hurt then heal them
if I heard that someone else is HURT then
try these in this order:
1. use my innate ability to lay on hands on them
2. use my innate ability to cure light wounds on them
3. cast the cleric spell cure critical wounds on them
4. cast the cleric spell cure serious wounds on them
5. cast the cleric spell cure light wounds on them
// run from my own party members attacking me (charmed?)
if I am attacked by anyone in my party then
run away from them
// defend myself
if I am attacked by an enemy that is not in our party then
shout I'm UNDER_ATTACK
TWFights:
if enemy is not in STATE_PANIC and within range 5 then
attack with melee
else
attack with ranged
TWSpells:
if the enemy is 10' or farther away then
attack with ranged if possible
else
run away
// defend others
if I heard that someone else is UNDER_ATTACK by an enemy not in our party then
TWFights:
if the enemy attacking them is not in STATE_PANIC and within range 5 then
attack with melee
else
attack with ranged
TWSpells:
if the enemy attacking them is 10' or farther away then
attack with ranged if possible
// initiate attack
if I see an enemy that is not in our party then
shout I'm ATTACKING
TWFights:
if enemy is not in STATE_PANIC and within range 5 then
attack with melee
else
attack with ranged
TWSpells:
if the enemy is 10' or farther away then
attack with ranged if possible
else
run away
// coordinate with others when they initiate an attack
if I heard that someone is ATTACKING then
TWFights:
if the enemy nearest to them is not in STATE_PANIC and within range 5 then
attack with melee
else
attack with ranged
TWSpells:
if the enemy nearest to them is 10' or farther away then
attack with ranged if possible
// do this stuff when there are no enemies around and
// I have nothing else better to do
if I don't see an enemy then
if I hear a call for help and I'm not standing next to them then
go help them (i.e. move to them)
if my hit points are near full (85%-100%) and I have good berries then
eat one (for 1 HP of health)
every 30 seconds check if I don't have good berries then
cast the cleric spell good berries if I can
end