summaryrefslogtreecommitdiff
path: root/npc/008-4-1/boss.txt
blob: fda71fffbc629fe0c8727c6465b046b92ee01efe (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
// Evol Script
// Author:
//  Jesusalva
// Description:
//  Controls the boss on 008-4-1 and the Master Book Learning
// see npc/items/master_skillbook.txt for explanation about variables

008-4-1,0,0,0	script	#BossCtrl_008-4-1	NPC_HIDDEN,{
    end;

// Test server: 15 minutes only
OnTimer900000:
    if (!debug)
        end;

// Otherwise, respawn every hour
OnTimer3600000:
    stopnpctimer;
OnInit:
    $@MB_00841=0;
    monster "008-4-1", 67, 30, strmobinfo(1, GameBalance), GameBalance, 1, "#BossCtrl_008-4-1::OnBossDeath";
    end;

OnBossDeath:
    initnpctimer;
    // Only the party which defeated the boss can learn the skill
    getmapxy(.@m$, .@x, .@y, 0);
    .@party=getcharid(1);
    if (.@party > 0)
    {
        $@MB_00841=.@party;
        areatimer("008-4-1", .@x-15, .@y-15, .@x+15, .@y+15, 10, "#BossCtrl_008-4-1::OnBossCheck");
        mapannounce "008-4-1", "Boss deafeated by Party: " + getpartyname(.@party), bc_all;
    }
    else
    {
        $@MB_00841=-2;
        areatimer("008-4-1", .@x-15, .@y-15, .@x+15, .@y+15, 10, "#BossCtrl_008-4-1::OnBossCheck");
        addtimer(20, "#BossCtrl_008-4-1::OnBegin");
        mapannounce "008-4-1", "Boss deafeated by: " + strcharinfo(0), bc_all;
    }
    end;

OnBossCheck:
    @mb_BossId=-1;
    // TODO: Check if you really fought or was just lurking
    // Check if party is correct
    if (getcharid(1) != $@MB_00841)
        end;
OnBegin:
    @mb_BossId=GameBalance;
    @mb_SkillId=MG_COLDBOLT;
    @mb_ItemId=MagicFeather; // Placeholder
    @mb_ItemAm=1;
    addtimer(15000, "#BossCtrl_008-4-1::OnFinish");
    end;

OnFinish:
    @mb_BossId=0;
    @mb_SkillId=0;
    @mb_ItemId=0;
    @mb_ItemAm=0;
    end;

}