guild_building_melt={["start"]=0,GetOreRefineCost= function (cost)if pc . empire ~= npc . empire then 
return 3 * cost 
end 
if pc . get_guild ( ) == npc . get_guild ( ) then 
return cost * 0.9 
end 
return cost 
end ,GetOreRefineGoodPct= function ()return 60 
end ,GetOreRefineBadPct= function ()return 30 
end ,GetMyRefineNum= function (race)return ( { 
[ 20060 ] = 50601 , 
[ 20061 ] = 50602 , 
[ 20062 ] = 50603 , 
[ 20063 ] = 50604 , 
[ 20064 ] = 50605 , 
[ 20065 ] = 50606 , 
[ 20066 ] = 50607 , 
[ 20067 ] = 50608 , 
[ 20068 ] = 50609 , 
[ 20069 ] = 50610 , 
[ 20070 ] = 50611 , 
[ 20071 ] = 50612 , 
[ 20072 ] = 50613 , 
[ 33009 ] = 50614 , 
[ 33010 ] = 50615 , 
[ 33011 ] = 50616 , 
[ 33012 ] = 50617 , 
[ 33013 ] = 50618 
} ) [ race ] 
end ,IsRefinableRawOre= function (vnum)return vnum >= 50601 and vnum <= 50618 
end ,DoRefineDiamond= function (pct)local from_postfix 
local from_name = item_name ( item . vnum ) 
local to_vnum = item . vnum + 20 
local to_name = item_name ( to_vnum ) 
local to_postfix 
say ( gameforge . guild_building_melt . _10_say ) 
if item . count >= 100 then 
say ( string . format ( gameforge . guild_building_melt . _20_say , pct , guild_building_melt . GetOreRefineCost ( 10000 ) ) ) 
local s = select ( gameforge . locale . guild . yes , gameforge . locale . guild . no ) 
if s == 1 then 
if pc . get_gold ( ) < guild_building_melt . GetOreRefineCost ( 10000 ) then 
say ( gameforge . guild_building_melt . _30_say ) 
return 
end 
if pc . diamond_refine ( 10000 , pct ) then 
say ( gameforge . guild_building_melt . _40_say ) 
say_item ( to_name , to_vnum , "" ) 
else 
say ( gameforge . guild_building_melt . _50_say ) 
end 
end 
else 
say ( string . format ( gameforge . guild_building_melt . _60_say , from_name ) ) 
end 
end ,DoRefine= function (pct)local from_postfix 
local from_name = item_name ( item . vnum ) 
local to_vnum = item . vnum + 20 
local to_name = item_name ( to_vnum ) 
local to_postfix 
say ( string . format ( gameforge . guild_building_melt . _70_say , from_name , to_name ) ) 
if item . count >= 100 then 
say ( string . format ( gameforge . guild_building_melt . _20_say , pct , guild_building_melt . GetOreRefineCost ( 3000 ) ) ) 
local s = select ( gameforge . locale . guild . yes , gameforge . locale . guild . no ) 
if s == 1 then 
if pc . get_gold ( ) < guild_building_melt . GetOreRefineCost ( 3000 ) then 
say ( gameforge . guild_building_melt . _30_say ) 
return 
end 
local selected_item_cell = select_item ( ) 
if selected_item_cell == 0 then 
say ( gameforge . guild_building_melt . _90_say ) 
return 
end 
local old_item = item . get_id ( ) 
if ( not item . select_cell ( selected_item_cell ) ) or item . vnum < 28000 or item . vnum >= 28300 then 
say ( gameforge . guild_building_melt . _100_say ) 
return 
end 
item . select ( old_item , old_item ) 
if pc . ore_refine ( 3000 , pct , selected_item_cell ) then 
say ( gameforge . guild_building_melt . _120_say ) 
say_item ( to_name , to_vnum , "" ) 
else 
say ( gameforge . guild_building_melt . _50_say ) 
end 
end 
else 
say ( string . format ( gameforge . guild_building_melt . _60_say , from_name ) ) 
end 
end }