// WHITE TROLL

ON INIT {
 INVULNERABILITY ON
 SET §reflection_mode 0
 TWEAK SKIN "npc_trollbase_body" "npc_trollgrey_body"
 TWEAK SKIN "npc_trollbase_head" "npc_trollgrey_head"
 BEHAVIOR FRIENDLY
 SETTARGET PLAYER
SET £friend "NONE"
 ACCEPT
}

ON DIE {
 INVENTORY ADD "Quest_item\amulet_troll\\AMULET_TROLL"
 ACCEPT
}

ON CUSTOM {
 IF (^$PARAM1 == "DOOR_UNLOCKED") GOTO ESCAPE
 IF (^$PARAM1 == "ENEMY") SET_CONTROLLED_ZONE "WHITE_TROLL"
 IF (^$PARAM1 == "DIE") DESTROY SELF
 IF (^$PARAM1 == "CHAT1") { 
  SPEAK [Naughty_troll_first] SENDEVENT CUSTOM LIGHT_DOOR_0111 "ENDC" 
  ACCEPT
 }
 IF (^SPEAKING == 1) ACCEPT
 IF (^$PARAM1 == "CHAT2") SPEAK [Naughty_troll_misc] NOP
 IF (^$PARAM1 == "CHAT3") SPEAK [Troll_greetings] NOP
 ACCEPT
}

ON CONTROLLEDZONE_ENTER {
 IF (^$PARAM1 != PLAYER) ACCEPT
>>ESCAPE
 PLAYERLOOKAT ME
 CINEMASCOPE -s ON
 SETPLAYERCONTROLS OFF
 PLAYERINTERFACE -s HIDE
 UNSET_CONTROLLED_ZONE "WHITE_TROLL"
 SPEAK [Troll_greetings_friend] GOTO RUNNOW
 ACCEPT
}

>>RUNNOW
SENDEVENT CUSTOM Goblin_base_0041 "Appear"
SENDEVENT CUSTOM Light_door_0111 "Gone"
CINEMASCOPE -s OFF
PLAYERINTERFACE -s SHOW
TIMERcontrol 1 4 SETPLAYERCONTROLS ON
TIMERbyebye 1 2 OBJECT_HIDE SELF YES SET #TROLL_QUEST 2
TIMERfadein 1 3 WORLDFADE IN 1800  
WORLDFADE OUT 1800 0 0 0
SET #troll_quest 2
SENDEVENT CUSTOM Light_Door_0111 "Control"
ACCEPT