summaryrefslogtreecommitdiff
path: root/npc/042-2/boss.txt
blob: 6698d31cbcf7b1dd5b5e57eb538fe18c31dca7d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// 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;

}