//****************************************************************************
// SPHERE by : Menasoft ©1997-2007
// www.sphereserver.com
// All SPHERE script files and formats are copyright Menasoft & Partners.
// This file may be freely edited for personal use, but may not be distributed
// in whole or in part, in any format without express written permission from
// Menasoft & Partners.  All donations and contributions
// become the property of Menasoft & Partners.
//
// DO NOT MAKE CHANGES TO DEFAULT SCRIPTS! MAKE YOUR ALTERATIONS IN CUSTOM FILES!
//****************************************************************************
// FILE LAST UPDATED: 14-March-2007
VERSION=0.56b

[dialog d_Guild_Master]
5,25
If (<type>!=t_stone_guild)
  return 1
elif (<masteruid>!=<src.uid>)&&(!<src.isgm>)
  return 1
endif

  
page 0
resizepic 0 0 5054 570 400
resizepic 10 10 3000 550 380
dhtmlgump 20 15 510 25 0 0 <def0.center>GUILDMASTER FUNCTIONS<def0.centere>
If (<tag0.changename_time> <= <serv.time>)	// Set Guild Name
  button 20 40 4005 4007 1 0 1 
  dhtmlgump 55 40 240 30 0 0 Set the guild name.
else
  gumppic 20 40 4020
  dhtmlgump 55 40 370 30 0 0 Set the guild name. N/A FOR <f_stonesys_determine_timeleft <tag0.changename_time>>
endif
If (<tag0.changeabbrev_time> <= <serv.time>)	// Set Guild Abbrev
  button 20 70 4005 4007 1 0 2 
  dhtmlgump 55 70 240 30 0 0 Set the guild's abbreviation.
else
  gumppic 20 70 4020
  dhtmlgump 55 70 370 30 0 0 Set the guild's abbreviation. N/A FOR <f_stonesys_determine_timeleft <tag0.changeabbrev_time>>
endif
If (<f_guildsys_iswarring>)
  gumppic 20 100 4020
  dhtmlgump 55 100 450 30 0 0 Change alignment. N/A DURING WARs // Guild Type
elif (<tag0.changealign_time> <= <serv.time>)
  button 20 100 4005 4007 1 0 3
  dhtmlgump 55 100 450 30 0 0 Change alignment: Currently <def0.guildconfig_align_<align>> // Guild Type
else
  gumppic 20 100 4020
  dhtmlgump 55 100 450 30 0 0 Change alignment. N/A FOR <f_stonesys_determine_timeleft <tag0.changealign_time>> // Guild Type
endif
dhtmlgump 55 130 200 30 0 0 Set the guild's charter.
  button 20 130 4005 4007 1 0 4	// Set Charter
If (<member.count> > 1)	// Dismiss a member
  dhtmlgump 55 160 200 30 0 0 Dismiss a member.
  button 20 160 4005 4007 1 0 5
else
  dhtmlgump 55 160 200 30 0 0 Dismiss a member. NO MEMBERS
  gumppic 20 160 4020
endif
dhtmlgump 55 190 200 30 0 0 Go to the War Menu.
  button 20 190 4005 4007 1 0 6	// War Menu
If (<member.count <def0.STONEPRIV_CANDIDATE>> > 0) // Candidates
  button 20 220 4005 4007 1 0 7
  dhtmlgump 55 220 240 30 0 0 Administer the list of candidates
else
  gumppic 20 220 4020
  dhtmlgump 55 220 320 30 0 0 There are currently no candidates for membership.
endif
dhtmlgump 55 250 240 30 0 0 Set the guildmaster's title.
  button 20 250 4005 4007 1 0 8 // Master Title
If (<member.count> > 1) // Grant Titles
  dhtmlgump 55 280 300 30 0 0 Grant a title to another member.
  button 20 280 4005 4007 1 0 9
else
  dhtmlgump 55 280 300 30 0 0 Grant a title to another member. NO MEMBERS
  gumppic 20 280 4020
endif
If (<def0.GUILDCONFIG_ALLOWTELEPORT>) // Teleport the stone
  button 20 310 4005 4007 1 0 10
  dhtmlgump 55 310 240 30 0 0 Move this guildstone. <qval <tag0.stonesys_moveruid> ? IN PROGRESS. : >
else
  gumppic 20 310 4020
  dhtmlgump 55 310 240 30 0 0 Move this guildstone. NOT AVAILABLE.
endif
If (<def0.GUILDCONFIG_ALLOWTRANSFER>) // Transfer the stone
  button 300 310 4005 4007 1 0 12
  dhtmlgump 335 310 200 30 0 0 Transfer ownership.
else
  gumppic 300 310 4020
  dhtmlgump 335 310 240 30 0 0 Transfer ownership. NOT AVAILABLE.
endif
dhtmlgump 55 360 175 30 0 0 Return to the main menu.
  button 20 360 4005 4007 1 0 11 // Return
dhtmlgump 335 360 100 30 0 0 EXIT
  button 300 360 4005 4007 1 0 0 // Exit
  

[dialog d_Guild_Master Button]
ON=0 12
  If (<argn1>==0) // Exit Gump
    //sdialog d_Guild_Main,0
    return 1
  elif (<masteruid>!=<src.uid>)&&(!<src.isgm>)
    src.sdialog d_Guild_Main,0
    return 1
  endif

  If (<argn1>==1)	// Guild Name    
    If (<tag0.changename_time> <= <serv.time>)
      src.ctag.guild_prompthandler_guilduid=<uid>
      try src.promptconsole f_prompthandler_guildname,Enter new guild name (min: <dDEF0.GUILDCONFIG_NAME_MINLENGTH> max: <dDEF0.GUILDCONFIG_NAME_MAXLENGTH>):
    endif
  elif (<argn1>==2)	// Guild Abbrev
    If (<tag0.changeabbrev_time> <= <serv.time>)
      src.ctag.guild_prompthandler_guilduid=<uid>
      try src.promptconsole f_prompthandler_guildabbrev,Enter new guild abbreviation (min: <dDEF0.GUILDCONFIG_ABBREV_MINLENGTH> max: <dDEF0.GUILDCONFIG_ABBREV_MAXLENGTH>):    
    endif
  elif (<argn1>==3)	// Guild  Type
    If ((!<f_guildsys_iswarring>) || (<tag0.changealign_time> <= <serv.time>))
      sdialog d_Guild_ChangeAlign,0
    endif
  elif (<argn1>==4)	// Charter
    sdialog d_Guild_SetCharter,0,
  elif (<argn1>==5)	// Dismiss member
    sdialog d_Guild_CharList,0,<def0.GUILDDLG_LISTTYPE_DISMISSMEMBER>
  elif (<argn1>==6)	// War Menu
    sdialog d_Guild_Master_Warfare,0
  elif (<argn1>==7)	// Candidate Menu
    sdialog d_Guild_CharList,0,<def0.GUILDDLG_LISTTYPE_ADMINCANDIDATES>
  elif (<argn1>==8)	// Set Guildmaster title
    src.ctag.guild_prompthandler_guilduid=<uid>
    src.ctag.guild_prompthandler_thisuid=<src.uid>
    try src.promptconsole f_prompthandler_guildtitle,New title (<dDEF0.GUILDCONFIG_TITLE_MAXLENGTH> characters max):
  elif (<argn1>==9)	// Grant title
    sdialog d_Guild_CharList,0,<def0.GUILDDLG_LISTTYPE_GRANTTITLE>
  elif (<argn1>==10)	// Move stone
    If (<def0.GUILDCONFIG_ALLOWTELEPORT>)
      if ( <tag0.stonesys_moveruid> )
        ref1 = <tag0.stonesys_moveruid>
        ref1.link = 0
        ref1.remove
      endif
      
      serv.newitem i_stone_mover
      new.link = <uid>
      new.attr = attr_newbie
      tag.stonesys_moveruid = <new.uid>
      new.cont <src.findlayer(layer_pack).uid>
      src.sysmessage @038A Use the teleporting object placed in your backpack to move this guildstone.
      sdialog d_Guild_Master,0
    endif
  elif (<argn1>==11)
    sdialog d_Guild_Main,0
  elif (<argn1>==12)
    If (<def0.GUILDCONFIG_ALLOWTRANSFER>)
      transferstone <uid>
    endif
  endif
  return 1
  
[EOF]
  
