Requesting this Map Condition Script

Reins

New member
Messages
99
Points
0
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!

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

 
Last edited by a moderator:
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!
default_tongue.png


Code:
-	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
 
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!
default_tongue.png




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

 
Hi Guys your suggested script are not working
default_sad.png


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


 

22.jpg

 
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?

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


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

 
Code:
-    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
 
Thanks its solved now. @Garr sorry for that thing next time i'll elaborate if what emulator i'm using btw thanks also
default_wink.png


 
-    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

 
Back
Top