summaryrefslogblamecommitdiff
path: root/npc/magic/scrolls.txt
blob: 6df45c4e442eb486bf65b513ba91b9a775044b58 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                          
                                                                                 




















                                                          
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  Scroll System

// SummonScroll(mob, life, {mob2, minlv})
function	script	SummonScroll	{
    .@mob = getarg(0);
    .@tim = getarg(1, 60);
    .@mbb = getarg(2, 0);
    .@blv = getarg(3, 0);

    // Depending on alignment status, invoke superior form
    if (alignment_cansummon() && alignment() > 1 && BaseLevel > .@blv && .@mbb) {
        .@mids = summon("Summoned Monster", .@mbb, .@tim);
    } else {
        .@mids = summon("Summoned Monster", .@mob, .@tim);
    }

    // Reconfigure monster modes
    .@opt=getunitdata(.@mids, UDT_MODE);
    // Disable looting
    if (.@opt & MD_LOOTER)
        .@opt=.@opt^MD_LOOTER;
    // All summons can suffer knockback
    if (.@opt & MD_NOKNOCKBACK)
        .@opt=.@opt^MD_NOKNOCKBACK;
    // Strip summons from BOSS mode and immunity
    if (.@opt & MD_BOSS)
        .@opt=.@opt^MD_BOSS;
    // Save new options
    setunitdata(.@mids, UDT_MODE, .@opt);
    return;
}