// 20.12.2001, Eidolon: Test color before guildstone removing
// 05.12.2001, Eidolon: t_key_match check in locked safe
// 15.11.2001, Eidolon: Guildstone invite member and drag objects and functions
// 28.10.2001, MoNK: Robes color and hitpoints
// 16.10.2001, MoNK: syntax errors
// 26.09.2001, MoNK: syntax errors
// 23.09.2001, MoNK: i_disconnecter, i_client_check
// 13.09.2001, MoNK: firestorm potion moved to sphereitem_potions.scp
// 12.09.2001, MoNK: decrease bandage delay for human and elven races
// 10.09.2001, MoNK: f_keyffffffff_fix
// 05.09.2001, MoNK: disable open safe containers if z of player is more than z of container
// 03.09.2001, MoNK: remove src.kills = (<src.kills> - 1) for guardian
// 18.08.2001, MoNK: bandages efficient increased in 1.5 times
// 17.08.2001, MoNK: src.kills = (<src.kills> - 1) for guardian
// 01.08.2001, MoNK: sash 'Thanks...'
// 30.07.2001, MoNK: GMs can open safes
// 20.07.2001, MoNK: disable to flip fences
// 17.06.2001, MoNK: Fire Storm potion
// 12.06.2001, MoNK: paladins in healing
// 27.05.2001, MoNK: Mage's staff added
// 27.05.2001, MoNK: check for region flags in resurrect script, fix distance to ghost check
// 27.05.2001, MoNK: Guardian [i_halberd_guard] added
// 24.05.2001, MoNK: speedhack command
// 20.05.2001, MoNK: emulation of fliping bar doors
// 12.05.2001, MoNK: i_forensics_bug added
// 11.05.2001, MoNK: 08010 fix in flipitem
// 08.05.2001, MoNK: new weight for bees
// 02.05.2001, MoNK: flipitem command
// 30.04.2001, MoNK: craftable beehive added

[ITEMDEF i_sash_thanks]
NAME=Thanks from Oskom to
ID=i_sash
DYE=0
WEIGHT=1

On=@Create
	hitpoints = 1000
	attr = attr_newbie

On=@Equip
	if <link> == <src.serial>
		attr = <attr> | attr_newbie
	else
		attr = <attr> & ~attr_newbie
	endif

On=@Click
	if <link> != 04fffffff
		message <name> <link.name>
		return 1
	endif

On=@Damage
	more = 07ff07ff
	return 1

[ITEMDEF i_wizards_hat_plus_int]
Name=Mage Hat
ID=i_hat_wizards
RESOURCES=i_hat_wizards, i_scroll_CUNNING
SKILLMAKE=60.0 TAILORING, 60.0 MAGERY, t_sewing_kit

[ITEMDEF 04100]
//Comm. Crystal (500) RED
DEFNAME=i_crystal_of_com_t1
NAME=Communications Crystal
ID=I_CRYSTAL_RED
TYPE=T_COMM_CRYSTAL
VALUE=81
WEIGHT=1

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Communication Crystals
DESCRIPTION=Communication Crystal (red)

ON=@Create
	MORE=500

[ITEMDEF 04101]
// Comm. Crystal (1000) GREEN
DEFNAME=i_CRYSTAL_OF_COM_T2
ID=I_CRYSTAL_GREEN
NAME=Communications Crystal
TYPE=T_COMM_CRYSTAL
VALUE=158
WEIGHT=1
CATEGORY=Provisions - Miscellaneous
SUBSECTION=Communication Crystals
DESCRIPTION=Communication Crystal (green)

ON=@Create
	MORE=1000

[ITEMDEF 04102]
// Comm. Crystal (2000) GREEN
DEFNAME=i_CRYSTAL_OF_COM_T3
ID=I_CRYSTAL_GREEN
TYPE=T_COMM_CRYSTAL
NAME=Communications Crystal
VALUE=310
WEIGHT=1

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Communication Crystals
DESCRIPTION=Communication Crystal (green)

ON=@Create
	MORE=2000

[ITEMDEF 04103]
DEFNAME=i_beard_NONE
ID=I_EQ_MARKER
NAME=No Beard
TYPE=T_BEARD
LAYER=layer_beard
VALUE=10

ON=@Create
	ATTR=attr_newbie
	TIMER=550000

ON=@TIMER
	if !<cont>	// on ground?
		return 0
	endif
	if <cont.brain>	// players only
		return 1
	endif
	cont.newitem=i_beard_mustache
	cont.act.color=<cont.findlayer(layer_beard).color>
	cont.equip <cont.act.uid>
	return 1

[ITEMDEF 04104]
DEFNAME=i_hair_NONE
ID=I_EQ_MARKER
NAME=No Hair
TYPE=T_HAIR
LAYER=layer_hair
VALUE=10

ON=@Create
	ATTR=attr_newbie
	TIMER=550000

ON=@TIMER
	if !<cont>	// on ground?
		return 0
	endif
	if <cont.brain>	// players only
		return 1
	endif
	cont.newitem=i_hair_krisna
	cont.act.color=<cont.findlayer(layer_hair).color>
	cont.equip <cont.act.uid>
	return 1

[ITEMDEF 04501]
NAME=GM Robe
ID=i_robe_gm
ARMOR=500

CATEGORY=Provisions - GM Items
SUBSECTION=GM Robes
DESCRIPTION=GM Robe

ON=@Create
	COLOR=color_o_magma
	hitpoints = 1000
	attr = attr_newbie | attr_move_never

On=@Equip
	color = color_o_magma
	more = 07ff07ff
	attr = attr_newbie | attr_move_never
	update

On=@Damage
	more = 07ff07ff

[ITEMDEF 04502]
NAME=Seer Robe
ID=i_robe_gm
ARMOR=500

CATEGORY=Provisions - GM Items
SUBSECTION=GM Robes
DESCRIPTION=Seer Robe

ON=@Create
	COLOR=color_o_crystal
	hitpoints = 1000
	attr = attr_newbie | attr_move_never

On=@Equip
	color = color_o_crystal
	more = 07ff07ff
	attr = attr_newbie | attr_move_never
	update

On=@Damage
	more = 07ff07ff

[ITEMDEF 04503]
NAME=Counselor Robe
ID=i_robe_gm
ARMOR=500

CATEGORY=Provisions - GM Items
SUBSECTION=GM Robes
DESCRIPTION=Counselor Robe

ON=@Create
	COLOR=color_o_mytheril
	hitpoints = 1000
	attr = attr_newbie | attr_move_never

On=@Equip
	color = color_o_mytheril
	more = 07ff07ff
	attr = attr_newbie | attr_move_never
	update

On=@Damage
	more = 07ff07ff

[ITEMDEF 04506]
DEFNAME=i_CHECKERBOARD
//DEFNAME=CHECKERBOARD
ID=i_game_board
NAME=Checkerboard
TYPE=T_GAME_BOARD
SKILLMAKE=tinkering 40.0, carpentry 40.0
RESOURCES=3 i_board, 3 i_log

CATEGORY=Items by Professions
SUBSECTION=BarKeep
DESCRIPTION=Checkerboard

ON=@Create
MORE=1	// make this checkers.

[ITEMDEF 04507]
DEFNAME=i_CHESSBOARD
ID=i_game_board
NAME=Chessboard
TYPE=T_GAME_BOARD
SKILLMAKE=tinkering 60.0, carpentry 60.0
RESOURCES=3 i_board, 4 i_log

CATEGORY=Items by Professions
SUBSECTION=BarKeep
DESCRIPTION=Chessboard

[ITEMDEF 04521]
// Town Stone
DEFNAME=i_town_stone
ID=i_guildstone
NAME=Townstone
TYPE=T_STONE_TOWN

CATEGORY=Provisions - Deeds
SUBSECTION=Guild and Town Stones
DESCRIPTION=Town Stone

//#######################################################
// Ulrick's hammer of temper. Use this hammer to
// harden following type of armor: iron, shadow, golden,
// agapite, bloodrock, silver, magma, obsidian, mytheril
//#######################################################
[6904]
DEFNAME=ULRICK_HAMMER
NAME=Ulrick's hammer of temper
ID=0fb4
TYPE=12
DAM=1,2
WEIGHT=30.0

CATEGORY=Other
SUBSECTION=Item Deeds
DESCRIPTION=Ulrick's hammer of temper

On=@Create
	COLOR=0515

On=@Equip

IF (<SRC.BLACKSMITHING><85.0)
	SRC.SYSMESSAGE Your blacksmithing too low to use this hammer.
	RETURN 1
ELSEIF (<SRC.ALCHEMY><50.0)
	SRC.SYSMESSAGE Your alchemy too low to use this hammer.
	RETURN 1
ENDIF

On=@TargOn_Item

//SRC.SYSMESSAGE ID=<SRC.TARG.ID>, BaseID=<SRC.TARG.BASEID>, Color=<SRC.TARG.COLOR>
IF (<SRC.TARG.TYPE>!=10)
	SRC.MESSAGE You can't temper this <SRC.TARG.NAME>.
	RETURN 1
ENDIF
// some kind of armor
IF (<SRC.TARG.ID>>=01408) && (<SRC.TARG.ID><=0141a)
//	SRC.MESSAGE Right! This is <SRC.TARG.NAME>.
ELSEIF (<SRC.TARG.ID>>=01b72) && (<SRC.TARG.ID><=01b77)
//	SRC.MESSAGE Right! This is <SRC.TARG.NAME>.
ELSEIF (<SRC.TARG.ID>>=013e5) && (<SRC.TARG.ID><=013f2)
//	SRC.MESSAGE Right! This is <SRC.TARG.NAME>.
ELSEIF (<SRC.TARG.ID>>=013bb) && (<SRC.TARG.ID><=013c4)
//	SRC.MESSAGE Right! This is <SRC.TARG.NAME>.
ELSE
	SRC.MESSAGE You can't temper this type of armor.
	RETURN 1
ENDIF
// some kind of hardenable armor, skills are good enough
IF (<SRC.TARG.MOREY>!=0)
	SRC.SYSMESSAGE You can't harden this magical armor.
	RETURN 1
ENDIF
// hardenable armor, not magical, skills are good enough
// check for resources needed to hardening
IF !((<SRC.RESTEST 10 i_reag_DAEMON_BONE>) && (<SRC.RESTEST 10 i_reag_BLOOD_VIAL>) && (<SRC.RESTEST 10 i_reag_VOLCANIC_ASH>) && (<SRC.RESTEST 20 i_reag_FERTILE_DIRT>))
	SRC.SYSMESSAGE You haven't got enough amount of reagents.
	RETURN 1
ENDIF
// check color of armor
IF (<SRC.TARG.COLOR>==0)
	VAR.SUCCESS=9
	IF (<SRC.BLACKSMITHING><85.0)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 1 i_INGOT_iron>)
		SRC.SYSMESSAGE You don't have iron ingots.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 10 i_reag_PIG_IRON>)
		SRC.SYSMESSAGE You don't have enough amount of reagents.
		RETURN 1
	ELSE
		SRC.CONSUME 1 i_ingot_iron
		SRC.CONSUME 10 i_reag_PIG_IRON
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==SHADOW_ARMOR_COLOR)
	// check for vampire gorget
	IF (<SRC.TARG.BASEID>==06857
		SRC.MESSAGE You can't temper this type of armor.
		RETURN 1
	ENDIF
	VAR.SUCCESS=8
	IF (<SRC.BLACKSMITHING><87.5)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF <SRC.RESTEST 1 i_ingot_SHADOW>
		SRC.CONSUME 1 i_ingot_SHADOW
	ELSE
		SRC.SYSMESSAGE You haven't got shadow ingots.
		RETURN 1
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==GOLDEN_ARMOR_COLOR)
	VAR.SUCCESS=7
	IF (<SRC.BLACKSMITHING><90.0)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF <SRC.RESTEST 1 i_ingot_NEWGOLD>
		SRC.CONSUME 1 i_ingot_NEWGOLD
	ELSE
		SRC.SYSMESSAGE You haven't got golden ingots.
		RETURN 1
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==AGAPITE_ARMOR_COLOR)
	VAR.SUCCESS=6
	IF (<SRC.BLACKSMITHING><92.5)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF <SRC.RESTEST 1 i_ingot_AGAPITE>
		SRC.CONSUME 1 i_ingot_AGAPITE
	ELSE
		SRC.SYSMESSAGE You haven't got agapite ingots.
		RETURN 1
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==BLOODROCK_ARMOR_COLOR)
	// check for nosferatu gorget
	IF (<SRC.TARG.BASEID>==06876
		SRC.MESSAGE You can't harden this type of armor.
		RETURN 1
	ENDIF
	VAR.SUCCESS=5
	IF (<SRC.BLACKSMITHING><95.0)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF <SRC.RESTEST 1 i_ingot_BLOODROCK>
		SRC.CONSUME 1 i_ingot_BLOODROCK
	ELSE
		SRC.SYSMESSAGE You haven't got bloodrock ingots.
		RETURN 1
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==SILVER_ARMOR_COLOR)
	VAR.SUCCESS=4
	IF (<SRC.BLACKSMITHING><97.5)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF <SRC.RESTEST 1 i_ingot_NEWSILVER>
		SRC.CONSUME 1 i_ingot_NEWSILVER
	ELSE
		SRC.SYSMESSAGE You haven't got silver ingots.
		RETURN 1
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==MAGMA_ARMOR_COLOR)
	VAR.SUCCESS=1
	IF (<SRC.BLACKSMITHING><100.0)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 1 i_ingot_MAGMA>)
		SRC.SYSMESSAGE You haven't got magma ingots.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 10 i_reag_DRAGON_BLOOD>)
		SRC.SYSMESSAGE You haven't got enough amount of reagents.
		RETURN 1
	ELSE
		SRC.CONSUME 1 i_ingot_MAGMA
		SRC.CONSUME 10 i_reag_DRAGON_BLOOD
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==OBSIDIAN_ARMOR_COLOR)
	VAR.SUCCESS=1
	IF (<SRC.BLACKSMITHING><100.0)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 1 i_ingot_OBSIDIAN>)
		SRC.SYSMESSAGE You haven't got obsidian ingots.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 10 i_reag_OBSIDIAN>)
		SRC.SYSMESSAGE You haven't got enough amount of reagents.
		RETURN 1
	ELSE
		SRC.CONSUME 1 i_ingot_OBSIDIAN
		SRC.CONSUME 10 i_reag_OBSIDIAN
	ENDIF
ELSEIF (<SRC.TARG.COLOR>==MYTHERIL_ARMOR_COLOR)
	VAR.SUCCESS=1
	IF (<SRC.BLACKSMITHING><100.0)
		SRC.SYSMESSAGE You can't temper this <SRC.TARG.NAME> becasue your blacksmithing too low.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 1 i_ingot_MYTHERIL>)
		SRC.SYSMESSAGE You haven't got mytheril ingots.
		RETURN 1
	ELSEIF !(<SRC.RESTEST 10 i_reag_WORM_HEART>)
		SRC.SYSMESSAGE You haven't got enough amount of reagents.
		RETURN 1
	ELSE
		SRC.CONSUME 1 i_ingot_MYTHERIL
		SRC.CONSUME 10 i_reag_WORM_HEART
	ENDIF
ELSE
	SRC.SYSMESSAGE This metall cannot be tempered.
	RETURN 1
ENDIF
// consume recources
SRC.CONSUME 10 i_reag_DAEMON_BONE
SRC.CONSUME 10 i_reag_BLOOD_VIAL
SRC.CONSUME 10 i_reag_VOLCANIC_ASH
SRC.CONSUME 20 i_reag_FERTILE_DIRT
// chance of success
IF RAND(15)><VAR.SUCCESS>
	SRC.MESSAGE <VAR.SUCCESS>
	SRC.ANIM 0b
	SRC.sfx 0237
	SRC.SYSMESSAGE You fail to temper this <SRC.TARG.NAME>.
	RETURN 1
ENDIF
// calculate MOREY value
IF <SRC.ALCHEMY>>=90.0
	SRC.TARG.MOREY=5
ELSEIF <SRC.ALCHEMY>>=80.0
	SRC.TARG.MOREY=4
ELSEIF <SRC.ALCHEMY>>=70.0
	SRC.TARG.MOREY=3
ELSEIF <SRC.ALCHEMY>>=60.0
	SRC.TARG.MOREY=2
ELSE
	SRC.TARG.MOREY=1
ENDIF
//SRC.TARG.MOREX=-1 // to prevent "of <place holder>"
SRC.TARG.ATTR=020	// change to magical

//animate the process and make some noise
SRC.ANIM 0b
SRC.sfx 02a
SRC.EMOTE You see the <SRC.TARG.NAME> looks harden!
SRC.sfx snd_SPELL_BLESS
RETURN 1

[ITEMDEF i_pickaxe_gorgish]
NAME=Gorgish pickaxe
ID=i_pickaxe

On=@Create
	hitpoints={ 30 50 }
	color=color_o_magma

On=@Targon_Ground
	if rand(100)==0
		src.newitem { i_ore_magma 1 i_ore_obsidian 1 i_ore_silver 1 i_ore_golden 1 }
		src.act.amount { 2 3 }
		src.act.bounce
		return 0
	elseif rand(300)==0
		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
		return 0
	endif

CATEGORY=Quests and legends
SUBSECTION=Ore elementals
DESCRIPTION=Gorgish pickaxe

// It's now possible to adjust the fighting speed of elementals

[ITEMDEF i_hammer_w_elemental]
NAME=Elemental hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_earth]
NAME=Earth hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Earth elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_air]
NAME=Air hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Air elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_water]
NAME=Water hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Water elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_fire]
NAME=Fire hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Fire elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_blood]
NAME=Blood hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Blood elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_poison]
NAME=Poison hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Poison elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_ice]
NAME=Ice hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Ice elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_snow]
NAME=Snow hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Snow elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_elem_ore]
NAME=Ore hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Ore elemental hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_ettin]
NAME=Ettin hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Ettin hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_ogre]
NAME=Ogre hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Ogre hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_troll]
NAME=Troll hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Troll hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_snake]
NAME=Snake hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Snake hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_horse]
NAME=Horse hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Horse hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_mustang]
NAME=Mustang hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Mustang hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_nightmare]
NAME=Nightmare hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Nightmare hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_orc]
NAME=Orc hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Orc hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_daemon]
NAME=Daemon hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Daemon hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_dragon]
NAME=Dragon hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Dragon hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_lizardman]
NAME=Lizardman hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Lizardman hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_terathan]
NAME=Terathan hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Terathan hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_titan]
NAME=Titan hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Titan hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_cyclop]
NAME=Cyclop hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Cyclop hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_ophidian]
NAME=Ophidian hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Ophidian hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_bear]
NAME=Bear hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Bear hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_blade]
NAME=Blade spirits hammer
ID=i_hammer_smith
WEIGHT=10.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Blade spirits hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_hammer_w_wolf]
NAME=Wolf hammer
ID=i_hammer_smith
WEIGHT=20.0

CATEGORY=CSD UO Shard Stuff
SUBSECTION=Special items
DESCRIPTION=Wolf hammer

On=@Create
	attr=attr_newbie|attr_invis
	hitpoints=200

On=@Click
	remove
	return 1

[ITEMDEF i_bandage_poisoned]
NAME=poisoned bandage%s
ID=i_bandage_bloody
WEIGHT=0.1
PILE=1
DYE=0
RESOURCES=1 i_bandage

CATEGORY=Items by Professions
SUBSECTION=Healer
DESCRIPTION=Poisoned Bandages

On=@Create
	color=color_o_verite

On=@Click
	if <amount>==1
		src.sysmessage This bandage is poisoned! Do not use it to heal someone!
	else
		src.sysmessage This bandages is poisoned! Do not use it to heal someone!
	endif
	return 0

On=@DClick
	if <cont>!=<src.findlayer(21).uid>
		src.sysmessage You cannot use poisoned bandages where it is
		return 1
	endif

	if <amount>==1
		TARGET Where do you want to use this poisoned bandage?
	else
		TARGET Where do you want to use this poisoned bandages?
	endif
	return 1

[ITEMDEF 0e1d]
DEFNAME=i_yarn_ball
TYPE=T_YARN
WEIGHT=1.2
VALUE={5 7}

RESOURCES=1 I_WOOL

CATEGORY=Items by Professions
SUBSECTION=Tailor
DESCRIPTION=BALL OF YARN

DUPELIST=0e1e,0e1f

On=@Targon_item
	if <src.targ.type> != t_loom
		return 0
	endif

	if <src.targ.more> == i_thread
		if <src.targ.more2> > 0
			src.sysmessage You remove unfinished cloth from the upright loom
			src.newitem i_thread
			src.act.amount = <src.targ.more2>
			src.act.bounce
		endif
		src.targ.more = i_yarn_ball
		src.targ.more2 = 0
	elseif <src.targ.more> == 0
		src.targ.more = i_yarn_ball
		src.targ.more2 = 0
	endif
	if <src.targ.more> == i_yarn_ball
		if !(<src.restest 1 i_yarn_ball>)
			src.sysmessage You have no yarn to make cloth
			return 1
		endif
		src.targ.more2 = <src.targ.more2> + 1
		src.consume 1 i_yarn_ball
		if <src.targ.more2> == 1
			src.sysmessage You have started new bolt of cloth
		elseif <src.targ.more2> == 2
			src.sysmessage Bolt of cloth need a great deal more
		elseif <src.targ.more2> == 3
			src.sysmessage You added third ball of yarn to upright loom
		elseif <src.targ.more2> == 4
			src.sysmessage You added fourth ball of yarn to upright loom
		elseif <src.targ.more2> == 5
			src.sysmessage Bolt of cloth is half done
		elseif <src.targ.more2> == 6
			src.sysmessage You added sixth ball of yarn to upright loom
		elseif <src.targ.more2> == 7
			src.sysmessage You added seventh ball of yarn to upright loom
		elseif <src.targ.more2> == 8
			src.sysmessage Bolt of cloth is three quarters done
		elseif <src.targ.more2> == 9
			src.sysmessage Bolt of cloth is almost finished
		elseif <src.targ.more2> == 10
			src.sysmessage Bolt of cloth is finished
			src.newitem i_cloth_bolt
			src.act.timer = -1
			src.act.bounce
			src.targ.more = 0
			src.targ.more2 = 0
		else
			src.message WARNING! Upright loom script is abdone! Call GM Gruff now!
		endif
	else
		src.sysmessage You remove SOMETHING from the upright loom
		src.targ.more = i_yarn_ball
	endif
	return 1

[ITEMDEF 0fa0]
//Spool of Thread
DEFNAME=i_thread
TYPE=T_THREAD
DYE=0
WEIGHT=1.2
VALUE={5 7}

RESOURCES=1 i_cotton

CATEGORY=Items by Professions
SUBSECTION=Tailor
DESCRIPTION=Spool of Thread

DUPELIST=0fa1

On=@Targon_item
	if <src.targ.type> != t_loom
		return 0
	endif

	if <src.targ.more> == i_yarn_ball
		if <src.targ.more2> > 0
			src.sysmessage You remove unfinished cloth from the upright loom
			src.newitem i_yarn_ball
			src.act.amount = <src.targ.more2>
			src.act.bounce
		endif
		src.targ.more = i_thread
		src.targ.more2 = 0
	elseif <src.targ.more> == 0
		src.targ.more = i_thread
		src.targ.more2 = 0
	endif
	if <src.targ.more> == i_thread
		if !(<src.restest 1 i_thread>)
			src.sysmessage You have no threads to make cloth
			return 1
		endif
		src.targ.more2 = <src.targ.more2> + 1
		src.consume 1 i_thread
		if <src.targ.more2> == 1
			src.sysmessage You have started new bolt of cloth
		elseif <src.targ.more2> == 2
			src.sysmessage Bolt of cloth need a great deal more
		elseif <src.targ.more2> == 3
			src.sysmessage You added third thread to upright loom
		elseif <src.targ.more2> == 4
			src.sysmessage You added fourth thread to upright loom
		elseif <src.targ.more2> == 5
			src.sysmessage Bolt of cloth is half done
		elseif <src.targ.more2> == 6
			src.sysmessage You added sixth thread to upright loom
		elseif <src.targ.more2> == 7
			src.sysmessage You added seventh thread to upright loom
		elseif <src.targ.more2> == 8
			src.sysmessage Bolt of cloth is three quarters done
		elseif <src.targ.more2> == 9
			src.sysmessage Bolt of cloth is almost finished
		elseif <src.targ.more2> == 10
			src.sysmessage Bolt of cloth is finished
			src.newitem i_cloth_bolt
			src.act.timer = -1
			src.act.bounce
			src.targ.more = 0
			src.targ.more2 = 0
		else
			src.message WARNING! Upright loom script is abdone! Call GM Gruff now!
		endif
	else
		src.sysmessage You remove SOMETHING from the upright loom
		src.targ.more = i_thread
	endif
	return 1

// bandages

[COMMENT ITEMDEF 0e21]
DEFNAME=i_bandage
RESOURCES=i_cloth
TYPE=T_BANDAGE
WEIGHT=.1
DUPELIST=0ee9
CATEGORY=Items by Professions
SUBSECTION=Healer
DESCRIPTION=Clean Bandages

On=@DClick
	type=t_bandage
	return 0

On=@Targon_char
	if <src.targ.npc>==brain_undead
		src.message You can't heal this dead creature
		return 1
	endif
	src.message <src.targ.plot1>, <eval(<src.targ.plot1> & 0100)>
	if  <src.targ.plot1> & 0100	//plotmask_vampire
		src.message You can't heal this dead creature
		return 1
	endif
	if <src.targ.distance> > 2
		src.message You are too far away from <src.targ.name> to use banages
		return 1
	endif

	if <src.targ.flags>&statf_poisoned
		if <src.findlayer(layer_hand1).id>>0
			src.findlayer(layer_hand1).unequip
		endif
		if <src.findlayer(layer_hand2).id>>0
			src.findlayer(layer_hand2).unequip
		endif

		if <src.healing> < 85.0
			if <src.serial>==<src.targ.serial>
				src.sysmessage You have been poisoned but your skill in healing is too low to neutralize the poison
				return 1
			else
				src.targ.sysmessage You have been poisoned but <src.name>'s skill in healing is too low to neutralize the poison
				return 1
			endif
		else
			src.targ.flags=(<src.targ.flags>&~statf_poisoned)
			src.message You neutrialize the poison
			src.consume 1 i_bandage
			src.newitem i_bandage_poisoned
			src.act.bounce
			src.targ.update
			return 1
		endif
	endif
	if <src.targ.hits> < <src.targ.str>
		if <src.findlayer(layer_hand1).id>>0
			src.findlayer(layer_hand1).unequip
		endif
		if <src.findlayer(layer_hand2).id>>0
			src.findlayer(layer_hand2).unequip
		endif

		return 0 // ======================== just normal healing
	else
		if !(<src.targ.flags>&statf_poisoned)
			if <src.serial>==<src.targ.serial>
				src.message You don't need healing yourself
			else
				src.message <src.targ.name> don't need you to heal him
			endif
		endif
		return 1
	endif

On=@Targon_item
	if <src.targ.id>!=02006	//i_corpse
		src.sysmessage You can't use bandages on <src.targ.name>	// 'cos it's not a corpse.
		return 1
	elseif (<src.targ.distance>>2)
		src.sysmessage You are a healer not medicineman, come closer!
		return 1
	elseif (<src.healing><95.0)
		src.sysmessage This is beyond your ability!
		return 1
	elseif (<src.hits> < 2)
		src.sysmessage You can't resurrect anyone becasue you too much wounded!
		return 1
	elseif (<src.flags>&statf_poisoned)
		src.sysmessage You can't resurrect anyone while you are poisoned!
		return 1
	endif
	//unequip
	if (<src.findlayer(layer_hand1).id>>0)
		src.findlayer(layer_hand1).unequip
	endif
	if (<src.findlayer(layer_hand2).id>>0)
		src.findlayer(layer_hand2).unequip
	endif

	if (<src.targ.link.flags>&statf_dead)
		if (<src.targ.link.distance>>1)
			src.sysmessage There is no ghost here!
			return 1
		endif
		if (<src.restest 20 i_bandage>)
			src.consume 20 i_bandage
			if rand(100) < (<src.anatomy>/10)
				src.emote resurrect the <src.targ.name>
				src.targ.link.resurrect
				if (<src.targ.link.restest 1 i_deathshroud>)
					src.targ.link.consume 1 i_deathshroud
				endif
				src.targ.link.hitpoints=(<src.hitpoints>/2)
				src.hitpoints=(<src.hitpoints>/2)
				return 1
			else
				src.sysmessage You fail to resurrect <src.targ.name>
				return 1
			endif
		else
			src.sysmessage You need more bandages!
			retutn 1
		endif
	else
		src.sysmessage There is no ghost here!
		return 1
	endif
	return 1

[ITEMDEF 0e21]
DEFNAME=i_bandage
RESOURCES=i_cloth
TYPE=T_BANDAGE
WEIGHT=.1
DUPELIST=0ee9

CATEGORY=Items by Professions
SUBSECTION=Healer
DESCRIPTION=Clean Bandages

On=@DClick
	if <src.timer> > 0
		src.sysmessage You must wait to perform another action
		return 1
	endif
	if <src.restest 1 i_bandage_delay>
		if <src.findid (i_bandage_delay).timer> < 1
			src.consume 10 i_bandage_delay
		else
			src.sysmessage You are already use bandage
			return 1
		endif
	endif
	target Where do you want to use <name>?
	return 1

On=@Targon_char
	if !(<src.restest 1 i_bandage>)
		src.sysmessage You have no bandages
		return 1
	endif
	if (<src.targ.npc>==brain_undead) || (<src.targ.plot1> & plotmask_vampire)
		src.message You can't heal this dead creature
		return 1
	endif
	if <src.targ.distance> > 2
		src.sysmessage You are a healer not medicineman, come closer!
		return 1
	endif
	if (<src.targ.hits> >= <src.targ.str>) && (!(<src.targ.flags> & statf_poisoned))
		src.sysmessage Do you wanna make a mummy?
		return 1
	endif
	if <src.targ.serial> == <src.serial>
		src.sysmessage You apply <name> to yourself
	elseif <src.flags> & statf_poisoned
		src.sysmessage You cannot heal anyone else while you are poisoned
		return 1
	else
		src.sysmessage You apply <name> to <src.targ.name>
	endif

	src.newitem i_bandage_delay
	src.act.equip

	if <src.stamina> >= <src.dex>
		src.act.timer = 1
	else
		src.act.timer = 1 + ((<src.dex> - <src.stamina>) / 15)
	endif

	if !(<src.plot1> & (plotmask_dwarf | plotmask_orc))
		src.act.timer = <src.act.timer> / 2
	endif

	src.timer = <src.act.timer>	// to prevent using other skill while healing

	if <src.food> > 14
		if <src.stamina> < 3
			src.stamina = 0
		else
			src.stamina = (<src.stamina> - 3)
		endif
	else
		if <src.stamina> < (3 + ((15 - <src.food>) / 2))
			src.stamina = 0
		else
			src.stamina = (<src.stamina> - (3 + ((15 - <src.food>) / 2)))
		endif
	endif


	if (<src.targ.npc>==brain_animal) || (<src.targ.npc>==brain_monster) || (<src.targ.npc>==brain_dragon) || (<src.targ.npc>==brain_beserk)
		src.act.more2=2	// skill_vet
	else
		src.act.more2=1	// skill_healing
	endif	

	src.act.more = <cont>
	src.act.morez = 1	// targon_char
	src.act.link = <src.targ.serial>

	src.consume 1 i_bandage
	if <src.findlayer(layer_hand1)>
		if ((<src.findlayer(layer_hand1).baseid> != i_sword_light) && (<src.findlayer(layer_hand1).baseid> != i_sword_exorcist)) || (<src.serial> != <src.targ.serial>)
			src.findlayer(layer_hand1).unequip
		endif
	endif
	if <src.findlayer(layer_hand2)>
		if ((<src.findlayer(layer_hand2).baseid> != i_shield_light) && (<src.findlayer(layer_hand2).baseid> != i_shield_blessed) && (<src.findlayer(layer_hand2).baseid> != i_shield_sacred)) || (<src.serial> != <src.targ.serial>)
			src.findlayer(layer_hand2).unequip
		endif
	endif
	src.anim 33

	return 1

On=@Targon_item
	if !(<src.restest 20 i_bandage>)
		src.sysmessage You need more bandages
		return 1
	endif
	if <src.targ.id>!=02006	//i_corpse
		src.sysmessage You can't use bandages on <src.targ.name>	// 'cos it's not a corpse.
		return 1
	elseif (<src.targ.distance> > 1)
		src.sysmessage You are a healer not medicineman, come closer!
		return 1
	elseif (<src.healing> < 95.0)
		src.sysmessage This is beyond your ability!
		return 1
	elseif (<src.hits> < 2)
		src.sysmessage You can't resurrect anyone becasue you too much wounded!
		return 1
	elseif (<src.flags> & statf_poisoned)
		src.sysmessage You can't resurrect anyone while you are poisoned!
		return 1
	endif

	src.newitem i_bandage_delay
	src.act.equip
	src.act.more = <cont>

	if <src.stamina> >= <src.dex>
		src.act.timer = 1
	else
		src.act.timer = 1 + ((<src.dex> - <src.stamina>) / 15)
	endif

// 18.08.2001: test for players request
	src.act.timer = 1

	src.timer = <src.act.timer>

// 18.08.2001: test for players request
//	if <src.stamina> < (3 + ((15 - <src.food>) / 2))
//		src.stamina = 0
//	else
//		src.stamina = (<src.stamina> - (3 + ((14 - <src.food>) / 2)))
//	endif

	src.act.more2 = 1	//skill_healing
	src.act.morez = 2	// targon_item
	src.act.link = <src.targ.serial>

	src.consume 20 i_bandage
	if <src.findlayer(layer_hand1)>
		if ((<src.findlayer(layer_hand1).baseid> != i_sword_light) && (<src.findlayer(layer_hand1).baseid> != i_sword_exorcist)) || (<src.serial> != <src.targ.serial>)
			src.findlayer(layer_hand1).unequip
		endif
	endif
	if <src.findlayer(layer_hand2)>
		if ((<src.findlayer(layer_hand2).baseid> != i_shield_light) && (<src.findlayer(layer_hand2).baseid> != i_shield_blessed) && (<src.findlayer(layer_hand2).baseid> != i_shield_sacred)) || (<src.serial> != <src.targ.serial>)
			src.findlayer(layer_hand2).unequip
		endif
	endif
	src.anim 32

	return 1

[ITEMDEF i_bandage_delay]
NAME=bandage delay
ID=i_bandage
TYPE=t_eq_script
LAYER=layer_special

On=@Create
	attr=attr_invis|attr_decay
	color=color_o_magma

On=@Equip
	if (<timer> < 0) || (<timer> > 15)
		timer=10
	endif

// morez=1	- character was targeted
// morez=2	- item was targeted
// more2		- skill (1 - healing or 2 - veterinary)
// cont		- link to player who use skill
// more		- link to container
// link		- link to target

On=@Timer
//	cont.message Timer has expired! Target is <cont.targ.name>, skill is <more2>, target is <morez>.
	if (<more2>!=1) && (<more2>!=2)
		cont.sysmessage ERROR: bandage delay script is broken (wrong skill value)!
		remove
		return 1
	endif
	if (<cont.flags>&(statf_dead|statf_freeze))
		cont.sysmessage You cannot use bandages in your current state
		remove
		return 1
	endif

if <morez>==1		// targon_char

	if <link.flags> & statf_poisoned
		// check for veterinary
		if (<more2>==2) && (<cont.veterinary> < 80.0)
			cont.sysmessage You cannot neutralize the poison because you skill in veterinary is too low
			remove
			return 1
		endif

		if ((<more2>==1) && (<cont.healing> >= 80.0)) || (<more2>==2)
			if rand(101) < <eval(<cont.anatomy> / 10)>
				cont.sysmessage You did neutralize the poison
				link.flags=<link.flags> & ~statf_poisoned
				if <link.findlayer(42).id>!=0
					link.findlayer(42).remove
				endif
				link.effect=3,i_fx_sparkle,6,15,1
				link.sfx snd_spell_cure
				cont.newitem i_bandage_bloody
				cont.act.timer=-1
				cont.act.bounce
				cont.sfx 87
				cont.act.cont = <more>
				cont.sysmessage You put <cont.act.name> in <cont.act.cont.name>
			else
				cont.sysmessage You have failed to neutralize poison
			endif
			// gain skill
			if (<more2>==2) && (<cont.veterinary> < 100.0)
				if rand(<eval(<cont.veterinary> / 20)>)==0
					cont.veterinary = <cont.veterinary> + 0.1
				endif
			endif
			if (<more2>==1) && (<cont.healing> < 100.0) && (<cont.healing> < 95.0)
				if rand(<eval(<cont.healing> / 20)>)==0
					cont.healing = <cont.healing> + 0.1
				endif
			endif
			remove
			return 1
		endif
	endif

	// cannot or no need cure
	if (<link.hits> < <link.str>)
		if rand(110) < <eval((<cont.anatomy> + <cont.healing>)/20)>
			if <more2>==2
				morex=<eval ( (<cont.veterinary> / 200) + (<cont.anatomy> / 500) + (<cont.dex> / 50) )>
				morey=<eval ( (<cont.veterinary> / 20) + (<cont.anatomy> / 200) + (<cont.dex> / 20) )>
			else
				morex=<eval ( (<cont.healing> / 133) + (<cont.anatomy> / 333) + (<cont.dex> / 33) )>
				morey=<eval ( (<cont.healing> / 13) + (<cont.anatomy> / 133) + (<cont.dex> / 13) )>
			endif
			link.hits=<link.hits>+<eval({<morex> <morey>})>
			morex=0
			morey=0
			if <link.hits> > <link.str>
				link.hits = <link.str>
			endif
			cont.newitem i_bandage_bloody
			cont.act.timer=-1
			cont.sfx 87
			cont.act.cont = <more>
			cont.sysmessage You put <cont.act.name> in <cont.act.cont.name>
		else
			cont.sysmessage You apply bandages but they barely help
		endif
		// gain skill
		if (<more2>==2) && (<cont.veterinary> < 100.0)
			if rand(<eval(<cont.veterinary> / 10)>)==0
				cont.veterinary = <cont.veterinary> + 0.1
			endif
		endif
		if (<more2>==1) && (<cont.healing> < 100.0)
			if rand(<eval(<cont.healing> / 10)>)==0
				cont.healing = <cont.healing> + 0.1
			endif
		endif
		remove
		return 1
	else
		cont.sysmessage Do you wanna make a mummy?
		remove
		return 1
	endif

elseif <morez>==2	// targon_item (corpse, skill is high enough)

	if (<cont.hits> < 2)
		cont.sysmessage Thou can't resurrect anyone becasue thou art wounded too much!
		remove
		return 1
	endif
	if (<link.link.flags> & statf_dead)
		if (<link.p.x> > <link.link.p.x>
			if (<link.p.x> - <link.link.p.x>) > 1
				cont.sysmessage Ghost art too far away from body!
				remove
				return 1
			endif
		elseif <link.p.x> < <link.link.p.x>
			if (<link.link.p.x> - <link.p.x>) > 1
				cont.sysmessage Ghost art too far away from body!
				remove
				return 1
			endif
		endif

		if (<link.p.y> > <link.link.p.y>
			if (<link.p.y> - <link.link.p.y>) > 1
				cont.sysmessage Ghost art too far away from body!
				remove
				return 1
			endif
		elseif <link.p.y> < <link.link.p.y>
			if (<link.link.p.y> - <link.p.y>) > 1
				cont.sysmessage Ghost art too far away from body!
				remove
				return 1
			endif
		endif

		if rand(102) < <eval(<cont.anatomy> / 10)>
			if <link.link.region.flags> & 03013
				cont.emote try to resurrect the <link.name>
				cont.sysmessage Anti-magic filed disables to resurrect <link.name>
				remove
				return 1
			endif
			cont.emote resurrect the <link.name>
			link.link.resurrect
			if <link.link.restest 1 i_deathshroud>
				link.link.consume 1 i_deathshroud
			endif
			link.link.hits = (<cont.hits> / 2)
			cont.hits = (<cont.hits> / 2)
		else
			cont.sysmessage You fail to resurrect <cont.targ.name>
		endif
		// gain skill
		if <cont.healing> < 100.0
			if rand(<eval(<cont.healing> / 20)>)==0
				cont.healing = <cont.healing> + 0.1
			endif
		endif
		remove
		return 1
	else
		cont.sysmessage There is no ghost here!
		remove
		return 1
	endif
	remove
	return 1
else
	cont.sysmessage ERROR: bandage delay script is broken (wrong type of target)!
	remove
	return 1
endif
remove
return 1

//###############
// De-bug for skills
//###############
[ITEMDEF i_poisoning_bug]
ID=02093
NAME=Poisoning bug
WEIGHT=0
TYPE=t_eq_script
LAYER=layer_special

On=@Create
	color = color_o_orion
	attr = attr_newbie|attr_invis
	more = 0
	timer = -1

On=@Equip
	more = 1
	timer = 360
	attr = <attr> | attr_decay

[ITEMDEF i_forensics_bug]
ID=i_deed
NAME=Forensics bug
WEIGHT=0
TYPE=t_eq_script
LAYER=layer_special

On=@Create
	color = color_o_magma
	attr = attr_newbie|attr_invis
	more = 0
	timer = -1

On=@Equip
	more = 1
	timer = 1800
	attr = <attr> | attr_decay

//############
// Safe containers
//############

[FUNCTION f_lock_safe_container]
	if <src.targ.serial>==<serial>
		more = <serial>
		type = t_container_locked
		src.sfx snd_spell_magic_lock
		src.sysmessage You lock container properly
		src.newitem i_key_copper
		src.act.timer = -1
		src.act.more = <serial>
		src.act.link = <serial>
		src.act.bounce
		return 1
	endif
	if (<src.targ.type>==t_container) || (<src.targ.type>==t_container_locked)
		if <src.targ.more>==0
			src.sysmessage This container does not have a lock. Select another one.
			return 1
		else
			more = <src.targ.more>
			type = t_container_locked
			src.sfx snd_spell_magic_lock
			src.sysmessage You lock container properly
			return 1
		endif
	elseif <src.targ.type>==t_key
		if <src.targ.link>==04fffffff
			src.sysmessage You cannot use this key with safes. Select another one.
			return 1
		elseif ((<src.targ.link.type>==t_container) || (<src.targ.link.type>==t_container_locked)) && (<src.targ.more>!=0)
			more = <src.targ.more>
			type = t_container_locked
			src.sfx snd_spell_magic_lock
			src.sysmessage You lock container properly
			return 1
		else
			src.sysmessage You cannot use this key with safes. Select another one.
			return 1
		endif
	else
		src.sysmessage You can't think of a way to use this item
		return 1
	endif

[ITEMDEF i_safe_metal_brass]
NAME=Brass metal safe
ID=i_chest_metal_brass

RESOURCES=15 i_ingot_iron, 4 i_ingot_newgold, 2 i_board, 4 i_nails, 2 i_hinges_brass, 1 i_ingot_copper
SKILLMAKE=TINKERING 80.0,t_tinker_tools

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Safe
DESCRIPTION=Metal brass chest

On=@DClick
	f_keyffffffff_fix <more>
	if (!<src.restest 1 t_key_match>) && ((<type>==t_container_locked) || (<type>==t_door_locked) || (<type>==t_ship_side_locked)) && (!<src.isgm>)
		src.sysmessage This <name> is locked.
		return 1
	endif
	src.f_match_key

	if <src.isgm>
		return 0
	endif
	if <link>==04fffffff
		src.sysmessage You must lockdown container first
		return 1
	elseif <more>==0
		target Select key or safe with lock
		return 1
	elseif <src.p.z> > <z>
		if <src.isgm>
			src.sysmessage You can't reach that (system), <z>, <src.p.z>
		else
			src.sysmessage You can't reach that
			return 1
		endif
	endif

On=@Targon_item
	f_lock_safe_container
	return 1

On=@Spell
	return 1

[ITEMDEF i_safe_wooden_brass]
NAME=Brass wooden safe
ID=i_chest_wooden_brass

RESOURCES=20 i_board, 4 i_nails, 2 i_hinges_brass, 1 i_ingot_copper
SKILLMAKE=CARPENTRY 80.0, t_carpentry

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Safe
DESCRIPTION=Wooden brass chest

On=@DClick
	f_keyffffffff_fix <more>
	if (!<src.restest 1 t_key_match>) && ((<type>==t_container_locked) || (<type>==t_door_locked) || (<type>==t_ship_side_locked)) && (!<src.isgm>)
		src.sysmessage This <name> is locked.
		return 1
	endif
	src.f_match_key

	if <src.isgm>
		return 0
	endif
	if <link>==04fffffff
		src.sysmessage You must lockdown container first
		return 1
	elseif <more>==0
		target Select key or safe with lock
		return 1
	elseif <src.p.z> > <z>
		if <src.isgm>
			src.sysmessage You can't reach that (system), <z>, <src.p.z>
		else
			src.sysmessage You can't reach that
			return 1
		endif
	endif

On=@Targon_item
	f_lock_safe_container
	return 1

On=@Spell
	return 1

[ITEMDEF i_safe_metal]
NAME=Metal safe
ID=i_chest_metal

RESOURCES=20 i_ingot_iron, 1 i_nails, 2 i_hinge, 2 i_board, 1 i_ingot_copper
SKILLMAKE=TINKERING 80.0, t_tinker_tools

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Safe
DESCRIPTION=Metal chest

On=@DClick
	f_keyffffffff_fix <more>
	if (!<src.restest 1 t_key_match>) && ((<type>==t_container_locked) || (<type>==t_door_locked) || (<type>==t_ship_side_locked)) && (!<src.isgm>)
		src.sysmessage This <name> is locked.
		return 1
	endif
	src.f_match_key

	if <src.isgm>
		return 0
	endif
	if <link>==04fffffff
		src.sysmessage You must lockdown container first
		return 1
	elseif <more>==0
		target Select key or safe with lock
		return 1
	elseif <src.p.z> > <z>
		if <src.isgm>
			src.sysmessage You can't reach that (system), <z>, <src.p.z>
		else
			src.sysmessage You can't reach that
			return 1
		endif
	endif

On=@Targon_item
	f_lock_safe_container
	return 1

On=@Spell
	return 1

[ITEMDEF i_safe_strongbox]
NAME=Strongbox
ID=i_box_brass

RESOURCES=5 i_ingot_iron,1 i_nails, 5 i_board, 2 i_hinge, 1 i_ingot_copper
SKILLMAKE=TINKERING 80.0,t_tinker_tools

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Safe
DESCRIPTION=Strongbox

On=@DClick
	f_keyffffffff_fix <more>
	if (!<src.restest 1 t_key_match>) && ((<type>==t_container_locked) || (<type>==t_door_locked) || (<type>==t_ship_side_locked)) && (!<src.isgm>)
		src.sysmessage This <name> is locked.
		return 1
	endif
	src.f_match_key

	if <src.isgm>
		return 0
	endif
	if <link>==04fffffff
		src.sysmessage You must lockdown container first
		return 1
	elseif <more>==0
		target Select key or safe with lock
		return 1
	elseif <src.p.z> > <z>
		if <src.isgm>
			src.sysmessage You can't reach that (system), <z>, <src.p.z>
		else
			src.sysmessage You can't reach that
			return 1
		endif
	endif

On=@Targon_item
	f_lock_safe_container
	return 1

On=@Spell
	return 1

[ITEMDEF i_safe_box_wood]
NAME=Safe box
ID=i_box_wood

RESOURCES=10 i_board, 1 i_nails, 2 i_hinge, 1 i_ingot_copper
SKILLMAKE=CARPENTRY 80.0, t_carpentry

CATEGORY=Provisions - Miscellaneous
SUBSECTION=Safe
DESCRIPTION=Strongbox

On=@DClick
	f_keyffffffff_fix <more>
	if (!<src.restest 1 t_key_match>) && ((<type>==t_container_locked) || (<type>==t_door_locked) || (<type>==t_ship_side_locked)) && (!<src.isgm>)
		src.sysmessage This <name> is locked.
		return 1
	endif
	src.f_match_key

	if <src.isgm>
		return 0
	endif
	if <link>==04fffffff
		src.sysmessage You must lockdown container first
		return 1
	elseif <more>==0
		target Select key or safe with lock
		return 1
	elseif <src.p.z> > <z>
		if <src.isgm>
			src.sysmessage You can't reach that (system), <z>, <src.p.z>
		else
			src.sysmessage You can't reach that
			return 1
		endif
	endif

On=@Targon_item
	f_lock_safe_container
	return 1

On=@Spell
	return 1

//------------

[ITEMDEF i_beeswarm]
NAME=bees
ID=i_bee_swarm
TYPE=t_normal
WEIGHT=5000

On=@Create
	attr = attr_move_never

CATEGORY=Items by Professions
SUBSECTION=Beekeepers/Candlers
DESCRIPTION=Bees (no trap)

[ITEMDEF i_bee_hive]
NAME=beehive
ID=i_beehive
WEIGHT=10

RESOURCES=30 i_board, 4 i_nails, 2 i_hay_sheaf, 20 i_beeswax
SKILLMAKE=CARPENTRY 90.0, t_carpentry

On=@Create
	morez = 1	// not active bee hive

On=@Click
	if <morez> != 0
		message an empty beehive
	else
		message a beehive
	endif
	return 1

On=@DClick
	if <morez> == 0
		return 0
	endif
	src.sysmessage Which bee swarm do you want to try catch?
	target
	return 1

On=@Targon_item
	if <src.targ.baseid> != i_beeswarm
		return 0
	endif

	if <src.targ.attr> & 08000
		src.message You try to catch this swarm of wild bees, but you fail!
		src.damage { 10 15 }
		src.message Ouch! Bee sting!
		return 1
	endif

	if <src.restest 1 i_jar_honey>
		src.consume 1 i_jar_honey
		if rand(10) > 5
			src.message You try to catch this swarm of wild bees, but you fail!
			src.damage { 10 15 }
			src.message Ouch! Bee sting!
			return 1
		else
			morez = 0
			src.targ.remove
		endif
	else
		src.message You try to catch this swarm of wild bees, but you fail!
		src.damage { 10 15 }
		src.message Ouch! Bee sting!
		return 1
	endif
	return 1

On=@Dropon_ground
	if <morez>==0
		src.newitem i_beeswarm
		src.act.p = <p>
		src.act.timer = -1
		src.act.attr = <src.act.attr> | attr_static
		more2 = <src.act.serial>
	endif

On=@Pickup_ground
	if <more2> != 0
		more = <link>
		link = <more2>
		link.remove
		link = <more>
		more = 0
		more2 = 0
	endif

[ITEMDEF i_halberd_guard]
NAME=Guardian
ID=i_halberd
WEIGHT=1

On=@Create
	hitpoints = 100

On=@Equip
	if !<src.isgm>
		remove
		return 1
	endif

On=@Damage
	if <src.flags> & statf_criminal
		if <src.brain>
			src.flags = <src.flags> | statf_conjured
		endif
		say Take this vile crminal!
		src.kill
//		if <src.kills> > 0
//			src.kills = (<src.kills> - 1)
//		endif
		if <src.restest 1 i_csd_murderer_counter>
			src.consume 1 i_csd_murderer_counter
		endif
	elseif <src.kills> > 5
		if <src.brain>
			src.flags = <src.flags> | statf_conjured
		endif
		say Take this vile murderer!
		src.kill
//		if <src.kills> > 0
//			src.kills = (<src.kills> - 1)
//		endif
		if <src.restest 1 i_csd_murderer_counter>
			src.consume 1 i_csd_murderer_counter
		endif
	elseif <cont.brain>
		cont.remove
	else
		remove
	endif
	return 1

[ITEMDEF i_staff_magery]
NAME=Mage's staff
ID=i_staff_black
WEIGHT=200.0

On=@Create
	hitpoints = 100

On=@Damage
	src.damage 1
	src.hits = <src.hits> + 1
	return 1

//========================
// Flipitem
//========================

[PLEVEL 1]
flipitem

[FUNCTION flipitem]
	if <src.flags> & (statf_dead | statf_freeze | statf_insubstantial | statf_stone)
		src.sysmessage You can't do it in your current state
		return 1
	endif
	src.newitem i_flipitem_target
	src.act.equip
	return 1

[ITEMDEF i_flipitem_target]
NAME=Flip Item Target
ID=i_deed
TYPE=t_eq_script
LAYER=layer_special
WEIGHT=0

On=@Create
	attr = attr_newbie | attr_decay | attr_invis
	timer = 10

On=@Equip
	attr = attr_newbie | attr_decay | attr_invis
	timer = 10
	target Which item do you want to flip?

On=@Targon_item
	if <cont.targ.attr> & 08010
		cont.sysmessage You can't flip static items
		remove
		return 1
	else
		if <cont.targ.id> == 0190e
			cont.targ.id = 0190f
			cont.targ.update
			remove
			return 1
		elseif <cont.targ.id> == 0190f
			cont.targ.id = 0190e
			cont.targ.update
			remove
			return 1
		endif
		if (<cont.targ.type> == t_craft_fence) || (<cont.targ.type> == t_craft_door)
			cont.sysmessage You can't flip this item
			remove
			return 1
		endif
		cont.targ.flip
		cont.targ.update
		remove
		return 1
	endif

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

On=@Targon_ground
	cont.sysmessage You can't think of a way to use this item
	remove
	return 1

On=@Timer
	cont.sysmessage Targeting canceled
	remove
	return 1

[ITEMDEF i_disconnecter]
NAME=Disconnecter
ID=i_deed
WEIGHT=0
LAYER=layer_special
TYPE=t_eq_script

On=@Timer
	cont.disconnect
	remove
	return 1

[ITEMDEF i_client_check]
NAME=Client check
ID=i_gravestone

On=@Pickup_ground
	if <src.account.plevel> < 4
		return 1
	endif

On=@Create
	attr = attr_static | attr_move_never

On=@DClick
	if <src.clientver>!=2.0.3
		src.sysmessage Client version is <src.clientver>
		if <src.account.plevel> < 4
			src.newitem i_disconnecter
			src.act.equip
			src.act.timer 1
		endif
	else
		src.sysmessage Client version is 2.0.3, passed
	endif
	return 1

[ITEMDEF i_test]
NAME=Checker
ID=i_deed

On=@DClick
	src.sysmessage Bank balance is <src.bankbalance>
	target
	return 1

On=@Targon_item
	if <src.targ.resmake>
		src.sysmessage <src.targ.resmake>, <src.targ.resources>, <src.targ.skillmake>
	else
		src.sysmessage Nothing
	endif
	return 1

//==========
// Speedhack
//==========

[TYPEDEF t_speedhack_clock]
On=@DClick
	target Select target within 60 seconds
	return 1

On=@Timer
	timer = 60
	if <link> == 04fffffff
		remove
		return 1
	endif
	if <link.timer> != <timer>
		timer = <link.timer>
	endif
	if timer = -1
		remove
		return 1
	endif
	return 1

On=@Targon_char
	if <src.targ.restest 1 i_speed_check>
		cont.sysmessage <cont.targ.name> already has Speed Check
		remove
		return 1
	endif

	src.targ.newitem i_speed_check
	src.targ.act.more = <src.targ.serial>
	src.targ.act.link = <link>	// link to Speed mark stone
	src.targ.act.timer = <link.timer>
	src.targ.act.cont = <src.targ.serial>
	return 1

[ITEMDEF i_speedhack_clock]
ID=i_gravestone
NAME=Speedhack Clock

On=@Timer
	timer = 60
	return 1

On=@Dclick
	target What clock do you want to sychronize?
	return 1

On=@Targon_item
	if <src.targ.baseid> != i_clock
		src.message You must use clock to synchronize with Speedhack Clock
		return 1
	endif

	src.targ.type = t_speedhack_clock
	src.targ.link = <serial>
	src.targ.timer = <timer>
	return 1

[ITEMDEF i_speed_check]
NAME=Speed check
ID=i_deed
TYPE=t_eq_script
LAYER=layer_special

On=@Create
	attr = attr_invis | attr_decay | attr_newbie

On=@Timer
	if <cont>
		if <link> != 04fffffff
			if (<link.timer> > 5) && (<link.timer> < 55)
				cont.say Speedhack! link.timer = <link.timer>, link.name = <link.name>
				link.timer = 60
				timer = 60
				return 1
			else
				// clean - remove
				cont.say Clean!
				remove
				return 1
			endif
		endif
	else
		remove
		return 1
	endif

[ITEMDEF i_test1]
NAME=Test
ID=i_deed

On=@Click
	more = strlen(<name>)
	if <strleft(<name>,1)> == <strleft(<src.name>,1)>
		message !
	endif
	message <name>, more = <more>, <eval(strlen(<name>))>, strleft(name,1)
	return 1

[ITEMDEF i_disconnect_all]
NAME=Disconnect all
ID=i_deed
TYPE=t_normal

On=@Create
	color = color_o_bloodrock
	attr = attr_move_never

On=@DClick
	if <src.account.plevel> < 6
		return 1
	endif
	if !<cont>
		return 1
	endif
	if <cont> != <src.findlayer(layer_pack).serial>
		return 1
	endif
	cont.serv.allclients disconnect
	return 1

//###################
//# Guildstone misc #
//###################

[PLEVEL 1]
ACCEPT
DECLINE

[itemdef i_guildstone_drag]
id=i_guildstone
name=Guildstone
type=0
weight=5.0

On=@Dropon_ground
	if <src.memoryfindtype(0400).link.serial> == <link.serial>
		link.p=<p>
		link.update
	endif
	remove
	return 1

On=@DClick
	return 1

[itemdef i_add_member]
id=i_memory
type=t_eq_script
weight=0
layer=30

On=@Create
	attr=04

[FUNCTION ACCEPT]
	if !<src.restest 1 i_add_member>
		return 1
	endif
	if <src.findid(i_add_member).link.type>!=t_stone_guild
		src.consume 1 i_add_member
		return 1
	endif
	if <src.memoryfindtype(0400)>
		src.sysmessage You are already a member of the guild.
		src.consume 1 i_add_member
		return 1
	endif
	src.findid(i_add_member).link.joinasmember
	src.sysmessage You are now a member of <src.findid(i_add_member).link.name>
	src.consume 1 i_add_member
	return 1

[FUNCTION DECLINE]
	if !<src.restest 1 i_add_member>
		return 1
	endif
	src.findid(i_add_member).link.say <src.name> has declined the ... to join the guild.
	src.consume 1 i_add_member
	return 1

[ITEMDEF 04520]
// Guild Stone
DEFNAME=i_guild_stone
ID=i_guildstone
NAME=Guildstone
TYPE=T_STONE_GUILD

CATEGORY=Provisions - Deeds
SUBSECTION=Guild and Town Stones
DESCRIPTION=Guild Stone

On=@Create
	morez=01
	timer=3600

On=@Timer
	if (<morex> >= 720) && (<color> == 0486)
		remove
	elseif (<morex> >= 720) && (<color> != 0486)
		morex=0
		color=0
		update		
	elseif <morex> >=552
		color=0486
		update
	endif
	if <src.uid.<more2>.baseid> != i_guildstone_drag
		morez=<morez>&~02
		more2=0
	endif
	morex = <morex> + 1

	timer = 3600

	return 1

On=@Dclick
	if <timer>==-1
		timer = 3600
	endif
	if <src.memoryfindtype(0400).link.serial>==<serial>
		morez = <morez>|01
		morex = 0
		color = 0
		update
	endif
	if <src.uid.<more2>.baseid> != i_guildstone_drag
		morez=<morez>&~02
		more2=0
	endif

On=@Click
	if <timer>==-1
		timer = 3600
	endif
	if (<src.isgm>) && (!(<morez>&01))
		message A guildstone for <name> (unregistered)
		message <morex> hours old.
		return 1
	endif

On=@Targon_char
	if  !(<morez>&04)
		return 0
	endif
	if <src.targ.brain>
		say Only players can be members.
		return 1
	endif
	if <src.targ.memoryfindtype(0400)>
		src.sysmessage <src.targ.name> is already a member of a guild.
		return 1
	elseif <src.targ.findid(i_add_member)>
		src.sysmessage <src.targ.name> is already invited to join the guild.
		return 1
	endif
	src.targ.sysmessage You have been invited to join <name>. Type .accept to join or .decline to decline offer
	src.targ.newitem i_add_member
	src.targ.act.link = <serial>
	src.targ.act.name = <name>
	src.targ.equip <src.targ.act.serial>
	morez = <morez>&~04
	return 1

On=@Targon_item
	src.sysmessage You can't think abount the way to use this item.
	morez = <morez>&~04
	return 1

On=@Targon_ground
	morez = <morez>&~04
	return 1


[EOF]
