Jump to content
  • 0
Svanhild

There's a problem with the card remover

Question

When you're not equipping anything, and try to talk to the card remover npc, it still shows a blank menu instead of displaying the message "Young one... Your not wearing anything there that I can remove cards from." Is there a problem with this line?

 

set .@part,select(.@menu$);
   if(!getequipisequiped(.@part)) {
     mes " ";
     mes "Young one... Your not wearing anything there that I can remove cards from.";
     close;
   }

 

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

ah ... that was because official behavior, players can change equipment while talking to npc

that's why that check was meant to counter those players who are trying to cheat with changing equips

 

after members found this may lead to some exploit (on other script), the *disable_item script command was added later

so yeah, with *disable_item script command, that condition is useless

 

but I tested the script isn't bug though

Share this post


Link to post
Share on other sites
  • 0

by default, you should show your full script.

 

if you're referring to a blank menu, that mean your script didnt provide a checking for no equipments selection in the menu.

for ( .@i = EQI_HEAD_TOP; .@i <= EQI_SHOES; .@i++ ) {	.@item_id = getequipid( .@i );	if ( .@item_id != -1 ) {		.@menu$ = .@menu$ + getitemname( .@item_id );		.@equip_count++;	}	.@menu$ = .@menu$ + ":";}if ( .@equip_count ) {	.@part = select( .@menu$ );}else {	mes "You didn't wear any equipments.";}

Share this post


Link to post
Share on other sites
  • 0

exactly, and since the player can't select anything, click ok or cancel will just close the npc without further talking

thus, the script isn't bug

 

......

http://upaste.me/369a21998cc2e67c5

I wonder I should fix or not .... since the script isn't bug ...

Share this post


Link to post
Share on other sites
  • 0

well, if we are to follow logical flow, the menu part shouldn't be reachable since it's empty. 

Not sure why would official server would allow it if this happened in official server.

 

by the way, the method of checking using this way isn't good in term of dynamic.

if ( .@menu$ == "::::::::::" ) {

because if users adjusted the loop size / array , the condition will be bypass again if they didnt update / add extra ":" into it.

 

personally think that, hardcoded value shall be avoided as much as possible during npc execution.

Share this post


Link to post
Share on other sites
  • 0

this is not official script o.o

this is inside custom folder

 

hmm ... all right I will fix it properly ..

quite a ton of scripts actually ...

 

 

EDIT: what the heck ... Haru is changing npc header now o.o

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

Yeah I understand. Quite simple but could be a headache. Btw, the dispbottom color still not working right? including the addparty_member stuff. :/ We're behind from rathena's scripting.

Edited by presence

Share this post


Link to post
Share on other sites
  • 0

dispbottom color still not working right?

I already pull request

https://github.com/HerculesWS/Hercules/pull/858

but already 1 week there is no input from haru yet ...

.

.

including the addparty_member stuff. :/ We're behind from rathena's scripting.

this one I have to refuse for 2 reason

http://herc.ws/board/topic/4186-party-commands/

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.