|
37 | 37 | #include [casual] $currentmap_game_master |
38 | 38 |
|
39 | 39 | //Game master modules |
| 40 | +#include game_master/map_transitions |
40 | 41 | #include game_master/vote_generic |
41 | 42 |
|
42 | 43 | { game_spawn |
|
104 | 105 | callevent 0.1 setup_gm |
105 | 106 | callevent 1.0 gm_setup_weather |
106 | 107 | callevent 60.0 time_sync_check |
107 | | - |
108 | | - //Crash file name configuration |
109 | | - setvarg G_CRASHCFG game.cvar.ms_crashcfg |
110 | | - if ( G_CRASHCFG !contains '.cfg' ) |
111 | | - { |
112 | | - stradd G_CRASHCFG ".cfg" |
113 | | - } |
114 | 108 | } |
115 | 109 |
|
116 | 110 | { [server] time_sync_check |
|
150 | 144 | dodamage PARAM1 PARAM2 PARAM3 PARAM4 PARAM5 PARAM6 PARAM7 |
151 | 145 | } |
152 | 146 |
|
153 | | - |
154 | 147 | //Spawn gold bag post-mortem - |
155 | 148 | { [server] gold_spew //PARAM1=gold_per_bag PARAM2=bags_player PARAM3=dist_from_mon PARAM4=min#bags PARAM5 max#bags |
156 | 149 |
|
|
474 | 467 | } |
475 | 468 | } |
476 | 469 |
|
477 | | -{ gm_manual_map_change //[map] [destspawn] |
478 | | - |
479 | | - //redundancy, but maybe a bit late |
480 | | - setvard GM_DISABLE_TRANSITIONS 1 //tells msarea_transitions to disable code side, so they don't change spawns |
481 | | - if ( PARAM2 !startswith PARAM ) setvard GM_DEST_TRANS PARAM2 |
482 | | - if ( GM_DEST_TRANS isnot 'GM_DEST_TRANS' ) callexternal players ext_setspawn GM_DEST_TRANS |
483 | | - //saveallnow |
484 | | - |
485 | | - local L_MAP_NAME MAP_NAME |
486 | | - if ( PARAM1 isnot 'PARAM1' ) local L_MAP_NAME PARAM1 |
487 | | - messageall green Traveling to L_MAP_NAME |
488 | | - setvard F_MAP_NAME L_MAP_NAME |
489 | | - |
490 | | - erasefile G_CRASHCFG |
491 | | - local OUT_LINE "map " |
492 | | - local COMMENT "/" |
493 | | - stradd COMMENT "/" |
494 | | - strconc OUT_LINE F_MAP_NAME COMMENT written from MSC |
495 | | - writeline G_CRASHCFG OUT_LINE |
496 | | - local SRV_COMMAND "echo Changelevel: " |
497 | | - stradd SRV_COMMAND F_MAP_NAME |
498 | | - servercmd SRV_COMMAND |
499 | | - |
500 | | - setvarg G_WEATHER_LOCK clear |
501 | | - setvarg global.map.weather "clear;clear;clear" |
502 | | - setvarg G_OVERRIDE_WEATHER_CODE "clear;clear;clear" |
503 | | - setvarg G_CUR_WEATHER "clear" |
504 | | - setvarg G_IDLE_MUSIC none |
505 | | - setvarg G_IDLE_MUSIC_LENGTH 0 |
506 | | - setvarg G_COMBAT_MUSIC none |
507 | | - setvarg G_COMBAT_MUSIC_LENGTH 0 |
508 | | - setvarg G_MAP_ADDPARAMS 0 |
509 | | - |
510 | | - if ( G_SERVER_LOCKED ) |
511 | | - { |
512 | | - local SV_CMD "sv_password " |
513 | | - stradd SV_CMD $quote() |
514 | | - stradd SV_CMD $quote() |
515 | | - servercmd SV_CMD |
516 | | - } |
517 | | - |
518 | | - if ( game.players > 0 ) |
519 | | - { |
520 | | - callexternal players ext_changelevel_prep |
521 | | - } |
522 | | - |
523 | | - //this used to be a 0.1 delay |
524 | | - //but I wanted to give more time for the ext_changelevel_prep to set the player's wait delays |
525 | | - |
526 | | - setvard GM_CHANGELEVEL 1 |
527 | | - |
528 | | - callevent 1.0 gm_manual_map_change2 |
529 | | -} |
530 | | - |
531 | | -{ gm_manual_map_change2 |
532 | | - callevent 2.0 gm_manual_map_change3 |
533 | | -} |
534 | | - |
535 | | -{ gm_manual_map_change3 |
536 | | - setvard VOTE_IN_PROGRESS 0 |
537 | | - changelevel F_MAP_NAME |
538 | | -} |
539 | | - |
540 | 470 | { gm_find_highest |
541 | 471 |
|
542 | 472 | local CUR_VOTE_IDX game.script.iteration |
|
566 | 496 | //infomsg all "DEBUG ALERT" "MSAREA_MONSTERSPAWN REMOVED" |
567 | 497 | } |
568 | 498 |
|
569 | | -{ game_transition_triggered //1: Transition_desc //2: DestBSP //3: local_spawn //4: dest_spawn |
570 | | - |
571 | | - local MAP_TO_VOTE PARAM2 |
572 | | - local MAP_DESC PARAM1 |
573 | | - local LOCAL_TRANS PARAM3 |
574 | | - local DEST_TRANS PARAM4 |
575 | | - setvard GM_DEST_TRANS PARAM4 |
576 | | - |
577 | | - local L_PLAYER_LIST '' |
578 | | - |
579 | | - if ( !$map_exists(MAP_TO_VOTE) ) |
580 | | - { |
581 | | - messageall green MAP_TO_VOTE does not exist on this server. Perhaps this is a future transition point? |
582 | | - local EXIT_SUB 1 |
583 | | - } |
584 | | - if !EXIT_SUB |
585 | | - |
586 | | - getplayers L_PLAYER_LIST //using this method instead of game.players so we can test with bots |
587 | | - |
588 | | - callexternal players ext_set_map MAP_TO_VOTE LOCAL_TRANS DEST_TRANS //mark map quest data |
589 | | - |
590 | | - if ( $get_token_amt(L_PLAYER_LIST) > 1 ) |
591 | | - { |
592 | | - local MSG_TITLE "Travel to " |
593 | | - stradd MSG_TITLE MAP_DESC |
594 | | - infomsg all MSG_TITLE "Vote now..." |
595 | | - |
596 | | - local VOTE_TITLE "Travel to " |
597 | | - stradd VOTE_TITLE MAP_DESC |
598 | | - stradd VOTE_TITLE "?" |
599 | | - |
600 | | - local VOTE_CALLER $get(ent_me,id) |
601 | | - |
602 | | - callevent gm_map_vote VOTE_CALLER MAP_TO_VOTE VOTE_TITLE 1 |
603 | | - } |
604 | | - |
605 | | - if ( $get_token_amt(L_PLAYER_LIST) == 1 ) |
606 | | - { |
607 | | - setvard MAP_NAME MAP_TO_VOTE |
608 | | - local AMX_STRING force_map_ |
609 | | - stradd AMX_STRING MAP_NAME |
610 | | - usetrigger AMX_STRING |
611 | | - |
612 | | - setvard GM_DISABLE_TRANSITIONS 1 //tells msarea_transitions to disable code side, so they don't change spawns |
613 | | - if ( GM_DEST_TRANS isnot 'GM_DEST_TRANS' ) callexternal players ext_setspawn GM_DEST_TRANS |
614 | | - //saveallnow |
615 | | - |
616 | | - callevent 5.0 gm_manual_map_change |
617 | | - } |
618 | | -} |
619 | | - |
620 | 499 | { reset_server |
621 | 500 |
|
622 | 501 | dbg *** reset_server check: var game.cvar.ms_reset_if_empty plrs game.players |
|
629 | 508 |
|
630 | 509 | if ( game.cvar.ms_chatlog > 0 ) chatlog $timestamp(>) "SERVER_SHUTDOWN: reason: ms_reset_if_empty 1" |
631 | 510 |
|
632 | | - erasefile G_CRASHCFG |
633 | | - local OUT_LINE "map " |
634 | | - local COMMENT "/" |
635 | | - stradd COMMENT "/" |
636 | | - strconc OUT_LINE edana COMMENT written from MSC |
637 | | - writeline G_CRASHCFG OUT_LINE |
638 | 511 | callevent 0.1 exit_server |
639 | 512 | } |
640 | 513 |
|
|
661 | 534 | chatlog WRITE_LOG |
662 | 535 | } |
663 | 536 |
|
664 | | - |
665 | | - |
666 | 537 | { player_left |
667 | 538 | if ( game.cvar.ms_chatlog ) |
668 | 539 | { |
|
706 | 577 | { manual_edana |
707 | 578 | //this changes to edana when no players are present (sending clientcmd with no players causes errors) |
708 | 579 | if ( game.players > 0 ) callexternal all game_playercmd_setweather clear 0.01 0.01 //just in case of weirdness |
709 | | - erasefile G_CRASHCFG |
710 | | - local OUT_LINE "map " |
711 | | - local COMMENT "/" |
712 | | - stradd COMMENT "/" |
713 | | - strconc OUT_LINE edana COMMENT written from MSC |
714 | | - writeline G_CRASHCFG OUT_LINE |
715 | 580 | if ( game.cvar.ms_chatlog > 0 ) chatlog $timestamp(>) "Server empty, switching to Edana via ms_timelimit." |
716 | | - callevent 1.0 manual_edana2 |
| 581 | + setvard DEST_MAP edana |
| 582 | + callevent 1.0 delay_changelevel |
717 | 583 | } |
718 | 584 |
|
719 | | -{ manual_edana2 |
720 | | - changelevel edana |
| 585 | +{ delay_changelevel //Uses var DEST_MAP to change level. Intended for delays |
| 586 | + changelevel DEST_MAP |
721 | 587 | } |
722 | 588 |
|
723 | 589 | { gm_setname |
724 | 590 | name PARAM1 |
725 | 591 | } |
726 | 592 |
|
727 | | - |
728 | 593 | //==================================== POTION OF FORGETFUNLESS - BEGIN |
729 | 594 |
|
730 | 595 | { forget_spell //PARAM1=owner PARAM2=potion_ID |
|
2038 | 1903 | } |
2039 | 1904 | } |
2040 | 1905 |
|
2041 | | -{ game_triggered //<map trigger fired> |
2042 | | - dbg game_triggered PARAM1 |
2043 | | - |
2044 | | - local L_TRIG PARAM1 |
2045 | | - |
2046 | | - if ( L_TRIG startswith touch_trans_ ) |
2047 | | - { |
2048 | | - if !VOTE_BUSY |
2049 | | - if !GM_CHANGELEVEL |
2050 | | - if game.players > 0 |
2051 | | - local L_VOTEMAP $string_from(L_TRIG,touch_trans_) |
2052 | | - local L_VOTETITLE "Change map to " |
2053 | | - stradd L_VOTETITLE L_VOTEMAP |
2054 | | - getplayers T_PLAYERLIST |
2055 | | - local L_VOTESTARTER $get_token(T_PLAYERLIST,0) |
2056 | | - callexternal GAME_MASTER gm_map_vote L_VOTESTARTER L_VOTEMAP L_VOTETITLE 1 1 |
2057 | | - } |
2058 | | - else if ( L_TRIG startswith force_map_ ) |
2059 | | - { |
2060 | | - if !GM_CHANGELEVEL |
2061 | | - local L_FORCEMAP $string_from(L_TRIG,force_map_) |
2062 | | - callevent gm_manual_map_change L_FORCEMAP |
2063 | | - } |
2064 | | -} |
| 1906 | +//{ game_triggered //<map trigger fired> |
| 1907 | +// |
| 1908 | +//} |
2065 | 1909 |
|
2066 | 1910 | //---Quest Items |
2067 | 1911 |
|
|
2133 | 1977 | { ext_dump_quest_items_loop |
2134 | 1978 | dbg $get_array(ARRAY_QUEST_ITEMS,game.script.iteration) |
2135 | 1979 | } |
2136 | | - |
2137 | | - |
0 commit comments