Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prontera,155,181,5 script Monster Counting Game 4_F_JPN2,{
- function xy_wall;
- end;
- OnInit:
- .max_round = 3;
- .max_duration = 3;
- .wall_mob_id = 1085;
- setarray .xy_area,
- 151,169,
- 161,179;
- setarray .monster,
- PORING,
- DROPS,
- MARIN,
- POPORING;
- .monster_size = getarraysize( .monster );
- .npc_name$ = strnpcinfo(0);
- getmapxy( .Map$,.npc_x,.npc_y,1 );
- setmapflag .Map$,mf_monster_noteleport;
- end;
- OnMinute00:
- OnStartEvent:
- if ( !.status ) {
- areawarp .Map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],.Map$,.npc_x,.npc_y;
- killmonster .Map$,.npc_name$+"::OnDied";
- killmonster .Map$,.npc_name$+"::OnWallDied";
- setcell .Map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_basilica,1;
- setcell .Map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_walkable,1;
- .status = 1;
- for( .@i = .xy_area[0]; .@i <= .xy_area[2]; .@i++ ){
- xy_wall( .@i,.xy_area[1] );
- xy_wall( .@i,.xy_area[3] );
- }
- for( .@i = .xy_area[1]; .@i <= .xy_area[3]; .@i++ ){
- xy_wall( .xy_area[0],.@i,0 );
- xy_wall( .xy_area[2],.@i );
- }
- do{
- .@round++;
- npctalk "Round # "+.@round;
- sleep 5000;
- .status = 2;
- .@mob = .monster[ rand( .monster_size ) ];
- .@amount = rand( 20,50 );
- // add-on size influence ?
- areamonster .Map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],"",.@mob,.@amount,.npc_name$+"::OnDied";
- deletepset 1;
- defpattern 1,"([^:]+):.*"+.@amount+".$", "OnRight";
- activatepset 1;
- waitingroom "How many's there?",0;
- npctalk "Tell me the correct amount of monster in there.";
- // debugmes " > "+.@amount+" "+getmonsterinfo( .@mob,MOB_NAME );
- sleep ( .max_duration * 60000 );
- killmonster .Map$,.npc_name$+"::OnDied";
- delwaitingroom;
- deletepset 1;
- .status = 1;
- sleep 5000;
- }while( .@round < .max_round );
- npctalk "That's the Last, thank you for participating.";
- emotion e_thx;
- killmonster .Map$,.npc_name$+"::OnDied";
- killmonster .Map$,.npc_name$+"::OnWallDied";
- setcell .Map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_basilica,0;
- setcell .Map$,.xy_area[0],.xy_area[1],.xy_area[2],.xy_area[3],cell_walkable,1;
- .status = 0;
- }
- end;
- OnDied:
- OnWallDied:
- end;
- OnRight:
- getmapxy( .@Map$,.@x,.@y,0 );
- if ( .status == 0 ) {
- dispbottom "[Counting Game] Event isnt running.";
- }
- else if ( .status == 1 ) {
- dispbottom "[Counting Game] Please wait for the round to start.";
- }
- else if ( distance( .npc_x,.npc_y,.@x,.@y ) > 14 ) {
- dispbottom "[Counting Game] You're too far away.";
- }
- else {
- npctalk "Bravo!! "+strcharinfo(0)+" is correct!!";
- // rewards
- getitem 512,1;
- getitem 512,2;
- getitem 512,3;
- specialeffect EF_POTION_CON;
- awake .npc_name$;
- }
- end;
- function xy_wall {
- .@x = getarg(0);
- .@y = getarg(1);
- monster .Map$,.@x,.@y,"",.wall_mob_id,1,.npc_name$+"::OnWallDied";
- setcell .Map$,.@x,.@y,.@x,.@y,cell_walkable,0;
- // setcell .Map$,.@x,.@y,.@x,.@y,cell_basilica,1;
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement