Jump to content

Quests, Games: Monster Counting Game


Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Monster Counting Game


A mini event where a numbers of monsters will be spawned within a specified area. Players have to count for the monsters that exist within that area and tell the NPC to win the event.

Btw, this is just a new version of event based on my previous Flower Counting Event.

Thank you @AnnieRuru for delivering me the idea of using "live" monsters.

Configuration:

	OnInit:		// how many rounds		.max_round = 3;				// minute each round		.max_duration = 3;				// dummy mob id represent wall		.wall_mob_id = 1085;				// ( x1,y1,x2,y2 ) area for event		setarray .xy_area,			151,169,		// ( x1,y1 )			161,179;		// ( x2,y2 )					// monster list used in event		setarray .monster,			1002,			1031,			1836,			1595;

Preview :

Feel free to share your idea/opinions to improve this.


 

  • Upvote 4
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  173
  • Reputation:   9
  • Joined:  11/14/12
  • Last Seen:  

It looks really awesome, thanks!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  08/09/14
  • Last Seen:  

is it possible to warp player that are inside the cell to some where else?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

is it possible to warp player that are inside the cell to some where else?

Oh, forgotten that xD

 

Updated script to v1.1.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

can we include also the spam check?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

can we include also the spam check?

you can refer my flower counting script to add that.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

Woa awesome script! *5/5*

 

thank you so much for such amazing script o:!

 

Edit:

may i ask, ho to make it to start when clicked? or by pm? o:!

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Kido

OnWhisperGlobal:
	if( getgmlevel() < 99 ) end;
	detachrid;
OnMinute00:	// start every hour

find and add..

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

@Kido

OnWhisperGlobal:
	if( getgmlevel() < 99 ) end;
	detachrid;
OnMinute00:	// start every hour

find and add..

 

Thank you so much it's working awsm o:! dunno why, players can kill the mushrooms D:

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  08/09/14
  • Last Seen:  

When player tried to put answer within a rows, its crash the map server?
E.g Player : 11 12 13 14 15 16 17 18
Player 2 : 23 24 25 26 27 28 29 30

Any idea?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Moofie91

it seem fine for me, my map-server didnt crash even though i try to answer using your way.

JVVXRZT.jpg

 

 

anyway, updated script to avoid this kind of "answer" which exploit the event behaviours.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  127
  • Topics Per Day:  0.03
  • Content Count:  1445
  • Reputation:   163
  • Joined:  08/17/13
  • Last Seen:  

My players can kill the mushrooms D:

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

im trying to add the spam protection from Emistry flower counting, can you  verify if this is ok?  Thanks :D

prontera,155,181,5	script	Monster Counting Game	757,{
mes "This is a Monsters Counting Game";
mes "I will summon some Monsters here, and you have to count the Correct Amount of Monsters i summoned.";
mes "^FF0000Only Count for the Monsters i mentioned^000000";
next;
switch( select( "Information",
				( getgmlevel() < .GMLevel || .status )?"":"^FF0000[GM]^000000 Start Game",
				( getgmlevel() < .GMLevel || !.status )?"":"^FF0000[GM]^000000 End Game" )){
				
case 1:
	mes "When the Event Start, i will summon some Monsters at a small area, and players have to count the amount of the flowers.";
	mes "Whoever tell me the correct amount of Monsters i mentioned, he/she win the game.";
	break;
	
case 2:
	mes "Event will begin right now.";
	close2;
	donpcevent strnpcinfo(0)+"::OnStartEvent";
	end;

case 3:
	deletepset 1;
	npctalk "Counting Game Cancelled.";
	mes "Game Cancelled.";
	killmonster .map$,"All";
	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;
	delwaitingroom;
	break;
}
close;

OnSpammed:
	.@Spam = 0;
	end;

iSpam:
	if( getgmlevel() > 90 ) end;
	set @Spam,@Spam + 1;
	if( @Spam >= .Spam ){	// 3 Continuos Answer will trigger...
		set @SpamDelay,gettimetick(2) + .Spam;
		dispbottom "SPAM Detected, your answer within next "+.Spam+" Seconds will be Ignored.";
	}
	deltimer strnpcinfo(0)+"::OnSpammed";
	addtimer ( .Spam * 1000 ),strnpcinfo(0)+"::OnSpammed";
	end;

OnRight:
		.@Spam = 0;
		deltimer strnpcinfo(0)+"::OnSpammed";
		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 if( @SpamDelay > gettimetick(2) ){
			message strcharinfo(0),"SPAM Protection : Remain "+( @SpamDelay - gettimetick(2) )+" seconds.";
		}
		else {
			npctalk "Bravo!! "+strcharinfo(0)+" is correct!!";
			
			// rewards
			getitem 512,1;
			getitem 512,2;
			getitem 512,3;
			
			specialeffect2 EF_POTION_CON;
			awake .npc_name$;
		}
		end;


	function xy_wall;
	end;
	
	OnInit:
		//	Min. GM Level to access GM Panel
		.GMLevel = 80;
		.Spam = 3;
		.Delay = 10;
		.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";
				defpattern 1,"([^:]+):.*.*", "iSpam";

				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;


		
	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;
	}

}
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  05/31/13
  • Last Seen:  

.......

g163021e152.jpg

I correct it to 1002 then it is ok

Edited by ccp033102
Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

My players can kill the mushrooms D:

yah same issue to me waiting for emistry to fix this :(

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  57
  • Reputation:   2
  • Joined:  03/03/15
  • Last Seen:  

<--- first time to make a ragnarok private server

 

how can i add this script?

can u teach my step by step ?

 

thank you!!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   95
  • Joined:  09/30/14
  • Last Seen:  

I'd rename the text file you download from "Monster Counting Game 1.2.txt" to "monstercounting.txt"

After that, put the script inside your npc/ folder. Probably inside npc/custom/

Then inside your same npc/ folder, look for the file called scripts_custom.conf and add a line to it saying

npc: npc/custom/monstercounting.txt 

Or whatever you ended up naming the text file.

Once that's done all you need to do is log in as a GM with sufficient powers, and type in @reloadscript and the script will be loaded onto the server.

Or you can restart the server as well, either works.

Link to comment
Share on other sites

  • 5 months later...

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   0
  • Joined:  09/10/14
  • Last Seen:  

Please Tell me how to make so that one player takes no more than 3 answers for 1 round?

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  12/28/16
  • Last Seen:  

How do you change the map where the event is held? I assume its where the npc is located? or am i wrong? 

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

On 8/22/2015 at 10:08 PM, qabakrall said:

Please Tell me how to make so that one player takes no more than 3 answers for 1 round?

.Spam = 3;

 

1 hour ago, BreezyRO said:

I assume its where the npc is located

yes

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  11/17/16
  • Last Seen:  

On 11/30/2014 at 7:09 PM, ccp033102 said:

g163021e152.jpg

I correct it to 1002 then it is ok

i had the same problem now. where to replace that 1002?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

setarray .monster,
			PORING,
			DROPS,
			MARIN,
			POPORING;

replace with monster id.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  11/17/16
  • Last Seen:  

On 1/27/2017 at 4:03 PM, Emistry said:

setarray .monster,
			PORING,
			DROPS,
			MARIN,
			POPORING;

replace with monster id.

Thank you!

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

hello, I was testing this script and i found a few glitches. 

  • The wall of mushrooms are killable
  • The mobs in the area are killable with aoes
  • npc wont hear your answer unless the answer follows a space 

    not sure maybe setcell basilica changed ? maybe using a setmapflag skilldamage 2 to disable mob killing ? 

its a fun minigame. not sure if anyone else noticed these.

 

Edited by mirabell
fix post
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   2
  • Joined:  03/30/16
  • Last Seen:  

On 4/10/2017 at 2:56 AM, mirabell said:

hello, I was testing this script and i found a few glitches. 

  • The wall of mushrooms are killable
  • The mobs in the area are killable with aoes
  • npc wont hear your answer unless the answer follows a space 

    not sure maybe setcell basilica changed ? maybe using a setmapflag skilldamage 2 to disable mob killing ? 

its a fun minigame. not sure if anyone else noticed these.

 

Experienced the same problem. How to make mushrooms and monsters invulnerable?

Edit: Got mine working properly.

map.c

Quote

switch( cell ) {
case CELL_WALKABLE: map[m].cell[j].walkable = flag; break;
case CELL_SHOOTABLE: map[m].cell[j].shootable = flag; break;
case CELL_WATER: map[m].cell[j].water = flag; break;
 
case CELL_NPC: map[m].cell[j].npc = flag; break;
case CELL_BASILICA: map[m].cell[j].basilica = flag; break;
case CELL_LANDPROTECTOR: map[m].cell[j].landprotector = flag; break;
case CELL_NOVENDING: map[m].cell[j].novending = flag; break;
case CELL_NOCHAT: map[m].cell[j].nochat = flag; break;
default:
ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell);
break;
}

Looks like set_cell function type is case sensitive.

Also, I put the set_cell line at OnMinute59: 

Edited by akosivinmark
Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   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.

×
×
  • Create New...