// ============================= /* Farming Map: http://herc.ws/board/topic/13874-farm-room-ticket/ ---------------------------- by: Legend compatible w/: Hercules ---------------------------- Description: * Allows everyone to farm unto one map * Requires an item to be able to enter * Item can be obtain upon entering * Item expires after a specific time * When item expires, player warps to a certain map * When item expires, delay has been set according to your liking before you can enter again * Mapflags are set * Configurable settings * Certain checks are applied */ // ============================= prontera,156,165,4 script Request#1 1_F_MARIA,{ if (countitem(.iid) > 0) { if (!checkfarm) { mes .npc$; mes "Your "+getitemname(.iid)+" is not"; mes "an authentic item and"; mes "has not been registered"; mes "to our system."; close; } mes .npc$; mes "Would you like to be warped"; mes "back to the farming site?"; next; if (select("Yes","No") != 2){ warp .fm$,0,0; end; } close; } if ( delay > gettimetick(2) ){ mes .npc$; mes "You must wait "+(delay - gettimetick(2))+" seconds"; mes "before you can enter again."; close; } if (checkfarm) { mes .npc$; mes "Your time is currently"; mes "running but you lost"; mes "your ^FF0000"+getitemname(.iid)+"^000000 so,"; mes "you need to wait until"; mes "your time will run out."; close; } mes .npc$; mes "I am your Farming manager!"; mes "How may I help you?"; next; switch(select("Information:Farm Now!")){ case 1: mes .npc$; mes "Welcome to Farming Zone!"; mes "You will be able to obtain"; mes "different kinds of items"; mes "you need for your adventure."; next; mes .npc$; mes "Before you can enter inside,"; mes "you will acquire^FF0000 1 "+getitemname(.iid)+"^000000"; mes "and once you entered"; mes "the farm zone, you will"; mes "be given ^FF0000"+.t+" hour/s^000000 before "+getitemname(.iid)+" expires."; next; mes .npc$; mes "When "+getitemname(.iid)+" expires,"; mes "you have ^FF0000"+.del+" seconds^000000 before"; mes "you can enter again."; close; case 2: if (getmapusers(.fm$) >= .mp){ mes .npc$; mes "You can no longer enter"; mes "on the farming map,"; mes "Max Count: ^00ff00"+.mp+"^000000"; mes "Current: ^FF0000"+getmapusers(.fm$)+"^000000 players"; close; } checkfarm = 1; .time = 1000*60*60*.t; // 1 hour message strcharinfo(0),"Good luck "+strcharinfo(0)+"!"; addtimer .time, strnpcinfo(3)+"::OnTrigTime"; getitem .iid,1; close2; sleep2 500; warp .fm$,0,0; end; } OnTrigTime: announce .npc$+" : Times up! "+.t+" hour/s had passed!",bc_self; if (countitem(.iid) > 0) { delitem .iid,1; dispbottom "Farm ticket has been expired!"; } checkfarm = 0; if (.del) delay = gettimetick(2) + .del; if (strcharinfo(3) == .fm$) { sleep2 500; warp .em$,.emx,.emy; } end; OnInit: // -- CONFIG -- .npc$ = "[ Farm Manager ]"; // You can set your npc name here .mp = 99; // Max player count who can enter on the farm map || default (99) = 99 players .t = 1; // (HOUR) when the ticket expires || default (1) = 1 hour .del = 300; // (SECONDS) Delay after the ticket expires || default (300) = 15 minutes .iid = 7711; // Serves as the farm ticket || default (7711) = Event Ticket .fm$ = "morocc"; // Serves as the farming map .em$ = "prontera"; // Serves as the exit map .emx = 160; // Exit map "x" coordinate .emy = 160; // Exit map "y" coordinate // -- set mapflag -- setmapflag .fm$, mf_nomobloot; setmapflag .fm$, mf_nomvploot; setmapflag .fm$, mf_nowarpto; setmapflag .fm$, mf_nochat; setmapflag .fm$, mf_novending; setmapflag .fm$, mf_nocommand,60; setmapflag .fm$, mf_nojobexp; setmapflag .fm$, mf_nobaseexp; end; }