diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-03-06 21:50:06 +0100 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-03-06 20:56:30 +0000 |
commit | 581683d406b91b4106a5bc60f7d05b0ba1933de7 (patch) | |
tree | 521769bcbe15447a7ee6f886b3f69c5b07efe465 | |
parent | bdd55a6a450ef74d290f91e6d1e6077f51a84daf (diff) | |
download | serverdata-581683d406b91b4106a5bc60f7d05b0ba1933de7.tar.gz serverdata-581683d406b91b4106a5bc60f7d05b0ba1933de7.tar.bz2 serverdata-581683d406b91b4106a5bc60f7d05b0ba1933de7.tar.xz serverdata-581683d406b91b4106a5bc60f7d05b0ba1933de7.zip |
Prevent returning to the same map
(+1 repetition of map ID in code :/)
-rw-r--r-- | npc/commands/event.txt | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/npc/commands/event.txt b/npc/commands/event.txt index 306215960..5655c7c30 100644 --- a/npc/commands/event.txt +++ b/npc/commands/event.txt @@ -462,6 +462,8 @@ OnEffect: atcommand "@refresh"; end; } else { + .@mymap$ = getmapname(); + setarray .@choices$, l("Cancel"), "-1"; // I'm not sure which IDs to use for the switch after the menu, @@ -479,60 +481,80 @@ OnEffect: if ($@MK_SCENE == MK_SIEGE_TULIM || BaseLevel > 20) { switch ($@MK_SCENE) { case MK_SIEGE_TULIM: - array_push(.@choices$, l("Assist %s", "Tulimshar")); - array_push(.@choices$, "100301"); + if (!compare(.@mymap$, "003-1")) { + array_push(.@choices$, l("Assist %s", "Tulimshar")); + array_push(.@choices$, "100301"); + } break; case MK_SIEGE_HALIN: - array_push(.@choices$, l("Assist %s", "Halinarzo")); - array_push(.@choices$, "100901"); + if (!compare(.@mymap$, "009-1")) { + array_push(.@choices$, l("Assist %s", "Halinarzo")); + array_push(.@choices$, "100901"); + } break; case MK_SIEGE_HURNS: - array_push(.@choices$, l("Assist %s", "Hurnscald")); - array_push(.@choices$, "101201"); + if (!compare(.@mymap$, "012-1")) { + array_push(.@choices$, l("Assist %s", "Hurnscald")); + array_push(.@choices$, "101201"); + } break; case MK_SIEGE_NIVAL: - array_push(.@choices$, l("Assist %s", "Nivalis")); - array_push(.@choices$, "102001"); + if (!compare(.@mymap$, "020-1")) { + array_push(.@choices$, l("Assist %s", "Nivalis")); + array_push(.@choices$, "102001"); + } break; } } - if ($@GM_EVENT) { + if ($@GM_EVENT && !compare(.@mymap$, "001-1") ) { array_push(.@choices$, l("Participate in Aeros event")); array_push(.@choices$, "100101"); } - if ($@FEFE_DELAY > gettimetick(2) && !$@FEFE_CAVE_LEVEL && $@FEFE_CAVE_HERO$ != "" && !$@FEFE_WAVE) { + if ($@FEFE_DELAY > gettimetick(2) && $@FEFE_CAVE_HERO$ != "" + && !$@FEFE_WAVE && !$@FEFE_CAVE_LEVEL + && !compare(.@mymap$, "001-6") ) + { array_push(.@choices$, l("Assist %s in Candor Battle Cave", $@FEFE_CAVE_HERO$)); array_push(.@choices$, "100106"); } - if ($EVENT$ == "Valentine") { + if ($EVENT$ == "Valentine" && !compare(.@mymap$, "001-11")) { array_push(.@choices$, l("Go to Valentine Highlands")); array_push(.@choices$, "100111"); } - if ($EVENT$ == "Easter") { + if ($EVENT$ == "Easter" && !compare(.@mymap$, "001-4")) { array_push(.@choices$, l("Go to Easter event")); array_push(.@choices$, "100104"); } - if ($EVENT$ == "Worker") { + + if ($EVENT$ == "Worker" && !compare(.@mymap$, "001-5")) { array_push(.@choices$, l("Go to Contributor's Cave")); array_push(.@choices$, "100105"); } - if ($EVENT$ == "Christmas" && BaseLevel >= 20) { + + if ($EVENT$ == "Christmas" && !compare(.@mymap$, "019-4-1") + && BaseLevel >= 20) + { array_push(.@choices$, l("Go to the Christmas Workshop")); array_push(.@choices$, "10190401"); } - if ($EVENT$ == "Tower" && countitem(EventDreamTicket)) { + + if ($EVENT$ == "Tower" && !compare(.@mymap$, "030-") + && countitem(EventDreamTicket)) + { array_push(.@choices$, l("Ascend a dream tower")); array_push(.@choices$, "103000"); // the last two digits vary } - if ($EVENT$ == "Olympics") { + + if ($EVENT$ == "Olympics" && !compare(.@mymap$, "001-14")) { array_push(.@choices$, l("Go to Porthos")); array_push(.@choices$, "100114"); } - if ($EVENT$ == "Raid") { + + if ($EVENT$ == "Raid" && !compare(.@mymap$, "001-13")) { array_push(.@choices$, l("Challenge the raiding boss!")); array_push(.@choices$, "100113"); } |