Jump to content
  • 0
Sign in to follow this  
Reins

Requesting this Map Condition Script

Question

Hi hercules,

I would like to request a map condition script which works like this example in mjo_dun03,mjo_dun02(Coal Mines) you need to wear gas mask headgear ItemID#5005 before you enter on the map it will check if you are wearing it or else in 5 seconds you will be dead and respawn to the last savepoint thanks!

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0
-    script    ItemRestrict    -1,{    OnPCLoadMapEvent:        while ( strcharinfo( 3 ) == "mjo_dun02" || strcharinfo( 3 ) == "mjo_dun03" ) {            if ( getequipid( EQI_HEAD_MID ) != 5005 ) {                message strcharinfo( 0 ), "You will be out on this map after five seconds";                sleep2 5000;                atcommand "@die";                sleep2 500;                warp "SavePoint", 0, 0;                end;            }            sleep2 1000;        }        end;}mjo_dun02    mapflag    loadeventmjo_dun03    mapflag    loadevent

Share this post


Link to post
Share on other sites
  • 0
-	script	CoalMinesMapDeath	-1,{	end;OnPCLoadMapEvent:	if( strcharinfo(PC_MAP) != "mjo_dun02" && strcharinfo(PC_MAP) != "mjo_map03") end;	if( getequipid(EQI_HEAD_MID) == 5005 ) end;	sleep2 5000;	atcommand "@die";	sleep2 500;	warp "Save",0,0;	end;}mjo_dun02	mapflag	loadeventmjo_dun03	mapflag	loadevent

Not tested, but should work, I think.

Note: this check will run on every warping in map, be it via warp or just using fly wing.

Edited by Garr

Share this post


Link to post
Share on other sites
  • 0

If you want the script to check once the character entered the map then use the method given by @Garr. Take note that after the first check the script would not check it anymore for the second time so the tendency is player can un-equip their gas mask after they entered the map. It would be better if you continuously check if they have the gas mask until they leave the map. Use while instead of if and use some sleep to prevent infinity loop! :P

-	script	ItemRestrict	-1,{	OnPCLoadMapEvent:		while ( strcharinfo( PC_MAP ) == "mjo_dun02" || strcharinfo( PC_MAP ) == "mjo_dun03" ) {			if ( getequipid( EQI_HEAD_MID ) != 5005 ) {				message strcharinfo( PC_NAME ), "You will be out on this map after five seconds";				sleep2 5000;				atcommand "@die";				sleep2 500;				warp "SavePoint", 0, 0;				end;			}			sleep2 1000;		}		end;}mjo_dun02	mapflag	loadeventmjo_dun03	mapflag	loadevent

Share this post


Link to post
Share on other sites
  • 0

 

If you want the script to check once the character entered the map then use the method given by @Garr. Take note that after the first check the script would not check it anymore for the second time so the tendency is player can un-equip their gas mask after they entered the map. It would be better if you continuously check if they have the gas mask until they leave the map. Use while instead of if and use some sleep to prevent infinity loop! :P

-	script	ItemRestrict	-1,{	OnPCLoadMapEvent:		while ( strcharinfo( PC_MAP ) == "mjo_dun02" || strcharinfo( PC_MAP ) == "mjo_dun03" ) {			if ( getequipid( EQI_HEAD_MID ) != 5005 ) {				message strcharinfo( PC_NAME ), "You will be out on this map after five seconds";				sleep2 5000;				atcommand "@die";				sleep2 500;				warp "SavePoint", 0, 0;				end;			}			sleep2 1000;		}		end;}mjo_dun02	mapflag	loadeventmjo_dun03	mapflag	loadevent

Hmm. Are you not afraid that if the character teleports (and, let's face it, people teleport a lot on mjo_dun02) it will start yet another copy of this script on him, so you'll effectively run well over 1 cheking script on the player? It'd need some kind of extra layer of protection so that people who have this check running already would be excluded from triggering it once more...

Share this post


Link to post
Share on other sites
  • 0

Hi Guys your suggested script are not working :(

@Patskie & @Garr no errors but the script wont work
@Emistry - it has error see the image below


 

post-1143-0-14841100-1421221011_thumb.jpg

Share this post


Link to post
Share on other sites
  • 0

Try this one:

-	script	CoalMinesMapDeath	-1,{	end;OnPCLoadMapEvent:	if( strcharinfo(3) != "mjo_dun02" && strcharinfo(3) != "mjo_map03") end;	if( getequipid(EQI_HEAD_MID) == 5005 ) end;	sleep2 5000;	atcommand "@die";	sleep2 500;	warp "Save",0,0;	end;}mjo_dun02	mapflag	loadeventmjo_dun03	mapflag	loadevent

 

Are you using rAthena by chance?

Share this post


Link to post
Share on other sites
  • 0

Try this one:

-	script	CoalMinesMapDeath	-1,{	end;OnPCLoadMapEvent:	if( strcharinfo(3) != "mjo_dun02" && strcharinfo(3) != "mjo_map03") end;	if( getequipid(EQI_HEAD_MID) == 5005 ) end;	sleep2 5000;	atcommand "@die";	sleep2 500;	warp "Save",0,0;	end;}mjo_dun02	mapflag	loadeventmjo_dun03	mapflag	loadevent

 

Are you using rAthena by chance?

yes because i have some sort of custom modifications that don't work on hercules :(

Share this post


Link to post
Share on other sites
  • 0

Guessed so. Just for the future when you ask for script, please mention that you're using rAthena, as Hercules and rAthena have a bit different scripting (and that's the reason scripts that were given to you didn't work, they were relying on constants that are not present in rAthena).

Share this post


Link to post
Share on other sites
  • 0

 

-    script    ItemRestrict    -1,{    OnPCLoadMapEvent:        while ( strcharinfo( 3 ) == "mjo_dun02" || strcharinfo( 3 ) == "mjo_dun03" ) {            if ( getequipid( EQI_HEAD_MID ) != 5005 ) {                message strcharinfo( 0 ), "You will be out on this map after five seconds";                sleep2 5000;                atcommand "@die";                sleep2 500;                warp "SavePoint", 0, 0;                end;            }            sleep2 1000;        }        end;}mjo_dun02    mapflag    loadeventmjo_dun03    mapflag    loadevent

btw Patskie how will i add also a condition which is if a player is currently with using a certain palette because i have a skin palettes let say the player doesn't wear the gas mask but it has palette(cloth and hair) #500 for example which is make him/her immune to map's condition script

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.