summaryrefslogblamecommitdiff
path: root/npc/018-6-3/main.txt
blob: 9b6fbb503e0c8b82a08565e68fb3d3ac236f85ef (plain) (tree)













































































                                                                                                                                                             















































                                     


 
// TMW2 Scripts
// Author:
//    Jesusalva
// Description:
//    Controls Forgotten Shrine

// 01863_RelevanceCheck ( Room ID )
function	script	01863_RelevanceCheck	{
    .@id=getarg(0);
    .@q=getq(LoFQuest_Barbara);
    .@q2=getq2(LoFQuest_Barbara);
    .@q3=getq3(LoFQuest_Barbara);
    if (.@q < 3)
        Exception("INVALID QUEST STATE, REVCHECK", RB_DEFAULT|RB_ISFATAL);
    if (.@q != 3)
        return false;
    if (.@q3 & .@id)
        return false;
    return true;
}

// Main Controller for Instanced maps
018-6-3,0,0,0	script	#01863_InstCtrl	NPC_HIDDEN,{
    end;

// Map, x1, y1, x2, y2, mob, amount
function AreaMonsterB {
    .@m$=getarg(0);
    .@x1=getarg(1);
    .@x2=getarg(3);
    .@y1=getarg(2);
    .@y2=getarg(4);
    .@mi=getarg(5);
    .@am=getarg(6);
    if (!.@am)
        return;
    areamonster(.@m$, .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@mi), .@mi, .@am);
    //, instance_npcname(.name$)+"::OnKill"+.@mi);
    return;
}

// Map, x1, y1, x2, y2, mob, amount, bossID
function AreaMonsterBoss {
    .@m$=getarg(0);
    .@x1=getarg(1);
    .@x2=getarg(3);
    .@y1=getarg(2);
    .@y2=getarg(4);
    .@mi=getarg(5);
    .@am=getarg(6);
    .@id=getarg(7);
    areamonster(.@m$, .@x1, .@y1, .@x2, .@y2, strmobinfo(1, .@mi), .@mi, .@am, instance_npcname(.name$)+"::OnKill"+.@id);
    return;
}

OnRoomA:
    // True: Must spawn boss, False: Allow to use warps
    if (01863_RelevanceCheck(1)) {
        mapannounce getmap(), l("BOSS FIGHT!"), bc_map|bc_pc;
        AreaMonsterBoss(getmap(), 62, 41, 121, 58, any(HolyPixie, NulityPixie, VanityPixie, TerraniteProtector, GoboBear, Centaur), 1, 1); // Aggressive: 33%
        // 6~12 support units
        AreaMonsterB(getmap(), 62, 41, 121, 58, BlackSlime, rand2(3,5));
        AreaMonsterB(getmap(), 62, 41, 121, 58, DarkLizard, rand2(2,3));
        AreaMonsterB(getmap(), 62, 41, 121, 58, BlackScorpion, rand2(1,2));
        // 620ms, AD18, tk710 hp 8.7
        AreaMonsterB(getmap(), 62, 41, 121, 58, Archant, rand2(0,1));
        // 200ms, AD21, tk630 hp 6.4
        AreaMonsterB(getmap(), 62, 41, 121, 58, HoodedNinja, any(0,0,1));
    }
    end;

// Kill boss will use setq3 and also erase any remaining monster
OnKill1:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|1;
    killmonsterall(getmap());
    end;

OnKill2:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|2;
    killmonsterall(getmap());
    end;

OnKill4:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|4;
    killmonsterall(getmap());
    end;

OnKill8:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|8;
    killmonsterall(getmap());
    end;

OnKill16:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|16;
    killmonsterall(getmap());
    end;

OnKill32:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|32;
    killmonsterall(getmap());
    end;

OnKill64:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|64;
    killmonsterall(getmap());
    end;

OnKill128:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|128;
    killmonsterall(getmap());
    end;

OnKill256:
    .@q3=getq3(LoFQuest_Barbara);
    setq3 LoFQuest_Barbara, .@q3|256;
    killmonsterall(getmap());
    end;

}