Jump to content
  • 0

Certain map weapon restriction


Question

23 answers to this question

Recommended Posts

Posted (edited)

Well here is the thing, I don't want to enter each and every item that I don't want players to be able to equip on a certain map. I want the ability to block equipping depending on their equipment positions, for example they cannot equip anything on their right hand or left hand in prontera. This would be different because I don't have to enter every weapon and shield or w/e to the item_noequip.txt

Edited by kou
Posted

That is pretty similar to adding items to the item_noequip.txt. I'm looking for a code that will actually make equipping things impossible on a certain map. Does not matter if they have it in their inventory. Now who can really help me with this? I'm sure it is possible. I don't want a script, else I wouldn't have posted here.

Posted

noitem mapflag

prontera	mapflag	noitem	4,5

item type 4 (weapon) and item type 5 (armor) can't equip in prontera map

since this is SVN discussion,

I dunno this modification should add into SVN or not

because this question also frequently asked in database/script request section

Posted

Is this mapflag officially implemented in rathena revisions or is this still a custom add-on?

I need to know cuz I'm looking for a way to block equipping in a certain map also. I tried to find 'noitem' in my src files, but couldn't find a match.

Posted (edited)

[paste=1a4xw30mq7va]

actually strtok is not thread safe ... I'm thinking writing a new one

ok done lol, quite fast

[paste=43c3y0h62jbk]

EDIT:

I think there's some problem with encoding ...

I use attachment for the time being

noitem_20140108_.patch

Edited by AnnieRuru
Posted

I got this warning during the recompiling process...
 

npc.c: In function ‘npc_parse_mapflag’:
npc.c:3707: warning: suggest parentheses around assignment used as truth value
npc.c:3716: warning: suggest parentheses around && within ||

And the map flag didn't work. I had the mapflag set like this for one of my maps

prontera mapflag noitem 4

 

This should block weapons from being equipped in that map, correct?

 

Well it didn't work, I was able to equip weapons.

Posted (edited)

oh right i forgot about the wep type changing.

 

 

About the warnings, my revision is 11800. I'm not at the latest revision, and maybe that's why I'm getting the warning?

So, Could you tell me what that warning means and maybe tell me how I can get rid of it?

 

The warnings are coming form the first and the last line in npc.c:

 

		if ( l = strlen(w4) ) {
			i = 0;
			while ( i <= l && k < MAX_RESTRICTED_LIST ) {
				if ( w4[i] != ' ' && w4[i] != '	' && w4[i] != ',' && w4[i] != '\0' ) {
					temp[j++] = w4[i];
				}
				else if ( w4[i-1] != ' ' && w4[i-1] != '	' && w4[i-1] != ',' ) {
					temp[j] = '\0';
					id = atoi( temp );
					if ( id >= IT_HEALING && id < IT_MAX || itemdb_exists( id ) )
Edited by Phenex
Posted (edited)

I got this warning during the recompiling process...

 

npc.c: In function ‘npc_parse_mapflag’:
npc.c:3707: warning: suggest parentheses around assignment used as truth value
npc.c:3716: warning: suggest parentheses around && within ||
how about you tell me whats the exact line in 3707 and 3716 ?

... or better off just show me the whole npc.c file

Edited by AnnieRuru
Posted (edited)

Thank you, I will try this out. As for the compiler, it's the compiler provided by Asura hosting. So I'm not exactly sure what they use for the compiler ^^;

Edit: It works! No warnings~ Perfect! Thank you very much Annie Ruru!

Edited by Phenex

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...