// 14.12.2001, Eidolon: Skinning Knife: masks carving
// 22.11.2001, Eidolon: fixed f_crash_remove calls (arguments added)
// 01.11.2001, MoNK: remove DAM=1
// 31.10.2001, MoNK: DAM=1
// 04.10.2001, MoNK: decrease armor-depending for bows and crossbows
// 25.09.2001, MoNK: lowered skill for daggers
// 28.08.2001, MoNK: f_damage_spear, remove decreasing damage for elfs with bows on horse
// 11.08.2001, MoNK: f_damage_hammer, modified races damage
// 12.07.2001, MoNK: time settings for pickaxe
// 19.06.2001, MoNK: debug messages for GM was removed
// 07.06.2001, MoNK: syntax error
// 28.05.2001, MoNK: decrease operations in damage formulas
// 27.05.2001, MoNK: decrease chance to mine elems and treasures, modified f_damage functions
// 26.05.2001, MoNK: decrease operations in damage formulas, -10% for horse archers
// 24.05.2001, MoNK: check for container to prevent self hiting, calculation of chance of armor damage was changed
// 21.05.2001, MoNK: fixed armor crash functions, check distance for bows and crossbows added
// 18.05.2001, MoNK: fish now can be cutted up by dagger
// 16.05.2001, MoNK: tactics/anatomy modificators error fixed
// 16.05.2001, MoNK: f_damage_waraxe, f_damage_xbow added
// 16.05.2001, MoNK: damage levels were made lower
// 16.05.2001, MoNK: prevent damage itself
// 14.05.2001, MoNK: disable targeting with "mace smith" type weapon
// 07.05.2001, MoNK: str/10 changed on dex/10 in f_damage_bow
// 04.05.2001, MoNK: fix syntax error in damage formulas
// 03.05.2001, MoNK: recalculate weight of weapons: WEIGHT=(90-SPEED)/5
// 28.04.2001, MoNK: treasure hunting for mining, disable mine if pickaxe is targeted on character
// 26.04.2001, MoNK: more2 = <more2> + (<morey> / 7.0) into f_damage_ functions (magic weapons)
// 25.04.2001, MoNK: calculation of damage is on

//##################################
// Swordsmanship
//##################################

//===================
// Swordsmanship: axes
//===================

[ITEMDEF 01442]
DEFNAME=i_axe_two_hand
TYPE=t_weapon_axe
FLIP=1
DAM=5,39
SKILL=Swordsmanship
REQSTR=40
TWOHANDS=Y

SPEED=30
WEIGHT=12.0

RESOURCES=16 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 58.5

DUPELIST=01443

On=@Create
	HITPOINTS={31 70}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 2d18+3 = 5-39
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 39}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Two Handed Axe

[ITEMDEF 01443]
//two handed axe
DUPEITEM=01442

[ITEMDEF 013fa]
DEFNAME=i_axe_battle_large
TYPE=t_weapon_axe
FLIP=1
DAM=6,38
SKILL=Swordsmanship
REQSTR=45
TWOHANDS=Y

SPEED=30
WEIGHT=12.0

RESOURCES=14 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 53.8

DUPELIST=013fb

On=@Create
	HITPOINTS={31 110}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 2d17+4 = 6-38
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {6 38}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Large Battle Axe

[ITEMDEF 013fb]
//Large Battle Axe
DUPEITEM=013fa

[ITEMDEF 0f43]
//Hatchet
DEFNAME=i_hatchet
TYPE=t_weapon_axe
FLIP=1
DAM=2,17
SKILL=Swordsmanship
REQSTR=15
TWOHANDS=N

SPEED=40
WEIGHT=10.0

RESOURCES=4 i_ingot_iron, 1 i_log
SKILLMAKE=TINKERING 33.9, t_tinker_tools

DUPELIST=0f44

On=@Create
	HITPOINTS={31 80}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 1d16+1 = 2-17
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {2 17}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Hatchet

[ITEMDEF 0f44]
//hatchet
DUPEITEM=0f43

[ITEMDEF 0f45]
//Executioner's Axe
DEFNAME=i_axe_exec
TYPE=t_weapon_axe
FLIP=1
DAM=6,33
SKILL=Swordsmanship
REQSTR=35
TWOHANDS=Y

SPEED=37
WEIGHT=10.6

SKILLMAKE=BLACKSMITHING 59.7
RESOURCES=16 i_ingot_iron, 1 i_log

DUPELIST=0f46

On=@Create
	HITPOINTS={31 90}

On=@Targon_item
	if (<src.targ.type>==t_corpse) && (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
		src.sysmessage You can't carve <src.targ.name>
		return 1
	endif

On=@Targon_ground
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Damage	// 3d10+3 = 6-33
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {6 33}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Executioner's Axe

[ITEMDEF 0f46]
//Executioner's Axe
DUPEITEM=0f45

[ITEMDEF 0f47]
//Battle Axe
DEFNAME=i_axe_battle
TYPE=t_weapon_axe
FLIP=1
DAM=6,38
SKILL=Swordsmanship
REQSTR=40
TWOHANDS=Y

SPEED=30
WEIGHT=12.0

RESOURCES=14 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 56.1

DUPELIST=0f48

On=@Create
	HITPOINTS={31 110}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 2d17+4 = 6-38
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {6 38}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Battle Axe

[ITEMDEF 0f48]
//battle axe
DUPEITEM=0f47

[ITEMDEF 0f49]
//Axe
DEFNAME=i_axe
TYPE=t_weapon_axe
FLIP=1
DAM=6,33
SKILL=Swordsmanship
REQSTR=35
TWOHANDS=Y

SPEED=37
WEIGHT=10.6

RESOURCES=14 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 59.7

DUPELIST=0f4a

On=@Create
	HITPOINTS={31 100}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 3d10+3 = 6-33
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {6 33}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Axe

[ITEMDEF 0f4a]
//axe
DUPEITEM=0f49

[ITEMDEF 0f4b]
//Double Axe
DEFNAME=i_axe_double
TYPE=t_weapon_axe
FLIP=1
DAM=5,35
SKILL=Swordsmanship
REQSTR=45
TWOHANDS=Y

SPEED=37
WEIGHT=10.6

RESOURCES=12 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 55.0

DUPELIST=0f4c

On=@Create
	HITPOINTS={31 110}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 1d31+4 = 5-35
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 35}
	f_damage_axe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=Double Axe

[ITEMDEF 0f4c]
//double axe
DUPEITEM=0f4b

//===================
// Swordsmanship: blades
//===================

[ITEMDEF 01440]
DEFNAME=i_cutlass
TYPE=t_weapon_sword
FLIP=1
DAM=6,28
SKILL=Swordsmanship
REQSTR=10
TWOHANDS=N

SPEED=45
WEIGHT=9.0

SKILLMAKE=BLACKSMITHING 50.2
RESOURCES=8 i_ingot_iron

DUPELIST=01441

On=@Create
	HITPOINTS={31 70}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d12+4 = 6-28
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {6 28}
	f_damage_sword
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Cutlass

[ITEMDEF 01441]
//cutlass
DUPEITEM=01440

[ITEMDEF 013fe]
DEFNAME=i_katana
TYPE=t_weapon_sword
FLIP=1
DAM=5,26
SKILL=Swordsmanship
REQSTR=10
TWOHANDS=N

SPEED=55
WEIGHT=8.0

RESOURCES=8 i_ingot_iron
SKILLMAKE=BLACKSMITHING 69.1

DUPELIST=013ff

On=@Create
	HITPOINTS={9 13}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 3d8+2 = 5-26
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 26}
	f_damage_sword
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Katana

[ITEMDEF 013ff]
//katana
DUPEITEM=013fe

[ITEMDEF 0f5e]
//Broadsword
DEFNAME=i_sword_broad
TYPE=t_weapon_sword
FLIP=1
DAM=5,29
SKILL=Swordsmanship
REQSTR=25
TWOHANDS=N

SPEED=45
WEIGHT=9.0

RESOURCES=10 i_ingot_iron
SKILLMAKE=BLACKSMITHING 60.8

DUPELIST=0f5f

On=@Create
	HITPOINTS={31 100}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d13+3 = 5-29
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 29}
	f_damage_sword
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Broadsword

[ITEMDEF 0f5f]
//broadsword
DUPEITEM=0f5e

[ITEMDEF 0f60]
//Longsword (not the same as 013b8, i_sword_long_b)
DEFNAME=i_sword_long
TYPE=t_weapon_sword
FLIP=1
DAM=5,33
SKILL=Swordsmanship
REQSTR=25
TWOHANDS=N

SPEED=35
WEIGHT=11.0

RESOURCES=12 i_ingot_iron
SKILLMAKE=BLACKSMITHING 53.8

DUPELIST=0f61

On=@Create
	HITPOINTS={31 110}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d15+3 = 5-33
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 33}
	f_damage_sword
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Longsword

[ITEMDEF 0f61]
//longsword
DUPEITEM=0f60

[ITEMDEF 013b5]
DEFNAME=i_scimitar
TYPE=t_weapon_sword
FLIP=1
DAM=4,30
SKILL=Swordsmanship
REQSTR=10
TWOHANDS=N

SPEED=43
WEIGHT=9.4

RESOURCES=10 i_ingot_iron
SKILLMAKE=BLACKSMITHING 57.3

DUPELIST=013b6

On=@Create
	HITPOINTS={31 90}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d14+2 = 4-30
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {4 30}
	f_damage_sword
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Scimitar

[ITEMDEF 013b6]
//scimitar
DUPEITEM=013b5

[ITEMDEF 013b7]
//long sword NOT THE SAME AS 0f60
DEFNAME=i_sword_long_b
TYPE=t_weapon_sword
FLIP=1
DAM=5,33
SKILL=Swordsmanship
REQSTR=40
TWOHANDS=N

SPEED=35
WEIGHT=11.0

RESOURCES=12 i_ingot_iron
SKILLMAKE=BLACKSMITHING 53.8

DUPELIST=013b8

On=@Create
	hitpoints={31 90}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d15+3 = 5-33
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 33}
	f_damage_sword
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Long Sword B

[ITEMDEF 013b8]
//long sword
DUPEITEM=013b7

[ITEMDEF 013b9]
DEFNAME=i_sword_viking
TYPE=t_weapon_sword
FLIP=1
DAM=6,34
SKILL=Swordsmanship
REQSTR=40
TWOHANDS=N

SPEED=30
WEIGHT=12.0

RESOURCES=14 i_ingot_iron
SKILLMAKE=BLACKSMITHING 50.2

DUPELIST=013ba

On=@Create
	HITPOINTS={31 100}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 4d8+2 = 6-34
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {6 34}
	f_damage_sword
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Swords
DESCRIPTION=Viking Sword

[ITEMDEF 013ba]
//viking sword
DUPEITEM=013b9

//===================
// Swordsmanship: poles
//===================

[ITEMDEF 0143e]
DEFNAME=i_halberd
TYPE=t_weapon_sword
FLIP=1
DAM=5,49
SKILL=Swordsmanship
REQSTR=45
TWOHANDS=Y

SPEED=25
WEIGHT=13.0

RESOURCES=20 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 64.4

DUPELIST=0143f

On=@Create
	HITPOINTS={31 80}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d23+3 = 5-49
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 49}
	f_damage_halberd
	src.damage <more2>
	f_crash_halberd
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Polearms
DESCRIPTION=Halberd

[ITEMDEF 0143f]
//halberd
DUPEITEM=0143e

[ITEMDEF 0f4d]
//Bardiche
DEFNAME=i_bardiche
TYPE=t_weapon_sword
FLIP=1
DAM=5,43
SKILL=Swordsmanship
REQSTR=40
TWOHANDS=Y

SPEED=26
WEIGHT=12.8

RESOURCES=18 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 57.3

DUPELIST=0f4e

On=@Create
	HITPOINTS={31 100}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d20+3 = 5-43
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {5 43}
	f_damage_halberd
	src.damage <more2>
	f_crash_halberd
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Polearms
DESCRIPTION=Bardiche

[ITEMDEF 0f4e]
//bardiche
DUPEITEM=0f4d

//===================
// Swordsmanship: knives
//===================

[ITEMDEF 0ec2]
//Cleaver
DEFNAME=i_cleaver_meat
TYPE=t_weapon_sword
FLIP=1
DAM=2,13
SKILL=Swordsmanship
REQSTR=10
TWOHANDS=N

SPEED=40
WEIGHT=10.0

SKILLMAKE=TINKERING 33.9, t_tinker_tools
RESOURCES=3 i_ingot_iron

DUPELIST=0ec3

On=@Create
	HITPOINTS={31 50}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Knives & Daggers
DESCRIPTION=Cleaver

[ITEMDEF 0ec3]
//cleaver
DUPEITEM=0ec2

[ITEMDEF 0ec4]
// Skinning Knife
DEFNAME=i_knife_skinning
TYPE=t_weapon_fence
FLIP=1
DUPELIST=0ec5
DAM=1,10
SKILL=Swordsmanship
REQSTR=5
TWOHANDS=N

SPEED=40
WEIGHT=10.0

RESOURCES=1 i_log, 2 i_ingot_iron
SKILLMAKE=TINKERING 33.9, t_tinker_tools //BLACKSMITHING 15.0

On=@Create
	HITPOINTS={31 40}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			if (<src.anatomy> >= 100.0) && (<src.animallore> >= 100.0) && (<src.targ.more>) && (!<eval(rand(20))>)
				if (<src.targ.amount>==7) || (<src.targ.amount>==17)
					src.newitem i_mask_orc
					src.act.timer = -1
					src.act.cont = <src.targ.serial>
					src.act.update
				elseif (<src.targ.amount>==211) || (<src.targ.amount>==212) || (<src.targ.amount>==213)
					src.newitem i_mask_bear
					src.act.timer = -1
					src.act.cont = <src.targ.serial>
					src.act.update
				elseif (<src.targ.amount>==234) || (<src.targ.amount>==237)
					src.newitem i_mask_deer
					src.act.timer = -1
					src.act.cont = <src.targ.serial>
					src.act.update
				endif
			endif
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Knives & Daggers
DESCRIPTION=Skinning Knife

[ITEMDEF 0ec5]
//Skinning Knife
DUPEITEM=0ec4

[ITEMDEF 013f6]
DEFNAME=i_knife_butcher
TYPE=t_weapon_sword
FLIP=1
DAM=2,14
SKILL=Swordsmanship
REQSTR=5
TWOHANDS=N

SPEED=40
WEIGHT=10.0

SKILLMAKE=TINKERING 33.9, t_tinker_tools
RESOURCES=1 i_board, 1 i_ingot_iron

DUPELIST=013f7

On=@Create
	HITPOINTS={31 40}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Knives & Daggers
DESCRIPTION=Butchers Knife

[ITEMDEF 013f7]
//butcher knife
DUPEITEM=013f6

//##################################
// Fencing
//##################################

[ITEMDEF 0e87]
//Pitchfork
DEFNAME=i_pitchfork
TYPE=t_weapon_fence
FLIP=1
DAM=4,16
SKILL=Fencing
REQSTR=15
TWOHANDS=Y

SPEED=45
WEIGHT=9.0

RESOURCES=5 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 20.0

DUPELIST=0e88

On=@Create
	HITPOINTS={31 60}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 4d4 = 4-16
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {4 16}
	f_damage_spear
	src.damage <more2>
	f_crash_spear
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Polearms
DESCRIPTION=Pitchfork

[ITEMDEF 0e88]
//pitchfork
DUPEITEM=0e87

[ITEMDEF 0f51]
//Dagger
DEFNAME=i_dagger
TYPE=t_weapon_fence
FLIP=1
DAM=3,15
SKILL=Fencing
REQSTR=1
TWOHANDS=N

VALUE={24 33}

SPEED=55
WEIGHT=5.8

RESOURCES=3 i_ingot_iron
SKILLMAKE=BLACKSMITHING 16.7

DUPELIST=0f52

On=@Create
	HITPOINTS={11 20}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif (<src.targ.type> == t_tree) || (<src.targ.type> == t_log) || (<src.targ.type> == t_fish)
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

CATEGORY=Provisions - Weapons
SUBSECTION=Knives & Daggers
DESCRIPTION=Dagger

[ITEMDEF 0f52]
//dagger
DUPEITEM=0f51

[ITEMDEF 0f62]
//Spear
DEFNAME=i_spear
TYPE=t_weapon_fence
FLIP=1
DAM=2,36
SKILL=Fencing
REQSTR=30
TWOHANDS=Y

SPEED=46
WEIGHT=8.8

RESOURCES=12 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 73.8

DUPELIST=0f63

On=@Create
	HITPOINTS={31 80}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d18 = 2-36
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {2 36}
	f_damage_spear
	src.damage <more2>
	f_crash_spear
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Polearms
DESCRIPTION=Spear

[ITEMDEF 0f63]
//spear
DUPEITEM=0f62

[ITEMDEF 01400]
DEFNAME=i_kryss
TYPE=t_weapon_fence
FLIP=1
DAM=3,28
SKILL=Fencing
REQSTR=10
TWOHANDS=N

SPEED=53
WEIGHT=8.0

RESOURCES=8 i_ingot_iron
SKILLMAKE=BLACKSMITHING 62.0

DUPELIST=01401

On=@Create
	HITPOINTS={31 90}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 1d26+2 = 3-28
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {3 28} 
	f_damage_fencing
	src.damage <more2>
	f_crash_sword
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Knives & Daggers
DESCRIPTION=Kryss

[ITEMDEF 01401]
//kryss
DUPEITEM=01400

[ITEMDEF 01402]
DEFNAME=i_spear_short
TYPE=t_weapon_fence
FLIP=1
DAM=4,32
SKILL=Fencing
REQSTR=15
LAYER=1
TWOHANDS=N

SPEED=50
WEIGHT=8.0

RESOURCES=6 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 70.2

DUPELIST=01403

On=@Create
	HITPOINTS={31 70}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 2d15+2 = 4-32
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {4 32}
	f_damage_spear
	src.damage <more2>
	f_crash_spear
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Spears and Forks
DESCRIPTION=Short Spear

[ITEMDEF 01403]
//short spear
DUPEITEM=01402

[ITEMDEF 01404]
DEFNAME=i_war_fork
TYPE=t_weapon_fence
FLIP=1
DAM=4,32
SKILL=Fencing
REQSTR=35
TWOHANDS=N

SPEED=45
WEIGHT=9.0

RESOURCES=12 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 63.2

DUPELIST=01405

On=@Create
	HITPOINTS={31 110}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if !((<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff))
			return 0
		endif
		src.sysmessage You can't carve <src.targ.name>
	endif
	return 1

On=@Targon_ground
	return 1

On=@Damage	// 1d29+3 = 4-32
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {4 32}
	f_damage_fencing
	src.damage <more2>
	f_crash_spear
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Spears and Forks
DESCRIPTION=War fork

[ITEMDEF 01405]
//war fork
DUPEITEM=01404

//##################################
// Macefighting
//##################################

[ITEMDEF 0df0]
//Black Staff
DEFNAME=i_staff_black
TYPE=t_weapon_mace_staff
FLIP=1
DAM=8,33
SKILL=Macefighting
REQSTR=35
TWOHANDS=Y

SPEED=35
WEIGHT=11.0

SKILLMAKE=CARPENTRY 50.0, t_carpentry
RESOURCES=8 i_log

DUPELIST=0df1

On=@Create
	HITPOINTS={31 70}

On=@Damage	// 5d6+3 = 8-33
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 33}
	f_damage_mace
	src.damage <more2>
	f_drop_weapon
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Staves
DESCRIPTION=Black Staff

[ITEMDEF 0df1]
//black staff
DUPEITEM=0df0

[ITEMDEF 0e81]
//miniature shepherd's crook (picture for backpack only?)
// This is different from i_shepherds_crook
DEFNAME=i_crook_thin
TYPE=t_weapon_mace_crook
FLIP=1
DAM=3,12
REQSTR=10
TWOHANDS=Y

SPEED=30
WEIGHT=12.0

RESOURCES=7 i_log
SKILLMAKE=CARPENTRY 78.9, t_carpentry

DUPELIST=0e82

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=Sheperds Crook

On=@Create
	HITPOINTS={31 50}

On=@Damage	// 3d4 = 3-12
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {3 12}
	f_damage_mace
	src.damage <more2>
	f_drop_weapon
	return 1

[ITEMDEF 0e82]
//miniature shepherd's crook (picture for backpack only?)
DUPEITEM=0e81

[ITEMDEF 0e85]
//PickAxe
DEFNAME=i_pickaxe
TYPE=t_weapon_mace_pick
FLIP=1
DAM=1,15
REQSTR=25
TWOHANDS=N

SPEED=35
WEIGHT=11.0

SKILLMAKE=TINKERING 42.1, t_tinker_tools
RESOURCES=4 i_ingot_iron, 1 i_log

DUPELIST=0e86

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=PickAxe

On=@Create
	HITPOINTS={31 60}

On=@Equip
	more = 00270027

On=@Damage	// 1d15 = 1-15
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more = 00270027
	more2 = {1 15}
	f_damage_mace
	src.damage <more2>
	f_crash_mace
	return 1

On=@Targon_item
	IF (<SRC.TARG.ID>==0134f) || (<SRC.TARG.ID>==01363)	// boulder or rock
		if <src.targ.attr>&08010
			return 0
		elseif (<src.targ.distance> > 3) && (<src.targ.cont> != <src.findlayer(layer_pack).uid>)
			src.sysmessage You are too far away from <src.targ.name>: <src.targ.distance>
			return 1
		else
			morez=(<SRC.MINING>/200)
			SRC.TARG.REMOVE
			IF <morez>==0
				SRC.SYSMESSAGE You lack skill to harvest some stone! Boulder is crashed.
				RETURN 1
			ELSEIF <morez><3
				SRC.SYSMESSAGE Some part of boulder is crashed!
			ENDIF
			SRC.NEWITEM i_stone_block
			SRC.ACT.AMOUNT <morez>
			SRC.ACT.BOUNCE
			morez=0
			RETURN 1
		endif
	ENDIF

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

	if <timer> > 0
		return 0
	endif

	if <src.food> > 13
		if rand(1000)==1
			src.anim 11
			// treasure
			dorand 4
				src.newitem i_treasure_1
				src.newitem i_treasure_2
				src.newitem i_treasure_3
				src.newitem i_treasure_4
			enddo
			src.act.equip
			timer = 7200
			return 1
		endif
	endif

	if rand(500)==1
		src.newnpc c_elem_earth
		src.act.p=<src.p>
		src.act.home=<src.p>
		src.act.homedist=4
		src.act.flags=0
		timer = 1200
		return 1
	endif

	if rand(1000)==1
		dorand 10
			src.newnpc c_elem_ore_obsidian
			src.newnpc c_elem_ore_magma
			src.newnpc c_elem_ore_mytheril
			src.newnpc c_elem_ore_verite
			src.newnpc c_elem_ore_valorite
			src.newnpc c_elem_ore_dwarf
			src.newnpc c_elem_ore_agapite
			src.newnpc c_elem_ore_orion
			src.newnpc c_elem_ore_silver
			src.newnpc c_elem_ore_gold
		enddo
		src.act.p=<src.p>
		src.act.home=<src.p>
		src.act.homedist=4
		src.act.flags=0
		timer = 2400
		return 1
	endif

On=@Targon_char
	src.sysmessage You can't think of a way to use this item
	return 1

On=@Timer
	if <cont>
		if <cont.ischar>
			timer = -1
			return 1
		endif
	else
		attr = <attr> | attr_decay
	endif

[ITEMDEF 0e86]
//pickaxe
DUPEITEM=0e85

[ITEMDEF 0e89]
//Quarter Staff
DEFNAME=i_staff_quarter
TYPE=t_weapon_mace_staff
FLIP=1
DAM=10,28	// 5d5+3 = 8-28
SKILL=Macefighting
REQSTR=30
TWOHANDS=N

SPEED=48
WEIGHT=8.4

RESOURCES=3 i_log
SKILLMAKE=CARPENTRY 15.0, t_carpentry

DUPELIST=0e8a

CATEGORY=Provisions - Weapons
SUBSECTION=Staves
DESCRIPTION=Quarter Staff

On=@Create
	HITPOINTS={31 60}

On=@Damage	// 5d5+3 = 8-28
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 28}
	f_damage_mace
	src.damage <more2>
	f_drop_weapon
	return 1

[ITEMDEF 0e8a]
//quarter staff
DUPEITEM=0e89

[ITEMDEF 0f5c]
//Mace
DEFNAME=i_mace
TYPE=t_weapon_mace_smith
FLIP=1
DAM=15,32	// 6d5+2 = 8-32
SKILL=Macefighting
REQSTR=20
TWOHANDS=N

SPEED=30
WEIGHT=12.0

RESOURCES=6 i_ingot_iron
SKILLMAKE=BLACKSMITHING 40.8

DUPELIST=0f5d

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=Mace

On=@Create
	HITPOINTS={31 70}

On=@Damage	// 6d5+2 = 8-32
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 32}
	f_damage_mace
	src.damage <more2>
	f_crash_mace
	return 1

On=@DClick
	equip
	return 1

[ITEMDEF 0f5d]
//mace
DUPEITEM=0f5c

[ITEMDEF 0fb4]
//Sledge Hammer
DEFNAME=i_hammer_sledge
TYPE=t_weapon_mace_smith
FLIP=1
SKILL=Macefighting
DAM=8,20

WEIGHT=15.0

RESOURCES=4 i_ingot_iron, 1 i_log
SKILLMAKE=TINKERING 54.1, t_tinker_tools

DUPELIST=0fb5

CATEGORY=Items by Professions
SUBSECTION=Blacksmiths
DESCRIPTION=Sledge Hammer

On=@Create
	hitpoints={30 80}

On=@Damage	// 6d3+2 = 8-20
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 20}
	f_damage_hammer
	src.damage <more2>
	f_crash_mace
	return 1

[ITEMDEF 0fb5]
//sledge hammer
DUPEITEM=0fb4

[ITEMDEF 013af]
DEFNAME=i_axe_war
TYPE=t_weapon_mace_sharp
FLIP=1
DAM=9,27
REQSTR=35
TWOHANDS=N

SPEED=40
WEIGHT=10.0

RESOURCES=16 i_ingot_iron, 1 i_log
SKILLMAKE=BLACKSMITHING 64.4

DUPELIST=013b0

On=@Create
	HITPOINTS={31 80}

On=@Targon_item
	if <src.targ.type>==t_corpse
		if (<src.targ.region.flags> & 04000) && (<src.targ.link>!=04fffffff)
			src.sysmessage You can't carve <src.targ.name>
			return 1
		endif
		return 0
	elseif <src.targ.type> == t_tree
		return 0
	endif
	return 1

On=@Targon_ground
	if <src.account.plevel> > 1
		src.sysmessage Turn off GM Mode first!
		return 1
	endif

On=@Damage	// 6d4+3 = 9-27
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {9 27}
	f_damage_waraxe
	src.damage <more2>
	f_crash_axe
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Axes
DESCRIPTION=War Axe

[ITEMDEF 013B0]
//War Axe
DUPEITEM=013af

[ITEMDEF 013b3]
DEFNAME=i_club
TYPE=t_weapon_mace_smith
FLIP=1
DUPELIST=013b4
DAM=8,24
SKILL=Macefighting
REQSTR=10
TWOHANDS=N

SPEED=40
WEIGHT=10.0

RESOURCES=4 i_log
SKILLMAKE=CARPENTRY 30.0, t_carpentry

On=@Create
	HITPOINTS={31 40}

On=@Damage	// 4d5+4 = 8-24
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 24}
	f_damage_mace
	src.damage <more2>
	f_crash_mace
	return 1

On=@DClick
	equip
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=Club

[ITEMDEF 013b4]
//Club
DUPEITEM=013b3

[ITEMDEF 013f4]
DEFNAME=i_shepherds_crook
TYPE=t_weapon_mace_crook
FLIP=1
DAM=3,12
REQSTR=10
TWOHANDS=Y

SPEED=33
WEIGHT=12.0

RESOURCES=7 i_log

DUPELIST=013f5

On=@Create
	HITPOINTS={31 50}

On=@Damage	// 3d4 = 3-12
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {3 12}
	f_damage_mace
	src.damage <more2>
	f_drop_weapon
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Staves
DESCRIPTION=Sheperd's Crook

[ITEMDEF 013f5]
//Shepherd's Crook
DUPEITEM=013f4

[ITEMDEF 013f8]
DEFNAME=i_staff_gnarled
TYPE=t_weapon_mace_staff
FLIP=1
DAM=10,30
SKILL=Macefighting
REQSTR=20
TWOHANDS=Y

SPEED=33
WEIGHT=11.4

SKILLMAKE=CARPENTRY 48.9, t_carpentry
RESOURCES=4 i_log

DUPELIST=013f9

On=@Create
	HITPOINTS={31 50}

On=@Damage	// 5d5+5 = 10-30
	if !<cont>
		return 1
	endif
	if !<cont.ischar>
		return 1
	endif
	more2 = {10 30}
	f_damage_mace
	src.damage <more2>
	f_drop_weapon
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Staves
DESCRIPTION=Gnarled Staff

[ITEMDEF 013f9]
//gnarled staff
DUPEITEM=013f8

[ITEMDEF 01406]
DEFNAME=i_mace_war
TYPE=t_weapon_mace_smith
FLIP=1
DAM=8,32
SKILL=Macefighting
REQSTR=30
TWOHANDS=N

SPEED=32
WEIGHT=11.6

RESOURCES=14 i_ingot_iron
SKILLMAKE=BLACKSMITHING 53.8

DUPELIST=01407

On=@Create
	HITPOINTS={31 110}

On=@Damage	// 6d5+2 = 8-32
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 32}
	f_damage_mace
	src.damage <more2>
	f_crash_mace
	return 1

On=@DClick
	equip
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=War Mace

[ITEMDEF 01407]
//war mace
DUPEITEM=01406

[ITEMDEF 01438]
DEFNAME=i_hammer_war
TYPE=t_weapon_mace_smith
FLIP=1
DAM=8,36
SKILL=Macefighting
REQSTR=40
TWOHANDS=Y

SPEED=31
WEIGHT=11.8

SKILLMAKE=BLACKSMITHING 59.7
RESOURCES=16 i_ingot_iron,1 i_log

DUPELIST=01439

On=@Create
	HITPOINTS={31 110}

On=@Damage	// 7d5+1 = 8-36
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 36}
	f_damage_hammer
	src.damage <more2>
	f_crash_mace
	return 1

On=@Dclick
	equip
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=War Hammer

[ITEMDEF 01439]
//war hammer
DUPEITEM=01438

[ITEMDEF 0143a]
DEFNAME=i_maul
TYPE=t_weapon_mace_smith
FLIP=1
DAM=10,30
SKILL=Macefighting
REQSTR=20
TWOHANDS=N

SPEED=30
WEIGHT=12.0

RESOURCES=10 i_ingot_iron
SKILLMAKE=BLACKSMITHING 45.5

DUPELIST=0143b

On=@Create
	HITPOINTS={31 70}

On=@Damage	// 5d5+5 = 10-30
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {10 30}
	f_damage_hammer
	src.damage <more2>
	f_crash_mace
	return 1

On=@Dclick
	equip
	return 1

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=Maul

[ITEMDEF 0143b]
//Maul
DUPEITEM=0143a

[ITEMDEF 0143c]
DEFNAME=i_hammer_pick
TYPE=t_weapon_mace_smith
FLIP=1
DAM=6,33
SKILL=Macefighting
REQSTR=35
TWOHANDS=N
LAYER=1

SPEED=30
WEIGHT=	10.0

CATEGORY=Provisions - Weapons
SUBSECTION=Maces & Hammers
DESCRIPTION=Hammer Pick

SKILLMAKE=BLACKSMITHING 51.4
RESOURCES=8 i_ingot_iron,1 i_log

DUPELIST=0143d

On=@Create
	HITPOINTS={31 70}

On=@Damage	// 3d10+3 = 6-33
	if !<cont>
		return 1
	endif
	if !<cont.ischar>
		return 1
	endif
	more2 = {6 33}
	f_damage_hammer
	src.damage <more2>
	f_crash_mace
	return 1

On=@Dclick
	equip
	return 1

[ITEMDEF 0143d]
//hammer pick
DUPEITEM=0143c

//##################################
// Archery
//##################################

[ITEMDEF 0f4f]
//Crossbow
DEFNAME=i_crossbow
TYPE=t_weapon_xbow
FLIP=1
DAM=8,43
SKILL=Archery
REQSTR=30
TWOHANDS=Y

SPEED=24
WEIGHT=11.0

TDATA3=i_xbolt
TDATA4=i_xbolt_x

SKILLMAKE=BOWCRAFT 37.8
RESOURCES=8 i_board, 1 i_thread, 1 i_ingot_iron

DUPELIST=0f50

On=@Create
	HITPOINTS={31 80}

On=@Damage	// 5d8+3 = 8-43
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {8 43}
	f_damage_xbow
	src.damage <more2>
	return 1

On=@Equip
	attr = <attr> & ~attr_cursed

On=@UnEquip
	attr = <attr> & ~attr_cursed

CATEGORY=Provisions - Weapons
SUBSECTION=Bows
DESCRIPTION=Crossbow

[ITEMDEF 0f50]
//crossbow
DUPEITEM=0f4f

[ITEMDEF 013b1]
DEFNAME=i_bow
TYPE=t_weapon_bow
FLIP=1
DAM=9,41
SKILL=Archery
REQSTR=20
TWOHANDS=Y

SPEED=32
WEIGHT=9.7

DUPELIST=013b2

TDATA3=i_arrow
TDATA4=i_arrow_x

SKILLMAKE=BOWCRAFT 17.8
RESOURCES=6 i_log, 1 i_thread

On=@Create
	HITPOINTS={31 60}

On=@Damage	// 4d9+5 = 9-41
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {9 41}
	f_damage_bow
	src.damage <more2>
	return 1

On=@Equip
	attr = <attr> & ~attr_cursed

On=@UnEquip
	attr = <attr> & ~attr_cursed

CATEGORY=Provisions - Weapons
SUBSECTION=Bows
DESCRIPTION=Bow

[ITEMDEF 013b2]
//bow
DUPEITEM=013b1

[ITEMDEF 013fc]
DEFNAME=i_crossbow_heavy
TYPE=t_weapon_xbow
FLIP=1
DAM=11,56
SKILL=Archery
REQSTR=40
TWOHANDS=Y

SPEED=18
WEIGHT=12.0

TDATA3=i_xbolt
TDATA4=i_xbolt_x

DUPELIST=013fd

SKILLMAKE=BOWCRAFT 57.8 
RESOURCES=10 i_log, 1 i_wire_iron, 1 i_ingot_iron

On=@Create
	HITPOINTS={31 100}

On=@Damage	// 5d10+6 = 11-56
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {11 56}
	f_damage_xbow
	src.damage <more2>
	return 1

On=@Equip
	attr = <attr> & ~attr_cursed

On=@UnEquip
	attr = <attr> & ~attr_cursed

CATEGORY=Provisions - Weapons
SUBSECTION=Bows
DESCRIPTION=Heavy Crossbow

[ITEMDEF 013fd]
//heavy crossbow
DUPEITEM=013fc

//##################################
// Damage modification functions
//##################################

[FUNCTION f_damage_sword]
	more2 = (<more2> * (100 + (<cont.swordsmanship>/30) + (<cont.str>/20) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.swordsmanship>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_round_metal)
		more2 = (<more2> - (<more2> / 3))
	elseif <src.findlayer(layer_hand2).baseid>==i_shield_kite_wood
		more2 = (<more2> / 2)
	endif
	more2 = <more2> + (<morey> / 7.0)
	if !(<src.plot1> & (plotmask_dwarf | plotmask_elf))
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_axe]
	more2 = (<more2> * (100 + (<cont.swordsmanship>/30) + (<cont.lumberjacking>/100) + (<cont.str>/20) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.swordsmanship>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_wood)
		more2 = (<more2> - (<more2> / 5))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if <cont.plot1> & plotmask_dwarf
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_waraxe]
	more2 = (<more2> * (100 + (<cont.macefighting>/30) + (<cont.lumberjacking>/100) + (<cont.str>/20) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.macefighting>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_wood)
		more2 = (<more2> - (<more2> / 5))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if <cont.plot1> & (plotmask_dwarf | plotmask_orc)
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_halberd]
	more2 = (<more2> * (100 + (<cont.swordsmanship>/30) + (<cont.str>/20) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.swordsmanship>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_wood)
		more2 = (<more2> - (<more2> / 5))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if !(<src.plot1> & (plotmask_orc | plotmask_dwarf | plotmask_elf))
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_fencing]
	more2 = (<more2> * (100 + (<cont.fencing>/30) + ((<cont.str> + <cont.dex>)/40) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.fencing>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_round_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_buckler)
		more2 = (<more2> / 2)
	elseif <src.findlayer(layer_hand2).baseid>==i_shield_kite_wood
		more2 = (<more2> - (<more2> / 3))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if !(<src.plot1> & (plotmask_orc | plotmask_dwarf | plotmask_elf))
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_spear]
	more2 = (<more2> * (100 + (<cont.fencing>/30) + ((<cont.str> + <cont.dex>)/40) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.fencing>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_round_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_buckler)
		more2 = (<more2> / 2)
	elseif (<src.findlayer(layer_hand2).baseid>==i_shield_kite_wood) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal)
		more2 = (<more2> - (<more2> / 3))
	endif
	if <cont.findlayer(layer_horse)>
		more2 = (<more2> + (<more2> / 3))
		if (<src.findlayer(layer_horse)>
			if rand(200) <= <eval(<cont.fencing> / 100)>
				src.dclick
				src.sysmessage <cont.name>'s <name> unseat you!
				cont.sysmessage Your <name> unseat <src.name>!
			endif
		endif
	endif
	more2 = <more2> + (<morey> / 7.0)
	if !(<src.plot1> & (plotmask_orc | plotmask_dwarf | plotmask_elf))
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_bow]	// optimal distance is 6
	more2 = (<more2> * (100 + (<cont.archery>/30) + (<cont.dex>/20) - (<src.ac>/3))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater
		more2 = (<more2> / 2)
	elseif <src.findlayer(layer_hand2).baseid>==i_shield_kite_wood
		more2 = (<more2> - (<more2> / 3))
	endif
	if <cont.plot1> & plotmask_elf
		more2 = <more2> + (<morey> / 7.0)
		more2 = (<more2> + (<more2> / 10))
		return 1
	endif
	if <cont.distance> > 6
		more2 = (<more2> * (16 - <cont.distance>)) / 10
	endif
	if <cont.distance> < 6
		more2 = (<more2> * (4 + <cont.distance>)) / 10
	endif
	if <cont.findlayer(layer_horse)>
		more2 = (<more2> - (<more2> / 10))
	endif
	more2 = <more2> + (<morey> / 7.0)
	return 1

[FUNCTION f_damage_xbow] // optimal distance is 4
	more2 = (<more2> * (100 + (<cont.archery>/30) + ((<cont.str> + <cont.dex>)/40) - (<src.ac>/3))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater
		more2 = (<more2> / 2)
	elseif <src.findlayer(layer_hand2).baseid>==i_shield_kite_wood
		more2 = (<more2> - (<more2> / 3))
	endif
	if <cont.distance> > 4
		more2 = (<more2> * (14 - <cont.distance>)) / 10
	endif
	if <cont.distance> < 4
		more2 = (<more2> * (6 + <cont.distance>)) / 10
	endif
	if <cont.findlayer(layer_horse)>
		more2 = (<more2> - (<more2> / 10))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if !(<src.plot1> & (plotmask_orc | plotmask_dwarf | plotmask_elf))
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_mace]
	more2 = (<more2> * (100 + (<cont.macefighting>/30) + (<cont.str>/20) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.macefighting>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if <src.findlayer(layer_hand2).baseid>==i_shield_kite_wood
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_round_metal)
		more2 = (<more2> - (<more2> / 20))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if !(<src.plot1> & (plotmask_orc | plotmask_dwarf | plotmask_elf))
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

[FUNCTION f_damage_hammer]
	more2 = (<more2> * (100 + (<cont.macefighting>/30) + (<cont.blacksmithing>/100) + (<cont.str>/20) - (<src.ac>/2))) / 100
	if <src.tactics> < <cont.tactics>
		more2 = <more2> + ((<more2> * <cont.tactics>) / 10000)
	endif
	if <src.anatomy> < <cont.anatomy>
		more2 = <more2> + ((<more2> * <cont.anatomy>) / 20000)
	endif
	if (<src.findlayer(layer_hand1).type>==t_weapon_sword) && (<src.swordsmanship> > <cont.macefighting>)
		more2 = (<more2> - (<more2> / 10))
	endif
	if <src.findlayer(layer_hand2).baseid>==i_shield_kite_wood
		more2 = (<more2> - (<more2> / 10))
	endif
	if (<src.findlayer(layer_hand2).baseid>==i_shield_heater) || (<src.findlayer(layer_hand2).baseid>==i_shield_kite_metal) || (<src.findlayer(layer_hand2).baseid>==i_shield_round_metal)
		more2 = (<more2> - (<more2> / 20))
	endif
	more2 = <more2> + (<morey> / 7.0)
	if <cont.plot1> & (plotmask_dwarf | plotmask_orc)
		more2 = (<more2> + (<more2> / 10))
	endif
	return 1

//##################################
// Armor crash functions
//##################################

[FUNCTION f_crash_remove]
	cont.sysmessage You destroy <src.name>'s <src.findlayer(<argn>).name>
	src.sysmessage <cont.name>'s <name> destroy your <src.findlayer(<argn>).name>
	if <argn>==layer_chest
		src.findlayer(layer_chest).remove
	elseif <argn>==layer_legs
		src.findlayer(layer_legs).remove
	elseif <argn>==layer_arms
		src.findlayer(layer_arms).remove
	elseif <argn>==layer_helm
		src.findlayer(layer_helm).remove
	elseif <argn>==layer_gloves
		src.findlayer(layer_gloves).remove
	elseif <argn>==layer_pants
		src.findlayer(layer_pants).remove
	elseif <argn>==layer_collar
		src.findlayer(layer_collar).remove
	endif
	return 1

[FUNCTION f_crash_5]
	if <argn>==layer_chest
		src.findlayer(layer_chest).more = (<src.findlayer(layer_chest).more> - (<more2> / 5))
	elseif <argn>==layer_legs
		src.findlayer(layer_legs).more = (<src.findlayer(layer_legs).more> - (<more2> / 5))
	elseif <argn>==layer_arms
		src.findlayer(layer_arms).more = (<src.findlayer(layer_arms).more> - (<more2> / 5))
	elseif <argn>==layer_helm
		src.findlayer(layer_helm).more = (<src.findlayer(layer_helm).more> - (<more2> / 5))
	elseif <argn>==layer_gloves
		src.findlayer(layer_gloves).more = (<src.findlayer(layer_gloves).more> - (<more2> / 5))
	elseif <argn>==layer_pants
		src.findlayer(layer_pants).more = (<src.findlayer(layer_pants).more> - (<more2> / 5))
	elseif <argn>==layer_collar
		src.findlayer(layer_collar).more = (<src.findlayer(layer_collar).more> - (<more2> / 5))
	endif
	cont.sysmessage You damage <src.name>'s <src.findlayer(<argn>).name>
	src.sysmessage <cont.name>'s <name> damage your <src.findlayer(<argn>).name>
	return 1

[FUNCTION f_crash_10]
	if <argn>==layer_chest
		src.findlayer(layer_chest).more = (<src.findlayer(layer_chest).more> - (<more2> / 10))
	elseif <argn>==layer_legs
		src.findlayer(layer_legs).more = (<src.findlayer(layer_legs).more> - (<more2> / 10))
	elseif <argn>==layer_arms
		src.findlayer(layer_arms).more = (<src.findlayer(layer_arms).more> - (<more2> / 10))
	elseif <argn>==layer_helm
		src.findlayer(layer_helm).more = (<src.findlayer(layer_helm).more> - (<more2> / 10))
	elseif <argn>==layer_gloves
		src.findlayer(layer_gloves).more = (<src.findlayer(layer_gloves).more> - (<more2> / 10))
	elseif <argn>==layer_pants
		src.findlayer(layer_pants).more = (<src.findlayer(layer_pants).more> - (<more2> / 10))
	elseif <argn>==layer_collar
		src.findlayer(layer_collar).more = (<src.findlayer(layer_collar).more> - (<more2> / 10))
	endif
	cont.sysmessage You damage <src.name>'s <src.findlayer(<argn>).name>
	src.sysmessage <cont.name>'s <name> damage your <src.findlayer(<argn>).name>
	return 1

[FUNCTION f_crash_20]
	if <argn>==layer_chest
		src.findlayer(layer_chest).more = (<src.findlayer(layer_chest).more> - (<more2> / 20))
	elseif <argn>==layer_legs
		src.findlayer(layer_legs).more = (<src.findlayer(layer_legs).more> - (<more2> / 20))
	elseif <argn>==layer_arms
		src.findlayer(layer_arms).more = (<src.findlayer(layer_arms).more> - (<more2> / 20))
	elseif <argn>==layer_helm
		src.findlayer(layer_helm).more = (<src.findlayer(layer_helm).more> - (<more2> / 20))
	elseif <argn>==layer_gloves
		src.findlayer(layer_gloves).more = (<src.findlayer(layer_gloves).more> - (<more2> / 20))
	elseif <argn>==layer_pants
		src.findlayer(layer_pants).more = (<src.findlayer(layer_pants).more> - (<more2> / 20))
	elseif <argn>==layer_collar
		src.findlayer(layer_collar).more = (<src.findlayer(layer_collar).more> - (<more2> / 20))
	endif
	cont.sysmessage You damage <src.name>'s <src.findlayer(<argn>).name>
	src.sysmessage <cont.name>'s <name> damage your <src.findlayer(<argn>).name>
	return 1

[FUNCTION f_crash_sword]
	if rand(15) >= <eval(<cont.swordsmanship> / 100)>
		return 1
	endif
	dorand 7
		f_crash_sword_sub <eval(layer_chest)>
		f_crash_sword_sub <eval(layer_legs)>
		f_crash_sword_sub <eval(layer_arms)>
		f_crash_sword_sub <eval(layer_helm)>
		f_crash_sword_sub <eval(layer_gloves)>
		f_crash_sword_sub <eval(layer_pants)>
		f_crash_sword_sub <eval(layer_collar)>
	enddo
	return 1

[FUNCTION f_crash_sword_sub]
	if !(<src.findlayer(<argn>)>)
		return 1
	endif
	if <src.findlayer(<argn>).type>==t_armor
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 10)
			f_crash_10 <argn>
		else
			f_crash_remove <argn>
		endif
	elseif <src.findlayer(<argn>).type>==t_armor_leather
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 5)
			f_crash_5 <argn>
		else
			f_crash_remove <argn>
		endif
	endif
	return 1

[FUNCTION f_crash_fencing]
	if rand(15) >= <eval(<cont.fencing> / 100)>
		return 1
	endif
	dorand 7
		f_crash_fencing_sub <eval(layer_chest)>
		f_crash_fencing_sub <eval(layer_legs)>
		f_crash_fencing_sub <eval(layer_arms)>
		f_crash_fencing_sub <eval(layer_helm)>
		f_crash_fencing_sub <eval(layer_gloves)>
		f_crash_fencing_sub <eval(layer_pants)>
		f_crash_fencing_sub <eval(layer_collar)>
	enddo
	return 1

[FUNCTION f_crash_fencing_sub]
	if !(<src.findlayer(<argn>)>)
		return 1
	endif
	if <src.findlayer(<argn>).type>==t_armor
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 20)
			f_crash_20 <argn>
		else
			f_crash_remove <argn>
		endif
	elseif <src.findlayer(<argn>).type>==t_armor_leather
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 10)
			f_crash_10 <argn>
		else
			f_crash_remove <argn>
		endif
	endif
	return 1

[FUNCTION f_crash_spear]
	if rand(15) >= <eval(<cont.fencing> / 100)>
		return 1
	endif
	dorand 7
		f_crash_spear_sub <eval(layer_chest)>
		f_crash_spear_sub <eval(layer_legs)>
		f_crash_spear_sub <eval(layer_arms)>
		f_crash_spear_sub <eval(layer_helm)>
		f_crash_spear_sub <eval(layer_gloves)>
		f_crash_spear_sub <eval(layer_pants)>
		f_crash_spear_sub <eval(layer_collar)>
	enddo
	return 1

[FUNCTION f_crash_spear_sub]
	if !(<src.findlayer(<argn>)>)
		return 1
	endif
	if (<src.findlayer(<argn>).type>==t_armor) || (<src.findlayer(<argn>).type>==t_armor_leather)
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 10)
			f_crash_10 <argn>
		else
			f_crash_remove <argn>
		endif
	endif
	return 1

[FUNCTION f_crash_axe]
	if rand(15) >= <eval(<cont.swordsmanship> / 100)>
		return 1
	endif
	dorand 7
		f_crash_axe_sub <eval(layer_chest)>
		f_crash_axe_sub <eval(layer_legs)>
		f_crash_axe_sub <eval(layer_arms)>
		f_crash_axe_sub <eval(layer_helm)>
		f_crash_axe_sub <eval(layer_gloves)>
		f_crash_axe_sub <eval(layer_pants)>
		f_crash_axe_sub <eval(layer_collar)>
	enddo
	return 1

[FUNCTION f_crash_axe_sub]
	if !(<src.findlayer(<argn>)>)
		return 1
	endif
	if (<src.findlayer(<eval(<argn>)>).type>==t_armor) || (<src.findlayer(<eval(<argn>)>).type>==t_armor_leather)
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 10)
			f_crash_10 <argn>
		else
			f_crash_remove <argn>
		endif
	endif
	return 1

[FUNCTION f_crash_mace]
	if rand(15) >= <eval(<cont.macefighting> / 100)>
		return 1
	endif
	dorand 7
		f_crash_mace_sub <eval(layer_chest)>
		f_crash_mace_sub <eval(layer_legs)>
		f_crash_mace_sub <eval(layer_arms)>
		f_crash_mace_sub <eval(layer_helm)>
		f_crash_mace_sub <eval(layer_gloves)>
		f_crash_mace_sub <eval(layer_pants)>
		f_crash_mace_sub <eval(layer_collar)>
	enddo
	return 1

[FUNCTION f_crash_mace_sub]
	if !(<src.findlayer(<argn>)>)
		return 1
	endif
	if <src.findlayer(<argn>).type>==t_armor
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 5)
			f_crash_5 <argn>
		else
			f_crash_remove <argn>
		endif
	endif
	return 1

[FUNCTION f_crash_halberd]
	if rand(15) >= <eval(<cont.swordsmanship> / 100)>
		return 1
	endif
	dorand 7
		f_crash_halberd_sub <eval(layer_chest)>
		f_crash_halberd_sub <eval(layer_legs)>
		f_crash_halberd_sub <eval(layer_arms)>
		f_crash_halberd_sub <eval(layer_helm)>
		f_crash_halberd_sub <eval(layer_gloves)>
		f_crash_halberd_sub <eval(layer_pants)>
		f_crash_halberd_sub <eval(layer_collar)>
	enddo
	return 1

[FUNCTION f_crash_halberd_sub]
	if !(<src.findlayer(<argn>)>)
		return 1
	endif
	if <src.findlayer(<argn>).type>==t_armor
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 5)
			f_crash_5 <argn>
		else
			f_crash_remove <argn>
		endif
	elseif <src.findlayer(<argn>).type>==t_armor_leather
		if (<src.findlayer(<argn>).more> & 0ffff) > (<more2> / 10)
			f_crash_10 <argn>
		else
			f_crash_remove <argn>
		endif
	endif
	return 1

[FUNCTION f_drop_weapon]
	if <cont.dex> >= <src.dex>
		if rand(200) <= <eval(<cont.macefighting> / 100)>
			if <src.findlayer(layer_hand1)>
				src.findlayer(layer_hand1).drop
			elseif <src.findlayer(layer_hand2)>
				src.findlayer(layer_hand2).drop
			endif
		endif
	else
		if rand(2000) <= <eval(<cont.macefighting> / 100)>
			if <src.findlayer(layer_hand1)>
				src.findlayer(layer_hand1).drop
			elseif <src.findlayer(layer_hand2)>
				src.findlayer(layer_hand2).drop
			endif
		endif
	endif

[EOF]
