summaryrefslogblamecommitdiff
path: root/npc/042-2/boss.txt
blob: 6698d31cbcf7b1dd5b5e57eb538fe18c31dca7d1 (plain) (tree)






































































                                                                                           
// TMW 2 Script
// Author:
//  Jesusalva
//  Micksha
// Description:
//  Basement Boss Fight

042-2,41,22,0	script	#KDoor0422	NPC_HIDDEN,0,0,{
    end;

OnTouch:
    .@label$=instance_npcname(.name$)+"::OnKillBoss";
    .@g=getcharid(2);
    if (($KAMELOT_QUEST[.@g] & 4) && !mobcount(getmap(), .@label$)) {
        warp "042-2@"+.@g, 58, 139;
    } else {
        dispbottom l("Powerful magic repels you!");
        percentheal -5, -5;
        slide 38, 28;
    }
    end;

OnArrival:
    .@g=getcharid(2);
    if (.@g < 1)
        percentheal -100, -100;
    if (getmap() != "042-2@"+.@g)
        end;
    //if ($@KAMELOT_WAVE == 0)
    //    goto OnKillMob;
    // TODO: Fire dialog
    // TODO: Stun yourself for cutscene
    // ...
    end;


OnKillMob:
    if (!playerattached()) end;
    .@g=getcharid(2);
    if (.@g < 1) percentheal -100, -100;
    getexp $KAMELOT_MX[.@g]*5, $KAMELOT_MX[.@g]*2;
    end;

OnKillBoss:
    .@g=getcharid(2);
    dispbottom l("This is all in KAMELOT for now.");
    $KAMELOT_QUEST[.@g]=$KAMELOT_QUEST[.@g]|4; // FIXME
    // Player Reward for completing this stage
    getitem GuildCoin, min(1, $KAMELOT_MX[.@g]/20);
    getexp $KAMELOT_MX[.@g]*50, $KAMELOT_MX[.@g]*10;
    // Guild Reward for completing this stage
    .@ggp=300+$KAMELOT_MX[.@g]*5;
    .@gxp=$KAMELOT_MX[.@g]*10;
    $GUILD_BANK[.@g]+=.@ggp;
    guildgetexp(.@gxp); // 5xp per player average level (max 500/750)
    // Announce
    mapannounce getmap(), strcharinfo(0)+" has defeated Krukan!", 0;
    // Guild Master Notification
    .@gm$=getguildmaster(.@g);
    if (!getcharid(3, .@gm$)) end;
    .@gma=getcharid(3, .@gm$);
    .@gmb=getcharid(0, .@gm$);
    if (!isloggedin(.@gma, .@gmb)) end;
    message .@gm$, strcharinfo(0)+" defeated Krukan: Guild GP +"+.@ggp+" Guild XP +"+.@gxp;

    // TODO: maptimer to give EXP to helpers/survivors
    end;

}