////////////////////////////////////////////////////////////////////////////////
[FUNCTION CREATEMAP]
SDIALOG D_CREATEMAP 0
RETURN 1
[DIALOG D_CREATEMAP]
806,0
NOMOVE
PAGE 0
PAGE 1
IF !<TAG0.CREATEMAP.RECTS>
TAG.CREATEMAP.RECTS 5
ENDIF
RESIZEPIC 0 0 2620 345 <EVAL 240+(<dTAG.CREATEMAP.RECTS>*20)>
GUMPPICTILED 5 5 335 <EVAL 230+(<dTAG.CREATEMAP.RECTS>*20)> 2604
GUMPPICTILED 5 5 335 20 2624
GUMPPICTILED 5 30 335 <EVAL 205+(<dTAG.CREATEMAP.RECTS>*20)> 2624
FOR 1 <EVAL 5+<dTAG.CREATEMAP.RECTS>>
GUMPPICTILED 70 <EVAL 61+(<dLOCAL._FOR>*20)> 220 18 2604
ENDFOR
CHECKERTRANS 5 5 335 <EVAL 230+(<dTAG.CREATEMAP.RECTS>*20)>
DHTMLGUMP 5 5 335 20 0 0 <DEF.BFONT_WHITE><DEF.CENTER>Map Create Assistant
DHTMLGUMP 10 40 80 20 0 0 <DEF.BFONT_GREEN>Choose type:
RADIO 90 40 210 211 1 1001
DHTMLGUMP 120 40 60 20 0 0 <DEF.BFONT_WHITE>AreaDEF
RADIO 180 40 210 211 0 1002
DHTMLGUMP 210 40 60 20 0 0 <DEF.BFONT_WHITE>RoomDEF
DHTMLGUMP 10 80 80 20 0 0 <DEF.BFONT_WHITE>Defname
DTEXTENTRYLIMITED 75 80 210 20 0481 1 100 <TAG.CREATEMAP.DEFNAME>
BUTTON 295 83 1209 1210 1 0 1
DHTMLGUMP 10 100 80 20 0 0 <DEF.BFONT_WHITE>Name
DTEXTENTRYLIMITED 75 100 210 20 0481 2 100 <TAG.CREATEMAP.NAME>
BUTTON 295 103 1209 1210 1 0 2
DHTMLGUMP 10 120 80 20 0 0 <DEF.BFONT_WHITE>Group
DTEXTENTRYLIMITED 75 120 210 20 0481 3 100 <TAG.CREATEMAP.GROUP>
BUTTON 295 123 1209 1210 1 0 3
DHTMLGUMP 10 140 80 20 0 0 <DEF.BFONT_WHITE>P
DTEXTENTRYLIMITED 75 140 210 20 0481 4 100 <TAG0.CREATEMAP.P>
BUTTON 50 143 1209 1210 1 0 4
BUTTON 295 143 1209 1210 1 0 5
DHTMLGUMP 10 160 80 20 0 0 <DEF.BFONT_WHITE>RECTS
DTEXTENTRYLIMITED 75 160 210 20 0481 5 100 <dTAG0.CREATEMAP.RECTS>
BUTTON 295 163 1209 1210 1 0 6
FOR 1 <dTAG.CREATEMAP.RECTS>
DHTMLGUMP 10 <EVAL 160+(<dLOCAL._FOR>*20)> 80 20 0 0 <DEF.BFONT_WHITE>RECT <dLOCAL._FOR>
DTEXTENTRYLIMITED 75 <EVAL 160+(<dLOCAL._FOR>*20)> 210 20 <EVAL 6+(<dLOCAL._FOR>)*10> 3 100 <TAG0.CREATEMAP.RECT.<dLOCAL._FOR>>
BUTTON 295 <EVAL 163+(<dLOCAL._FOR>*20)> 1209 1210 1 0 <EVAL 10000+<dLOCAL._FOR>>
BUTTON 315 <EVAL 163+(<dLOCAL._FOR>*20)> 1209 1210 1 0 <EVAL 20000+<dLOCAL._FOR>>
ENDFOR
BUTTON 145 <EVAL 195+(<dTAG.CREATEMAP.RECTS>*20)> 2128 2130 1 0 7
// REMOTE CONTROL
RESIZEPIC 0 <EVAL 240+(<dTAG.CREATEMAP.RECTS>*20)> 2620 345 150
GUMPPICTILED 105 <EVAL 250+(<dTAG.CREATEMAP.RECTS>*20)> 135 130 2604
CHECKERTRANS 5 <EVAL 245+(<dTAG.CREATEMAP.RECTS>*20)> 335 140
BUTTON 147 <EVAL 10+240+(<dTAG.CREATEMAP.RECTS>*20)> 4500 4500 1 0 11
BUTTON 197 <EVAL 4+240+(<dTAG.CREATEMAP.RECTS>*20)> 4501 4501 1 0 12
BUTTON 190 <EVAL 50+240+(<dTAG.CREATEMAP.RECTS>*20)> 4502 4502 1 0 13
BUTTON 194 <EVAL 97+240+(<dTAG.CREATEMAP.RECTS>*20)> 4503 4503 1 0 14
BUTTON 147 <EVAL 90+240+(<dTAG.CREATEMAP.RECTS>*20)> 4504 4504 1 0 15
BUTTON 98 <EVAL 97+240+(<dTAG.CREATEMAP.RECTS>*20)> 4505 4505 1 0 16
BUTTON 105 <EVAL 50+240+(<dTAG.CREATEMAP.RECTS>*20)> 4506 4506 1 0 17
BUTTON 98 <EVAL 4+240+(<dTAG.CREATEMAP.RECTS>*20)> 4507 4507 1 0 18
BUTTON 162 <EVAL 66+240+(<dTAG.CREATEMAP.RECTS>*20)> 210 210 1 0 19
BUTTON 326 <EVAL 221+(<dTAG.CREATEMAP.RECTS>*20)> 10741 10742 1 0 20
DHTMLGUMP 35 <EVAL -50+240+(<dTAG.CREATEMAP.RECTS>*20)> 100 20 0 0 <DEF.BFONT_RED>Set Events
BUTTON 10 <EVAL -50+240+(<dTAG.CREATEMAP.RECTS>*20)> 1209 1210 0 2 0
DHTMLGUMP 35 <EVAL -30+240+(<dTAG.CREATEMAP.RECTS>*20)> 100 20 0 0 <DEF.BFONT_LGREEN>Set Flags
BUTTON 10 <EVAL -30+240+(<dTAG.CREATEMAP.RECTS>*20)> 1209 1210 0 3 0
PAGE 2
RESIZEPIC 0 0 2620 345 <EVAL 100+(<dDEF.EVENTS.TOTAL>*20)>
GUMPPICTILED 5 5 335 <EVAL 90+(<dDEF.EVENTS.TOTAL>*20)> 2604
GUMPPICTILED 5 5 335 <EVAL 90+(<dDEF.EVENTS.TOTAL>*20)> 2624
CHECKERTRANS 5 5 335 <EVAL 90+(<dDEF.EVENTS.TOTAL>*20)>
DHTMLGUMP 5 5 335 20 0 0 <DEF.BFONT_RED><DEF.CENTER>Set Events
IF !STRMATCH(*,*,<TAG0.CREATEMAP.EVENTS>)
TAG.CREATEMAP.EVENTS 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
ENDIF
DHTMLGUMP 35 35 335 20 0 0 <DEF.BFONT_WHITE>Set Default Events
BUTTON 15 38 1209 1210 1 0 500
DHTMLGUMP 35 55 335 20 0 0 <DEF.BFONT_WHITE>BACK
BUTTON 15 58 1209 1210 0 1 0
FOR 1 <dDEF.EVENTS.TOTAL>
DTEXT 35 <EVAL 65+<dLOCAL._FOR>*20> <QVAL <EVAL <GETARGVX <dLOCAL._FOR>,<TAG.CREATEMAP.EVENTS>>>==1?044:020> <DEF.EVENTS.<dLOCAL._FOR>>
BUTTON 15 <EVAL 68+<dLOCAL._FOR>*20> 1209 1210 1 0 <EVAL 500+<dLOCAL._FOR>>
ENDFOR
PAGE 3
RESIZEPIC 0 0 2620 345 <EVAL 100+(<dDEF.FLAGS.TOTAL>*20)>
GUMPPICTILED 5 5 335 <EVAL 90+(<dDEF.FLAGS.TOTAL>*20)> 2604
GUMPPICTILED 5 5 335 <EVAL 90+(<dDEF.FLAGS.TOTAL>*20)> 2624
CHECKERTRANS 5 5 335 <EVAL 90+(<dDEF.FLAGS.TOTAL>*20)>
DHTMLGUMP 5 5 335 20 0 0 <DEF.BFONT_LGREEN><DEF.CENTER>Set Flags
IF !STRMATCH(*,*,<TAG0.CREATEMAP.FLAGS>)
TAG.CREATEMAP.FLAGS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ENDIF
DHTMLGUMP 35 35 335 20 0 0 <DEF.BFONT_WHITE>Set Default Flags
BUTTON 15 38 1209 1210 1 0 600
DHTMLGUMP 35 55 335 20 0 0 <DEF.BFONT_WHITE>BACK
BUTTON 15 58 1209 1210 0 1 0
FOR 1 <dDEF.FLAGS.TOTAL>
DTEXT 35 <EVAL 65+<dLOCAL._FOR>*20> <QVAL <EVAL <GETARGVX <dLOCAL._FOR>,<TAG.CREATEMAP.FLAGS>>>==1?044:020> <DEF.FLAGS.<dLOCAL._FOR>>
BUTTON 15 <EVAL 68+<dLOCAL._FOR>*20> 1209 1210 1 0 <EVAL 600+<dLOCAL._FOR>>
ENDFOR
[DIALOG D_CREATEMAP BUTTON]
ON=500
TAG.CREATEMAP.EVENTS 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
SDIALOG D_CREATEMAP 2
RETURN 1
ON=501 517 // CHANGE HERE IF YOU INCREASE THE DEF.EVENTS.TOTAL... IT SHOULD BE 500+<dDEF.EVENTS.TOTAL>
LOCAL.BUTTON <EVAL <ARGN1>-500>
FOR 1 <dDEF.EVENTS.TOTAL>>
LOCAL.STR.<dLOCAL._FOR>=<GETARGVX <dLOCAL._FOR>,<TAG.CREATEMAP.EVENTS>>
ENDFOR
LOCAL.STR.<dLOCAL.BUTTON> <QVAL <EVAL <GETARGVX <dLOCAL.BUTTON>,<TAG.CREATEMAP.EVENTS>>>==1?0:1>
TAG.CREATEMAP.EVENTS <dLOCAL.STR.1>
FOR 2 <dDEF.EVENTS.TOTAL>>
TAG.CREATEMAP.EVENTS .= ,<dLOCAL.STR.<dLOCAL._FOR>>
ENDFOR
SDIALOG D_CREATEMAP 2
RETURN 1
ON=600
TAG.CREATEMAP.FLAGS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
SDIALOG D_CREATEMAP 3
RETURN 1
ON=601 616 // CHANGE HERE IF YOU INCREASE THE DEF.FLAGS.TOTAL... IT SHOULD BE 600+<dDEF.FLAGS.TOTAL>
LOCAL.BUTTON <EVAL <ARGN1>-600>
FOR 1 <dDEF.FLAGS.TOTAL>>
LOCAL.STR.<dLOCAL._FOR>=<GETARGVX <dLOCAL._FOR>,<TAG.CREATEMAP.FLAGS>>
ENDFOR
LOCAL.STR.<dLOCAL.BUTTON> <QVAL <EVAL <GETARGVX <dLOCAL.BUTTON>,<TAG.CREATEMAP.FLAGS>>>==1?0:1>
TAG.CREATEMAP.FLAGS <dLOCAL.STR.1>
FOR 2 <dDEF.FLAGS.TOTAL>>
TAG.CREATEMAP.FLAGS .= ,<dLOCAL.STR.<dLOCAL._FOR>>
ENDFOR
SDIALOG D_CREATEMAP 3
RETURN 1
ON=1 3
TAG.CREATEMAP.DEFNAME <ARGTXT[1]>
TAG.CREATEMAP.NAME <ARGTXT[2]>
TAG.CREATEMAP.GROUP <ARGTXT[3]>
SDIALOG D_CREATEMAP
RETURN 1
ON=4
TAG.CREATEMAP.P <P.X>,<P.Y>,<P.Z>,<MAP>
SDIALOG D_CREATEMAP
RETURN 1
ON=5
TAG.CREATEMAP.P <ARGTXT[4]>
SDIALOG D_CREATEMAP
RETURN 1
ON=6
IF (<EVAL <ARGTXT[5]>> > 0) && (<EVAL <ARGTXT[5]>> <= 19)
TAG.CREATEMAP.RECTS <ARGTXT[5]>
ENDIF
SDIALOG D_CREATEMAP
RETURN 1
ON=10001 10019
LOCAL.BUTTON <EVAL <ARGN1>-10000>
TAG.CREATEMAP.RECT.<dLOCAL.BUTTON>.1 <P.X>,<P.Y>
TAG.CREATEMAP.RECT.<dLOCAL.BUTTON> "<TAG0.CREATEMAP.RECT.<dLOCAL.BUTTON>.1>,<TAG0.CREATEMAP.RECT.<dLOCAL.BUTTON>.2>,<MAP>"
SDIALOG D_CREATEMAP
RETURN 1
ON=20001 20019
LOCAL.BUTTON <EVAL <ARGN1>-20000>
TAG.CREATEMAP.RECT.<dLOCAL.BUTTON>.2 <P.X>,<P.Y>
TAG.CREATEMAP.RECT.<dLOCAL.BUTTON> "<TAG0.CREATEMAP.RECT.<dLOCAL.BUTTON>.1>,<TAG0.CREATEMAP.RECT.<dLOCAL.BUTTON>.2>,<MAP>"
SDIALOG D_CREATEMAP
RETURN 1
ON=7
IF <ARGCHKID> == 1001
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp [AREADEF <TAG.CREATEMAP.DEFNAME>]
SYSMESSAGE @044,,1 AreaDEF [<TAG.CREATEMAP.DEFNAME>] successful created!
ELSE
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp [ROOMDEF <TAG.CREATEMAP.DEFNAME>]
SYSMESSAGE @044,,1 RoomDEF [<TAG.CREATEMAP.DEFNAME>] successful created!
ENDIF
IF STRMATCH(*1*,<TAG.CREATEMAP.EVENTS>)
LOCAL.EVENTS EMPTY
FOR 1 <dDEF.EVENTS.TOTAL>
IF <GETARGVX <dLOCAL._FOR>,<TAG.CREATEMAP.EVENTS>>
LOCAL.EVENTS .= ,<DEF.EVENTS.<dLOCAL._FOR>>
ENDIF
ENDFOR
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp EVENTS=<STREAT <LOCAL.EVENTS>>
ENDIF
TAG.CREATEMAP.EVENTS 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
IF STRMATCH(*1*,<TAG.CREATEMAP.FLAGS>)
LOCAL.FLAGS EMPTY
FOR 1 <dDEF.FLAGS.TOTAL>
IF <GETARGVX <dLOCAL._FOR>,<TAG.CREATEMAP.FLAGS>>
LOCAL.FLAGS .= ,<DEF.FLAGS.<dLOCAL._FOR>>
ENDIF
ENDFOR
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp FLAGS=<STREAT <LOCAL.FLAGS>>
ENDIF
TAG.CREATEMAP.FLAGS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp NAME=<TAG.CREATEMAP.NAME>
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp GROUP=<TAG.CREATEMAP.GROUP>
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp P=<TAG.CREATEMAP.P>
FOR 1 <dTAG.CREATEMAP.RECTS>
WRITEFILE maps/<TAG.CREATEMAP.DEFNAME>.scp RECT=<TAG.CREATEMAP.RECT.<dLOCAL._FOR>>
ENDFOR
SDIALOG D_CREATEMAP
RETURN 1
ON=11
MOVE NW 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=12
MOVE N 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=13
MOVE NE 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=14
MOVE E 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=15
MOVE SE 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=16
MOVE S 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=17
MOVE SW 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=18
MOVE W 1
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=19
FIX
SDIALOG D_CREATEMAP
RETURN 1
ON=20
FOR 1 19
TAG.CREATEMAP.RECT.<dLOCAL._FOR>
TAG.CREATEMAP.RECT.<dLOCAL._FOR>.1
TAG.CREATEMAP.RECT.<dLOCAL._FOR>.2
ENDFOR
SDIALOG D_CREATEMAP
RETURN 1
////////////////////////////////////////////////////////////////////////////////
[FUNCTION WRITEFILE]
IF !(<FILE.INUSE>)
FILE.MODE.CREATE=1
FILE.MODE.APPEND=1
FILE.MODE.WRITEFLAG=1
IF (<FILE.OPEN <STRARG <ARGS>>>)
FILE.WRITELINE <STREAT <ARGS>>
FILE.CLOSE
ENDIF
ENDIF
////////////////////////////////////////////////////////////////////////////////
[DEFNAME CREATEMAP.DEFS]
EVENTS.TOTAL 17
EVENTS.1 r_default
EVENTS.2 r_default_rock
EVENTS.3 r_default_water
EVENTS.4 r_default_tree
EVENTS.5 r_default_grass
EVENTS.6 r_water
EVENTS.7 r_brit
EVENTS.8 r_brit_castle
EVENTS.9 r_guard_tower
EVENTS.10 r_black_castle
EVENTS.11 r_bucs_den
EVENTS.12 r_spooky
EVENTS.13 r_dungeon
EVENTS.14 r_plains
EVENTS.15 r_forests
EVENTS.16 r_jungle
EVENTS.17 r_swamp
FLAGS.TOTAL 16
FLAGS.1 region_antimagic_all
FLAGS.2 region_antimagic_recall_in
FLAGS.3 region_antimagic_recall_out
FLAGS.4 region_antimagic_gate
FLAGS.5 region_antimagic_teleport
FLAGS.6 region_antimagic_damage
FLAGS.7 region_flag_ship
FLAGS.8 region_flag_nobuilding
FLAGS.9 region_flag_globalname
FLAGS.10 region_flag_announce
FLAGS.11 region_flag_insta_logout
FLAGS.12 region_flag_underground
FLAGS.13 region_flag_nodecay
FLAGS.14 region_flag_safe
FLAGS.15 region_flag_guarded
FLAGS.16 region_flag_no_pvp
////////////////////////////////////////////////////////////////////////////////