//****************************************************************************
//SPHERE by : Menasoft ©1997-2007
//www.sphereserver.net
// 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.
//****************************************************************************
// FILE LAST UPDATED: 14-March-2007
VERSION=0.56b
	
[dialog d_Guild_Main]
5,25
src.closealldialogs
If (<type>!=t_stone_guild)
  return 1
elif (<memberfromuid.<src.uid>.uid>!=<src.uid>)&&(!<src.isgm>)
  return 1
endif
  local.charpriv=<QVAL <src.isgm> ? <def0.STONEPRIV_MASTER>:<memberfromuid.<src.uid>.priv>>
If (<local.charpriv>!=<def0.STONEPRIV_MEMBER>)&&(<local.charpriv>!=<def0.STONEPRIV_MASTER>)
  return 1
endif

//----The Gump----
page 0
resizepic 0 0 5054 550 400
resizepic 10 10 3000 530 380
dhtmlgump 20 15 220 35 0 0 Guild: <name>
  If (<masteruid>)
    local.mastername=<mastergendertitle>: <qval (<eval strlen(<mastertitle>)>) ? <mastertitle> :><master>
    dhtmlgump 275 15 250 20 0 0 <local.mastername>
  endif

dhtmlgump 55 50 100 20 0 0 Loyal to: 
local.loyalto=<memberfromuid.<src.uid>.loyalto>
dhtmlgump 55 70 470 20 0 0 <qval (!<local.loyalto>)||(<local.loyalto>==<src.uid>) ? yourself:<uid.<local.loyalto>.name>>
  button 20 50 4005 4007 1 0 1 

dhtmlgump 275 50 470 20 0 0 Display guild abbreviation: <abbrev>
dhtmlgump 275 70 90 20 0 0 Currently: <AbbreviationToggle>
  button 240 50 4005 4007 1 0 2

dhtmlgump 55 100 240 30 0 0 View the current roster.
  button 20 100 4005 4007 1 0 3

dhtmlgump 55 130 240 30 0 0 Recruit someone into the guild.
  button 20 130 4005 4007 1 0 4

If (<member.count <def0.STONEPRIV_CANDIDATE>>)
  button 20 160 4005 4007 1 0 5
  dhtmlgump 55 160 380 30 0 0 View list of candidates who have been sponsored to the guild.
else
  button 20 160 4020 4020 0 0 0 
  dhtmlgump 55 160 320 30 0 0 There are currently no candidates for membership.
endif

dhtmlgump 55 220 240 30 0 0 View the guild's charter.
  button 20 220 4005 4007 1 0 6
dhtmlgump 55 250 240 30 0 0 Resign from the guild.
  button 20 250 4005 4007 1 0 7
dhtmlgump 55 280 240 30 0 0 View the guild's wartime status.
  button 20 280 4005 4007 1 0 8

If (<src.isgm>)||(<masteruid>==<src.uid>)
  button 20 310 4005 4007 1 0 9
  dhtmlgump 55 310 240 30 0 0 Access guildmaster functions.
else
  button 20 310 4020 4020 0 0 0
  dhtmlgump 55 310 240 30 0 0 Reserved for guildmaster.
endif

dhtmlgump 55 360 470 30 0 0 EXIT
  button 20 360 4005 4007 1 0 0

dhtmlgump 320 345 470 20 0 0 Alliance Points:
dhtmlgump 320 365 120 20 0 0 <dTAG0.ALLYPOINTS>

If (<src.isgm>)||(<masteruid>==<src.uid>)
button 280 345 4005 4007 1 0 10
endif

[dialog d_Guild_Main Button]
ON=0 10
If (<argn1>==0) // Exit Gump
  return 1
endif

If (<argn1>==1 )	// Declare LoyalTo Dialog
  sdialog d_Guild_CharList,0,<def0.GUILDDLG_LISTTYPE_LOYALITY>
elif (<argn1>==2)	// Abbreviation Switch
  toggleabbreviation <src.uid>
  sdialog d_Guild_Main,0,<uid>
elif (<argn1>==3)	// Roster List
  sdialog d_Guild_CharList,0,<def0.GUILDDLG_LISTTYPE_ROSTER>
elif (<argn1>==4)	// Recruit New Member
  src.targetf f_guildsys_recruitguy <uid>
  src.sysmessage Select a character to recruit
elif (<argn1>==5)	// Candidates list
  sdialog  d_Guild_CharList,0,<def0.GUILDDLG_LISTTYPE_CANDIDATES>
elif (<argn1>==6)	// Guild charter
  sdialog d_Guild_ViewCharter,0,<uid>
elif (<argn1>==7)	// Resign
  resign
elif (<argn1>==8)	// Enemies
  sdialog d_Guild_WarfareStatus,0,<uid>
elif (<argn1>==9)	// Guildmaster Menu
  If (<src.isgm>)||(<masteruid>==<src.uid>)
    sdialog d_Guild_Master,0
  endif
elif (<argn1>==10)
sdialog d_guild_domination
endif
return 1
	
[EOF]