summaryrefslogblamecommitdiff
path: root/npc/081-1/dungeon.txt
blob: 80f93f624e5ae6b22d65b9dfdb5e17d035197de2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                        

                                                                                                                    

                                                               
              
 
                                 



                          

                                                       
                                                                                             





                



                                                        

                                                                                            







































                                                                                                                                                                                                                                                                       
                                   






















                                                                                                                                                                   
                     













                                                                                                                                                                                                                           
                 

                  
                         

















                                                                                                                                                                                                                            
                                                                                                          





                                        
                                           












                                                

                      


                      
                                


                                   


                                   
         



                                                                                                                                                                                                         

      

          





































                                                               

          

















































                                                                                                            










                                
                                                                                              


















































                                                                                                                                 
                                                









                                                                  

                













                                                                                 
        


































                                                                                                              
 
 
// TMW Script.
// Author:
//    Jesusalva
// Notes:
//    Christmas 2021 - Northen Lights Dungeon Entrance

081-1,68,30,0	script	#0811Nexit	NPC_HIDDEN,0,0,{
    end;
OnTouch:
    if (!isChristmas21()) end;
    if (!X21_START()) end;
    if (!X21_DISPATCH()) { dispbottom l("This looks dangerous, I should talk with Santa before proceeding."); end; }

    /* We need to determine if instance exists and is needed */
    X21INIT();

	.@mapa$="0812@"+X21ID2();
    warp .@mapa$, 90, 298;
    end;
}

081-1,64,34,0	script	#X21_SIGN01	NPC_NO_SPRITE,{
    if (!isChristmas21()) end;
    npctalk3 l("Northern Lights Dungeon - Form a party to join or enter alone. Be careful!");
    end;
OnInit:
    .distance=5;
    end;
}

020-1,78,85,0	script	Santa Helper#Fake	NPC435,{
    function soon;
    function complete;
    function dowarp;
    // Created *after* the event begun (on test server)? Disregard.
    if (TUT_var < 1639278000) { mes l("This account is too young to participate."); close; }
    if (!isChristmas21()) soon();
    if (X21ED2_CLEAR()) complete();
    do
    {
        mesn;
        mesq l("Santa has been so worried this year... What'll I do...");
        select
            rif(X21_START(), l("Can you bring me back to Santa?")),
            l("[Information]"),
            l("Not my problem."),
            rif(X21_START(), l("What's the Frontier of Existence?"));
        mes "";
        switch (@menu) {
        case 1:
            dowarp(); end;
        case 2:
            mesn;
            mesq l("Ah, well, you see... Santa has this... uh... unique friend, let's call him.");
            next;
            mesn;
            mesq l("Actually, is it even right to call a skeleton a \"him\"? With them being undead and all... Wait, I'm getting sidetracked here.");
            next;
            mesn;
            mesq l("So, you see, Santa made this friend called %s. Creepy fella, but Santa has never been one to really judge others.", b("Gak"));
            next;
            mesn;
            mesq l("Really, to make friends with undead, I'll never understand these Sages of Kaizei... Damn, I'm really getting sidetracked today. Sorry.");
            next;
            mesn;
            mesq l("Anyway. Santa is worried about Gak. I think it is anniversary of the death of his wife or something. To be honest, how an undead would mourn the dead is so... Sidetracked. Again.");
            next;
            mesn;
            mesq l("Look, you know Santa and Nikolai are both on the same circle, the Sages of Kaizei, right? Nikolai was representing this order during the %s.", "[@@https://forums.themanaworld.org/viewtopic.php?f=1&t=20921|"+l("Doomsday's Sage Council")+"@@]");
            next;
            mesn;
            mesq l("The biggest meeting of... Sorry. Well, things changed. I don't know how, I'm not a wizard, but Santa went to investigate. Something about cheering his friend up.");
            next;
            mesn;
            mesq l("He is worried with Gak, and we are worried with him; The Sages of Kaizei specialize in transport magic, not on combat magic. If brave adventurers could help him...");
            next;
            if (X21_START()) break;
            select
                l("Why don't you go yourself?"),
                l("Don't worry, I'll help."),
                l("Not my business.");
            mes "";
            if (@menu == 1) {
                mesn;
                mesq l("Didn't you hear me earlier? The Sages of Kaizei specialize in transport magic. Geez, and I was the one getting side-tracked here!");
                next;
            }
            else if (@menu == 2) {
                X21_DOSTART();
                mesn;
                mesq l("Really? You'll do it? Thank you! That's much appreciated!");
                next;
                mesn;
                if (getcharid(1) > 0)
                    mesq l("I hope you and your friends can do it!");
                else
                    mesq l("You may consider forming a party to do it, but who am I to judge if you want to do it alone!");
                next;
                mesn;
                mesq l("I can warp you to where Santa is once you're ready. Be prepared. I believe the place is called... %s.", b(l("The Frontier Of Existence")));
                next;
            }
            break;
        case 4:
            mesn;
            mesq l("Where Santa is, obviously.");
            next;
            mesn;
            mesq l("It's the absolute limit between what exists and what doesn't. If you fall in the æther, you'll cease to exist and nothing can bring you back.");
            next;
            mesn;
            mesq l("...Normally, but whatever the %s set off in motion makes fun of the concept of existence itself.", "[@@https://forums.themanaworld.org/viewtopic.php?f=1&t=20921|"+l("Doomsday's Sage Council")+"@@]");
            next;
            mesn;
            mesq l("Just be careful, I never even heard about æther before Santa decided to help Gak, so I'm pretty sure the regular magic laws are worthless past this point.");
            next;
            break;
        }
    } while (@menu != 3);
    npctalkonce l("Merry Christmas!");
    closeclientdialog;
    close;

function soon {
    mesn;
    mesq l("Hey there, %s. It's not Christmas time right now, so I am just appreciating the view.", strcharinfo(0));
    next;
    mesn;
    mesq l("Christmas Event will happen from %s to %s this year. You can click %s for more details.", b(l("Dec 12th")), b(l("Dec 26th")), "[@@https://forums.themanaworld.org/viewtopic.php?f=68&t=21296|"+l("here")+"@@]");
    close;
}

function complete {
    mesn;
    mesq l("Thanks for helping Santa yet again.");
    next;
    mesn;
    mesq l("I believe he has been trading %s... Do you want to meet him again?", getitemlink(XmasTicket));
    next;
    if (askyesno() == ASK_YES) dowarp();
    close;
}

function dowarp {
    if (!isChristmas21()) end; // Fail-safe
    dispbottom l("Santa Helper : Fly awayyy!!");
    warp "081-1", 58, 103;
    closeclientdialog;
    close;
}

OnInit:
    .distance=5;
    end;
}


081-1,56,63,0	script	Santa	NPC_SANTA,{
    function accepted;
    function idiot;
    function report;
    function gotogak;
    function finished;
    if (!X21_START()) end; // ??
    if (X21ED2_CLEAR()) finished();
    if (X21GAK_GOTO()) gotogak();
    if (X21ED1_CLEAR()) report();
    if (X21BC1_CLEAR()) idiot();
    if (X21_DISPATCH()) accepted();
    /* Not yet started */
    mesn;
    mesq l("ho-hum ho-hum ho-hum, why hello there, %s!", lg("Young Heroine", "Young Hero"));
    next;
    mesn;
    mesq l("Welcome to the %s! Try avoiding the edges of this place, you know, æether all over the place, not really an appealing way to leave this world. Ho! Ho! Ho!", b(l("Frontier of Existence")));
    do
    {
    next;
    select
        l("Cool, I'm just taking a look around."),
        l("What's the Frontier of Existence?"),
        l("What's the æther?"),
        l("Who are you?"),
        l("What are the Sages of Kaizei?"),
        l("How come you're friend with Gak?"),
        l("What should I expect here?"),
        rif(!X21_DISPATCH(), l("I'm ready to help."));
    mes "";
    switch (@menu) {
    case 1: close;
    case 2: // Frontier?
        mesn;
        mesq l("I don't know.");
        break;
    case 3: // æther?
        mesn;
        mesq l("I don't know.");
        break;
    case 4: // you?
        mesn;
        mesq l("Me? I am Santa Claus, of course! Ho! Ho! Ho!");
        break;
    case 5: // Sages?
        mesn;
        mesq l("I don't know.");
        break;
    case 6: // Gak?
        mesn;
        mesq l("I don't know.");
        break;
    case 7: // Expect?
        mesn;
        mesq l("I don't know.");
        break;
    case 8: close;
    }
    while (true);
    close;

function accepted {
    mesn;
    mesq l("North of here is the entrance to the Northern Lights Dungeon.");
    next;
    mesn;
    mesq l("Something related to Gak's past has been brought past to existence.");
    next;
    mesn;
    mesq l("Go there, find whatever it is, and lets make Christmas a merry time for everyone! Ho! Ho! Ho!");
    if (getcharid(1) < 1) {
        next;
        mesn;
        mesq l("Oh, but you may want to form a party, first. Otherwise, you'll have to do it alone.");
    }
    close;
}

function idiot {
    mesn;
    mesq l("Have you found anything, %s?", lg("Young Heroine", "Young Hero"));
    next;
    if (askyesno() == ASK_YES) {
        mes "";
        mesn;
        mesq l("I may be old but I'm no fool, Ho! Ho! Ho!");
        next;
    }
    mes "";
    mesn;
    mesq l("Keep looking for something to cheer Gak up. Ah, also...");
    next;
    mesn;
    mesq l("I have a hint for you. Use this if you're struck:");
    // This is the solution to Alissa's puzzle
    mesc l("Candies, Identity, Fake Identity, Coup'detat, Slaughter, Proof of the living.");
    next;
    select
        l("Thanks Santa, you're the best!"),
        l("How do I use it?");
    mes "";
    if (@menu == 1) {
        mesn;
        mesq l("I know! And a Merry Christmas for you! Ho! Ho! Ho!");
    } else {
        mesn;
        mesq l("No idea! But I'm sure you'll figure something out! Ho! Ho! Ho!");
    }
    close;
}

function report {
    select
        l("I've found Alissa.");
    mes "";
    mesn;
    mesq l("You WHAT?");
    next;
    select
        l("I've found Alissa.");
    mes "";
    mesn;
    mesq l("In name of the Ice, I didn't thought you would find Alissa herself! Ho! Ho! Ho!");
    next;
    mesn;
    mesq l("Congratulations, I guess.");
    next;
    select
        l("Where's Gak?");
    mes "";
    mesn;
    mesq l("Uh? He went home, obviously.");
    next;
    mesn;
    mes "\""+l("...Ah");
    mes l("I guess that's inconvenient to you, isn't it? Hohoho!")+"\"";
    next;
    select
        l("Where does he live?"),
        l("Where's his house?");
    mes "";
    mesn;
    mesq l("I have no idea, he haven't asked for a Christmas gift lately.");
    next;
    mesn;
    mesq l("Maybe you can ask someone else? Hohoho!");
    next;
    // useless Santa...
    select
        l("Where did you last seen him?");
    mes "";
    mesn;
    mesq l("Asphodel Moors. Not sure if there's any significance to him about that place, but well, maybe someone there knows.");
    next;
    mesn;
    mesq l("I also think I saw Kytty around, from Valentine's Day. She may have seen something, who knows.");
    X21GAK_DOGOTO();
    close;
}

function gotogak {
    mesn;
    mesq l("Gak went home, but maybe someone else in Asphodel Moors has seen him. Or maybe Kytty.");
    close;
}

function finished {
    mesn;
    mesq l("Have you been a very good kid this year?");
    askyesno();
    mes "";
    mesn;
    mes "\""+l("Well, whenever you explore that place, you may get some tickets.");
    mes l("I'll exchange these for rares which were featured in other Christmas Events.");
    mes l("An unique chance! Ho! Ho! Ho!")+"\"";
    next;
    mesn;
    mes "\""+l("But keep in mind, you can only get one of each.");
    mes l("So, what'll it be?")+"\"";
    next;
    openshop;
    closeclientdialog;
    close;
}

OnInit:
    .distance=5;
    setarray .prizes, ElfNightcap, TopHat, ShroomHat, FunkyHat,
                      SnowmanSnowGlobe, ChristmasTreeHat, BunnyEars,
                      SantaBeardHat, MushHat, LeatherGoggles, SantaSnowGlobe,
                      MoubooHead, Goggles, Sunglasses, ChristmasElfHat, FaceMask;
    setarray .prices,  300,  400,  500,  600,
                       625,  650,  700,
                       800,  825,  850,  875,
                      1000, 1100, 1200, 1500, 1600;
	tradertype(NST_CUSTOM);
    freeloop(true);
    for (.@i = 0; .@i < getarraysize(.prizes); .@i++) {
        sellitem(.prizes[.@i], .prices[.@i]);
    }
    freeloop(false);
    end;
OnCountFunds:
	setcurrency(countitem(XmasTicket));
	end;

OnPayFunds:
    if (!X21ED2_CLEAR()) end;
	if( countitem(XmasTicket) < @price )
		end;
    /* Verify if you're not purchasing a dupe */
    /* This requires servercode@712c09c2c6d848243c3426aeb3dbdf730c1e0b08 to work */
    for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) {
        if (debug || $@XMAS21_OVERRIDE)
            debugmes("%dx %s", @bought_quantity[.@i], getitemname(@bought_nameid[.@i]));

        .@arr = array_find(.prizes, @bought_nameid[.@i]);
        if (.@arr < 0) { dispbottom "REPORT ME: Array Error (Santa)"; end;}
        .@bit = (2 ** .@arr);

        if (#X21PRIZES_SANTA & .@bit) {
            dispbottom l("You already purchased a(n) %s during the event.", getitemlink(@bought_nameid[.@i]));
            dispbottom l("Therefore, the operation was cancelled.");
            end;
        }
    }
	delitem XmasTicket, @price;
    /* Record the items on the bitmask (far more important) */
    /* This requires servercode@712c09c2c6d848243c3426aeb3dbdf730c1e0b08 to work */
    for (.@i=0;.@i < getarraysize(@bought_nameid); .@i++) {
        .@arr = array_find(.prizes, @bought_nameid[.@i]);
        if (.@arr < 0) { dispbottom "REPORT ME: Fatal Array Error (Santa)"; end;}
        .@bit = (2 ** .@arr);
        #X21PRIZES_SANTA = #X21PRIZES_SANTA | .@bit;
    }
	purchaseok();
	end;
}