change to
set .Mode,rand(2);
switch( .Mode ){
Case 0: set .Answer$, getmonsterinfo( .MonsterID,0 ); break; // Name
Case 1: set .Answer$, .Element$[ getmonsterinfo( .MonsterID,20 ) ]; break; // Element
}
you can just simply add this part at every cases...
// if no ring...
if ( !countitem(26130) ){
mes "[Training Trader]";
mes "I'm so sorry but you need to finish the course and show me the ring from your mastered training,";
mes "in order for you to open this shop.";
close2;
emotion e_sry;
end;
}
if not mistaken ....
monster will never trigger the OnTouch label,...only players does...
to warp a particular monster..you required their GID ....
the only way you can get the GID ... Get_monster_gid
use the original script...then ....replace the menu part with this...
// Menu Selection
select("Jump Training Shop","Other Training Shop");
// if no ring...
if ( !countitem(26130) ){
mes "[Training Trader]";
mes "I'm so sorry but you need to finish the course and show me the ring from your mastered training,";
mes "in order for you to open this shop.";
close2;
emotion e_sry;
end;
}
* /me dont like using goto...
and since you mentioned you get error...you should show the error message that you get...
remove this
mes "[Dice]";
mes "Please tell me your name";
next;
input .@name$;
if(.@name$ != strcharinfo(0)) {
mes "[Dice]";
mes "Are you sure thats your character name?";
close;
}
if( .@npc1$ == 500 || .@npc1$ == 100 ){
// blablbala
}
just compare the value inside the array and the value u want...
if you can briefly explain or tell us what you wanna do with that sql statement..perhap we can figure out another way for you....
like checking the value through SQL...
it will work even for compounded items...
same trick using in my
https://rathena.org/board/index.php?/files/file/2505-%7B?%7D/
the wiki even show you the example ...
query_sql "SELECT `npc1`, `npc2`, `npc3`, `npc4`, `npc5` FROM `quest_db` WHERE `char_id` = " + getcharid(0) + " ", .@npc1$,.@npc2$,.@npc3$,.@npc4$,.@npc5$;
i dun understand the array part you mentioned..