summaryrefslogtreecommitdiff
path: root/npc/magic/level1-transmutations.txt
blob: 88e916fc704d0180278c342876744a2538b9292b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// The Mana World script
// Author: Jesusalva <jesusalva@themanaworld.org>
//
// Magic Script: MULTIPLE (Level 1)
// School: Transmutation *

function	script	SK_Transmute	{
    // Setup
    switch (@skillId) {
    case SKILL_PARUM:
        .@prize = MoubooFigurine; .@pc = 1;
        .@mexp = 1; .@fx = FX_MAGIC_WOOD_CAST;
        setarray .@component, RawLog;
        setarray .@co_amount,      1;
        setarray .@failure, Iten, WarpedLog, WarpedLog;
        break;
    case SKILL_KULARZUFRILL:
        .@prize = Arrow; .@pc = AdjustSpellpower(40+@skillLv*2);
        .@mexp = 2; .@fx = FX_MAGIC_ARROW_CAST;
        setarray .@component, RawLog;
        setarray .@co_amount,      1;
        setarray .@failure, WarpedLog, WarpedLog;
        break;
    case SKILL_ZUKMINBIRF:
        .@prize = IronPowder; .@pc = 1+AdjustSpellpower(@skillLv*5);
        .@mexp = 2; .@fx = FX_MAGIC_IRON_CAST;
        setarray .@component, IronOre;
        setarray .@co_amount,      1;
        setarray .@failure, Iten, IronOre, IronOre;
        break;
    case SKILL_PATMUPLOO:
        .@prize = CottonShirt; .@pc = 1;
        .@mexp = 2; .@fx = FX_MAGIC_SHIRT_CAST;
        setarray .@component, CottonCloth;
        setarray .@co_amount,           5;
        setarray .@failure, CottonCloth, CottonCloth;
        break;
    case SKILL_PATVILOREE:
        .@prize = ShortTankTop; .@pc = 1;
        .@mexp = 2; .@fx = FX_MAGIC_SHIRT_CAST;
        setarray .@component, CottonCloth;
        setarray .@co_amount,           3;
        setarray .@failure, CottonCloth, CottonCloth;
        break;
    case SKILL_PATLOREE:
        .@prize = TankTop; .@pc = 1;
        .@mexp = 2; .@fx = FX_MAGIC_SHIRT_CAST;
        setarray .@component, CottonCloth;
        setarray .@co_amount,           4;
        setarray .@failure, CottonCloth, CottonCloth;
        break;
    case SKILL_GOLE:
        .@prize = SulphurPowder; .@pc = 1+AdjustSpellpower(@skillLv*20);
        .@mexp = 1; .@fx = FX_MAGIC_SULPHUR_CAST;
        setarray .@component, PileOfAsh;
        setarray .@co_amount,         1;
        setarray .@failure, PileOfAsh, PileOfAsh;
        break;
    case SKILL_MANPAHIL:
        .@prize = Lifestone; .@pc = 10;
        .@mexp = 2; .@fx = FX_MAGIC_STONE_CAST;
        setarray .@component, BugLeg, MaggotSlime, MauveHerb, AlizarinHerb, CobaltHerb, GambogeHerb;
        setarray .@co_amount,      1,           1,         1,            1,          1,           1;
        setarray .@failure, Lifestone, Lifestone;
        break;
    default: return;
    }
    // Check for items
    for (.@i=0; .@i < getarraysize(.@component); .@i++) {
        if (countitem(.@component[.@i]) < .@co_amount[.@i]) {
            dispbottom l("You do not have enough %s (min %d)",
                         getitemname(.@component[.@i]), .@co_amount[.@i]);
            return;
        }
    }
    // Delete reagents
    inventoryplace Iten, 1, .@prize, .@pc;
    for (.@i=0; .@i < getarraysize(.@component); .@i++) {
        delitem(.@component[.@i], .@co_amount[.@i]);
    }
    // Effect and EXP
    specialeffect(.@fx, AREA, getcharid(3));
    GetManaExp(@skillId, .@mexp);
    // The chances of success are based on magic exp, abizit and skill level
    .@rand100 = abizit()*10 + cap_value(MAGIC_EXP/100, 0, 50) + (@skillLv*5);
    if (.@rand100 > rand2(100)) {
        getitem .@prize, .@pc;
    } else {
        dispbottom l("Your magic takes a mind of its own!");
        getitem any_of(.@failure), 1;
    }
    return;
}