//#####################################
// CSD UO Tournament System
//#####################################

// exchanger and dialogs added by me, Green Bub on October 23, 2001 at 21:04 of my time

// 05.09.2001, MoNK: file created

[DEFNAME tournament_definitions]
color_tournament_archery		0
color_tournament_fencing		0
color_tournament_macefighting	0
color_tournament_magery		0
color_tournament_swordsmanship	0
color_tournament_wrestling		0
color_tournament_barbarian		0
color_tournament_combat		0481

[TYPEDEF t_tournament_point]
On=@Click
	message <name>
	return 1

[ITEMDEF i_tournament_archery]
NAME=Archery point
ID=i_virtstone_5
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_archery
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Archery point

[ITEMDEF i_tournament_barbarian]
NAME=Barbarian point
ID=i_virtstone_6
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_barbarian
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Barbarian point

[ITEMDEF i_tournament_combat]
NAME=Combat point
ID=i_virtstone_1
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_combat
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Combat point

[ITEMDEF i_tournament_fencing]
NAME=Fencing point
ID=i_virtstone_7
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_fencing
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Fencing point

[ITEMDEF i_tournament_macefighting]
NAME=Macefighting point
ID=i_virtstone_4
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_macefighting
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Macefighting point

[ITEMDEF i_tournament_magery]
NAME=Magery point
ID=i_virtstone_8
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_magery
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Magery point

[ITEMDEF i_tournament_swordsmanship]
NAME=Swordsmanship point
ID=i_virtstone_3
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_swordsmanship
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Swordsmanship point

[ITEMDEF i_tournament_wrestling]
NAME=Wrestling point
ID=i_virtstone_2
WEIGHT=0

On=@Create
	attr = attr_newbie
	color = color_tournament_wrestling
	type = t_tournament_point

CATEGORY=Tournament
SUBSECTION=Points
DESCRIPTION=Wrestling point


//
// banquet ticket definiton
//

[TYPEDEF t_banquet_ticket]
On=@Click
	message <name>
	return 1

[ITEMDEF i_banquet_ticket]
NAME=Banquet ticket
ID=i_deed
WEIGHT=1

On=@Create
	attr = attr_newbie
	color = 0445
	type = t_banquet_ticket

CATEGORY=Tournament

//#################################
//#       prize definitons        #
//#################################

//
//sandstone fireplace
//

[ITEMDEF i_sand_fireplace_n_1]
NAME=
ID= 047b
WEIGHT=50

[ITEMDEF i_sand_fireplace_n_2]
NAME=
ID=0482
WEIGHT=50

[ITEMDEF i_sand_fireplace_e_1]
NAME=
ID=0489
WEIGHT=50

[ITEMDEF i_sand_fireplace_e_2]
NAME=
ID=0475
WEIGHT=50

[ITEMDEF i_stone_fireplace_n_1]
NAME=
ID=0945
WEIGHT=50

[ITEMDEF i_stone_fireplace_n_2]
NAME=
ID=094b
WEIGHT=50

[ITEMDEF i_stone_fireplace_e_1]
NAME=
ID=0937
WEIGHT=50

[ITEMDEF i_stone_fireplace_e_2]
NAME=
ID=093d
WEIGHT=50

//
// name change ticket
//


[TYPEDEF t_namechange_ticket]
On=@Click
	message <name>
	return 1

[ITEMDEF i_namechange_ticket]
NAME=NameChange ticket
ID=i_deed
WEIGHT=1

On=@Create
	attr = attr_newbie
	color = 0543
	type = t_namechange_ticket

CATEGORY=Tournament


//#################################
//#      tournament exchanger     #
//#################################


[TYPEDEF t_prize_xchanger]

// on dclick testing for old stones

on=@dclick
	if  <src.restest 1 i_virtstone_8>
		f_prize_stone_8
	endif

	if  <src.restest 1 i_virtstone_2>
		f_prize_stone_2
	endif


	if  <src.restest 1 i_virtstone_3>
		f_prize_stone_3
	endif

	if  <src.restest 1 i_virtstone_1>
		f_prize_stone_1
	endif

	if  <src.restest 1 i_virtstone_4>
		f_prize_stone_4
	endif

	if  <src.restest 1 i_virtstone_5>
		f_prize_stone_5
	endif

	if  <src.restest 1 i_virtstone_7>
		f_prize_stone_7
	endif


//
// done converting stones
//
// checking for amount of points and opening appropriate menus
//

	if  <src.restest 300 t_tournament_point>
	src.dialog d_bub_prize_300
	return 1
	elseif  <src.restest 100 t_tournament_point>
	src.dialog d_bub_prize_100
	return 1
	elseif  <src.restest 50 t_tournament_point>
	src.dialog d_bub_prize_50
	return 1
	elseif  <src.restest 30 t_tournament_point>
	src.dialog d_bub_prize_30
	return 1
	elseif  <src.restest 10 t_tournament_point>
	src.dialog d_bub_prize_10
	return 1
	else
	src.dialog d_bub_prize_none
	endif

		
return 1

//
// stone xchange functions 
//
[function f_prize_stone_8]
	if <src.restest 1 i_virtstone_8>
		src.consume = 1 i_virtstone_8
		src.newitem i_tournament_combat
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_8>
			f_prize_stone_8
		endif
	endif

[function f_prize_stone_2]
	if <src.restest 1 i_virtstone_2>
		src.consume = 1 i_virtstone_2
		src.newitem i_tournament_wrestling
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_2>
			f_prize_stone_2
		endif
	endif


[function f_prize_stone_3]
	if <src.restest 1 i_virtstone_3>
		src.consume = 1 i_virtstone_3
		src.newitem i_tournament_swordsmanship
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_3>
			f_prize_stone_3
		endif
	endif

[function f_prize_stone_1]
	if <src.restest 1 i_virtstone_1>
		src.consume = 1 i_virtstone_1
		src.newitem i_tournament_combat
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_1>
			f_prize_stone_1
		endif
	endif

[function f_prize_stone_4]
	if <src.restest 1 i_virtstone_4>
		src.consume = 1 i_virtstone_4
		src.newitem i_tournament_macefighting
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_4>
			f_prize_stone_4
		endif
	endif

[function f_prize_stone_5]
	if <src.restest 1 i_virtstone_5>
		src.consume = 1 i_virtstone_5
		src.newitem i_tournament_archery
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_5>
			f_prize_stone_5
		endif
	endif

[function f_prize_stone_7]
	if <src.restest 1 i_virtstone_7>
		src.consume = 1 i_virtstone_7
		src.newitem i_tournament_fencing
		src.act.bounce
		src.update
		if <src.restest 1 i_virtstone_7>
			f_prize_stone_7
		endif
	endif
return 1

//
// prize dialogs
//

[dialog d_bub_prize_300]
100 10
resizepic 0 0 3600 400 280
page 0
resizepic 20 20 83 360 250
text 50 30 33 0
button 35 30 1209 1210 1 0 10
text 50 50 33 1
button 35 50 1209 1210 1 0 9
text 50 70 33 2
button 35 70 1209 1210 1 0 1
text 50 90 33 3
button 35 90 1209 1210 1 0 2
text 50 110 33 4
button 35 110 1209 1210 1 0 3
text 50 130 33 5
button 35 130 1209 1210 1 0 4
text 50 150 33 6
button 35 150 1209 1210 1 0 5
text 50 170 33 7
button 35 170 1209 1210 1 0 6
text 50 190 33 8
button 35 190 1209 1210 1 0 7
text 50 210 33 9
button 35 210 1209 1210 1 0 8


[DIALOG d_bub_prize_300 TEXT]
Weapon of The Tournament Master
NameChange Ticket for 100 stones
Sandstone Fireplace[North] for 50 stones
Sandstone Fireplace[East] for 50 stones
Stone Fireplace[North] for 50 stones
Stone Fireplace[East] for 50 stones
Robe for 30 stones
Cloak for 30 stones
Feathered Hat for 30 Stones
Banquet Ticket for 10 stones


[DIALOG d_bub_prize_300 BUTTON]
ONBUTTON=0

ONBUTTON=10
	f_weapon_of_the_tournament_master

ONBUTTON=1
	f_sandstone_fireplace_n

ONBUTTON=2
	f_sandstone_fireplace_e

ONBUTTON=3
	f_stone_fireplace_n

ONBUTTON=4
	f_stone_fireplace_e

ONBUTTON=5
	f_prize_robe

ONBUTTON=6
	f_prize_cape

ONBUTTON=7
	f_prize_hat

ONBUTTON=8
	f_banquet_ticket

ONBUTTON=9
	f_namechange_ticket
	
//
// 100 point stones
//

[dialog d_bub_prize_100]
100 10
resizepic 0 0 3600 400 280
page 0
resizepic 20 20 83 360 250
text 50 30 33 0
button 35 30 1209 1210 1 0 9
text 50 50 33 1
button 35 50 1209 1210 1 0 1
text 50 70 33 2
button 35 70 1209 1210 1 0 2
text 50 90 33 3
button 35 90 1209 1210 1 0 3
text 50 110 33 4
button 35 110 1209 1210 1 0 4
text 50 130 33 5
button 35 130 1209 1210 1 0 5
text 50 150 33 6
button 35 150 1209 1210 1 0 6
text 50 170 33 7
button 35 170 1209 1210 1 0 7
text 50 190 33 8
button 35 190 1209 1210 1 0 8


[DIALOG d_bub_prize_100 TEXT]
NameChange Ticket for 100 stones
Sandstone Fireplace[North] for 50 stones
Sandstone Fireplace[East] for 50 stones
Stone Fireplace[North] for 50 stones
Stone Fireplace[East] for 50 stones
Robe for 30 stones
Cloak for 30 stones
Feathered Hat for 30 Stones
Banquet Ticket for 10 stones

[DIALOG d_bub_prize_100 BUTTON]
ONBUTTON=0

ONBUTTON=1
	f_sandstone_fireplace_n

ONBUTTON=2
	f_sandstone_fireplace_e

ONBUTTON=3
	f_stone_fireplace_n

ONBUTTON=4
	f_stone_fireplace_e

ONBUTTON=5
	f_prize_robe

ONBUTTON=6
	f_prize_cape

ONBUTTON=7
	f_prize_hat

ONBUTTON=8
	f_banquet_ticket

ONBUTTON=9
	f_namechange_ticket



//
// 50 point stones
//

[dialog d_bub_prize_50]
100 10
resizepic 0 0 3600 400 240
page 0
resizepic 20 20 83 360 200
text 50 30 33 0
button 35 30 1209 1210 1 0 1
text 50 50 33 1
button 35 50 1209 1210 1 0 2
text 50 70 33 2
button 35 70 1209 1210 1 0 3
text 50 90 33 3
button 35 90 1209 1210 1 0 4
text 50 110 33 4
button 35 110 1209 1210 1 0 5
text 50 130 33 5
button 35 130 1209 1210 1 0 6
text 50 150 33 6
button 35 150 1209 1210 1 0 7
text 50 170 33 7
button 35 170 1209 1210 1 0 8

[DIALOG d_bub_prize_50 TEXT]
Sandstone Fireplace[North] for 50 stones
Sandstone Fireplace[East] for 50 stones
Stone Fireplace[North] for 50 stones
Stone Fireplace[East] for 50 stones
Robe for 30 stones
Cloak for 30 stones
Feathered Hat for 30 Stones
Banquet Ticket for 10 stones


[DIALOG d_bub_prize_50 BUTTON]
ONBUTTON=0

ONBUTTON=1
	f_sandstone_fireplace_n

ONBUTTON=2
	f_sandstone_fireplace_e

ONBUTTON=3
	f_stone_fireplace_n

ONBUTTON=4
	f_stone_fireplace_e

ONBUTTON=5
	f_prize_robe

ONBUTTON=6
	f_prize_cape

ONBUTTON=7
	f_prize_hat

ONBUTTON=8
	f_banquet_ticket


//
// 30 point stones
//

[dialog d_bub_prize_30]
100 10
resizepic 0 0 3600 400 150
page 0
resizepic 20 20 83 360 110
text 50 30 33 0
button 35 30 1209 1210 1 0 1
text 50 50 33 1
button 35 50 1209 1210 1 0 2
text 50 70 33 2
button 35 70 1209 1210 1 0 3
text 50 90 33 3
button 35 90 1209 1210 1 0 4

[DIALOG d_bub_prize_30 TEXT]
Robe for 30 stones
Cloak for 30 stones
Feathered Hat for 30 Stones
Banquet Ticket for 10 stones

[DIALOG d_bub_prize_30 BUTTON]
ONBUTTON=0
ONBUTTON=1
	f_prize_robe

ONBUTTON=2
	f_prize_cape

ONBUTTON=3
	f_prize_hat
ONBUTTON=4
	f_banquet_ticket


//
// 10 stones
//

//
// 30 point stones
//

[dialog d_bub_prize_10]
100 10
resizepic 0 0 3600 400 100
page 0
resizepic 20 20 83 360 70
text 50 30 33 0
button 35 30 1209 1210 1 0 1

[DIALOG d_bub_prize_10 TEXT]
Banquet Ticket for 10 stones

[DIALOG d_bub_prize_10 BUTTON]
ONBUTTON=0

ONBUTTON=1
	f_banquet_ticket


[dialog d_bub_prize_none]
100 10
resizepic 0 0 3600 430 100
page 0
resizepic 20 20 83 390 70
text 50 30 33 0

[DIALOG d_bub_prize_none TEXT]
You don't have enough stones to obtain anything

[DIALOG d_bub_prize_none BUTTON]
ONBUTTON=0

//
// end dialogs
//

//
//prize functions
//
[function f_prize_robe]

	if <src.restest 30 t_tournament_point>
		src.newitem= i_robe
		src.act.name= <src.name>'s robe
		src.act.attr= 024
		src.act.more1= 07fff7fff
		src.act.color= 08fc
		src.act.bounce
		src.consume= 30 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_prize_cape]
	if <src.restest 30 t_tournament_point>
		src.newitem= i_cape
		src.act.name= <src.name>'s cape
		src.act.attr= 024
		src.act.more1= 07fff7fff
		src.act.color= 08fc
		src.act.bounce
		src.consume= 30 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_prize_hat]
	if <src.restest 30 t_tournament_point>
		src.newitem= i_hat_feather
		src.act.name= <src.name>'s feathered hat
		src.act.attr= 024
		src.act.more1= 07fff7fff
		src.act.color= 08fc
		src.act.bounce
		src.consume= 30 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_banquet_ticket]
	if <src.restest 10 t_tournament_point>
		src.newitem= i_banquet_ticket
		src.act.name= Banquet ticket for <src.name>
		src.act.attr= 024
		src.act.bounce
		src.consume= 10 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_namechange_ticket]
	if <src.restest 100 t_tournament_point>
		src.newitem= i_namechange_ticket
		src.act.name= Namechange ticket for <src.name>
		src.act.bounce
		src.consume= 100 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif
//
// fireplace functions
//

[function f_sandstone_fireplace_n]
	if <src.restest 50 t_tournament_point>
		src.newitem= i_sand_fireplace_n_1
		src.act.bounce
		src.newitem= i_sand_fireplace_n_2
		src.act.bounce
		src.consume= 50 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_sandstone_fireplace_e]
	if <src.restest 50 t_tournament_point>
		src.newitem= i_sand_fireplace_e_1
		src.act.bounce
		src.newitem= i_sand_fireplace_e_2
		src.act.bounce
		src.consume= 50 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_stone_fireplace_n]
	if <src.restest 50 t_tournament_point>
		src.newitem= i_stone_fireplace_n_1
		src.act.bounce
		src.newitem= i_stone_fireplace_n_2
		src.act.bounce
		src.consume= 50 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif

[function f_stone_fireplace_e]
	if <src.restest 50 t_tournament_point>
		src.newitem= i_stone_fireplace_e_1
		src.act.bounce
		src.newitem= i_stone_fireplace_e_2
		src.act.bounce
		src.consume= 50 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif


[function f_weapon_of_the_tournament_master]
		
		if <src.isgm>
		src.message your body is <src.obody>
		endif

	if <src.restest 300 t_tournament_point>
			
				src.newitem =  i_tournament_claw
				src.act.name=The Tournament Master
				src.act.attr = 024
				src.act.color= 08fc
				src.act.bounce
		
				

		src.consume= 300 t_tournament_point
		sound 0F7
		return 1
	else
		message You don't posess enough tournament recognitions, kid.
	endif



//
//######################
//#  Tournament Sowrd  #
//######################

[ITEMDEF i_tournament_claw]
NAME= Tournament Master's Sword
ID=013b5
DAM=22,48


On=@Create
	HITPOINTS={100 180}
	COLOR=08fc

On=@Damage	// 2d14+2 = 4-30
	if !<cont>
		return 1
	elseif !<cont.ischar>
		return 1
	elseif <cont.serial>==<src.serial>
		return 1
	endif
	more2 = {17 47}
	f_damage_sword
	if <eval(<cont.swordsmanship>)> > <eval(rand(1160))>
		more2 = <more2> + 37
	endif
	src.damage <more2>
	f_crash_sword

//drop your sword and drop your shield, dude

	if <cont.dex> >= <src.dex>
		if <eval(<src.swordsmanship> / 50)> <= <eval(<cont.swordsmanship> / 50)>
			if <src.findlayer(layer_hand1)>
				src.findlayer(layer_hand1).drop
			elseif <src.findlayer(layer_hand2)>
				src.findlayer(layer_hand2).drop
			endif
		endif
	endif

//end drop




	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





[EOF]