// 18.12.2001, Eidolon: loot in gz bug fixed
// 16.12.2001, Eidolon: f_checkclientver - first function in EnvironChange
// 05.12.2001, Eidolon: syntax errors
// 05.12.2001, Eidolon: keys checking
// 12.11.2001, MoNK: client version checking
// 07.11.2001, MoNK: change coords of orcish totem
// 31.10.2001, MoNK: change stats table
// 30.10.2001, MoNK: stats functions
// 10.10.2001, MoNK: vampire and light items moved to sphereclasses.scp
// 05.10.2001, MoNK: remove "charges" from orcish amulet
// 03.10.2001, MoNK: i_orcish_amulet: check for orcish equipment, mana drain, increase chance of teleport
// 22.09.2001, MoNK: fix for wonder hammer
// 04.09.2001, MoNK: unequip in morphing
// 28.08.2001, MoNK: f_damage_spear
// 27.08.2001, MoNK: orcish amulet: random teleport
// 25.08.2001, MoNK: syntax errors, increase speed of orcish hammerpick, silver sharp, silver beam, fix error in weight of orcish war hammer, ### i_exp_silverbeam ###
// 22.07.2001, MoNK: skillsum for races
// 12.07.2001, MoNK: timer settings and stone harvesting for dwarf's pickaxe
// 18.06.2001, MoNK: vampire race colors
// 12.06.2001, MoNK: Light stuff
// 27.05.2001, MoNK: decrease chance of treasure or elemental mine
// 25.05.2001, MoNK: fix self hit part II, remove healing and restoration from morphers
// 18.05.2001, MoNK: remove formulas from src.damage (causes error in log)
// 16.05.2001, MoNK: disable targeting anything by weapons except corpses and lumber
// 16.05.2001, MoNK: damage calculation for Blood Claw, Dwarf Mytheril Crossbow
// 14.05.2001, MoNK: disable targeting on "mace smith" weapon, disable lumberjacking with Blood Claw
// 04.05.2001, MoNK: fix dwarf pickaxe after "breaking" - reset more
// 27.04.2001, MoNK: anti-curse in equipped state added
// 26.04.2001, MoNK: damage calculation for race weapons

[ITEMDEF i_disconnector]
NAME=Disconnector
ID=i_deed
LAYER=layer_special
TYPE=t_eq_script
WEIGHT=0

On=@Create
	attr = attr_newbie | attr_invis
	more = 10

On=@Timer
	if <cont>
		if !<cont.ischar>
			remove
			return 1
		endif
		if <cont.brain>
			remove
			return 1
		endif
		if <more> == 0
			cont.disconnect
			remove
			return 1
		endif
		more = (<more> - 1)
		cont.message <more>
		timer = 1
		return 1
	else
		remove
		return 1
	endif

[FUNCTION f_skillclass_set]
	if     (<plot1> & (plotmask_vampire | plotmask_dwarf))==(plotmask_vampire | plotmask_dwarf)
		src.skillclass = vampire_dwarf_class
	elseif (<plot1> & (plotmask_vampire | plotmask_elf))==(plotmask_vampire | plotmask_elf)
		src.skillclass = vampire_elf_class
	elseif (<plot1> & (plotmask_vampire | plotmask_orc))==(plotmask_vampire | plotmask_orc)
		src.skillclass = vampire_orc_class
	elseif (<plot1> & (plotmask_paladin | plotmask_dwarf))==(plotmask_paladin | plotmask_dwarf)
		src.skillclass = paladin_dwarf_class
	elseif (<plot1> & (plotmask_paladin | plotmask_elf))==(plotmask_paladin | plotmask_elf)
		src.skillclass = paladin_elf_class
	elseif (<plot1> & (plotmask_paladin | plotmask_orc))==(plotmask_paladin | plotmask_orc)
		src.skillclass = paladin_orc_class
	elseif (<plot1> & plotmask_vampire)
		src.skillclass = vampire_class
	elseif (<plot1> & plotmask_paladin)
		src.skillclass = paladin_class
	elseif (<plot1> & plotmask_dwarf)
		src.skillclass = dwarf_class
	elseif (<plot1> & plotmask_elf)
		src.skillclass = elf_class
	elseif (<plot1> & plotmask_orc)
		src.skillclass = orc_class
	else
		src.skillclass = class_undeclared
	endif
	return 1

[TYPEDEF t_skillclass_set]
// more = 0 - set skillclass for class_undeclared only
On=@Step
	if (<src.skillclass>==class_undeclared) || (<more>!=0)
		src.f_skillclass_set
	endif

	return 0

// 		STR/DEX/INT
// Human		170/170/170
// Dwarf		180/130/130
// Orc		170/140/130
// Elf		160/170/150

[FUNCTION f_stats_human]
	if <src.str> > 170
		src.str = (<src.str> - 1)
	endif
	if <src.dex> > 170
		src.dex = (<src.dex> - 1)
	endif
	if <src.int> > 170
		src.int = (<src.int> - 1)
	endif
	return 1

[FUNCTION f_stats_dwarf]
	if <src.str> > 180
		src.str = (<src.str> - 1)
	endif
	if <src.dex> > 130
		src.dex = (<src.dex> - 1)
	endif
	if <src.int> > 140
		src.int = (<src.int> - 1)
	endif
	return 1

[FUNCTION f_stats_orc]
	if <src.str> > 170
		src.str = (<src.str> - 1)
	endif
	if <src.dex> > 140
		src.dex = (<src.dex> - 1)
	endif
	if <src.int> > 130
		src.int = (<src.int> - 1)
	endif
	return 1

[FUNCTION f_stats_elf]
	if <src.str> > 160
		src.str = (<src.str> - 1)
	endif
	if <src.dex> > 170
		src.dex = (<src.dex> - 1)
	endif
	if <src.int> > 150
		src.int = (<src.int> - 1)
	endif
	return 1

//#########################
// Pure class skillclasses
//#########################

[SKILLCLASS paladin_class]
NAME=Paladin
//EVENTS=e_paladinclass
STATSUM=350
SKILLSUM=5100.0
STR=150
INT=100
DEX=100
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=110.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=115.0		// !!!
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<act.link.type> == t_multi) && (!(<isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_human

[EVENTS e_paladinclass]

[SKILLCLASS vampire_class]
NAME=Vampire
//EVENTS=e_vampireclass
STATSUM=350
SKILLSUM=5100.0
STR=140
INT=110
DEX=100
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=115.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=115.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=120.0		// !!!
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_human

[EVENTS e_vampireclass]

//########################
// Pure race skillclasses
//########################

[SKILLCLASS dwarf_class]
NAME=Dwarf
//EVENTS=e_dwarfclass
STATSUM=350
SKILLSUM=5100.0
STR=150
INT=90
DEX=110
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=115.0		// !!!
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=100.0
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=100.0
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=115.0			// !!!
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_dwarf

[EVENTS e_dwarfclass]

[SKILLCLASS elf_class]
NAME=Elf
//EVENTS=e_elffclass
STATSUM=350
SKILLSUM=5100.0
STR=110
INT=110
DEX=130
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=115.0			// !!!
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=100.0
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=115.0			// !!!
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=100.0
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_elf

[EVENTS e_elfclass]

[SKILLCLASS orc_class]
NAME=Orc
//EVENTS=e_orcclass
STATSUM=350
SKILLSUM=5100.0
STR=135
INT=80
DEX=135
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=100.0
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=100.0
Macefighting=115.0		// !!!
Fencing=100.0
Wrestling=115.0			// !!!
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_orc

[EVENTS e_orcclass]

//#############################
// Vampire + race skillclasses
//#############################

[SKILLCLASS vampire_dwarf_class]
NAME=Dwarf vampire
//EVENTS=e_dwarfclass
//EVENTS=e_vampireclass
STATSUM=350
SKILLSUM=5100.0
STR=150
INT=90
DEX=110
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=115.0		// !!!
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=115.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=120.0		// !!!
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=115.0			// !!!
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_dwarf

[SKILLCLASS vampire_elf_class]
NAME=Elf vampire
//EVENTS=e_elffclass
//EVENTS=e_vampireclass
STATSUM=350
SKILLSUM=5100.0
STR=110
INT=110
DEX=130
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=115.0			// !!!
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=115.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=115.0			// !!!
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=120.0		// !!!
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_elf

[SKILLCLASS vampire_orc_class]
NAME=Orc vampire
//EVENTS=e_orcclass
//EVENTS=e_vampireclass
STATSUM=350
SKILLSUM=5100.0
STR=135
INT=80
DEX=135
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=115.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=120.0		// !!!
Macefighting=115.0		// !!!
Fencing=100.0
Wrestling=115.0			// !!!
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_orc

//#############################
// Paladin + race skillclasses
//#############################

[SKILLCLASS paladin_dwarf_class]
NAME=Dwarf paladin
//EVENTS=e_dwarfclass
//EVENTS=e_paladinclass
STATSUM=350
SKILLSUM=5100.0
STR=150
INT=90
DEX=110
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=115.0		// !!!
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=110.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=115.0		// !!!
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=115.0			// !!!
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_dwarf

[SKILLCLASS paladin_elf_class]
NAME=Elf paladin
//EVENTS=e_elffclass
//EVENTS=e_paladinclass
STATSUM=350
SKILLSUM=5100.0
STR=110
INT=110
DEX=130
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=115.0			// !!!
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=110.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=115.0			// !!!
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=115.0		// !!!
Macefighting=100.0
Fencing=100.0
Wrestling=100.0
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_elf

[SKILLCLASS paladin_orc_class]
NAME=Orc paladin
//EVENTS=e_orcclass
//EVENTS=e_paladinclass
STATSUM=350
SKILLSUM=5100.0
STR=135
INT=80
DEX=135
Anatomy=100.0
ItemID=100.0
ArmsLore=100.0
Parrying=100.0
Begging=100.0
Blacksmithing=100.0
Bowcraft=100.0
Peacemaking=100.0
Camping=100.0
Carpentry=100.0
Cartography=100.0
Cooking=100.0
DetectingHidden=100.0
Enticement=100.0
EvaluatingIntel=100.0
Healing=100.0
Fishing=100.0
Forensics=100.0
Herding=100.0
Hiding=100.0
Provocation=100.0
Inscription=100.0
LockPicking=100.0
Magery=110.0			// !!!
MagicResistance=100.0
Tactics=100.0
Snooping=100.0
Musicianship=100.0
Poisoning=100.0
Archery=100.0
SpiritSpeak=100.0
Stealing=100.0
Tailoring=100.0
Taming=100.0
TasteID=100.0
Tinkering=100.0
Tracking=100.0
Veterinary=100.0
Swordsmanship=115.0		// !!!
Macefighting=115.0		// !!!
Fencing=100.0
Wrestling=115.0			// !!!
Lumberjacking=100.0
Mining=100.0
Meditation=100.0
Stealth=100.0
RemoveTrap=100.0
Necromancy=100.0

On=@Death
	findlayer(21).removefromview

On=@itemTIMER_UNUSED //@itemTargon_item
	if <act.type>==t_key
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			if <targ.more> != <act.more>
				Src.sysmessage The key does not match the lock.
				return 1
			endif
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			if (<targ.more> != <act.more>) && (((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>))
				Src.sysmessage The key does not match the lock.
				return 1
			else
				return 0
			endif
		elseif ((<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)) && (<act.more> != <targ.link>) && (<targ.type>!=t_container) && (<targ.type>!=t_container_locked) && (<targ.type>!=t_key) && (<targ.type>==t_house_brass_sign) && (<targ.type>==t_ship_tiller)
			Src.sysmessage The key does not match the lock.
			return 1
		endif
	elseif <act.type>==t_keyring
		if (<targ.type>==t_door) || (<targ.type>==t_door_locked) || (<targ.type>==t_ship_side) || (<targ.type>==t_ship_side_locked)
			f_keyffffffff_fix <targ.more>
		elseif (<targ.type>==t_container) || (<targ.type>==t_container_locked)
			f_keyffffffff_fix <targ.more>
			if (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
				f_keyffffffff_fix <targ.link>
			endif
		elseif (<targ.link.type>==t_multi) || (<targ.link.type>==t_ship)
			f_keyffffffff_fix <targ.link>
		else
			src.f_match_key
			return 0
		endif
		if (!<src.restest 1 t_key_match>)			
			src.sysmessage You don't have a key for this.
			return 1
		endif
		src.f_match_key

	endif

On=@itemPickup_Pack	// @itemPickup_Ground
	if (<src.act.link.type> == t_multi) && (!(<src.isgm>))
		return 1
	endif

On=@EnvironChange
	f_checkclientver
	if (<src.flags> & statf_polymorph) || (<src.findlayer(layer_spell_stats)>) || <isgm> || <src.brain>
		return 0
	endif
	f_stats_orc




[DEFNAME RACENAMES]
plotmask_dwarf		02
plotmask_elf		04
plotmask_orc		08
plotmask_paladin		080
plotmask_vampire		0100

// === Functions ===

[FUNCTION f_dwarf_only]
	if !(<src.plot1>&plotmask_dwarf)
		src.message Dast thau honestly belives to be the  firefroged son of Earth?
		unequip
		return 1
	else
		return 1
	endif
	return 1

[FUNCTION f_elf_only]
	if !(<src.plot1>&plotmask_elf)
		if <src.plot1>&plotmask_orc
			src.message Get off unclean!
			src.damage {10 20}
		else
			src.message Do not regress thyself proclaiming something, you are not, no Rrival!
		endif
		unequip
		return 1
	else
		return 1
	endif
	return 1

[FUNCTION f_orc_only]
	if !(<src.plot1>&plotmask_orc)
		src.sfx snd_spell_poison
		src.spelleffect s_poison 1000
		if <src.plot1>&plotmask_elf
			src.message Ugh ugh!
			src.damage {10 20}
		else
			src.message To darkness of the orcish blood do not have any thy compliance!
		endif
		unequip
		return 1
	else
		return 1
	endif
	return 1

[FUNCTION f_orc_plate_only]
	if !(<src.plot1>&plotmask_orc)
		src.sfx snd_spell_poison
		src.spelleffect s_poison 1000
		if <src.plot1>&plotmask_elf
			src.message Ugh ugh!
			src.damage {10 20}
		else
			src.message To darkness of the orcish blood do not have any thy compliance!
		endif
		unequip
		return 1
	elseif (<src.fame><5000)
		src.message Get's thy sparkly hands off, Cleansed one! Thy not deserves to wear this. Are you realy orc?
		unequip
		return 1
	else
		return 1
	endif

//############
// Dwarf items
//############

[ITEMDEF 06800]
//Dwarf apron
DEFNAME=DWARF_APRON
NAME=Dwarf apron
ID=0153d
DYE=0
ARMOR=4
WEIGHT=4

RESOURCES=10 i_cloth,1 i_thread, 1 i_ingot_mytheril
SKILLMAKE=TAILORING 100.0, t_sewing_kit

On=@Create
	HITPOINTS {21 30}
	color=MYTHERIL_ARMOR_COLOR

On=@DClick
	src.f_skillclass_set
	src.message You do not need this <name> anymore!
	return 1

On=@Click
	src.f_skillclass_set

On=@Equip
	if <src.plot1>&plotmask_dwarf
		src.f_skillclass_set
		src.message You do not need this <name> anymore!
		src.mining = (<src.mining> - 15.0)
		src.blacksmithing = (<src.blacksmithing> - 15.0)
		unequip
		return 1
	else
		src.message Dast thau honestly belives to be the  firefroged son of Earth?
		unequip
		return 1
	endif

On=@Unequip
	if <src.plot1>&plotmask_dwarf
		src.mining = (<src.mining> + 15.0)
		src.blacksmithing = (<src.blacksmithing> + 15.0)
	endif
	src.f_skillclass_set

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf apron

[ITEMDEF 06801]
//Dwarf kite shield
DEFNAME=dwarf_kite
NAME=Dwarf shield
ID=01b78
ARMOR=46
WEIGHT=12

RESOURCES=30 i_ingot_mytheril
SKILLMAKE=blacksmithing 110.0

On=@Create
	color=MYTHERIL_ARMOR_COLOR
	HITPOINTS={70 100}

On=@Equip
	if <type>!=t_shield
		type=t_shield
	endif

	if <src.plot1>&plotmask_dwarf
		src.parrying = (<src.parrying> + 30.0)
		src.tactics = (<src.tactics> + 10.0)
		return 0
	else
		src.message Dast thau honestly belives to be the  firefroged son of Earth?
		unequip
		return 1
	endif

On=@Unequip
	if <src.plot1> & plotmask_dwarf
		src.parrying = (<src.parrying> - 30.0)
		src.tactics = (<src.tactics> - 10.0)
	endif

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf kite shield

[ITEMDEF 06802]
//Dwarf hammer
DEFNAME=dwarf_hammer
NAME=Dwarf hammer
ID=01438
DAM=20,48
SPEED=20
SKILL=Mace Fighting
REQSTR=100
TWOHANDS=Y
WEIGHT=29.0
RESOURCES=15 i_ingot_mytheril
SKILLMAKE=blacksmithing 105.0

On=@Create
	HITPOINTS={31 110}
	color=MYTHERIL_ARMOR_COLOR

On=@Dclick
	equip
	return 1

On=@Equip
	f_dwarf_only

On=@Damage	// 4d8+16 = 20-48
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {20 48}
	f_damage_mace
	src.damage <more2>
	f_crash_mace
	more2 = 0
	return 1

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf hammer

[ITEMDEF 06803]
//Thunder hammer
DEFNAME=thunder_hammer
NAME=Thunder hammer
ID=0143c
DAM=18,45
//SPEED=30
SKILL=Mace Fighting
REQSTR=100
LAYER=1
TWOHANDS=N
//WEIGHT=30.0
RESOURCES=25 i_ingot_mytheril
SKILLMAKE=blacksmithing 115.0

On=@Create
	HITPOINTS {31 110}
	color=MYTHERIL_ARMOR_COLOR

On=@Dclick
	equip
	return 1

On=@Equip
	f_dwarf_only

ON=@Damage	// 3d10+15
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {18 45}
	f_damage_mace
	if rand(15)==1
		more2 = <more2> + (<more2> / 2)
		src.spelleffect 30 750
		src.sfx snd_spell_lightning
	endif
	src.damage <more2>
	f_crash_mace
	more2 = 0
	return 1

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Thunder hammer

[ITEMDEF 06804]
//Dwarf cloak
DEFNAME=DWARF_CLOAK
NAME=Dwarf cloak
ID=01515
DYE=0
ARMOR=15
WEIGHT=15
SKILLMAKE=TAILORING 100.0, t_sewing_kit
RESOURCES=14 i_cloth,1 i_thread, 1 i_ingot_mytheril

On=@Create
	HITPOINTS={22 80}
	color=MYTHERIL_ARMOR_COLOR
	attr=attr_newbie

On=@Equip
	f_dwarf_only

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf cloak

[ITEMDEF 06805]
// Dwarf's smiths hammer
DEFNAME=DWARF_SMITH_HAMMER
NAME=Dwarf's smiths hammer
ID=013e3
DAM=8,22
SKILL=Mace Fighting
REQSTR=90
TWOHANDS=N

RESOURCES=3 i_ingot_mytheril, 1 i_board
SKILLMAKE=blacksmithing 100.1

On=@Create
	attr=attr_newbie
	HITPOINTS={131 160}
	color=MYTHERIL_ARMOR_COLOR

On=@Equip
	if !(<src.plot1>&plotmask_dwarf)
		src.message You can't use this hammer! Only Dwarfs knows secrets of skill!
		unequip
		return 1
	else
		if <link>==04fffffff
			link=<src.SERIAL>
			NAME=<src.NAME>'s smiths hammer
			update
			return 0
		elseif <link>==<src.SERAIL>
			src.message Do I start to smithing now Master?
			src.sfx 02a
			return 0
		endif
	endif

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf's smiths hammer

[ITEMDEF 06806]
// Dwarf's pickaxe
DEFNAME=dwarf_pickaxe
NAME=Dwarf's pickaxe
ID=0e85
DAM=12,32
REQSTR=90
TWOHANDS=N

RESOURCES=5 i_ingot_mytheril, 1 i_log
SKILLMAKE=blacksmithing 100.1

On=@Create
	HITPOINTS={131 160}
	color=MYTHERIL_ARMOR_COLOR
	attr=attr_newbie

On=@Equip
	more = 00900090
	if !(<src.plot1> & plotmask_dwarf)
		src.message You can't use this pickaxe! Only Dwarfs knows secrets of skill!
		unequip
		return 1
	else
		attr = <attr> | attr_newbie
		if <link>==04fffffff
			link=<src.SERIAL>
			NAME=<src.NAME>'s pickaxe
			update
			more = 00540054
			return 0
		elseif <link>==<src.SERAIL>
			src.message Do I start to mining now Master?
			more = 00540054
			return 0
		endif
	endif

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 <eval(<src.account.plevel>)> > 1
		src.sysmessage Turn off GM mode first!
		return 1
	endif

	if <timer> > 0
		return 0
	endif

	if <src.mining> < 100.0
		return 0
	endif

	if <src.food> > 10
		if rand(10000)==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 = 3600
			return 1
		endif
	endif

	if rand(500)==1
		src.newitem { i_ore_magma 1 i_ore_mytheril 1 i_ore_obsidian 1 i_ore_silver 2 i_ore_golden 3 }
		src.act.amount { 1 5 }
		src.act.p = <src.p>
		src.sysmessage You have found some <src.act.name>!
		timer = 600
		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_silver
			src.newnpc c_elem_ore_gold
			src.newnpc c_elem_ore_mytheril
			src.newnpc c_elem_ore_dwarf
			src.newnpc c_elem_ore_verite
			src.newnpc c_elem_ore_valorite
			src.newnpc c_elem_ore_agapite
			src.newnpc c_elem_ore_orion
		enddo
		src.act.home=<src.p>
		src.act.p=<src.p>
		src.act.homedist 5
		timer = 1200
		return 0
	endif

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

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

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf's pickaxe

[ITEMDEF 06807]
//Dwarf mytheril crossbow
DEFNAME=DWARF_MYTHERIL_CROSSBOW
NAME=Dwarf mytheril crossbow
ID=0f4f
DAM=9,51
SKILL=Archery
REQSTR=90
TWOHANDS=Y
REPAIR=1

RESOURCES=15 i_ingot_mytheril, 80 i_board
SKILLMAKE=bowcraft 50.0, blacksmithing 100.0

On=@Create
	HITPOINTS={31 80}
	color=MYTHERIL_ARMOR_COLOR

CATEGORY=Races & Classes
SUBSECTIOn=Dwarf items
DESCRIPTIOn=Dwarf mytheril crossbow

On=@Equip
	type=t_weapon_xbow

	f_dwarf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

On=@Damage	// 3d15+6
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {9 51}
	f_damage_xbow
	src.damage <more2>
	more2 = 0
	return 1

//############
// Elven items
//############

[ITEMDEF 06810]
//Elven kilt
DEFNAME=elven_kilt
NAME=Elven kilt
ID=01537
DYE=0
ARMOR=4
WEIGHT=4.0

SKILLMAKE=TAILORING 100.0, t_sewing_kit
RESOURCES=16 i_cloth, 2 i_thread

On=@Create
	HITPOINTS={21 30}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	if <src.plot1>&plotmask_elf
		src.f_skillclass_set
		src.message You do not need this <name> anymore!
		src.archery = (<src.archery> - 15.0)
		src.bowcraft = (<src.bowcraft> - 15.0)
		unequip
		return 1
	else
		src.message Do not regress thyself proclaiming something, you are not, no Rrival!
		unequip
		return 1
	endif
	unequip
	return 1

On=@Unequip
	if <src.plot1>&plotmask_elf
		src.archery = (<src.archery> + 15.0)
		src.bowcraft = (<src.bowcraft> + 15.0)
	endif
	src.f_skillclass_set

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven kilt

[ITEMDEF 06811]
//Silver sharp
DEFNAME=SILVER_SHARP
NAME=Silver sharp
ID=01400
DAM=9,34
SKILL=Fencing
REQSTR=100
TWOHANDS=N

WEIGHT=7.0	//original WEIGHT=8.0

RESOURCES=25 i_ingot_newsilver
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={31 90}
	color=SILVER_ARMOR_COLOR

On=@Equip
	if <src.plot1>&plotmask_elf
		if <src.plot1>&plotmask_vampire
			src.message Vampire can't use silver weapon!
			src.damage {15 30}
			src.sfx 0df
			unequip
			return 1
		endif
		src.FENCING=(<src.FENCING>+10.0)
	else
		src.message Only elf can use this blade!
		src.damage {10 30}
		unequip
		return 1
	endif

On=@Unequip
	if <src.plot1>&plotmask_elf
		src.FENCING=(<src.FENCING>-10.0)
	endif

On=@Damage	// 5d6+4= 9-34
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {9 34}
	f_damage_fencing
	if ((<src.BRAIN>==BRAIN_UNDEAD) || (<src.plot1>&plotmask_vampire))
		if RAND(7)==1
			src.damage {18 34}
			src.spelleffect 30 750
			src.sfx snd_SPELL_LIGHTNING
		else
			src.damage <more2>
		endif
	else
		src.damage <more2>
	endif
	f_crash_sword
	more2 = 0
	return 1	

On=@Targon_ground
	return 1

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=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Silver sharp

[ITEMDEF i_exp_silverbeam]
NAME=Exp-card: silver beam
ID=i_spear
TYPE=t_eq_script
WEIGHT=0
LAYER=layer_special

On=@Create
	attr = attr_newbie | attr_invis

On=@Click
	if !<src.isgm>
		attr = <attr> | attr_invis
		return 1
	endif

//Silver beam
[ITEMDEF 06812]
DEFNAME=SILVER_BEAM
NAME=Silver beam
ID=0f62
DAM=13,48
SKILL=Fencing
REQSTR=100
TWOHANDS=Y

WEIGHT=7.8	//original WEIGHT=8.8

RESOURCES=30 i_ingot_newsilver
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={31 80}
	color=SILVER_ARMOR_COLOR

On=@Equip
	if <src.plot1>&plotmask_elf
		if <src.plot1> & plotmask_vampire
			src.message Vampire can't use silver weapon!
			src.damage {15 30}
			src.sfx 0df
			unequip
			return 1
		endif
		src.fencing = (<src.fencing> + 15.0)
		if !<src.restest 1 i_exp_silverbeam>
			src.newitem i_exp_silverbeam
			src.act.timer = -1
			src.act.cont = <src.serial>
		endif
	else
		src.message Only elf can use this spear!
		src.damage {10 30}
		unequip
		return 1
	endif

On=@Unequip
	if <src.plot1> & plotmask_elf
		src.fencing = (<src.fencing> - 15.0)
	endif

On=@Damage	// 5d8+8 = 13-48
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {13 48}
	f_damage_spear
	if <cont.restest 1 i_exp_silverbeam>
		if <cont.findid(i_exp_silverbeam).more> < 100000
			cont.findid(i_exp_silverbeam).more = <cont.findid(i_exp_silverbeam).more> + 1
		endif
	endif
	if ((<src.brain>==BRAIN_UNDEAD) || (<src.plot1>&plotmask_vampire))
		if rand(7)==1
		src.damage {16 42}
		src.spelleffect 30 750
		src.sfx snd_spell_lightning
	else
		src.damage <more2>
	endif
	f_crash_spear
	more2 = 0
	return 1

On=@Targon_ground
	return 1

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=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Silver beam

[ITEMDEF 06813]
//Elven chain tunic
DEFNAME=ELVEN_CHAIN_TUNIC
NAME=Elven chain tunic
ID=013bd
ARMOR=55
REQSTR=90
WEIGHT=17
RESOURCES=15 i_ingot_orion, 15 i_ingot_iron
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={146 158}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	f_elf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven chain tunic

[ITEMDEF 06814]
//Elven chain coif
DEFNAME=ELVEN_CHAIN_COIF
NAME=Elven chain coif
ID=013bb
ARMOR=50
REQSTR=90
WEIGHT=10
RESOURCES=5 i_ingot_orion, 5 i_ingot_iron
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={136 144}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	f_elf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven chain coif

[ITEMDEF 06815]
//Elven chain leggings
DEFNAME=ELVEN_CHAIN_LEGGINGS
NAME=Elven chain leggings
ID=013bc
ARMOR=50
REQSTR=90
WEIGHT=20
RESOURCES=10 i_ingot_orion, 10 i_ingot_iron
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={146 158}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	f_elf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven chain leggings

[ITEMDEF 06816]
//Elven chain gloves
DEFNAME=ELVEN_CHAIN_GLOVES
NAME=Elven chain gloves
ID=013eb
ARMOR=50
REQSTR=90
WEIGHT=4
RESOURCES=5 i_ingot_orion, 5 i_ingot_iron
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	f_elf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven chain gloves

[ITEMDEF 06817]
//Elven chain sleeves
DEFNAME=ELVEN_CHAIN_SLEEVES
NAME=Elven chain sleeves
ID=013e9
ARMOR=50
REQSTR=90
WEIGHT=10
RESOURCES=10 i_ingot_orion, 10 i_ingot_iron
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	f_elf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven chain sleeves

[ITEMDEF 06818]
//Elven gorget
DEFNAME=ELVEN_GORGET
NAME=Elven gorget
ID=01413
ARMOR=60
REQSTR=90
WEIGHT=4
RESOURCES=5 i_ingot_orion, 5 i_ingot_iron
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ELVEN_ARMOR_COLOR

On=@Equip
	f_elf_only

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Elven items
DESCRIPTIOn=Elven gorget

//#############
// Orcish items
//#############

//Orcish Verdebras
[TYPEDEF t_orcish_amulet]
On=@Click
	if <src.plot1> & plotmask_orc
		if <more> == 0
			message Bring this <name> to Orcish Totem
		else
			return 0
		endif
	elseif <src.plot1> & plotmask_elf
		message You feel bad magic on this strange Amulet
	elseif <src.plot1> & plotmask_dwarf
		message Oh! This Amulet has bad owner! It was shine and it's rusty now...
	else
		message It seems to be an orcish item
	endif
	return 1

On=@Equip
	more = 0940094
	if <src.plot1> & plotmask_orc
		timer = 1
		return 0
	elseif <src.plot1> & plotmask_elf
		src.message <name> is sqeeze your groin! You feel venom in you veins!
		src.flags = <src.flags> | statf_poisoned
		timer = 5
	elseif <src.plot1> & plotmask_dwarf
		src.message Too dirt and... What a terrible smelt!
		unequip
	else
		timer = 10
		src.message You feel yourself being strange...
		return 0
	endif
	return 1

On=@Unequip
	if <src.plot1> & plotmask_orc
		timer = -1
//		more = 0
		return 0
	elseif <src.plot1> & plotmask_elf
		src.message You feel yourself much better when this <name> is not on your neck!
	endif

On=@Timer
	if !<cont>
		timer = -1
		return 1
	endif
	if !<cont.ischar>
		timer = -1
		return 1
	endif
	if (<cont.plot1> & plotmask_orc) &&  (!(<cont.flags> & (statf_polymorph | statf_dead)))	// (<more>!=0) &&
		if <cont.hits> < <eval(<cont.str> / 20)>
			if rand(5)==1
				cont.go 991,1317
				cont.fix
				cont.sysmessage The power of <name> brings you to Orcish Totem!
				cont.hits = (<cont.str> / 20)
			endif
		endif

		// check equipment
		if <cont.findlayer(layer_helm).baseid>!=orcish_helmet
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_arms).baseid>!=orcish_ringmail_sleeves) && (<cont.findlayer(layer_arms).baseid>!=orcish_platemail_arms))
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_pants).baseid>!=orcish_ringmail_leggings) && (<cont.findlayer(layer_legs).baseid>!=orcish_platemail_legs))
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_arms).baseid>!=orcish_ringmail_sleeves) && (<cont.findlayer(layer_arms).baseid>!=orcish_platemail_arms))
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_chest).baseid>!=orcish_ringmail_tunic) && (<cont.findlayer(layer_chest).baseid>!=orcish_platemail_chest))
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_gloves).baseid>!=orcish_ringmail_gloves) && (<cont.findlayer(layer_gloves).baseid>!=orcish_platemail_gloves))
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_hand2).baseid>!=orcish_warhammer) && (<cont.findlayer(layer_hand2).baseid>!=orcish_buckler) && (<cont.findlayer(layer_hand2).baseid>!=orcish_shield))
			timer = 1
			return 1
		endif
		if ((<cont.findlayer(layer_hand2).baseid>!=orcish_warhammer) && (<cont.findlayer(layer_hand1).baseid>!=orcish_hammerpick) && (<cont.findlayer(layer_hand1).baseid>!=orcish_yataghan))
			timer = 1
			return 1
		endif
		if <cont.hits> < <cont.str>
			cont.hits = (<cont.hits> + { 1 5 })
		endif
		if <cont.stamina> < <cont.dex>
			cont.stamina = (<cont.stamina> + { 1 5 })
		endif
		if <cont.hits> < <cont.str>
			if <cont.mana> > 0
				if rand(2)==1
					cont.mana = (<cont.mana> - 1)
					if <cont.mana> > <cont.int>
						cont.mana = 0
					endif
				endif
				timer = 1
			else
				timer = 4
			endif
		else
			timer = 1
		endif
		return 1
	elseif <cont.plot1> & plotmask_elf
		if (<more> & 0ffff) < 10
			remove
			return 1
		else
			more = (<more> & 0ffff0000) + ((<more> & 0ffff) - 10)
		endif
		cont.spelleffect s_poison 1000
		cont.damage <eval({35,55})>
		cont.sound snd_spell_curse
		if <cont.mana> > 5
			cont.mana = (<src.mana> - { 1 5 })
		else
			cont.mana = 0
		endif
		dorand 3
			cont.sysmessage You feel venom in your veins!
			cont.sysmessage Strange fire burns in your mind!
			cont.sysmessage Breath of Orcish Totem touch you!
		enddo
		timer = 3
		return 1
	endif
	drop
	timer = -1
	return 1

On=@DClick
	if <src.plot1> & plotmask_orc
		if <more>==0
			target Show me Orcish Totem
			return 1
		else
			equip
			return 1
		endif
	elseif <src.plot1> & plotmask_elf
		equip
		return 1
	elseif <src.plot1> & plotmask_dwarf
		equip
		return 1
	else
		equip
		return 1
	endif

On=@Targon_item
	if <src.targ.type>!=t_morpher_orc
		src.message Only the powers of Orcish Totem can recharge this <name>!
		return 1
	else
		more = 1
		src.message <name> is recharged
		return 1
	endif

[ITEMDEF i_golden_wax]
NAME=Golden wax
ID=i_beeswax

RESOURCES=1 i_beeswax, 1 i_ingot_gold

On=@Create
	color = color_o_gold

[ITEMDEF i_orcish_amulet]
NAME=Orcish Verdebras
ID=i_necklace_gold
TYPE=t_orcish_amulet
WEIGHT=5

RESOURCES=5 i_ingot_iron, 5 i_reag_nightshade, 5 i_golden_wax
SKILLMAKE=50.0 TINKERING, t_orcish_amulet, t_tinker_tools, t_carpentry

On=@Create
	color = color_o_rusty
	more = 1

[ITEMDEF 06820]
//Orcish tunic
DEFNAME=orcish_tunic
NAME=Orcish tunic
ID=01fa1
DYE=0
ARMOR=15
WEIGHT=5
SKILLMAKE=TAILORING 100.0, t_sewing_kit
RESOURCES=24 i_cloth,2 i_thread, 24 i_reag_nightshade

On=@Create
	color=ORCISH_ARMOR_COLOR
	HITPOINTS={110 150}

On=@Equip
	if !(<src.plot1>&plotmask_orc)
		src.message Only Orc can wear this tunic!
		src.sfx snd_spell_poison
		src.spelleffect s_poison 1000
		if (<src.plot1> & plotmask_elf)
			src.damage {10 20}
		endif
		unequip
		return 1
	else
		src.f_skillclass_set
		src.macefighting=(<src.macefighting>-15.0)
		src.wrestling=(<src.wrestling>-15.0)
		src.message You do not need this <name> anymore!
		unequip
		return 1
	endif

On=@Unequip
	if (<src.plot1>&plotmask_orc)
		src.macefighting=(<src.macefighting>+15.0)
		src.wrestling=(<src.wrestling>+15.0)
	endif
	src.f_skillclass_set

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish tunic

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06821]
//Orcish helmet
DEFNAME=orcish_helmet
NAME=Orcish helmet
ID=01f0b
ARMOR=50
REQSTR=90
WEIGHT=5
RESOURCES=20 i_ingot_iron, 15 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={131 170}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	if !(<src.plot1>&plotmask_orc)
		src.message I've got you!
		src.sfx snd_spell_poison
		src.spelleffect s_poison 1000
		if (<src.plot1> & plotmask_elf)
			src.damage {10 20}
		endif
		attr=<attr>|0100
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish helmet

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06822]
//Orcish ringmail tunic
DEFNAME=orcish_ringmail_tunic
NAME=Orcish ringmail tunic
ID=013ec
ARMOR=50
REQSTR=90
WEIGHT=15
RESOURCES=25 i_ingot_iron, 20 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish ringmail tunic

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06823]
//Orcish ringmail leggings
DEFNAME=orcish_ringmail_leggings
NAME=Orcish ringmail leggins
ID=013e5
ARMOR=50
REQSTR=90
WEIGHT=20
RESOURCES=20 i_ingot_iron, 15 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish ringmail leggings

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06824]
//Orcish ringmail sleeves
DEFNAME=orcish_ringmail_sleeves
NAME=Orcish ringmail sleeves
ID=013e9
ARMOR=50
REQSTR=90
WEIGHT=15
RESOURCES=15 i_ingot_iron, 10 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish ringmail sleeves

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06825]
//Orcish ringmail gloves
DEFNAME=orcish_ringmail_gloves
NAME=Orcish ringmail gloves
ID=013eb
ARMOR=50
REQSTR=90
WEIGHT=2
RESOURCES=10 i_ingot_iron, 5 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish ringmail gloves

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06826]
//Orcish studded gorget
DEFNAME=orcish_studded_gorget
NAME=Orcish studded gorget
ID=013d6
ARMOR=50
REQSTR=90
WEIGHT=2
RESOURCES=5 i_ingot_iron, 10 i_hide, 5 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={136 144}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish studded gorget

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06827]
//Orcish platemail chest
DEFNAME=orcish_platemail_chest
NAME=Orcish platemail chest
ID=01415
ARMOR=55
REQSTR=100
WEIGHT=10
RESOURCES=30 i_ingot_iron, 25 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_plate_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish platemail chest

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06828]
//Orcish platemail arms
DEFNAME=orcish_platemail_arms
NAME=Orcish platemail arms
ID=01410
ARMOR=55
REQSTR=100
WEIGHT=5
RESOURCES=20 i_ingot_iron, 15 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_plate_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish platemail arms

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06829]
//Orcish platemail legs
DEFNAME=orcish_platemail_legs
NAME=Orcish platemail legs
ID=01411
ARMOR=55
REQSTR=100
WEIGHT=15
RESOURCES=25 i_ingot_iron, 20 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_plate_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish platemail legs

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 0682a]
//Orcish platemail gloves
DEFNAME=orcish_platemail_gloves
NAME=Orcish platemail gloves
ID=01414
ARMOR=55
REQSTR=100
WEIGHT=2
REPAIR=1 
SPEED=20 
TWOHANDS=N 
DAM=10,20
SKILL=Wrestling 
RESOURCES=10 i_ingot_iron, 5 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_plate_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish platemail gloves

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 0682b]
//Orcish platemail gorget
DEFNAME=orcish_platemail_gorget
NAME=Orcish platemail gorget
ID=01413
ARMOR=55
REQSTR=100
WEIGHT=2
RESOURCES=10 i_ingot_iron, 5 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_plate_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish platemail gorget

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 0682c]
//Orcish hammerpick
DEFNAME=orcish_hammerpick
NAME=Orcish hammerpick
ID=0143c
DAM=19,43
LAYER=1
SKILL=Macefighting
REQSTR=100
TWOHANDS=N

WEIGHT=9.0	//	original WEIGHT=	10.0

RESOURCES=25 i_ingot_iron, 20 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={131 170}
	color=ORCISH_ARMOR_COLOR

On=@Dclick
	equip
	return 1

On=@Equip
	f_orc_only

On=@Damage	// 3d9+16 = 19-43
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {19 43}
	f_damage_mace
	if <src.plot1> & 06
		if rand(7)==1
			src.sfx snd_spell_poison
			src.spelleffect s_poison 1000
			more2 = <more2> + (<more2> / 2)
		endif
	endif
	src.damage <more2>
	more2 = 0
	return 1

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish hammerpick

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 0682d]
//Orcish war hammer
DEFNAME=orcish_warhammer
NAME=Orcish war hammer
ID=01438
DAM=21,50
SPEED=20
SKILL=Mace Fighting
REQSTR=100
TWOHANDS=Y
WEIGHT=10.0	//	original WEIGHT=11.8
RESOURCES=35 i_ingot_iron, 25 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={131 210}
	color=ORCISH_ARMOR_COLOR

On=@Dclick
	equip
	return 1

On=@Equip
	f_orc_only

On=@Damage	// 6d7+15 = 21-50
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {21 50}
	f_damage_mace
	if <src.plot1> & 06
		if rand(7)==1
			src.sfx snd_spell_poison
			src.spelleffect s_poison 1000
			more2 = <more2> + (<more2> / 2)
		endif
	endif
	src.damage <more2>
	more2 = 0
	return 1

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish war hammer

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 0682e]
//Yataghan
DEFNAME=orcish_yataghan
NAME=Yataghan
ID=01440
DAM=12,32

SKILL=Swordsmanship
REQSTR=100
TWOHANDS=N
WEIGHT=15.0

RESOURCES=50 i_ingot_iron, 50 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={31 70}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	f_orc_only

On=@Damage	// 4d6+8 = 12-32
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {12 32}
	f_damage_sword
	if <src.plot1> & 06
		if rand(7)==1
			src.sfx snd_spell_poison
			src.spelleffect s_poison 1000
			more2 = <more2> + (<more2> / 2)
		endif
	endif
	src.damage <more2>
	f_crash_sword
	more2 = 0
	return 1

On=@Targon_ground
	return 1

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

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Yataghan

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 0682f]
//Orcish bukler
DEFNAME=orcish_buckler
NAME=Orcish buckler
ID=01b73
ARMOR=30
REQSTR=90
WEIGHT=5
RESOURCES=15 i_ingot_iron, 10 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={141 151}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	if <type>!=t_shield
		type=t_shield
	endif

	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish buckler

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

[ITEMDEF 06830]
//Orcish shield
DEFNAME=orcish_shield
NAME=Orcish shield
ID=01b7b
ARMOR=40
REQSTR=100
WEIGHT=6
RESOURCES=25 i_ingot_iron, 20 i_reag_nightshade
SKILLMAKE=blacksmithing 100.0

On=@Create
	HITPOINTS={151 165}
	color=ORCISH_ARMOR_COLOR

On=@Equip
	if <type>!=t_shield
		type=t_shield
	endif

	f_orc_only

CATEGORY=Races & Classes
SUBSECTIOn=Orcish items
DESCRIPTIOn=Orcish shield

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

//#############
// Other stuff
//#############

[ITEMDEF 068ff]
//Wonder hammer
DEFNAME=WONDER_HAMMER
NAME=Wonder hammer
ID=013e3
TYPE=11
DAM=8,22
SPEED=60
SKILL=Mace Fighting
REQSTR=90
TWOHANDS=N
WEIGHT=20.0
RESOURCES=1 i_ingot_magma, 1 i_ingot_obsidian
SKILLMAKE=blacksmithing 100.0, mining 110.0

On=@Create
	HITPOINTS={131 160}
	color=MAGMA_ARMOR_COLOR

On=@Equip
	attr = <attr> & ~(attr_cursed | attr_cursed2)
	morex = 0
	morey = 0
	if (<src.plot1>&7)
		src.message You can't use this hammer! Only human can smith with it!
		unequip
		return 1
	else
		src.mining=(<src.mining>+10.0)
	endif

On=@Unequip
	attr = <attr> & ~(attr_cursed | attr_cursed2)
	morex = 0
	morey = 0
	if !(<src.plot1>&7)
		src.mining=(<src.mining>-10.0)
		return 0
	else
		return 1
	endif

On=@Spell
	if (<argn>==27) && <cont>
		src.sysmessage Curse fizzle!
		return 1
	endif

CATEGORY=Races & Classes
SUBSECTIOn=Human items
DESCRIPTIOn=Wonder hammer

//################
// Chars & bodies
//################

[CHARDEF 04200]
DEFNAME c_dwarf_male
//Dwarf male
NAME=Dwarf male
ID=C_MAN
RESOURCES=i_flesh_head, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg, i_blood_2
FOODTYPE=15 t_food, t_fruit
DESIRES=i_gold,e_notoriety
AVERSIONS=t_TRAP,t_eerie_stuff
SHELTER=r_house
CAN=MT_WALK|MT_RUN|MT_FIRE_IMMUNE|MT_USEHANDS|MT_EQUIP|MT_MALE
ICOn=02106

TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk

On=@Create
	color=all_skin_colors
	FENCING={15.0 38.0}
	PARRYING={15.0 38.0}
	swordsmanship={15.0 38.0}
	wrestling={15.0 38.0}
	macefighting={15.0 38.0}
	MAGICRESISTANCE={15.0 38.0}
	tactics={15.0 38.0}
	NPC=brain_human

CATEGORY=Civilized
SUBSECTIOn=Races
DESCRIPTIOn=Dwarf male

[CHARDEF 04201]
DEFNAME c_dwarf_female
//Dwarf female
NAME=Dwarf female
ID=0191
RESOURCES=i_flesh_head, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg, i_blood_2
FOODTYPE=15 t_food, t_fruit
DESIRES=i_gold,e_notoriety
AVERSIONS=t_TRAP,t_eerie_stuff
SHELTER=r_house
CAN=MT_WALK|MT_RUN|MT_FIRE_IMMUNE|MT_USEHANDS|MT_EQUIP|MT_FEMALE
ICOn=02107

TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk

On=@Create
	color=all_skin_colors
	FENCING={15.0 38.0}
	PARRYING={15.0 38.0}
	swordsmanship={15.0 38.0}
	wrestling={15.0 38.0}
	macefighting={15.0 38.0}
	MAGICRESISTANCE={15.0 38.0}
	tactics={15.0 38.0}
	NPC=brain_human

CATEGORY=Civilized
SUBSECTIOn=Races
DESCRIPTIOn=Dwarf female

[CHARDEF 04202]
DEFNAME c_elf_male
//Elf male
Name=Elf male
ID=C_MAN
RESOURCES=i_flesh_head, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg, i_blood_2
FOODTYPE=15 t_food, t_fruit
DESIRES=i_gold,e_notoriety
AVERSIONS=t_TRAP,t_eerie_stuff
SHELTER=r_house
CAN=MT_WALK|MT_RUN|MT_USEHANDS|MT_EQUIP|MT_MALE
ICOn=02106

TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk

On=@Create
	color=all_skin_colors
	FENCING={15.0 38.0}
	PARRYING={15.0 38.0}
	swordsmanship={15.0 38.0}
	wrestling={15.0 38.0}
	macefighting={15.0 38.0}
	MAGICRESISTANCE={15.0 38.0}
	tactics={15.0 38.0}
	NPC=brain_human

CATEGORY=Civilized
SUBSECTIOn=Races
DESCRIPTIOn=Elf male

[CHARDEF 04203]
DEFNAME c_elf_female
//Elf female
NAME=Elf female
ID=0191
RESOURCES=i_flesh_head, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg, i_blood_2
FOODTYPE=15 t_food, t_fruit
DESIRES=i_gold,e_notoriety
AVERSIONS=t_TRAP,t_eerie_stuff
SHELTER=r_house
CAN=MT_WALK|MT_RUN|MT_USEHANDS|MT_EQUIP|MT_FEMALE
ICOn=02107

TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk

On=@Create
	color=all_skin_colors
	FENCING={15.0 38.0}
	PARRYING={15.0 38.0}
	swordsmanship={15.0 38.0}
	wrestling={15.0 38.0}
	macefighting={15.0 38.0}
	MAGICRESISTANCE={15.0 38.0}
	tactics={15.0 38.0}
	NPC=brain_human

CATEGORY=Civilized
SUBSECTIOn=Races
DESCRIPTIOn=Elf female

[CHARDEF 04204]
DEFNAME c_orc_male
//Orc male
Name=Orc male
ID=C_MAN
RESOURCES=i_flesh_head, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg, i_blood_2
FOODTYPE=15 t_food, t_fruit
DESIRES=i_gold,e_notoriety
AVERSIONS=t_TRAP,t_eerie_stuff
SHELTER=r_house
CAN=MT_WALK|MT_RUN|MT_USEHANDS|MT_EQUIP|MT_MALE
ICOn=02106

TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk

On=@Create
	color=all_skin_colors
	FENCING={15.0 38.0}
	PARRYING={15.0 38.0}
	swordsmanship={15.0 38.0}
	wrestling={15.0 38.0}
	macefighting={15.0 38.0}
	MAGICRESISTANCE={15.0 38.0}
	tactics={15.0 38.0}
	NPC=brain_human

CATEGORY=Civilized
SUBSECTIOn=Races
DESCRIPTIOn=Orc male

[CHARDEF 04205]
DEFNAME c_orc_female
//Orc female
NAME=Orc female
ID=0191
RESOURCES=i_flesh_head, i_flesh_torso, i_flesh_right_arm, i_flesh_left_arm, i_flesh_left_leg, i_flesh_right_leg, i_blood_2
FOODTYPE=15 t_food, t_fruit
DESIRES=i_gold,e_notoriety
AVERSIONS=t_TRAP,t_eerie_stuff
SHELTER=r_house
CAN=MT_WALK|MT_RUN|MT_USEHANDS|MT_EQUIP|MT_FEMALE
ICOn=02107

TSPEECH=spk_human_prime
TSPEECH=spk_human_default
TEVENTS=e_Human_HearUnk

On=@Create
	color=all_skin_colors
	FENCING={15.0 38.0}
	PARRYING={15.0 38.0}
	swordsmanship={15.0 38.0}
	wrestling={15.0 38.0}
	macefighting={15.0 38.0}
	MAGICRESISTANCE={15.0 38.0}
	tactics={15.0 38.0}
	NPC=brain_human

CATEGORY=Civilized
SUBSECTIOn=Races
DESCRIPTIOn=Orc female

[plotITEM 1] // Plot1=02, Dwarf
On=@Dclick
	if <TYPE>==t_scroll
		if (<ID>!=01f4c)
			SAY You can't read this scroll.
			return 1
		endif
	endif

On=@Equip
	if (<type>==t_weapon_bow) || (<type>==t_weapon_xbow)
		if <baseid>!=DWARF_MYTHERIL_CROSSBOW
			src.message You cannot use this weapon, Dwarf!
			unequip
			return 1
		endif
	endif

On=@Unequip
	if (<TYPE>==t_weapon_bow) || (<TYPE>==t_weapon_xbow)
		if <BASEID>!=DWARF_MYTHERIL_CROSSBOW
			if (<attr> & attr_cursed) && (<morex>==27)
				src.sysmessage Cused magic!
				src.str = (<src.str> - ((<morey> + 191) / 40))
				src.dex = (<src.dex> - ((<morey> +191) / 40))
				src.int = (<src.int> - ((<morey> + 191) / 40))
			endif
			return 1
		endif
	endif

[plotITEM 2] // Plot1=04, Elf
On=@Equip
	if <TYPE>==t_weapon_mace_smith
		if <baseid>!=i_hammer_smith
			src.message Elf cannot equip maces of any sort.
			unequip
			return 1
		endif
	endif

On=@Unequip
	if (<type>==t_weapon_mace_smith) && (<baseid>!=i_hammer_smith)
		if (<attr> & attr_cursed) && (<morex>==27)
			src.sysmessage Cused magic!
			src.str = (<src.str> - ((<morey> + 191) / 40))
			src.dex = (<src.dex> - ((<morey> +191) / 40))
			src.int = (<src.int> - ((<morey> + 191) / 40))
		endif
		return 1
	endif

[plotITEM 3] // plot1=08, Orc
On=@Dclick
	if (<type>==t_scroll)
		if (<ID>>01f5c)
			SAY You can't read this scroll.
			return 1
		endif
	endif
return 0

[plotITEM 4] // Plot1=010
return 0

[plotITEM 5] // Plot1=020
return 0

[plotITEM 6] // Plot1=040
return 0

[plotITEM 7] // plot1=080, Paladin
//On=@DClick
//	src.sysmessage @Dclick
//	return 0
//On=@itemDclick
//	src.sysmessage @itemDClick
//	return 0
//On=@Equip
//	src.sysmessage @Equip
//	return 0
//On=@Unequip
//	src.sysmessage @Unequip
//	return 0
//On=@Spell
//	src.sysmessage @Spell
//	return 0
//On=@itemEquip
//	src.sysmessage @itemEquip
//	return 0
//On=@itemUnequip
//	src.sysmessage @itemUnequip
//	return 0
//On=@GetHit
//	src.sysmessage @GetHit
//	return 0
//On=@HitTry
//	src.sysmessage @HitTry
//	return 0
//On=@HitMiss
//	src.sysmessage @HitMiss
//	return 0
//On=@Hit
//	src.sysmessage @Hit
//	return 0
//On=@itemDamage
//	src.sysmessage @itemDamage
//	return 0
//On=@itemPickup_ground
//	src.sysmessage @itemPickup_ground
//	return 0
//On=@itemPickup_pack
//	src.sysmessage @itemPickup_pack
//	return 0
//On=@Click
//	src.sysmessage @Click
//	return 0
//On=@Step
//	src.sysmessage @Step
//	return 0
//return 0

//######################################################################
// Vampire plot trigger
// Vampires can't drink yellow potions and wear silver armor and cloth.
//######################################################################
[plotITEM 8] // Plot1=100, Vampire
On=@Equip
	if (<color>==color_o_silver)
		src.message You touch the holy silver!
		src.damage {5 10}
		src.sfx 0df
		src.spelleffect s_poison 1000
		unequip
		return 1
	else
		return 0
	endif

On=@Unequip
	if (<color>==color_o_silver)
		if (<attr> & attr_cursed) && (<morex>==27)
			src.sysmessage Cused magic!
			src.str = (<src.str> - ((<morey> + 191) / 40))
			src.dex = (<src.dex> - ((<morey> +191) / 40))
			src.int = (<src.int> - ((<morey> + 191) / 40))
		endif
		return 1
	endif

On=@Dclick
	if (<color>==color_o_silver)
		src.message You touch the holy silver!
		src.sfx 0df
		return 1
	endif

	if (<id>==0f0c) //Yellow potion
		src.message You are sick! Vampire can't drink THIS.
		return 1
	endif
	return 0

On=@Click
	if (<COLOR>==color_o_silver)
		src.message You touch the holy silver!
		src.sfx 0df
		return 1
	endif

[DEFNAME race_colors]
colors_skin_dwarf	{ 443 1 1509 1 1517 1 1518 1 { 1524 1527 } 1 }
colors_skin_elf	{ { 2001 2004 } 1 { 1401 1405 } 1 }
colors_skin_orc	{ { 1705 1709 } 1 { 1713 1727 } 1 }

colors_skin_dwarf_vampire	033
colors_skin_elf_vampire	color_o_shadow
colors_skin_orc_vampire	color_o_blackrock

colors_skin_vampire	038a

//########################
// Race morphing triggers
//########################
[TYPEDEF 2000]
DEFNAME t_morpher_dwarf
// Dwarf trigger
On=@DClick
	if <src.plot1> & plotmask_dwarf

		if (<src.obody> != c_dwarf_male) && (<src.obody> != c_dwarf_female)
			if <src.body>==c_woman
				src.obody = c_dwarf_female
				src.body = c_dwarf_female
			else
				src.obody = c_dwarf_male
				src.body = c_dwarf_male
			endif
		endif

		if <src.flags> & statf_dead
			src.flags = <src.flags> & ~(statf_dead | statf_insubstantial)
			src.body = <src.obody>
			src.sfx snd_spell_resurrection
			src.consume 1 i_deathshroud
		endif

		src.message You feel yourself more skilfull.
		src.sfx 02a
		
		if <src.skillclass>==class_undeclared
			src.f_skillclass_set
		endif

		src.oskin = colors_skin_dwarf
		src.color = <src.oskin>

	elseif <src.plot1> & plotmask_orc
		src.message Get off, monster!
		src.damage {50 100}
		src.sfx 0166
		if <src.skillclass>==class_undeclared
			src.f_skillclass_set
		endif
	elseif <src.plot1> & plotmask_elf
		src.message How did you come here, Elf? Please, come out.
		src.sfx 0231
		if <src.skillclass>==class_undeclared
			src.f_skillclass_set
		endif
	else	// Morfing
		src.spelleffect s_dispel 1000
		if <src.findlayer(layer_hand1)>
			src.findlayer(layer_hand1).unequip
		endif
		if <src.findlayer(layer_hand2)>
			src.findlayer(layer_hand2).unequip
		endif
		if (<src.body>==c_man)
			src.obody=c_dwarf_male
			src.body=c_dwarf_male
		elseif (<src.body>==c_ghost_man)
			src.obody=c_dwaf_male
		elseif (<src.body>==c_woman)
			src.obody=c_dwarf_female
			src.body=c_dwarf_female
		elseif (<src.body>==c_ghost_woman)
			src.obody=c_dwarf_female
		endif

		src.plot1 = (<src.plot1> | plotmask_dwarf)

		if <src.plot1> & plotmask_vampire
			src.color = colors_skin_dwarf_vampire
		else
			src.color = colors_skin_dwarf
		endif

		src.oskin = <src.color>

		src.message Now you are Dwarf!
		src.sfx 02a
	endif
	src.f_skillclass_set
	return 1

[TYPEDEF 2001]
DEFNAME t_morpher_elf
// Elven trigger
On=@Step
	if <src.brain>
		return 0
	endif

	if <src.plot1> & plotmask_elf

		if (<src.obody> != c_elf_male) && (<src.obody> != c_elf_female)
			if <src.body>==c_woman
				src.obody = c_elf_female
				src.body = c_elf_female
			else
				src.obody = c_elf_male
				src.body = c_elf_male
			endif
		endif

		if <src.flags> & statf_dead
			src.flags = <src.flags> & ~(statf_dead | statf_insubstantial)
			src.body = <src.obody>
			src.sfx snd_spell_resurrection
			src.consume 1 i_deathshroud
		endif

		if <src.skillclass>==class_undeclared
			src.f_skillclass_set
		endif

		src.oskin = colors_skin_elf
		src.color = <src.oskin>

		src.message Welcome, brother.
		src.sfx 08f
	elseif <src.plot1> & plotmask_orc
		src.message Die, evil!
		src.sfx 028
		src.kill
		src.message Die!
	elseif <src.plot1> & plotmask_dwarf
		src.message Get out, master of dungeons!
		src.sfx 0245
	else	// Morfing
		src.spelleffect s_dispel 1000
		if <src.findlayer(layer_hand1)>
			src.findlayer(layer_hand1).unequip
		endif
		if <src.findlayer(layer_hand2)>
			src.findlayer(layer_hand2).unequip
		endif
		if (<src.body>==c_man)
			src.obody=c_elf_male
			src.body=c_elf_male
		elseif (<src.body>==c_ghost_man)
			src.obody==c_elf_male
		elseif (<src.body>==c_woman)
			src.obody=c_elf_female
			src.body=c_elf_female
		elseif (<src.body>==c_ghost_woman)
			src.obody=c_elf_female
		endif

		src.plot1 = (<src.plot1> | plotmask_elf)

		if <src.plot1> & plotmask_vampire
			src.color = colors_skin_elf_vampire
		else
			src.color = colors_skin_elf
		endif

		src.oskin = <src.color>

		src.message Welcome to the Elven brotherhood!
		src.sfx 0216
	endif
	src.f_skillclass_set
	src.p = <morep>
	return 0

[TYPEDEF 2002]
DEFNAME t_morpher_orc
// Orc trigger
On=@Dclick
	if (<src.plot1> & plotmask_dwarf)
		src.message Eah! Eah! Eah! Feel the pain you stuped Dwarf!
		src.damage {10 20}
		src.sfx 019c
	elseif (<src.plot1> & plotmask_elf)
		src.message Urgh! Urgh! Urgh! Fall and dizz you weakness!
		src.damage {20 40}
		src.sfx 0e6
	elseif (<src.plot1> & plotmask_orc)

		if (<src.obody> != c_orc_male) && (<src.obody> != c_orc_female)
			if <src.body>==c_woman
				src.obody = c_orc_female
				src.body = c_orc_female
			else
				src.obody = c_orc_male
				src.body = c_orc_male
			endif
		endif

		if <src.flags> & statf_dead
			src.flags = <src.flags> & ~(statf_dead | statf_insubstantial)
			src.body = <src.obody>
			src.sfx snd_spell_resurrection
			src.consume 1 i_deathshroud
		endif

		if <src.skillclass>==class_undeclared
			src.f_skillclass_set
		endif

		src.color = colors_skin_orc
		src.oskin = <src.color>

		src.message Aaagh! Welcome my dirty falk!
		src.sfx 0246
	else	// Morfing
		src.spelleffect s_dispel 1000
		if <src.findlayer(layer_hand1)>
			src.findlayer(layer_hand1).unequip
		endif
		if <src.findlayer(layer_hand2)>
			src.findlayer(layer_hand2).unequip
		endif
		if (<src.body>==c_man)
			src.obody = c_orc_male
			src.body = c_orc_male
		elseif (<src.body>==c_ghost_man)
			src.obody==c_orc_male
		elseif (<src.body>==c_woman)
			src.obody = c_orc_female
			src.body = c_orc_female
		elseif (<src.body>==c_ghost_woman)
			src.obody = c_orc_female
		endif

		src.plot1 = (<src.plot1> | plotmask_orc)

		if <src.plot1> & plotmask_vampire
			src.color = colors_skin_orc_vampire
		else
			src.color = colors_skin_orc
		endif

		src.oskin = <src.color>

		src.message Muhahagh! Hallo, dirty Orc! That will be fun!
		src.sfx 01b0
	endif
	src.f_skillclass_set
	return 1

[ITEMDEF 06910]
DEFNAME=i_remorpher
NAME=Remorpher
ID=0edd
TYPE=0

On=@Create
	color=0676

On=@Dclick
	if <src.flags>&statf_dead
		return 1
	endif

	if <src.findlayer(layer_hand1)>
		src.findlayer(layer_hand1).unequip
	endif
	if <src.findlayer(layer_hand2)>
		src.findlayer(layer_hand2).unequip
	endif

	if (<src.plot1> & (plotmask_dwarf | plotmask_elf | plotmask_orc))
		if (<src.plot1> & plotmask_dwarf)
			src.mining = (<src.mining> - 25.0)
			src.blacksmithing = (<src.blacksmithing> - 25.0)
		elseif (<src.plot1> & plotmask_elf)
			src.archery = (<src.archery> - 25.0)
			src.bowcraft = (<src.bowcraft> - 25.0)
		else
			src.macefighting = (<src.macefighting> - 25.0)
			src.wrestling = (<src.wrestling> - 25.0)
		endif
		if (<src.flags> & 0400) // Unpolymorf
			src.spelleffect dispel 1000
		endif
		if <src.body>==c_man
			src.body=c_man
			src.obody=c_man
		else
			src.body=c_woman
			src.obody=c_woman
		endif

		src.plot1 = (<src.plot1> & ~(plotmask_dwarf | plotmask_elf | plotmask_orc))
		if <src.plot1> & plotmask_vampire
			src.color = colors_skin_vampire
		else
			src.color = colors_skin
		endif
		src.oskin = <src.color>
	else
		src.message What do you want, human?
	endif
	src.f_skillclass_set
	return 1

[EOF]