ON INIT {
 SETNAME [description_blacksmith_hammer]
 SET_MATERIAL WEAPON
 SET_WEAPON_MATERIAL CLUB
 SET_STRIKE_SPEECH [player_strike_small]
 SET_PRICE 100
 SET_STEAL 55
//SET_THROW_DAMAGE 2
 SETOBJECTTYPE WEAPON
 SET_GROUP "BLUNT"
 SET_GROUP ARMORY
 SETOBJECTTYPE 1H
 SETEQUIP DAMAGES 4
 SETEQUIP aim_time 900
 SETEQUIP STEALTH -3
 SETEQUIP CASTING -3
 SET_DURABILITY 50
 SET §max_life 40
 SET §life §max_life
 SET §temporary 0
 SET §temporary2 0
 SET @price_coef 0
 SET @repair_coef 0
 SET §poisonable 1
 SET_WEIGHT 1
 ACCEPT
}

ON EQUIPIN {
 PLAY "equip_nosword"
 ACCEPT
}

ON INVENTORYUSE {
 IF (^PLAYER_ATTRIBUTE_STRENGTH < 8) {
  SPEAK -p [player_not_skilled_enough] NOP
  HEROSAY [required_st_8]
  //COLORISE SELF 1 0 0
  ACCEPT
 }
 //COLORISE SELF 0 0 0
 EQUIP PLAYER
 ACCEPT
}

//#WEAPONS
ON COMBINE {
 IF (^$PARAM1 ISCLASS "POTION_GREEN") {
  IF (§poisonable == 0) {
   SPEAK -p [player_weapon_not_poisonable] NOP
   ACCEPT
  }
  IF (^PLAYER_SKILL_OBJECT_KNOWLEDGE < 30) {
   SPEAK -p [player_not_skilled_enough] NOP
   ACCEPT
  }
  SENDEVENT CUSTOM ^$PARAM1 "EMPTY"
  SET #TMP ~^PLAYER_SKILL_OBJECT_KNOWLEDGE~
  DEC #TMP 27 // donc tmp est entre 3 et 73
  DIV #TMP 3 // donc tmp est entre 1 et 24
  SET_POISONOUS ~#TMP~ ~#TMP~
  SPEAK -p [player_weapon_poisoned] NOP
  ACCEPT
 }
 ACCEPT
}

ON BREAK {
>>BREAKING
PLAY "broken_weapon"
 INVENTORY PLAYERADD "\\special\\piece_wood\\piece_wood"
 INVENTORY PLAYERADD "\\Provisions\\scrap_metal_small\\scrap_metal_small"
DESTROY SELF
ACCEPT
}

ON REPAIRED {
 IF (^DURABILITY == ^MAXDURABILITY) {
  SPEAK -p [player_weapon_already_repaired] NOP
  ACCEPT
 }
 SET §tmp ~^MAXDURABILITY~
 REPAIR SELF ~^PLAYER_SKILL_MECANISM~
 if (^DURABILITY < §tmp) {
  SPEAK -p [player_weapon_repaired_partially] NOP
  ACCEPT
 }
 SPEAK -p [player_weapon_repaired_in_full] NOP
 UNSET §tmp
 ACCEPT
} 