viewing paste Unknown #39722 | Athena

Posted on the
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 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
// Insert into your instance_db.txt ( change 1 to whatever last instance you have).
// 1,Training Grounds,14400,jupe_ele,45,50,jupe_ele
prontera,148,145,2  script  Training Grounds#Ins    4_M_ROYALGUARD,{
    .@md_namenpc$ = "[ ^ee7600Training Grounds^000000 ]";
    .@instance$ = "Training Grounds";
    if (instance_id()) {
        mes .@md_namenpc$;
        mes "You are already part of an instance.";
        next;
        switch(select("Enter Instance.:Cancel.")) {
        case 1:
            break;
        case 2:
            mes .@md_namenpc$;
            mes "You don't want to try again?";
            emotion e_sob;
            close;
        }
    } else {
        mes .@md_namenpc$;
        mes "Hello there "+strcharinfo(0)+".";
        mes "Would you like to enter the Training Grounds?";
        next;
        mes .@md_namenpc$;
        mes "Info:";
        .@size = 4;
            for ( .@i = 1; .@i <= .@size; .@i++ )
            {
                mes "Training Ground "+.@i+": (Lv. ^FF0000"+$@MinRange[.@i]+"^000000 ~ ^0000FF"+$@MaxRange[.@i]+ "^000000 )";
            }
                next;
                mes .@md_namenpc$;
        switch(select("Create "+.@md_namenpc$+":Cancel.")) {
        case 1:
            .@create = instance_create( .@instance$ );
            if (.@create < 0) {
            mes "Time to train!";
            mes "...";
                switch (.@create) {
                    case -1: mes "ERROR: Invalid type."; break;
                    case -2: mes "ERROR: Party not found."; break;
                    case -3: mes "ERROR: Instance already exists."; break;
                    case -4: mes "ERROR: No free instances."; break;
                }
                mes " ";
                mes "Instance creation ^FF0000failed^000000.";
                emotion e_omg;
                close;
            }
            mes "Instance created.";
            mes " ";
            mes "Now entering the Training Grounds..";
            next;
            break;
        case 2:
            mes "Okay. Maybe next time!";
            close;
        }
    }
 
    .@enter = instance_enter(.@instance$);
    if (.@enter != 0) {
        mes .@md_namenpc$;
        switch (.@enter) {
            case 1: mes "ERROR: Party not found."; break;
            case 2: mes "ERROR: Party does not have an instance."; break;
            case 3: mes "ERROR: Unknown error."; break;
        }
        mes " ";
        mes "Instance entry ^FF0000failed^000000.";
        emotion e_omg;
        close;
    }
    close;
 
    OnInit:
    setarray $@MinRange[1],1,5,10,20;
    setarray $@MaxRange[1],5,10,20,99;
 
    setarray $@MinBase[1],2,5,10,15;
    setarray $@MaxBase[1],3,10,15,25;
    end;
}
 
jupe_ele,42,45,4    script  Training System#Ins 4_M_ROYALGUARD,{
 
            .@md_namenpc$ = "[ ^ee7600Training System^000000 ]";
            mes .@md_namenpc$;
            if ( 'CurrentRound )
                {
                    mes "There is a round currently in progress.";
                    close;
                }
                mes "Spawn Training Mobs?";
                next;
                switch(select("Sure","Leave Instance."))
                {
                case 1:
                'CurrentRound++;
        if ( BaseLevel <= $@MaxRange[1] ) {
        dispbottom "type 1";
        'TotalCount = 'MobAM[1];
        areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[1],'MobAM[1],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
        end;
        }
        if ( BaseLevel >= $@MinRange[2] && BaseLevel < $@MaxRange[2] ) {
        dispbottom "type 2";
        'TotalCount = 'MobAM[2];
        areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[2],'MobAM[2],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
        end;
        }
        if ( BaseLevel >= $@MinRange[3] && BaseLevel < $@MaxRange[3] ) {
        dispbottom "type 3";
        'TotalCount = 'MobAM[3];
        areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[3],'MobAM[3],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
        end;
        }
        if ( BaseLevel >= $@MinRange[4] && BaseLevel < $@MaxRange[4] ) {
        dispbottom "type 4";
        'TotalCount = 'MobAM[4];
        areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[4],'MobAM[4],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
        end;
    }
 
                case 2: // Leave Instance
                instance_announce -1,"Finished Training...",bc_self;
                instance_destroy();
                end;
                }
 
        OnThisMobDeath:
            'MobCount++;
        if ( 'MobCount == 'TotalCount )
        {
            dispbottom "Finished mobs.";
            dispbottom "Current round reset.";
            'CurrentRound--;
            'MobCount = 0;
        }
        if ( BaseLevel <= $@MaxRange[1] ) {
        BaseLevel += rand($@MinBase[1],$@MaxBase[1]);
        end;
        }
        if ( BaseLevel >= $@MinRange[2] && BaseLevel < $@MaxRange[2] ) {
        BaseLevel += rand($@MinBase[2],$@MaxBase[2]);
        end;
        }
        if ( BaseLevel >= $@MinRange[3] && BaseLevel < $@MaxRange[3] ) {
        BaseLevel += rand($@MinBase[3],$@MaxBase[3]);
        end;
        }
        if ( BaseLevel >= $@MinRange[4] && BaseLevel < $@MaxRange[4] ) {
        BaseLevel += rand($@MinBase[4],$@MaxBase[4]);
        end;
    }
    end;
 
    OnInstanceInit:
    enablenpc instance_npcname ("Training System#Ins");
    setarray 'MobID[1],1002,1002,1002,1002;
    setarray 'MobAM[1],2,3,4,5;
    setmapflag instance_mapname ("jupe_ele"),mf_nobaseexp;
    setmapflag instance_mapname ("jupe_ele"),mf_nojobexp;
    end;
}
Viewed 1043 times, submitted by Guest.