// Warden Lord after the Player 
ON INIT {
 SET §attak_kultar 0
 SET §uncontrol 0
 SET §agres 0
 SET £type goblin_lord
 SET §reflection_mode 0
 ACCEPT
}

ON INITEND {
 SET £key_carried "NOKEYEVER"
 INVENTORY DESTROY
 INVENTORY CREATE
 INVENTORY ADDFROMSCENE "PIECE_WOOD_0006"
 INVENTORY ADDMULTI "Jewelry\\Gold_coin\\Gold_coin" 21
 RANDOM 30 {
    INVENTORY ADD "PROVISIONS\\PIE\\PIE"
}
 SET_NPC_STAT damages 5
 SET £youmad []
 SET £hail []
 LOADANIM ACTION1 "Goblin_normal_actionlever"
 SET_CONTROLLED_ZONE LORD_WAIT
 SET_NPC_STAT life 35
 SETWEAPON Torch_weap
 ACCEPT
}

ON LOAD {
 USE_MESH "Goblin_lord\\Goblin_lord.teo"
 ACCEPT
}

ON DETECTPLAYER {
 IF (§firsttime == 0) REFUSE
ACCEPT
}

ON DIE {
TIMERpipo 1 1 GOTO FIGHTEND
IF (#KULTAR_HELPED == 1) ADD_XP 35
ACCEPT
}

>>FIGHTEND
AMBIANCE -v 0 ambient_fight_music
SENDEVENT LORD_DEAD HUMAN_BASE_0030 ""
ACCEPT

ON ATTACK_PLAYER {
TIMERkultar 0 10 GOTO KULTAR
IF (#KULTAR_HELPED == 1) SET_XP_VALUE 35
ACCEPT
}

ON AGGRESSION {
 IF (§uncontroll == 1) ACCEPT
 SET §uncontroll 1
 SET §agres 1
 GOTO ENTER
 ACCEPT
}
 

ON CONTROLLEDZONE_ENTER {
 IF (^$PARAM1 != PLAYER) ACCEPT
>>ENTER
 UNSET_CONTROLLED_ZONE LORD_WAIT 
 SET §uncontroll 1
 SET_PLAYER_CONTROLS OFF
 TELEPORT -p MARKER_0397
 CINEMASCOPE -s ON
 PLAYERINTERFACE HIDE
 BEHAVIOR FRIENDLY
 SETTARGET PLAYER
 PLAYANIM NONE
 IF (§agres == 0) {
  TIMERlookat -m 1 10 PLAYERLOOKAT SELF
  TIMERwait 1 2 CAMERA_ACTIVATE CAMERA_0022
  TIMERpouet 1 2 SPEAK [GoblinLord_toxta_threat] GOTO NOW_SOME_ACTION 
  ACCEPT
 }
 IF (§agres == 1) {
  PLAYERLOOKAT SELF
  CAMERA_ACTIVATE CAMERA_0022
  SPEAK [GoblinLord_toxta_threat] GOTO NOW_SOME_ACTION 
  ACCEPT
 }
 ACCEPT
}

>>NOW_SOME_ACTION
 BEHAVIOR FRIENDLY
 SETTARGET Lever_0003
 CAMERA_ACTIVATE NONE
 TIMERaction -m 1 800 SENDEVENT ACTION LEVER_0003 ""
 TIMERanim -m 1 500 PLAYANIM ACTION1
 TIMERattak 1 2 GOTO SUITE
 SENDEVENT CUSTOM LEVER_0003 "HIDE"
 SENDEVENT CUSTOM LEVER_BASE_0002 "SHOW"
 CINEMASCOPE -s OFF
 PLAYERINTERFACE -s SHOW
 SET_PLAYER_CONTROLS ON
 SENDEVENT KULTAR HUMAN_BASE_0030 ""
 AMBIANCE -v 100 ambient_fight_music
ACCEPT

>>SUITE
SENDEVENT ATTACK_PLAYER SELF ""
//IF (#helped_kultar == 1) TIMERkultar 0 10 GOTO KULTAR
ACCEPT

ON TIMER {
>>KULTAR
HEROSAY -d "Kultar"
SET §attak_kultar 1
SET §enemy 0
SET §fighting_mode 0
BEHAVIOR -f MOVE_TO 
SETTARGET HUMAN_BASE_0030
IF (#KULTAR_HELPED == 1) SET_XP_VALUE 35
TIMERplayer 1 3 GOTO REDIRECT
ACCEPT
}
>>REDIRECT
SENDEVENT ATTACK_PLAYER SELF ""
ACCEPT


ON TARGET_DEATH {
 IF (^TARGET != PLAYER) {
 TIMERkultar OFF
 TIMERplayer OFF
 SENDEVENT ATTACK_PLAYER SELF ""
 ACCEPT
 }
 ACCEPT
}
ON INVENTORY2_OPEN {
 IF (§open == 1) ACCEPT
 SET §open 1
 HEROSAY [tutorial_bag_02]
 QUEST [tutorial_bag_02]
 ACCEPT
}