viewing paste 4meowmessy instance farming | Athena

Posted on the | Last edited on
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
prontera,155,185,5  script  Farming Instance    1_F_MARIA,{
    mes "[ ^551A8B Farming Instance ^000000 ]";
    if ( has_instance2("1@def01") >= 0 ) {
        mes "resume farming ?";
        next;
        if ( select( "Yes", "No" ) == 2 ) close;
        warp has_instance("1@def01"), 0,0;
        end;
    }
    if ( #farmroomdelay + .delayenter > gettimetick(2) ) {
        mes "wait for "+( #farmroomdelay + .delayenter - gettimetick(2) )+" seconds.";
        close;
    }
    mes "blah ... blah...";
    next;
    if ( select( "Yes, I want to farm", "No thanks." ) == 2 ) {
        mes "Alright then, come again another time!";
        close;
    }
    mes "Attempting to open the dimension gate to enter the realm of bountiful item farming.";
    sleep2 200;
    mes "The gate is OPEN! Good luck on farming!";
    mes "Watch as the rift engulfs you!";
    specialeffect2 EF_AGIUP2;
    announce "[Entering Farming Instance]",bc_self;
    sleep2 45;
    specialeffect2 EF_HEALSP;
    specialeffect2 EF_M05;
    sleep2 20;
    .@instance = instance_create( "Farming Instance", getcharid( 3 ), IOT_CHAR);
    if ( .@instance < 0 ) {
        dispbottom "Instance Failed.";
        end;
    }
    dispbottom "^0000ff" + "Farming Instance" + "^000000- Attempting to create Farm Instance.";
    if ( instance_attachmap("1@def01",.@instance) == "" ) {
        instance_destroy( .@instance );
        dispbottom "Failed to instance yuno_fild02/Instance Name: 1@def01";
        end;
    }
    dispbottom "^0000ff" + "Farming Instance" + " attempt successful on Instance attach!";
    instance_set_timeout 3600, 300;
    instance_attach .@instance;
    instance_init .@instance;
    warp instance_mapname("1@def01"),0,0;
    #farmroomdelay = gettimetick(2);
    end;
OnInit:
    .delayenter = 20; // how many seconds delay to enter again ?
    .maxfarmitemlimit = 3; // can farm how many items before being kick out ?
    .farmrate = 50; // n% chance to get an item. 50 = 50%
    setarray .item, // what are the items can get from farming inside this instance ?
        Flamberge,
        Ring_Pommel_Saber,
        Claymore,
        Buster,
        Two_Handed_Axe,
        Stunner,
        Finger,
        Lance;
 
    .itemsize = getarraysize( .item );
    end;
}
 
1@def01,0,0,0   script  FarmInstance#Ins    FAKE_NPC,{
OnInstanceInit:
    monster instance_mapname("1@def01"),0,0,"[ Farm Zone ] Resident",PORING,50,instance_npcname("FarmInstance#Ins")+"::OnFarmItem";
    'mainnpc$ = "Farming Instance";
    'maxfarmitemlimit = getvariableofnpc( .maxfarmitemlimit, "Farming Instance" );
    'farmrate = getvariableofnpc( .farmrate, "Farming Instance" );
    'itemsize = getvariableofnpc( .itemsize, "Farming Instance" );
    copyarray 'itemid, getvariableofnpc( .item, "Farming Instance" ), 'itemsize;
    end;
OnFarmItem:
    monster instance_mapname("1@def01"),0,0,"[ Farm Zone ] Resident",PORING,1,instance_npcname("FarmInstance#Ins")+"::OnFarmItem";
    if ( 'farmcount < 'maxfarmitemlimit && rand(100) < 'farmrate ) {
        getitem 'itemid[ rand( 'itemsize ) ], 1;
        dispbottom "[ Farm Zone ] : Farmed ["+( ++'farmcount )+" / "+ 'maxfarmitemlimit +"] Items";
        if ( 'farmcount == 'maxfarmitemlimit ) {
            message strcharinfo(0),"Limit Reach , you may join again later.";
            sleep2 5000;
            warp "Save", 0,0;
            instance_destroy();
            end;
        }
    }
    end;
}
1@def01 mapflag nomobloot
Viewed 1326 times, submitted by AnnieRuru.