Jump to content
  • 0
Sign in to follow this  
kronobr

Mining for a job

Question

// can someone help for only the Jobs of my choice can use this Npc?
this npc started for harvesting, but i adapted it and now it works as mining.


===== rAthena Script =======================================
//= Item Harvest Event
//=========================  by: =============================
//= pajodex
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project (pajodex)
//===== Description: =========================================
/*

Automated event that runs every 30 mins. Players will enter via
'item harvest farmer' NPC in prontera. Plants will be spawn on
the event map. Each plant will give random items.

Enjoy!

*/
//=====******** Note ********=================================
//= if you find bugs or problem, please do tell DM me at
//= Discord (pajodex#1328) or rAthena (pajodex) 
//= open for suggestions
//===== Additional Comments: =================================
/* 
    1.0 - Initial release
*/
//=============================================================
prontera,150,180,6    script    Item Harvest Farmer    100,{
    if([email protected] == 0) {
    mes "A mineiração começa a cada 30 mins.";
    close;
    }
    else if([email protected] == 1) {
    mes "O evento está começando, quer participar?";
    if(select("Yes:No") == 2) close;
        mes "Good luck!";
        close2;
        warp "pvp_n_1-2",0,0;
        end;
    }
    else {
    mes "A mineiração já começou, entre na próxima";
    close;
    }
    end;

OnInit:
    waitingroom "Mineração de Ores",0;
    end;
}

pvp_n_1-2,0,0,0    script    #plant_spawner    -1,{
OnMinute00: // Runs every 30 mins
OnMinute30: // Runs every 30 mins
OnEventStart:
    if([email protected] != 0) end;
    pvpoff .map$;
    mapwarp .map$,"prontera",150,190,0;
    killmonsterall .map$;
    [email protected] = 1;
        announce "[Mineração] : In 5 mins, será a hora de minerar!",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            sleep 2000;
        announce "[Mineração] : Vá para o minerador para começar a minerar em breve",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            sleep 60000;
        announce "[Mineração] : 4 mins ",0;
            sleep 2000;
        announce "[Mineração] : Vá para o minerador to join",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            sleep 60000;
        announce "[Mineração] : 3 mins ",0;
            sleep 2000;
        announce "[Mineração] : Vá para o minerador to join",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            sleep 60000;
        announce "[Mineração] : 2 mins ",0;
            sleep 2000;
        announce "[Mineração] : Vá para o minerador para começar a minerar em breve",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            sleep 60000;
        announce "[Mineração] : 1 min ",0;
            sleep 2000;
        announce "[Mineração] : Vá para o minerador para começar a minerar em breve",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
            sleep 60000;
        announce "[Mineração] : Hora de mineração!",0;
        mapannounce .map$, "Free up your inventory to carry more items",1,0x00FF00;
        [email protected] = 2;
            sleep 2000;
        mapannounce .map$, "Você tem 2 minutos para minerar!",1,0x00FF00;
            sleep 2000;
        mapannounce .map$, "Cada minério vai te dar um Ore aleatório",1,0x00FF00;
            sleep 2000;
        mapannounce .map$, "Vamos começar! Goodluck!",1,0x00FF00;
        [email protected] = getmapusers(.map$);
        monster .map$,0,0,"Stone",1908,[email protected] * 10,strnpcinfo(0)+"::OnKillPlants";
        initnpctimer;
        end;
        
    OnTimer120000:
        stopnpctimer;
        [email protected] = 0;
        announce "[Item Harvest Event] : A mineração acabou! Til' next time!",0;
        killmonsterall .map$;
        sleep 5000;
        mapwarp .map$,"prontera",150,190,0;
        end;
        
    OnKillPlants:
        [email protected] = rand(getarraysize(.item_drop));
        getitem .item_drop[[email protected]], 1;
            if(.warp_) warp "prontera",150,190;
        end;
    
OnInit:
    // set items
    setarray .item_drop,984,999,722,723,984;
    
    // set map
    .map$ = "pvp_n_1-2";
    
    // warp players out when already killed a plant (1 = on || 0 = off)
    .warp_ = 0; 
    
    // use @itemharvest to activate event.
    bindatcmd "itemharvest",strnpcinfo(3)+"::OnEventStart",0,60;

    
    setarray .mapflag,
        mf_nowarp,    mf_nowarpto,        mf_nosave,
        mf_nomemo,    mf_noteleport,        mf_nopenalty,
        mf_noreturn,    mf_nobranch,        mf_nomobloot,
        mf_nomvploot,    MF_NOZENYPENALTY,    MF_NOTRADE,
        MF_NOCOMMAND,    mf_noskill;
        
    for([email protected] = 0; [email protected] < getarraysize(.map$); [email protected]++){
        for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ )
            setmapflag .map$[[email protected]], .mapflag[[email protected]];
        }
        
    end;

}

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.