There's a problem with the card remover

Svanhild

New member
Messages
115
Points
0
Location
Queenslander
Emulator
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;
   }
 
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

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

Code:
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.";}
 
I believe this is what he mentioned ...

https://raw.githubusercontent.com/HerculesWS/Hercules/master/npc/custom/card_remover.txt

LhueUch.png


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

 
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.

 
Last edited by a moderator:
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

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

 
Last edited by a moderator:
Last edited by a moderator:
Back
Top