Jump to content
  • 0

Need a little mod <3


Mabuhay

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Please help me mod my script. 

 

1.) if the @map$ = is not available as a map, it will notify the GM that the map he wrote is invalid.

 sample: "if he input 'protea' instead or 'prontera', the npc will say 'Invalid map' "

 

2.) After map has been selected. All skills will be disabled on the specified map from @map$.

 

Here is my script:

-	script	spawnevent	-1,{
OnInit:
	.correct = 10; // spawn the special zombies
	.wrong = 90; // spawn the normal zombies
	end;
	
OnWhisperGlobal:
	if(getgroupid() < 4) end;
	else if ( compare( @whispervar0$, "on" ) || compare( @whispervar0$, "start" ) ) {
		mes "What map to spwn?";
		input @map$;
		set @2map$,@map$;
		if ( .count )
			dispbottom "event already started";
		else
			goto L_Start;
	}
	else if ( compare( @whispervar0$, "off" ) || compare( @whispervar0$, "end" ) ) {
		if ( !.count )
			dispbottom "event not yet start";
		else
			goto L_End;
	}
	else if ( !.count )
		dispbottom "event is currently not running";
	else
		dispbottom "event is currently running. "+ .count +" poring left";
	end;
	
L_Start:
	.count = .correct;
	announce "Apocalypse has begun at "+ @2map$ +".", 0;
	monster @2map$, 0,0, "Zombie", 1898, .correct, strnpcinfo(0)+"::OnCorrectKill";
	monster @2map$, 0,0, "Zombie", 1898, .wrong, strnpcinfo(0)+"::OnWrongKill";
	if ( !.count ) end;

OnWrongKill:
		end;	
		
OnCorrectKill:
	.count--;
	getitem 909,1; // item reward
	if ( .count )
		announce strcharinfo(0) +" killed a special zombie. "+ .count +" special zombie(s) left", 1;
	else
		goto L_End;
	end;


L_End:
	.count = 0;
	announce "All special zombies are dead. Apocalypse has ended.", 0;
	killmonster @2map$, strnpcinfo(0)+"::OnCorrectKill";
	killmonster @2map$, strnpcinfo(0)+"::OnWrongKill";
	end;
}

 

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

1.) if the @map$ = is not available as a map, it will notify the GM that the map he wrote is invalid.

 sample: "if he input 'protea' instead or 'prontera', the npc will say 'Invalid map' "
input @map$;
if ( getmapusers( @map$ ) == -1 ) {
	mes "Invalid map.";
	close;
}

 

 

After map has been selected. All skills will be disabled on the specified map from @map$.

 

setmapflag @map$,mf_noskill;

 

 

There is a mistake in

L_End:
	.count = 0;
	announce "All special zombies are dead. Apocalypse has ended.", 0;
	killmonster @2map$, strnpcinfo(0)+"::OnCorrectKill";
	killmonster @2map$, strnpcinfo(0)+"::OnWrongKill";
	end;

@2map$ is defined for the gm, null for player

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Thanks :)



 There is a mistake in

 

L_End:
    .count = 0;
    announce "All special zombies are dead. Apocalypse has ended.", 0;
    killmonster @2map$, strnpcinfo(0)+"::OnCorrectKill";
    killmonster @2map$, strnpcinfo(0)+"::OnWrongKill";
    end;
 

@2map$ is defined for the gmnull for player

 

 

About this part. Im not good at scripting, so if you mind? :D how can i fix this :D

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

×
×
  • Create New...