viewing paste topic/4652- raid_instances_deny2 | 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
prontera,156,189,5  script  Raid    100,{
    mes "This is Raid Dungeon.";
    mes "you need to make a party of MAXIMUM of 15Members and a MINIMUM of 10Members.. so i can allow you to dive inside.";
    mes "Inside this raid dungeon, there would be 7 Levels of Mob.";
    mes "Lever 1, Lever 2, Lever 3, and so on and so forth";
    mes "as the Lvl increases the more the mobs gets stronger. so better be carefull";
    mes "the next lever will appear after you finish the mobs  of ( e.g. Lever 1 )";
    mes "after Lever 1-7 which is normal mobs";
    mes "the Lever for boss of this raid dungeon will appear";
    mes "NOTE: this is a custom mob Boss Monster so u better be prepare what ever it happens";
    mes "and oh i forgot (your party has only 15 lives)";
    mes "you can ressurect them by using Yggdrasil leaf or Skill of priest";
    mes "but remember just 15 Lives. if ur party exceed this limit you party will be automatically warped out";
    mes "so are you ready?";
    mes "here we go";
    next;
    if ( !getcharid(1) ) {
        mes "You have to form a party to play.";
        close;
    }
    if ( getpartyleader( getcharid(1), 2 ) != getcharid(0) ) {
        mes "Only the party leader can register.";
        close;
    }
    if ( !countitem( .register_item ) ) {
        mes "you don't have "+ getitemname( .register_item );
        close;
    }
    .@origin = getcharid(3);
    getpartymember getcharid(1), 1;
    getpartymember getcharid(1), 2;
    for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
            attachrid $@partymemberaid[.@i];
            if ( strcharinfo(3) == strnpcinfo(4) ) {
                .@online++;
                if ( #raid_ins_deny + .deny_enter > gettimetick(2) ) {
                    .@denyname$[.@denycount] = strcharinfo(0);
                    .@denytime[.@denycount] = #raid_ins_deny + .deny_enter;
                    .@denycount++;
                }
            }
        }
    }
    attachrid .@origin;
    if ( $@partymembercount != .register_min ) {
        mes "[MvP Ladder Warper]";
        mes "You have to form a party with exactly "+ .register_min +" members to play.";
        close;
    }
    else if ( .@online != .register_min )  {
        mes "[MvP Ladder Warper]";
        mes "Your party must have "+ .register_min +" members online on map '"+ strnpcinfo(4) +"'.";
        close;
    }
    else if ( .@denycount ) {
        mes "[MvP Ladder Warper]";
        mes "There are a few party members that just enter this dungeon recently";
        for ( .@i = 0; .@i < .@denycount; .@i++ )
            mes ( .@i +1 ) +". "+ .@denyname$[.@i] +" has to come back in "+ callfunc( "Time2Str", .@denytime );
        close;
    }
    if ( ( .@ins = instance_create( "Raid Dungeon", getcharid(1), IOT_PARTY ) ) < 0 ) {
        mes "error : "+ .@ins;
        close;
    }
    if ( instance_attachmap( "guild_vs2", .@ins, 1, getcharid(1)+"RAID" ) == "" ) {
        mes "error : 5";
        instance_destroy .@ins;
        close;
    }
    instance_set_timeout 0, 1, .@ins;
    instance_init .@ins;
    instance_attach .@ins;
    delitem .register_item, 1;
    for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
            attachrid $@partymemberaid[.@i];
            if ( strcharinfo(3) == strnpcinfo(4) ) {
                #raid_ins_deny = gettimetick(2);
                warp has_instance("guild_vs2"), 0,0;
            }
        }
    }
    'lives = .party_lives;
    end;
OnInit:
    .register_min = 2; // the exact amount of party members to have in the party to start
    .register_item = 501; // this item is require to start the event
    .party_lives = 15; // number of lives for the party members to lose their life, otherwise they'll fail at this event
    .deny_enter = 30; // how many seconds to deny them from keep entering this instanced dungeon
 
    setarray .round1[0], 1001,20, 1001,20;
    setarray .round2[0], 1031,20, 1032,20;
    setarray .round3[0], 1111,20, 1113,20;
    .totalround = 3;
 
    getmapxy .map$, .x, .y, 1;
    end;
OnPCDieEvent:
    if ( strcharinfo(3) == has_instance("guild_vs2") ) {
        instance_attach has_instance2( "guild_vs2" );
        'lives--;
        if ( !'lives ) {
            instance_announce -1, "Your party has used up all the lives", bc_map;
            .@map$ = strcharinfo(3);
            killmonsterall .@map$;
            sleep 5000;
            mapwarp .@map$, .map$, .x, .y;
        }
        else {
            instance_announce -1, "Your party still has "+ 'lives +" lives left", bc_map;
        }
    }
    end;
}
guild_vs2,0,0,0 script  Raid_ins    -1,{
OnInstanceInit:
    sleep 2000; // delay abit
Ondead:
    if ( 'round ) 'killed++;
    if ( 'killed < 'total ) end;
    .@main$ = "Raid"; // main npc name
    'round++;
    'killed = 0;
    if ( 'round == getvariableofnpc( .totalround, .@main$ ) +1 ) {
        instance_announce -1, "Congratulations !", bc_all;
        sleep 2000;
        instance_warpall getvariableofnpc( .map$, .@main$ ), getvariableofnpc( .x, .@main$ ), getvariableofnpc( .y, .@main$ );
        end;
    }
    instance_announce -1, "Prepare for Level "+ 'round +" Mobs...", bc_all;
    sleep 2000;
    .@size = getarraysize( getvariableofnpc( getd( ".round"+ 'round ), .@main$ ) );
    'total = 0;
    for ( .@j = 0; .@j < .@size; .@j += 2 ) {
        monster has_instance( "guild_vs2" ), 49,49, "--ja--", getvariableofnpc( getelementofarray( getd( ".round"+ 'round ), .@j ), .@main$ ), getvariableofnpc( getelementofarray( getd( ".round"+ 'round ), .@j +1 ), .@main$ ), instance_npcname( strnpcinfo(0) )+"::Ondead";
        'total = 'total + getvariableofnpc( getelementofarray( getd( ".round"+ 'round ), .@j +1 ), .@main$ );
    }
    end;
}
 
guild_vs2   mapflag nowarp
guild_vs2   mapflag nowarpto
guild_vs2   mapflag nomemo
guild_vs2   mapflag nosave  SavePoint
guild_vs2   mapflag partylock
guild_vs2   mapflag src4instance
Viewed 1570 times, submitted by AnnieRuru.