//****************************************************************************
// 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_Town_ViewCharter]
5,25
If (<type>!=t_stone_town)
  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
  
page 0
resizepic 0 0 5054 550 400
resizepic 10 10 3000 530 380
dhtmlgump 55 360 300 35 0 0 Return to the main menu.
  button 20 360 4005 4007 1 0 0 // Return

If (<isempty <charter0>>)
  local.noempty=0
  local.chartertext=<def0.br>
else
  local.noempty=1
  local.chartertext=<charter0><def0.br>
endif
For _line 1 5
  If (<isempty <charter<dlocal._line>>>)
    local.chartertext .= <def0.br>
  else
    local.chartertext .= <charter<dlocal._line>><def0.br>
    local.noempty += 1
  endif
endfor

If (!<local.noempty>)
  dhtmlgump 20 20 500 35 0 0 No charter has been defined.
else
  dhtmlgump 20 20 500 150 0 1 <local.chartertext>
endif

dhtmlgump 55 200 300 20 0 0 Visit the town website : 
  button 20 200 4005 4007 1 0 1 // Website
  local.website=<webpage>
  If (<eval Strlen(<local.website>)> <= 3) // A website cant be that small
    local.website=<serv.url>
  endif
  dhtmlgump 50 220 300 20 0 0 <local.website>


[dialog d_Town_ViewCharter Button]
ON=0 1    
  If (<argn1>==0)	// Exit Gump
    sdialog d_Town_Main,0
  elif (<argn1>==1)	// Website
    local.website=<webpage>
    If (<eval Strlen(<local.website>)> <= 3) // A website cant be that small
     local.website=<serv.url>
    endif
    src.weblink <local.website>
  endif
  return 1


//------------------------------------------------------------------------
[dialog d_Town_SetCharter]
110, 70
If (<type>!=t_stone_town)
  return 1
elif (<masteruid>!=<src.uid>)&&(!<src.isgm>)
  return 1
endif

page 0
resizepic 0 0 2520 350 400
tilepic 30 50 3805
tilepic 275 50 3805
gumppic 76 126 95
gumppic 85 135 96
gumppic 264 126 97
dtext 65 35 2301 <name>
dtext 110 70 0 Set Town Charter
dtext 120 85 0 and Web Link
dtext 140 115 0 Charter
dtext 125 290 0 Web Link
gumppic 76 301 95
gumppic 85 310 96
gumppic 264 301 97
dtext 40 370 0 Save this information
button 195 370 2130 2129 1 0 1
button 255 370 2121 2120 1 0 0
gumppic 40 152 1143
dtextentry 50 155 250 32 0 1000 <charter0>
gumppic 40 174 1143
dtextentry 50 177 250 32 0 1001 <charter1>
gumppic 40 196 1143
dtextentry 50 199 250 32 0 1002 <charter2>
gumppic 40 218 1143
dtextentry 50 221 250 32 0 1003 <charter3>
gumppic 40 240 1143
dtextentry 50 243 250 32 0 1004 <charter4>
gumppic 40 262 1143
dtextentry 50 265 250 32 0 1005 <charter5>
gumppic 40 328 1143
dtextentry 50 331 250 32 0 1006 <webpage>


[dialog d_Town_SetCharter Button]
ON=0 1
  If (<masteruid>!=<src.uid>)&&(!<src.isgm>)
    return 1
  endif
  
  If ( <argn1> == 1 ) // Set the values
    charter0=<argtxt[1000]>
    charter1=<argtxt[1001]>
    charter2=<argtxt[1002]>
    charter3=<argtxt[1003]>
    charter4=<argtxt[1004]>
    charter5=<argtxt[1005]>
    webpage=<argtxt[1006]>
  endif
  sdialog d_Town_Master,0
  return 1

[EOF]
