Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // just ignore if there are any overwrite
- function script F_InsertComma {
- set .@str$, getarg(0);
- for (set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3)
- set .@str$, insertchar(.@str$,",",.@i);
- return .@str$;
- }
- cmd_fild02,88,96,6 script Digging Supervisor 803,{
- mes .npc_name$;
- if( digquest == 1 ){
- mes "What are you still doing here?";
- next;
- mes .npc_name$;
- mes "Here are the digging spots.";
- callsub( OnShowSpot );
- }
- else{
- mes "Hello. I am Digane, the supervisor here on the digging site.";
- do{
- next;
- mes .npc_name$;
- mes "What can I do for you today?";
- next;
- .@i = 0;
- .@option = select( "What is Digging ?","Start Digging","What do I need for digging?","Cancel" );
- mes .npc_name$;
- switch( .@option ){
- case 1:
- do{
- if( .@i ) mes .npc_name$;
- mes .information$[.@i];
- .@i++;
- if( ( .@i >= .information_size ) ) break;
- next;
- }while( 1 );
- break;
- case 2:
- mes "Okay let me check if you have your equipments first....";
- next;
- mes "[ Digane ]";
- .@fail = 0;
- if( .required_item )
- if( countitem( .required_item ) < 1 ) .@fail++;
- if( Zeny < .required_zeny ) .@fail++;
- if( .@fail ){
- mes "I told you you must have these ";
- if( .required_item )
- mes "^FF00001 x "+getitemname( .required_item )+"^000000";
- if( .required_zeny )
- mes "^FF0000"+F_InsertComma( .required_zeny )+" Zeny^000000";
- mes "on your to start digging.";
- }
- else{
- mes "Okay here are the digging spots.";
- mes "Goodluck.";
- if( .required_zeny )
- Zeny -= .required_zeny;
- digquest = 1;
- message strcharinfo(0),"Digging enabled.";
- callsub( OnShowSpot );
- }
- break;
- case 3:
- do{
- if( .@i ) mes .npc_name$;
- mes .information2$[.@i];
- .@i++;
- if( ( .@i >= .information2_size ) ) break;
- next;
- }while( 1 );
- default: break;
- }
- }while( .@option < 4 && .@option != 2 );
- }
- close;
- OnInit:
- // npc name
- .npc_name$ = "[ Digane ]";
- // required zeny
- .required_zeny = 1000;
- // required item
- .required_item = 7016;
- // how many dig npc
- .total_dig_npc = 8;
- // reward list+ rate
- setarray .reward_list,16134,14135,14596,14380,14440,14448,14343,14287,14288,13606,13890,12109,14234,12214,13989,13807,13855,13809,12031,12029,13889,12034,12030,12032,12033,12028,7005,13851,7102,13849,13849,14232;
- setarray .reward_rate,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50;
- .reward_list_size = getarraysize( .reward_list );
- setarray .information$,
- "Various items can be obtained from this digging site made by the government of Comodo.",
- "Any adventurer who wish to try digging can do so just by talking to me and paying the fee.",
- "Any items you will find is yours to keep.",
- "We have ^FF0000"+.total_dig_npc+" Digging Spots^000000 here and you can dig on those spots one at a time.",
- "Just be careful on landmines, you might encounter one.";
- .information2_size = getarraysize( .information$ );
- setarray .information2$,
- "I need ^FF0000"+F_InsertComma( .required_zeny )+" Zeny^000000 for the digging fee.",
- "You will need a material to dig on those sands.",
- "On each dig that you will perform you will need a ^FF0000"+getitemname( .required_item )+"^000000",
- "I heard that zombie prisoners drop them so you might want to get some from them first.",
- "You can only use the spoon once since it gets broken easily when it hits solid objects like boxes and some other stuffs.",
- "All items that you will find is yours to keep but you will need to talk to me everytime you want to start digging again.",
- "After you finish digging, you will be sent back here automatically.";
- .information2_size = getarraysize( .information2$ );
- getmapxy( .npc_map$,.npc_x,.npc_y,1 );
- end;
- OnShowSpot:
- for( .@i = 1; .@i <= .total_dig_npc; .@i++ )
- if( !getmapxy( .@map$,.@x,.@y,1,"Digging Spot#"+.@i ) )
- viewpoint 1,.@x,.@y,.@i,0xFF0000;
- return;
- }
- // dig npc
- - script dig_spot -1,{
- // doevent "Digging Supervisor::OnDig";
- function dig_process;
- OnDig:
- if( !digquest ){
- mes "A digging spot. People usually dig here on this spot.";
- }
- else{
- for( .@i = 1; .@i <= 3; .@i++ ){
- for( .@x = 0; .@x < .@i; .@x++ )
- mes "*shook*";
- next;
- }
- dig_process( .required_item );
- }
- close;
- // dig_process( <item_id> );
- function dig_process {
- .@item_id = getarg(0);
- .@rand = rand( 152 );
- digquest = 0;
- // found landmine
- if(
- ( .rand >= 10 && .@rand <= 20 ) ||
- ( .@rand >= 45 && .@rand <= 46 && rand(100) > 3 ) ||
- ( .@rand >= 52 && .@rand <= 62 ) ||
- ( .@rand >= 91 && .@rand <= 114 ) ||
- ( .@rand >= 131 && .@rand <= 150 )
- ){
- message strcharinfo(0),"You found a landmine.";
- specialeffect2 EF_IGN_STR;
- unitkill getcharid(3);
- close;
- }
- // found nothing
- else if(
- .@rand <= 10 ||
- ( .@rand >= 47 && .@rand <= 67 ) ||
- ( .@rand >= 87 && .@rand <= 129 )
- ){
- message strcharinfo(0),"You found nothing.";
- }
- // found an item - 20~45, 68~86
- else{
- message strcharinfo(0),"You found an item!!";
- next;
- if( .@item_id ){
- if( countitem( .@item_id ) < 1 )
- .@fail++;
- }
- if( .@fail ){
- mes "But you don't have a "+getitemname( .@item_id )+" on you.";
- }
- else{
- mes "Your ^FF0000"+getitemname( .@item_id )+"^000000 broke as you tried to dig and reach the item.";
- delitem .@item_id,1;
- .@random = rand(100);
- do{
- .@random = rand( .reward_list_size );
- }while( .@random < .reward_rate[.@random] );
- .@reward = .reward_list[ .@random ];
- getitem .@reward,1;
- mes "Gained "+getitemname( .@reward );
- }
- }
- announce "Digane: Okay you're done. Come back here now.",bc_self;
- close2;
- warp .npc_map$,.npc_x,.npc_y;
- return;
- }
- OnInit:
- .required_item = 7016;
- getmapxy( .npc_map$,.npc_x,.npc_y,1,"Digging Supervisor" );
- // reward list+ rate
- setarray .reward_list,16134,14135,14596,14380,14440,14448,14343,14287,14288,13606,13890,12109,14234,12214,13989,13807,13855,13809,12031,12029,13889,12034,12030,12032,12033,12028,7005,13851,7102,13849,13849,14232;
- setarray .reward_rate,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50;
- .reward_list_size = getarraysize( .reward_list );
- end;
- }
- // duplicates dig spot
- cmd_fild02,51,97,5 duplicate(dig_spot) Digging Spot#1 111
- cmd_fild02,162,180,5 duplicate(dig_spot) Digging Spot#2 111
- cmd_fild02,122,174,5 duplicate(dig_spot) Digging Spot#3 111
- cmd_fild02,68,202,5 duplicate(dig_spot) Digging Spot#4 111
- cmd_fild02,232,93,5 duplicate(dig_spot) Digging Spot#5 111
- cmd_fild02,210,135,5 duplicate(dig_spot) Digging Spot#6 111
- cmd_fild02,286,126,5 duplicate(dig_spot) Digging Spot#7 111
- cmd_fild02,323,82,5 duplicate(dig_spot) Digging Spot#8 111
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement