[DIALOG D_BC_ITEM_PROPS]
40, 20
src.closealldialogs
PAGE 0
resizepic 0 0 5054 550 465
checkertrans 10 10 530 445
gumppictiled 10 205 170 45 2624
checkertrans 10 205 170 45
gumppictiled 10 390 365 30 2624
checkertrans 10 390 365 30
gumppictiled 10 285 170 70 2624
checkertrans 10 285 170 70
gumppictiled 10 10 530 30 2624
checkertrans 10 10 530 30
gumppictiled 10 45 160 155 2624
checkertrans 10 45 160 155
gumppictiled 175 45 365 100 2624
checkertrans 175 45 365 100
gumppictiled 175 150 365 100 2624
checkertrans 175 150 365 100
gumppictiled 175 255 365 100 2624
checkertrans 175 255 365 100
gumppictiled 175 360 365 60 2624
checkertrans 175 360 365 60

tilepic 40 60 <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.ID>

xmfhtmlgumpcolor 130 15 300 35 1044006 0 0 32767 //bowcraft and fletching menu

xmfhtmlgumpcolor 180 55 100 30 1011152 0 0 32767 //item
dhtmlgump 330 55 250 30 0 0 <DEF.BFONT_WHITE><SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.NAME><DEF.BFONTE>

IF (0<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>)
LOCAL.CRAFTCHANCE=<eval <floatval ((<src.bowcraft>/(<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>/10))*0.75)-0.05>/10000>
LOCAL.EXCEPTIONALCHANCE=<eval <floatval ((<src.armslore>/(<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>/10))*0.75)-0.30>/10000>
ELSE
LOCAL.CRAFTCHANCE=100
LOCAL.EXCEPTIONALCHANCE=100
ENDIF
IF (<LOCAL.CRAFTCHANCE> > 100)
LOCAL.CRAFTCHANCE=100
ENDIF
IF (<LOCAL.EXCEPTIONALCHANCE> > 100)
LOCAL.EXCEPTIONALCHANCE=100
ENDIF

xmfhtmlgumpcolor 180 100 120 30 1044057 0 0 32767 //success chance
dtext 420 100 1153 <FVAL <LOCAL.CRAFTCHANCE>*10>%
xmfhtmlgumpcolor 180 120 120 30 1044058 0 0 32767 //exceptional chance
dtext 420 120 1153 <FVAL <LOCAL.EXCEPTIONALCHANCE>*10>%

dhtmlgump 180 160 250 30 0 0 <DEF.BFONT_WHITE>bowcraft<DEF.BFONTE>
dtext 420 160 1153 <FVAL <serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>>

xmfhtmlgumpcolor 30 260 100 30 1044055 0 0 32767
dhtmlgump 200 260 300 200 0 0 <DEF.BFONT_WHITE><serv.itemdef.<SRC.CTAG.BC.ITEM>.RESMAKE><DEF.BFONTE>
dhtmlgump 200 310 340 40 0 0 <DEF.BFONT_WHITE>*All items that may be crafted with ingots, requires 12 ingots

xmfhtmlgumpcolor 30 360 100 30 1044056 0 0 32767
xmfhtmlgumpcolor 200 360 300 30 1044059 0 0 32767
xmfhtmlgumpcolor 200 380 300 30 1044152 0 0 32767

resizepic 10 430 5120 530 23
checkertrans 10 430 530 23

button 20 431 0fae 0fb0 1 0 1
xmfhtmlgumpcolor 55 433 100 30 1044150 0 0 32767 //back

button 320 431 4005 4006 1 0 2
xmfhtmlgumpcolor 355 433 100 30 1044151 0 0 32767 //make now

[DIALOG D_BC_ITEM_PROPS BUTTON]
ON=1
DIALOG d_newcraft_dialog_bowcraft

ON=2
SRC.F_CRAFTITEM_BC

[DIALOG d_newcraft_dialog_bowcraft]
40, 20
src.closealldialogs
PAGE 0 
resizepic 0 0 5054 550 465
gumppictiled 10 10 530 30 2624
checkertrans 10 10 530 30
gumppictiled 10 45 160 280 2624
checkertrans 10 45 160 280
gumppictiled 175 45 365 280 2624
checkertrans 175 45 365 280
//////
gumppictiled 10 330 160 40 2624
checkertrans 10 330 160 40
gumppictiled 175 330 365 40 2624
checkertrans 175 330 365 40
gumppictiled 10 375 530 85 2624
checkertrans 10 375 530 85
xmfhtmlgumpcolor 130 15 300 35 1044006 0 0 32767 //bowcraft and fletching menu
xmfhtmlgumpcolor 10 45 150 35 1044010 0 0 32767 //categories

xmfhtmlgumpcolor 40 <EVAL 65+(22*0)> 100 35 1044457 0 0 32767 //materials
button 10 <EVAL 65+(22*0)> 4005 4006 0 2 1
xmfhtmlgumpcolor 40 <EVAL 65+(22*1)> 100 35 1044565 0 0 32767 //Ammunition
button 10 <EVAL 65+(22*1)> 4005 4006 0 3 1
xmfhtmlgumpcolor 40 <EVAL 65+(22*2)> 100 35 1044566 0 0 32767 //weapons
button 10 <EVAL 65+(22*2)> 4005 4006 0 4 1
xmfhtmlgumpcolor 40 <EVAL 65+(22*3)> 100 35 1044566 0 0 32767 //weapons
button 10 <EVAL 65+(22*3)> 4005 4006 0 5 1

xmfhtmlgumpcolor 280 45 150 35 1044011 0 0 32767 //selections
xmfhtmlgumpcolor 20 340 100 35 1044012 0 0 32767 //notices
dhtmlgump 200 330 320 35 0 0 <DEF.BFONT_WHITE><SRC.CTAG.BC.MESSAGE><DEF.BFONTE>

button 290 425 4005 4006 1 0 18
xmfhtmlgumpcolor 325 427 100 35 1044013 0 0 32767 //make last
button 290 400 4005 4006 1 0 10000
IF (!(<SRC.TAG0.MARKITEM>))
xmfhtmlgumpcolor 325 402 100 35 1044017 0 0 32767 //mark item
ELSE
xmfhtmlgumpcolor 325 402 100 35 1044018 0 0 32767 //do not mark
ENDIF
button 290 375 4005 4006 1 0 10001
xmfhtmlgumpcolor 325 377 100 35 1044015 0 0 32767 //repair

button 20 400 4005 4006 0 6 10002 //ingots
IF (<ISEMPTY <SRC.CTAG.BCMATERIAL>>)
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>LOG(<SRC.RESCOUNT i_log>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,dull_copper)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>DULL COPPER(<SRC.RESCOUNT i_ingot_dull_copper>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,silver)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>SILVER(<SRC.RESCOUNT i_ingot_silver>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,copper)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>COPPER(<SRC.RESCOUNT i_ingot_copper>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,bronze)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>BRONZE(<SRC.RESCOUNT i_ingot_bronze>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,gold)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>GOLD(<SRC.RESCOUNT i_ingot_gold>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,agapite)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>AGAPITE(<SRC.RESCOUNT i_ingot_agapite>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,verite)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>VERITE(<SRC.RESCOUNT i_ingot_verite>)<DEF.BFONTE>
ELIF (!(STRCMPI(<SRC.CTAG.BCMATERIAL>,valorite)))
dhtmlgump 55 402 200 35 0 0 <DEF.BFONT_WHITE>VALORITE(<SRC.RESCOUNT i_ingot_valorite>)<DEF.BFONTE>
ENDIF

button 20 425 0fb1 0fb3 1 0 0
xmfhtmlgumpcolor 55 427 100 35 1011441 0 0 32767 //exit

PAGE 2 //materials
xmfhtmlgumpcolor 215 65 150 35 1027125 0 0 32767 //shafts
button 180 65 4005 4006 1 0 2
button 500 65 0FAB 0FAD 1 0 1002

PAGE 3 //ammunition
xmfhtmlgumpcolor 215 65 150 35 1023906 0 0 32767 //arrow
button 180 65 4005 4006 1 0 3
button 500 65 0FAB 0FAD 1 0 1003
xmfhtmlgumpcolor 215 <EVAL 65+(22*1)> 150 35 1027163 0 0 32767 //crossbow bolt
button 180 <EVAL 65+(22*1)> 4005 4006 1 0 4
button 500 <EVAL 65+(22*1)> 0FAB 0FAD 1 0 1004

PAGE 4 //weapons
xmfhtmlgumpcolor 215 65 150 35 1025042 0 0 32767 //bow
button 180 65 4005 4006 1 0 5
button 500 65 0FAB 0FAD 1 0 1005
xmfhtmlgumpcolor 215 <EVAL 65+(22*1)> 150 35 1023920 0 0 32767 //crossbow
button 180 <EVAL 65+(22*1)> 4005 4006 1 0 6
button 500 <EVAL 65+(22*1)> 0FAB 0FAD 1 0 1006
xmfhtmlgumpcolor 215 <EVAL 65+(22*2)> 150 35 1025116 0 0 32767 //heavy crossbow
button 180 <EVAL 65+(22*2)> 4005 4006 1 0 7
button 500 <EVAL 65+(22*2)> 0FAB 0FAD 1 0 1007
xmfhtmlgumpcolor 215 <EVAL 65+(22*3)> 150 35 1029922 0 0 32767 //composite bow
button 180 <EVAL 65+(22*3)> 4005 4006 1 0 8
button 500 <EVAL 65+(22*3)> 0FAB 0FAD 1 0 1008
xmfhtmlgumpcolor 215 <EVAL 65+(22*4)> 150 35 1029923 0 0 32767 //repeating crossbow
button 180 <EVAL 65+(22*4)> 4005 4006 1 0 9
button 500 <EVAL 65+(22*4)> 0FAB 0FAD 1 0 1009
xmfhtmlgumpcolor 215 <EVAL 65+(22*5)> 150 35 1030149 0 0 32767 //yumi
button 180 <EVAL 65+(22*5)> 4005 4006 1 0 10
button 500 <EVAL 65+(22*5)> 0FAB 0FAD 1 0 1010
xmfhtmlgumpcolor 215 <EVAL 65+(22*6)> 150 35 1031550 0 0 32767 //elven composite longbow
button 180 <EVAL 65+(22*6)> 4005 4006 1 0 11
button 500 <EVAL 65+(22*6)> 0FAB 0FAD 1 0 1011
xmfhtmlgumpcolor 215 <EVAL 65+(22*7)> 150 35 1031551 0 0 32767 //magical shortbow
button 180 <EVAL 65+(22*7)> 4005 4006 1 0 12
button 500 <EVAL 65+(22*7)> 0FAB 0FAD 1 0 1012

PAGE 5 //weapons (artifacts)
xmfhtmlgumpcolor 215 65 150 35 1072907 0 0 32767 //Blight Gripped Longbow
button 180 65 4005 4006 1 0 13
button 500 65 0FAB 0FAD 1 0 1013
xmfhtmlgumpcolor 215 <EVAL 65+(22*1)> 150 35 1072908 0 0 32767 //Faerie Fire
button 180 <EVAL 65+(22*1)> 4005 4006 1 0 14
button 500 <EVAL 65+(22*1)> 0FAB 0FAD 1 0 1014
xmfhtmlgumpcolor 215 <EVAL 65+(22*2)> 150 35 1072955 0 0 32767 //Silvani's Feywood Bow
button 180 <EVAL 65+(22*2)> 4005 4006 1 0 15
button 500 <EVAL 65+(22*2)> 0FAB 0FAD 1 0 1015
xmfhtmlgumpcolor 215 <EVAL 65+(22*3)> 150 35 1072910 0 0 32767 //Mischief Maker
button 180 <EVAL 65+(22*3)> 4005 4006 1 0 16
button 500 <EVAL 65+(22*3)> 0FAB 0FAD 1 0 1016
xmfhtmlgumpcolor 215 <EVAL 65+(22*4)> 150 35 1072912 0 0 32767 //The Night Reaper
button 180 <EVAL 65+(22*4)> 4005 4006 1 0 17
button 500 <EVAL 65+(22*4)> 0FAB 0FAD 1 0 1017

PAGE 6
dhtmlgump 215 65 150 35 0 0 <DEF.BFONT_WHITE>LOG(<SRC.RESCOUNT i_log>)<DEF.BFONTE>
button 180 65 4005 4006 1 0 2001
dhtmlgump 215 <EVAL 65+(22*1)> 150 35 0 0 <DEF.BFONT_WHITE>DULL COPPER(<SRC.RESCOUNT i_ingot_dull_copper>)
button 180 <EVAL 65+(22*1)> 4005 4006 1 0 2002
dhtmlgump 215 <EVAL 65+(22*2)> 150 35 0 0 <DEF.BFONT_WHITE>SILVER(<SRC.RESCOUNT i_ingot_silver>)
button 180 <EVAL 65+(22*2)> 4005 4006 1 0 2003
dhtmlgump 215 <EVAL 65+(22*3)> 150 35 0 0 <DEF.BFONT_WHITE>COPPER(<SRC.RESCOUNT i_ingot_copper>)
button 180 <EVAL 65+(22*3)> 4005 4006 1 0 2004
dhtmlgump 215 <EVAL 65+(22*4)> 150 35 0 0 <DEF.BFONT_WHITE>BRONZE(<SRC.RESCOUNT i_ingot_bronze>)
button 180 <EVAL 65+(22*4)> 4005 4006 1 0 2005
dhtmlgump 215 <EVAL 65+(22*5)> 150 35 0 0 <DEF.BFONT_WHITE>GOLD(<SRC.RESCOUNT i_ingot_gold>)
button 180 <EVAL 65+(22*5)> 4005 4006 1 0 2006
dhtmlgump 215 <EVAL 65+(22*6)> 150 35 0 0 <DEF.BFONT_WHITE>AGAPITE(<SRC.RESCOUNT i_ingot_agapite>)
button 180 <EVAL 65+(22*6)> 4005 4006 1 0 2007
dhtmlgump 215 <EVAL 65+(22*7)> 150 35 0 0 <DEF.BFONT_WHITE>VERITE(<SRC.RESCOUNT i_ingot_verite>)
button 180 <EVAL 65+(22*7)> 4005 4006 1 0 2008
dhtmlgump 215 <EVAL 65+(22*8)> 150 35 0 0 <DEF.BFONT_WHITE>VALORITE(<SRC.RESCOUNT i_ingot_valorite>)
button 180 <EVAL 65+(22*8)> 4005 4006 1 0 2009

[DIALOG d_newcraft_dialog_bowcraft BUTTON]
ON=0
SRC.CTAG.BC.MESSAGE=

ON=2 18
IF (<ARGN1> != 18)
F_SELECT_BCITEM <EVAL <ARGN1>-2>
ENDIF
SRC.F_CRAFTITEM_BC

ON=1002 1086
F_SELECT_BCITEM <EVAL <ARGN1>-1002>
DIALOG D_BC_ITEM_PROPS

ON=2001 2009
IF (<ARGN1> == 2001)
SRC.CTAG.BCMATERIAL=
ELIF (<ARGN1> == 2002)
SRC.CTAG.BCMATERIAL=dull_copper
ELIF (<ARGN1> == 2003)
SRC.CTAG.BCMATERIAL=silver
ELIF (<ARGN1> == 2004)
SRC.CTAG.BCMATERIAL=copper
ELIF (<ARGN1> == 2005)
SRC.CTAG.BCMATERIAL=bronze
ELIF (<ARGN1> == 2006)
SRC.CTAG.BCMATERIAL=gold
ELIF (<ARGN1> == 2007)
SRC.CTAG.BCMATERIAL=agapite
ELIF (<ARGN1> == 2008)
SRC.CTAG.BCMATERIAL=verite
ELIF (<ARGN1> == 2009)
SRC.CTAG.BCMATERIAL=valorite
ENDIF
DIALOG d_newcraft_dialog_bowcraft

ON=10000
IF (<SRC.TAG0.MARKITEM>)
SRC.TAG.MARKITEM=
ELSE
SRC.TAG.MARKITEM=1
ENDIF
DIALOG d_newcraft_dialog_bowcraft

ON=10001
SRC.TARGETF F_REPAIR_ITEM_BC

[FUNCTION F_CRAFTITEM_BC]
LOCAL.ARMSLOREPROPCHANCE=<FEVAL <FLOATVAL ((<SRC.ARMSLORE>/3.25)+(<SRC.BOWCRAFT>/3.25)+(<SRC.LUCK>/45))+5>>
	IF (<LOCAL.ARMSLOREPROPCHANCE> > 98)
	LOCAL.ARMSLOREPROPCHANCE=98
	ENDIF
LOCAL.ITEMIDPROPCHANCE=<FEVAL <FLOATVAL ((<SRC.ITEMID>/3.25)+(<SRC.BOWCRAFT>/3.25)+(<SRC.LUCK>/45))+5>>
	IF (<LOCAL.ITEMIDPROPCHANCE> > 98)
	LOCAL.ITEMIDPROPCHANCE=98
	ENDIF
IF (0<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>)
LOCAL.CRAFTCHANCE=<eval <floatval ((<src.bowcraft>/(<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>/10))*0.75)-0.05>/10000>
LOCAL.EXCEPTIONALCHANCE=<eval <floatval ((<src.armslore>/(<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>/10))*0.75)-0.30>/10000>
ELSE
LOCAL.CRAFTCHANCE=100
LOCAL.EXCEPTIONALCHANCE=100
ENDIF
REF1=<SRC.FINDID.i_arrow_fletching.UID>
IF (!(<SRC.CTAG0.BC.ITEM>))
SRC.CTAG.BC.MESSAGE=You must select an item to make.
ELIF (!(<REF1>))
SRC.CTAG.BC.MESSAGE=The tool must be on your person to use.
ELIF (!(<SRC.CANMAKESKILL <SRC.CTAG.BC.ITEM>>))
SRC.CTAG.BC.MESSAGE=You don't have the required skills to attempt this item.
ELIF (!(<SRC.F_BC_CHECK_FOR_MATERIALS <SRC.CTAG.BC.ITEM>>))
SRC.CTAG.BC.MESSAGE=You don't have the components needed to make that.
ELIF (<SRC.CTAG0.IJUSTCRAFTED>)
SRC.CTAG.BC.MESSAGE=You must wait a few moments before crafting another item.
ELIF (<LOCAL.CRAFTCHANCE> >= <R1,100>)
SRC.SKILLGAIN bowcraft <EVAL (<SRC.BOWCRAFT>/10)+1>
SRC.SKILLGAIN Armslore <EVAL (<serv.itemdef.<SRC.CTAG.BC.ITEM>.skillmake.1.val>/10)>
SRC.CTAG.IJUSTCRAFTED=1
SRC.TIMERF 2,CTAG.IJUSTCRAFTED=
SRC.CTAG.BC.MESSAGE=You craft the item.
SERV.NEWITEM=<SRC.CTAG.BC.ITEM>
SERV.LOG <NAME> (<UID>) crafts <NEW.NAME> (<NEW.BASEID>)
	IF (!(<NEW.TAG0.ISARTIFACT>))
	NEW.GIVEITEMEVENT T_PROPRIEDADES
		IF (!(<ISEMPTY <SRC.CTAG.BCMATERIAL>>))
		SRC.CONSUME 12 i_ingot_<SRC.CTAG.BCMATERIAL>
		NEW.F_GIVE_BONUS_FROM_METAL <SRC.CTAG.BCMATERIAL>
		ENDIF
		IF (<LOCAL.EXCEPTIONALCHANCE> >= <R1,100>)
		NEW.QUALITY=200
		SRC.CTAG.BC.MESSAGE=You create an exceptional quality item.
			IF (<SRC.TAG0.MARKITEM>)
			NEW.TAG.CRAFTEDBY=<SRC.NAME>
			ENDIF
			IF (<NEW.ISWEAPON>)
			LOCAL.BONUSFORDAMAGEINCREASE=<EVAL (35+(<SRC.ARMSLORE>/200))>
			NEW.TAG0.DAMINCREASE += <LOCAL.BONUSFORDAMAGEINCREASE>
			SRC.SYSMESSAGE @04ec,3,1 Your item receives a <dLOCAL.BONUSFORDAMAGEINCREASE>% damage increase bonus for being exceptional.
			ENDIF
		ENDIF
		IF (<NEW.ISWEAPON>)
		NEW.F_GIVE_PROPS <LOCAL.ARMSLOREPROPCHANCE>
		ENDIF
	ENDIF
NEW.BOUNCE
	FOR <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.COUNT>
		IF (<SERV.ITEMDEF.<SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.KEY>.TYPE> != T_INGOT)
		SRC.CONSUME <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.VAL> <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.KEY>
		ELSE
		SRC.CONSUME <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.VAL> i_ingot_<SRC.CTAG.BCMATERIAL>
		ENDIF
	ENDFOR
SRC.ANIM 5
SRC.SOUND <DEF.snd_z_end_carpntry>
	IF (<REF1.TAG0.CHARGES> == 1)
	SRC.MESSAGE @,,2 1044262
	REF1.TIMERF 1,REMOVE
	ELSE
	REF1.TAG0.CHARGES --
	REF1.RESENDTOOLTIP 1
	ENDIF
ELSE
SRC.CTAG.BC.MESSAGE=You failed to create the item, and some of your materials are lost.
	FOR <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.COUNT>
		IF (<SERV.ITEMDEF.<SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.KEY>.TYPE> != T_INGOT)
		SRC.CONSUME <EVAL (30*<SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.VAL>)/100> <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.KEY>
		ELSE
		SRC.CONSUME <EVAL (30*<SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.VAL>)/100> i_ingot_<SRC.CTAG.BCMATERIAL>
		ENDIF
	ENDFOR
	IF (!(<ISEMPTY <SRC.CTAG.BCMATERIAL>>))
	SRC.CONSUME 2 i_ingot_<SRC.CTAG.BCMATERIAL>
	ENDIF
	IF (<REF1.TAG0.CHARGES> == 1)
	SRC.MESSAGE @,,2 1044262
	REF1.TIMERF 1,REMOVE
	ELSE
	REF1.TAG0.CHARGES --
	REF1.RESENDTOOLTIP 1
	ENDIF
ENDIF
DIALOG d_newcraft_dialog_bowcraft

[FUNCTION F_REPAIR_ITEM_BC]
IF (<ARGO.BASEID> == i_scroll_blank) && (<ARGO.TOPOBJ.UID> == <SRC.UID>)
ARGO.f_create_repair_contract 8
ELSE
LOCAL.SKILL=<DEF.<SERV.ITEMDEF.<ARGO.ID>.SKILLMAKE.1.KEY>>
LOCAL.SKILL &= ~0c0000000
	IF (!(<ARGO.MAXHITS>)) || (<ARGO.HITS> == <ARGO.MAXHITS>) || (<ARGO.TOPOBJ.UID> != <SRC.UID>)
	SRC.SYSMESSAGELOC -1,1047014
	ELIF (<LOCAL.SKILL> != 8)
	SRC.SYSMESSAGELOC -1,1061136
	ELSE
		IF (<R<EVAL <SRC.bowcraft>/10>> < <R<EVAL (<ARGO.MAXHITS>*10)/<ARGO.HITS>)>>)
		ARGO.MAXHITS --
			IF (<ARGO.MAXHITS> <= 0)
			ARGO.REMOVE
			SRC.SYSMESSAGELOC -1,500424
			ELSE
			ARGO.HITS=<ARGO.MAXHITS>
			SRC.SYSMESSAGELOC -1,1062782
			ENDIF
		ELSE
		ARGO.HITS=<ARGO.MAXHITS>
		SRC.SYSMESSAGELOC -1,500425
		ENDIF
	ARGO.RESENDTOOLTIP 1
	ENDIF
ENDIF
DIALOG d_newcraft_dialog_bowcraft

[FUNCTION F_BC_CHECK_FOR_MATERIALS]
FOR <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.COUNT>
	IF (<SERV.ITEMDEF.<SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.KEY>.TYPE> != T_INGOT)
		IF (<SRC.RESTEST <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>>>)
		LOCAL.OK ++
		ENDIF
	ELSE
		IF (<SRC.RESTEST <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.<dLOCAL._FOR>.VAL> i_ingot_<SRC.CTAG.BCMATERIAL>>)
		LOCAL.OK ++
		ENDIF
	ENDIF
ENDFOR
IF (!(<ISEMPTY <SRC.CTAG.BCMATERIAL>>))
	IF (!(<SRC.RESTEST 12 i_ingot_<SRC.CTAG.BCMATERIAL>>))
	RETURN 0
	ENDIF
ENDIF
IF (<LOCAL.OK> < <SERV.ITEMDEF.<SRC.CTAG.BC.ITEM>.RESOURCES.COUNT>)
RETURN 0
ELSE
RETURN 1
ENDIF

[FUNCTION F_SELECT_BCITEM]
DOSWITCH <ARGN1>
SRC.CTAG.BC.ITEM=i_arrow_shaft
SRC.CTAG.BC.ITEM=i_arrow
SRC.CTAG.BC.ITEM=i_xbolt
SRC.CTAG.BC.ITEM=i_bow
SRC.CTAG.BC.ITEM=i_crossbow
SRC.CTAG.BC.ITEM=i_crossbow_heavy
SRC.CTAG.BC.ITEM=i_composite_bow
SRC.CTAG.BC.ITEM=i_repeating_crossbow
SRC.CTAG.BC.ITEM=i_yumi
SRC.CTAG.BC.ITEM=i_elven_composite_longbow
SRC.CTAG.BC.ITEM=i_magical_shortbow
SRC.CTAG.BC.ITEM=i_blight_gripped_longbow
SRC.CTAG.BC.ITEM=i_faerie_fire
SRC.CTAG.BC.ITEM=i_silvani_feywood_bow
SRC.CTAG.BC.ITEM=i_mischief_maker
SRC.CTAG.BC.ITEM=i_the_night_reaper
ENDDO

[EOF]