Jump to content
  • 0

wearing eqs restriction when characters enter to a map


retroflav

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   4
  • Joined:  08/09/12
  • Last Seen:  

I hope someone could make a custom command that acts like a mapflag, that whenever players enter on that specific map, all equipped items will be automatically removed and they're not allowed to wear any.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

You mean all equips? Or just specific?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   4
  • Joined:  08/09/12
  • Last Seen:  

all equips will be automatically removed upon entering on that map, and at the same time, you won't be able to wear any of them.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  

all equips will be automatically removed upon entering on that map, and at the same time, you won't be able to wear any of them.

 

Index: conf/battle_athena.conf
===================================================================
--- conf/battle_athena.conf	(revision 17101)
+++ conf/battle_athena.conf	(working copy)
@@ -57,5 +57,8 @@
 // Includes duel, day/night, mute/manner, log settings.
 import: conf/battle/misc.conf
+
+// Import a little conf for mf_noequip
+import: conf/battle/noequip.conf
 
 //Your custom config goes here.
 import: conf/import/battle_conf.txt

Index: conf/battle/noequip.conf
===================================================================
--- conf/battle/noequip.conf	(revision 0)
+++ conf/battle/noequip.conf	(working copy)
@@ -0,0 +0,6 @@
+// [Cydh]
+// noequip is mapflag, you can check it in mapflag\noequip.txt
+// mapflag format [mapname]<tab>mapflag<tab>noequip
+// This mode will disable player to use any equipments in the map that has noequip mapflag
+// except player with Group ID above noequip_belowgrouplv
+noequip_belowgrouplv: 1

Index: conf/mapflag/noequip.txt
===================================================================
--- conf/mapflag/noequip.txt	(revision 0)
+++ conf/mapflag/noequip.txt	(working copy)
@@ -0,0 +0,8 @@
+//===== unOfficial Script =======================================
+//= Map flags that disable players to use any equipments any usable item
+//===== By: ==================================================
+//= Cydh
+//= [mapname]	mapflag	noequip
+//============================================================
+
+//guild_vs5	mapflag	noequip

Index: db/const.txt
===================================================================
--- db/const.txt	(revision 17101)
+++ db/const.txt	(working copy)
@@ -367,3 +367,4 @@
 mf_reset	52
+mf_noequip	53	//mf_noequip
 
 cell_walkable	0
 
Index: npc/scripts_mapflags.conf
===================================================================
--- npc/scripts_mapflags.conf	(revision 17101)
+++ npc/scripts_mapflags.conf	(working copy)
@@ -28,3 +28,4 @@
 npc: conf/mapflag/town.txt
 npc: conf/mapflag/reset.txt
+npc: conf/mapflag/noequip.txt	//mf_noequip
 
Index: src/map/battle.c
===================================================================
--- src/map/battle.c	(revision 17101)
+++ src/map/battle.c	(working copy)
@@ -5877,3 +5877,4 @@
 	{ "mob_size_influence",					&battle_config.mob_size_influence,				0,		0,		1,				},
+	{ "noequip_belowgrouplv",               &battle_config.noequip_belowgrouplv,            1,      0,    MAX_LEVEL,        },	//mf_noequip
 };
 #ifndef STATS_OPT_OUT

Index: src/map/battle.h
===================================================================
--- src/map/battle.h	(revision 17101)
+++ src/map/battle.h	(working copy)
@@ -485,4 +485,5 @@
 	int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95]
+	int noequip_belowgrouplv;	//mf_noequip
 } battle_config;
 
 void do_init_battle(void);

Index: src/map/map.h
===================================================================
--- src/map/map.h	(revision 17101)
+++ src/map/map.h	(working copy)
@@ -563,4 +563,5 @@
 		unsigned src4instance : 1; // To flag this map when it's used as a src map for instances
 		unsigned reset :1; // [Daegaladh]
+		unsigned noequip : 1;	//mf_noequip
 	} flag;
 	struct point save;
	
Index: src/map/npc.c
===================================================================
--- src/map/npc.c	(revision 17101)
+++ src/map/npc.c	(working copy)
@@ -3396,4 +3396,7 @@
 	else if (!strcmpi(w3,"reset"))
 		map[m].flag.reset=state;
+	else if (!strcmpi(w3,"noequip"))	//mf_noequip
+		map[m].flag.noequip=state;
 	else
 		ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer));

Index: src/map/pc.c
===================================================================
--- src/map/pc.c	(revision 17101)
+++ src/map/pc.c	(working copy)
@@ -8270,6 +8270,12 @@
 		clif_equipitemack(sd,n,0,0);	// fail
 		return 0;
 	}
 
+	if( map[sd->bl.m].flag.noequip && pc_get_group_level(sd) < battle_config.noequip_belowgrouplv)	//mf_noequip
+	{
+		clif_displaymessage (sd->fd, "You can't wear any equipments at this map.");
+		return 0;
+	}
+
 	if(pos == EQP_ACC) { //Accesories should only go in one of the two,
 		pos = req_pos&EQP_ACC;

Index: src/map/script.c
===================================================================
--- src/map/script.c	(revision 17101)
+++ src/map/script.c	(working copy)
@@ -401,3 +401,4 @@
 	MF_BATTLEGROUND,
- 	MF_RESET
+ 	MF_RESET,
+	MF_noequip	//mf_noequip
 };
@@ -10707,4 +10707,5 @@
 			case MF_BATTLEGROUND:		script_pushint(st,map[m].flag.battleground); break;
 			case MF_RESET:				script_pushint(st,map[m].flag.reset); break;
+			case MF_NOEQUIP:			script_pushint(st,map[m].flag.noequip); break;	//mf_noequip
 		}
 	}
@@ -10807,4 +10807,5 @@
 			case MF_BATTLEGROUND:		map[m].flag.battleground = (val <= 0 || val > 2) ? 1 : val; break;
 			case MF_RESET:				map[m].flag.reset = 1; break;
+			case MF_NOEQUIP:			map[m].flag.noequip = 1; break;	//mf_noequip
 		}
 	}
@@ -10894,4 +10894,5 @@
 			case MF_BATTLEGROUND:		map[m].flag.battleground = 0; break;
 			case MF_RESET:				map[m].flag.reset = 0; break;
+			case MF_NOEQUIP:			map[m].flag.noequip=0; break;	//mf_noequip
 		}
 	}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   4
  • Joined:  08/09/12
  • Last Seen:  

wow thanks.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  87
  • Reputation:   4
  • Joined:  08/09/12
  • Last Seen:  

There's a problem... After applying the patch, compile went fine, start went fine, but it's not working at all. It's not even recognized as a mapflag when I use @mapflag noequip it's not being recognized at all :(



So, I made it work... the actual mapflag works. You're not able to equip any item, but the problem is, when you enter on that map, it doesnt automatically remove all your eqs, and secondly, it's not recognized in @mapflag, when you do @mapflag, theres no such mapflag named "noequip" it doesnt recognize it. And lastly, theres a typo error in your patch mf_noequip should be all caps.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Did it work? i've been looking for something like it but i'm not sure if it automatically unequip, did it work for you?

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