summaryrefslogtreecommitdiff
path: root/npc/magic/dragokin.txt
blob: bf8344f9f1245a546f6eeb141dea3efacf4f733e (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
// TMW2 script
// Author: Jesusalva <admin@tmw2.org>
//
// Magic Script: TMW2_DRAGOKIN
//
// Summons a Green Dragon because they are cool :3
//
// Cooldown is cast duration

function	script	SK_Dragokin	{
    // Blocked from summoning magic
    if (alignment() < 0)
        return;

    // Other requeriments: 5x Dragon Scale or Demure Axe
    if (!(countitem(DragonScales) >= 4 || countitem(DemureAxe))) {
        dispbottom l("You need 4x @@ to cast this skill.", getitemlink(DragonScales));
        return;
    }

    // Setup
    @sk=TMW2_DRAGOKIN;
    @mp=50;
    @amp=4;

    // Check if you have mana to cast
    // MagicCheck(SkillID, Mana{, MP per level})
    if (!MagicCheck(@sk, @mp, @amp))
        return;

    // Destroy reagents
    if (!countitem(DemureAxe))
        delitem DragonScales, 4;

    // set cooldown
    @dragokin_at=gettimetick(2);
    @dragokin_at=@dragokin_at+16;

    // Summon the dragons and give Mana EXP
    SK_summon(GreenDragon, 5, 5);
    return;
}