summaryrefslogblamecommitdiff
path: root/npc/functions/aurora.txt
blob: af6cc7a45f9f37f0696ae44aa16f4fdb9305147d (plain) (tree)
























                                                                            

                               
                                                                                                      















































                                                                            
                                   







                                                              












                                                             








                                          
 
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    AURORA EVENT FRAMEWORK
//    Previously known as FY:Event System
//
//    Controls weekly events so Saulc, seeds and I can take vacations.
//    See also: seasons.txt, command/event.txt, event.txt, 003-1/events.txt
//    soulmenhir.txt and, of course, the event maps (if any).
//    Aurora Event Framework functions are called by event.txt
//    specs override and is overriden by those defined in commands/event.txt

// AEF: BEGIN
function	script	FYNewEvent	{
    debugmes "\033[1mFY event is set to happen...";
    $FYEVENT_CYCLE+=1;
    // Overrides standard event system
    $EVENT$="";
    switch ($FYEVENT_CYCLE % 12) {
    case 1:
        $EVENT$="Kamelot";
        kamibroadcast("Kamelot Season is now open!", "Aurora Events");
        break;
    case 2:
        $EVENT$="Regnum";
        callfunc("FYE_Regnum");
        kamibroadcast("Regnum's Blessing: "+$@REGNUM_BLESSMAP_H$+" is now blessed!", "Aurora Events");
        break;
    case 3:
        break;
    case 4:
        break;
    case 5:
        break;
    case 6:
        break;
    case 7:
        break;
    case 8:
        break;
    case 9:
        break;
    case 10:
        break;
    case 11:
        break;
    case 12:
        break;
    }
    return;
}

// Modify Kamelot
function	script	FYE_Kamelot	{
    .@g=getcharid(2);
    if ($@FYE_KAMELOT[.@g] != gettimeparam(GETTIME_DAYOFMONTH)) {
        mesc l("Kamelot Season is open!");

        // Instance still exists
        if (instanceowner($@KAMELOT_ID[.@g]) == .@g) {
            mesc l("However, your guild just challenged Kamelot Dungeons.");
            mesc l("Please wait a while.");
            return false;
        }
        mesc l("Should we?");
        next;
        if (askyesno() == ASK_NO)
            return false;

        // Someone began while you waited
        if (instanceowner($@KAMELOT_ID[.@g]) == .@g)
            return true;

        // Begin
        callfunc("KamelotCleanup", .@g);
        $KAMELOT_COOLDOWN[.@g] = 0;
        $@FYE_KAMELOT[.@g] = gettimeparam(GETTIME_DAYOFMONTH);
        mesc l("Have fun!");
        next;
        return true;
    }
    return false;
}


// Regnum Blessing
function	script	FYE_Regnum	{
    setarray .@ma$, "004-1", "007-1";
    setarray .@mb$, "Tulimshar Outskirts", "Tulimshar Mines";
    .@m=rand2(getarraysize(.@ma$));
    $@REGNUM_BLESSMAP$=.@ma$[.@m];
    $@REGNUM_BLESSMAP_H$=.@mb$[.@m];
    // Apply the blessing
    setmapflag(.@ma$[.@m], mf_bexp, 200);
    return;
}

// Stops any Aurora Event
function	script	FYStopEvent	{
    setarray .@av$, "Kamelot", "Regnum";
    if (array_find(.@av$, $EVENT$) >= 0) {
        sClear();
        $EVENT$="";
    }
    return;
}