Jump to content
  • 0
karazu

Announcement to local map only. (MVP reward)

Question

-	script	MVPREWARD	-1,{OnNPCKillEvent:	if ( !getmonsterinfo( killedrid, MOB_MVPEXP ) ) end;	if ( getcharid(1) ) {		getpartymember getcharid(1), 1;		getpartymember getcharid(1), 2;		for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) { // what happens if someone in the party member is offline =/				.@partymemberaid[.@c] = $@partymemberaid[.@i];				.@c++;			}		}		getitem 7615, 1, .@partymemberaid[ rand( .@c ) ];		announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;	}	else {		getitem 7615, 1;		announce "Player ["+ strcharinfo(0) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;	}	end;} 

How to change this that it will only announce to the local map? I don't want to this to spam to all map.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
the 0 at the back, is actually bc_all

its defined in dbconst.txt

 

you can actually just change it into bc_map

announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ), bc_map;

Share this post


Link to post
Share on other sites
  • 0
*mapannounce "<map name>","<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}}};This command will work like 'announce' but will only broadcast to characters currently residing on the specified map. The flag and optional parameters parameters are the same as in 'announce', but target and source flags are ignored.

example:

mapannounce "bat_a01", "Group [1] has taken the work shop, and will now respawn there.",bc_map,"0xFFCE00"; 

 

@edit:

Or use strcharinfo(3)

3 - The name of the map the character is in.

mapannounce ""+strcharinfo(3)+"", "Group [1] has taken the work shop, and will now respawn there.",bc_map,"0xFFCE00";
Edited by kyeme
Added strcharinfo(3) thanks Jabote

Share this post


Link to post
Share on other sites
  • 0

Related to previous kyeme response here's a tip: you can use strcharinfo(3) to get the map name the user is currently in.

 

Will let you do that and test on your own.

Share this post


Link to post
Share on other sites
  • 0

 

announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ) +" at "+ strcharinfo(3), 0;
the 0 at the back, is actually bc_all

its defined in dbconst.txt

 

you can actually just change it into bc_map

announce "Party ["+ strcharinfo(1) +"] has killed "+ getmonsterinfo( killedrid, MOB_NAME ), bc_map;

I will test this one, Thank you very much.

 

 

 

Thank you also to jabote. 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.