Jump to content
  • 0

Certain map weapon restriction


rootKid

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   10
  • Joined:  11/28/11
  • Last Seen:  

HI I'd like to request the code that will make weapons unequipable on a certain map.

Link to comment
Share on other sites

23 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  56
  • Reputation:   30
  • Joined:  02/22/12
  • Last Seen:  

You can do this with scripting...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/db/re/item_noequip.txt

seems like I've tried, I'm able to save up to 32768, zone 11

perhaps the item_noequip.txt and skill_nocast_db.txt should make an update for it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   10
  • Joined:  11/28/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Just write an onloadmapevent script for this.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   10
  • Joined:  11/28/11
  • Last Seen:  

Could you show me an example?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   10
  • Joined:  11/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  83
  • Reputation:   10
  • Joined:  11/28/11
  • Last Seen:  

Which SVN was the mapflag noitem feature added?

Edited by kou
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

This should be moved in Source Request section. And to answer your question, this is a custom source mod made by Annie.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

[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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

download from the attachment, don't use pastebin

if you download from pastebin you'll get this problem

blame @Akkarin

I'm going to wear a maid costume and serve him some tea /shy

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

download from the attachment, don't use pastebin

if you download from pastebin you'll get this problem

blame @Akkarin

I'm going to wear a maid costume and serve him some tea /shy

 

I did. I downloaded the attachment. I applied the patch all well too.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

I don't get any warning during compile ( of course no warning or else I've fix it )

prontera	mapflag	noitem	4
this is actually restricting ARMOR <.<

https://github.com/rathena/rathena/blob/master/doc/item_db.txt#L30

if you want to block WEAPON, use 5

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Sure.

The line are this:

if ( l = strlen(w4) ) {
And This:

if ( id >= IT_HEALING && id < IT_MAX || itemdb_exists( id ) )
Thank you!

npc.rar

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

seems like you are using different compiler than mine

your compiler can even suggest me to write the code cleaner

try this one

noitem_20140110.patch

curious, tell me what's the compiler you are using ...

I'm using microsoft visual c++ 2010

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@Darkpurple asked to update this one so ...

noitem_20140828r.diff

the difference about this and official

is allow_equip_restricted_item just nullify the cards, but mine can unequip them

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