Jump to content
  • 0
Sign in to follow this  
bWolfie

getmapflag for zone

Question

I am trying to use getmapflag to detect a zone, but cannot get it to work.

Is it possible. Any advice?

 

Thank you.

 

 

if (getmapflag("" + strcharinfo(PC_MAP) + "", mf_zone) == "Memorial Dungeon") script here;
else other script here;
end;

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I'm not sure if can be possible of that, but an alternative that I can suggest is, if you are setting mf_zone by npc, use a temporary global variable to save the fact that you already setted that mapflag according to your needs, and then do the check over that variable.

Share this post


Link to post
Share on other sites
  • 0

I'm not sure if can be possible of that, but an alternative that I can suggest is, if you are setting mf_zone by npc, use a temporary global variable to save the fact that you already setted that mapflag according to your needs, and then do the check over that variable.

 

Hm well, I want to edit an item script, Giggling Box to be precise, so it will have a different effect in Memorial Dungeon than in general game play.

Any advice for that one? :o

Share this post


Link to post
Share on other sites
  • 0

Since normal instance maps has all of them an "@" in their name, you can use that for identify the instance maps using compare() script command. In example, give this script to the Giggling Box:

 

	Script: <"
		if (compare(strcharinfo(PC_MAP), "@"))
			announce "You are on an Instance Map.", bc_self;
		else
			announce "You aren't on an Instance Map.", bc_self;
	">

That script will compare if the string "@" is contained inside the string generated by strcharinfo(PC_MAP), so, if player is in an instance map (let's say 1@tower) it will return true (1) otherwise it will return false (0) when name doesn't have the "@" string.

Edited by Ragno

Share this post


Link to post
Share on other sites
  • 0

Since normal instance maps has all of them an "@" in their name, you can use that for identify the instance maps using compare() script command. In example, give this script to the Giggling Box:

 

	Script: <"
		if (compare(strcharinfo(PC_MAP), "@"))
			announce "You are on an Instance Map.", bc_self;
		else
			announce "You aren't on an Instance Map.", bc_self;
	">

That script will compare if the string "@" is contained inside the string generated by strcharinfo(PC_MAP), so, if player is in an instance map (let's say 1@tower) it will return true (1) otherwise it will return false (0) when name doesn't have the "@" string.

 

Thank you, sir. I think this is the best that can be done.

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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