WhiteEagle
New member
- Messages
- 52
- Points
- 0
- Emulator
Can anyone help me to script a NPC who show only learned recipes and
give for each "showing" recipe an own selection?
Hope anyone can help me.
Example:
mes .@name$;
mes "nothing learned.";
close;
}
give for each "showing" recipe an own selection?
Hope anyone can help me.
Example:
query_sql("SELECT account_id char_id,recept_id,receptname,learned FROM `profession_db`",.@accid,.@charid,.@recept,.@recname$,.@learned);
set .@rezept$,Diablo;
set .@rezept2$,Valkyrie;
mes .@name$;
if(.@learned > 0){
.@size = getarraysize(.@learned);
for(.@i = 0; .@i < .@size; .@i++)
set .@menu$,.@menu$ + .@recname$[.@i]+":";
.@i = select(.@menu$);
next;
if (select(.@rezept$)){
mes "Diablo.";
close;
}
if (select(.@rezept2$)){
mes "Valkyire.";
close;
}
}
set .@rezept$,Diablo;
set .@rezept2$,Valkyrie;
mes .@name$;
if(.@learned > 0){
.@size = getarraysize(.@learned);
for(.@i = 0; .@i < .@size; .@i++)
set .@menu$,.@menu$ + .@recname$[.@i]+":";
.@i = select(.@menu$);
next;
if (select(.@rezept$)){
mes "Diablo.";
close;
}
if (select(.@rezept2$)){
mes "Valkyire.";
close;
}
}
mes "nothing learned.";
close;
}