I was trying to take / borrow script card seller from rathena and this MD_BOSS is not working like MD_MVP in rathena
[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Source (NPC): card_seller_creation (invisible/not on a map)
[Warning]: script_get_val: cannot access player variable 'MD_BOSS', defaulting t
o 0
Map-server says not working what can I do to fix that part?
Note : Script Header was not kept
Spoiler
prontera,165,169,3 script Normal Card Seller 4W_SAILOR,{
.@menu$ = getvariableofnpc( .alphabet_menu$, "card_seller_creation" );
if (.@menu$ == "") {
mes "[Card Seller]";
mes "I am sorry, it seems like something went wrong.";
mes "I cannot find any cards in our database at the moment.";
mes "Please contact a game master.";
close;
}
mes "[Card Seller]";
mes "Welcome!";
mes "I can sell you any normal monster card in the game. Would you like to have a look?";
next;
.@s = select(.@menu$) -1;
close2;
callshop "card_mob#"+ getvariableofnpc( .alphabet$[.@s], "card_seller_creation" ), 1;
end;
}
- script card_seller_creation -1,{
end;
OnInit:
// if (checkre(0)) {
// .@mob_db$ = "mob_db_re";
// .@item_db$ = "item_db_re";
// } else {
.@mob_db$ = "mob_db";
.@item_db$ = "item_db";
// }
freeloop 1;
.@total = query_sql( "SELECT DISTINCT LEFT( `name_japanese`, 1 ) AS alphabets FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE (`MEXP`) <= "+0+" ) ORDER BY alphabets;", .@alphabet$ );
for ( .@i = 0; .@i < .@total; .@i++ ) {
.@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND LEFT( `name_japanese`, 1 ) = '"+ .@alphabet$[.@i] +"' AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE (`MEXP`) <= "+0+" ) ORDER BY `name_japanese` LIMIT 128;", .@id );
if (.@nb > 0) {
.alphabet$[.@size_alphabet++] = .@alphabet$[.@i];
.alphabet_menu$ = .alphabet_menu$ + .@alphabet$[.@i] +" Cards:";
npcshopdelitem "card_mob#"+ .@alphabet$[.@i], 501;
for ( .@j = 0; .@j < .@nb; .@j++ ) {
if (callfunc( "F_IsCharm", .@id[.@j] ) == true)// Skip enchants in case someone added them as card drop
continue;
npcshopadditem "card_mob#"+ .@alphabet$[.@i], .@id[.@j], 1000;
}
}
}
freeloop 0;
end;
}
I was trying to take / borrow script card seller from rathena and this MD_BOSS is not working like MD_MVP in rathena
[Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Source (NPC): card_seller_creation (invisible/not on a map) [Warning]: script_get_val: cannot access player variable 'MD_BOSS', defaulting t o 0
Map-server says not working what can I do to fix that part?
Note : Script Header was not kept
prontera,165,169,3 script Normal Card Seller 4W_SAILOR,{
.@menu$ = getvariableofnpc( .alphabet_menu$, "card_seller_creation" );
if (.@menu$ == "") {
mes "[Card Seller]";
mes "I am sorry, it seems like something went wrong.";
mes "I cannot find any cards in our database at the moment.";
mes "Please contact a game master.";
close;
}
mes "[Card Seller]";
mes "Welcome!";
mes "I can sell you any normal monster card in the game. Would you like to have a look?";
next;
.@s = select(.@menu$) -1;
close2;
callshop "card_mob#"+ getvariableofnpc( .alphabet$[.@s], "card_seller_creation" ), 1;
end;
}
- script card_seller_creation -1,{
end;
OnInit:
// if (checkre(0)) {
// .@mob_db$ = "mob_db_re";
// .@item_db$ = "item_db_re";
// } else {
.@mob_db$ = "mob_db";
.@item_db$ = "item_db";
// }
freeloop 1;
.@total = query_sql( "SELECT DISTINCT LEFT( `name_japanese`, 1 ) AS alphabets FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE (`MEXP`) <= "+0+" ) ORDER BY alphabets;", .@alphabet$ );
for ( .@i = 0; .@i < .@total; .@i++ ) {
.@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` WHERE `type` = " + IT_CARD + " AND LEFT( `name_japanese`, 1 ) = '"+ .@alphabet$[.@i] +"' AND `id` IN ( SELECT DISTINCT `dropcardid` FROM `"+ .@mob_db$ +"` WHERE (`MEXP`) <= "+0+" ) ORDER BY `name_japanese` LIMIT 128;", .@id );
if (.@nb > 0) {
.alphabet$[.@size_alphabet++] = .@alphabet$[.@i];
.alphabet_menu$ = .alphabet_menu$ + .@alphabet$[.@i] +" Cards:";
npcshopdelitem "card_mob#"+ .@alphabet$[.@i], 501;
for ( .@j = 0; .@j < .@nb; .@j++ ) {
if (callfunc( "F_IsCharm", .@id[.@j] ) == true)// Skip enchants in case someone added them as card drop
continue;
npcshopadditem "card_mob#"+ .@alphabet$[.@i], .@id[.@j], 1000;
}
}
}
freeloop 0;
end;
}
- shop card_mob#A -1,501:1000
- shop card_mob#B -1,501:1000
- shop card_mob#C -1,501:1000
- shop card_mob#D -1,501:1000
- shop card_mob#E -1,501:1000
- shop card_mob#F -1,501:1000
- shop card_mob#G -1,501:1000
- shop card_mob#H -1,501:1000
- shop card_mob#I -1,501:1000
- shop card_mob#J -1,501:1000
- shop card_mob#K -1,501:1000
- shop card_mob#L -1,501:1000
- shop card_mob#M -1,501:1000
- shop card_mob#N -1,501:1000
- shop card_mob#O -1,501:1000
- shop card_mob#P -1,501:1000
- shop card_mob#Q -1,501:1000
- shop card_mob#R -1,501:1000
- shop card_mob#S -1,501:1000
- shop card_mob#T -1,501:1000
- shop card_mob#U -1,501:1000
- shop card_mob#V -1,501:1000
- shop card_mob#W -1,501:1000
- shop card_mob#X -1,501:1000
- shop card_mob#Y -1,501:1000
- shop card_mob#Z -1,501:1000
function script F_IsCharm { //CARD CHECKER!!! DONT REMOVE
.@id = getarg(0);
return ((.@id >= 4700 && .@id < 5000) || (.@id >= 29000 && .@id <= 29162));
}
Share this post
Link to post
Share on other sites