ON RELOAD {
/// Dans ce cas le goblin revive deux fois ///
IF (§dead == 4) USE_MESH "Goblin_lord\\Goblin_lord.teo" ACCEPT
IF (§dead > 0) {
 INC §dead 1
 USE_MESH "Goblin_lord\\Goblin_lord.teo"
 REVIVE -i
}
ACCEPT
}

ON INIT 
{
 SET £helping_buddy "Goblin_base_0054"
 SET £flee_marker "FLEE_MARKER_0001"
// INVENTORY ADDFROMSCENE "GOLD_CUP_0004"
 SETSPEED 0.8
 SET §testFPS 0
 SET §cowardice 90               //if life < cowardice, NPC flees
 SET §enemy 0
 IF (§dead != 0) {
  SET £type "goblin_lord"
  SETWEAPON LONG_SWORD
  TIMERchien 1 5 INVENTORY ADD "PROVISIONS\\food_apple\\food_apple"
  ACCEPT
 }
 SET §dead 0
 ACCEPT
}

ON DIE {
 IF (§dead < 4) INC §dead 1
ACCEPT
}


//*******************************************************
ON INITEND
{
 IF (§dead == 0) SETWEAPON NONE
// BEHAVIOR WANDER_AROUND 500
BEHAVIOR NONE
 SETTARGET NONE
  SET_NPC_STAT critical 0
  SET_NPC_STAT life 100
  SET_NPC_STAT backstab_skill 0
 SET £init_marker "Marker_0544"
// BEHAVIOR FRIENDLY
// SETTARGET NONE
 SETEVENT HEAR ON
 ACCEPT
}

ON HEAR
{
 herosay -d "hear !"
 SET £sender ^SENDER
 HEROSAY -d ^DIST_~£sender~
 ACCEPT
}

ON REACHEDTARGET {
IF (^TARGET == £init_marker) {
 BEHAVIOR NONE
 SETTARGET NONE
 }
ACCEPT
}

ON PATHFIND_FAILURE
{
 HEROSAY -d "pathfind failure"
 ACCEPT
}