Jump to content
  • 0

Card Seller


fictionx

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

Hi,

 I'm wondering if someone can help me to fix the following script, the problem that it have is with the menus, for example in the option "Normal Cards" appear MvP Cards, in the option "Mini-boss","MvP Cards", there is no cards in the shop.

 

prontera,155,177,5	script	Card Seller	100,{
    mes "Welcome to card seller ... meh lazy to say";
    next;
    if ( select ( "Normal Cards", "Mini-boss Cards", "MVP Cards" ) == 1 ) {
        .@s = select( .alphabet_menu$ ) -1;
        close2;
        callshop "card_mob#"+ .alphabet$[.@s], 1;
        end;
    }
    close2;
    callshop "card_mob#"+( ( @menu == 2 )? "miniboss":"MVP" ), 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$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 GROUP BY `name_japanese` ORDER BY alphabets;", .alphabet$ );
	for ( .@i = 0; .@i < .@total; .@i++ ) {
		.alphabet_menu$ = .alphabet_menu$ + .alphabet$[.@i] +" Cards:";
		.@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 AND LEFT( `name_japanese`, 1 ) = '"+ .alphabet$[.@i] +"' GROUP BY `name_japanese` ORDER BY `name_japanese` LIMIT 128;", .@id );
		npcshopdelitem "card_mob#"+ .alphabet$[.@i], 501;
		for ( .@j = 0; .@j < .@nb; .@j++ )
			npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000;
	}


	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
-	shop	card_mob#miniboss	-1,501:1000
-	shop	card_mob#MVP	-1,501:1000

Greetings.-

Edited by fictionx
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

Oh, that is true, i'll try to fix that issue.

So, the following syntax for try to recover data from normal, mvp and boss cards should be work right?.

query_sql("SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid`  WHERE type = 6 group by name_japanese", .@id); 
query_sql("SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid`  WHERE mexp > 0 and type = 6 by name_japanese", .@MVP); 
query_sql("SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid`  WHERE mode & 32 and type = 6 by name_japanese", .@BOSS); 

Note: i'm using the following script : Link

Greetings.-

Edited by fictionx
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

I might be mistaken, but I can't see a distinction in your sql command to get mvp / mini boss or normal only. 

I suppose you were willing to use the Mode option, but I think that using MEXP column would be easier.

Also, you're only filling array by using 

"card_mob#"+ .alphabet$[.@i]

This will never add anything in 

-	shop	card_mob#miniboss	-1,501:1000
-	shop	card_mob#MVP	-1,501:1000

As 'miniboss' and 'MVP' aren't exactly letters from the alphabet ^^

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  122
  • Reputation:   17
  • Joined:  12/10/12
  • Last Seen:  

10 hours ago, Alayne said:

I might be mistaken, but I can't see a distinction in your sql command to get mvp / mini boss or normal only. 

I suppose you were willing to use the Mode option, but I think that using MEXP column would be easier.

Also, you're only filling array by using 


"card_mob#"+ .alphabet$[.@i]

This will never add anything in 


-	shop	card_mob#miniboss	-1,501:1000
-	shop	card_mob#MVP	-1,501:1000

As 'miniboss' and 'MVP' aren't exactly letters from the alphabet ^^

That array fill the shop name, the full syntax is  

npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000;

id was called from 

    

   .@nb = query_sql( "select item_db_re.id from item_db_re right join mob_db_re on item_db_re.id = mob_db_re.dropcardid where type = 6 and left( name_japanese, 1 ) = '"+ .alphabet$[.@i] +"' group by name_japanese ", .@id );

 

Edited by fictionx
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  342
  • Reputation:   169
  • Joined:  02/25/12
  • Last Seen:  

Yeah I know but this request you have gives the first letter of all names grouped by first letter. So a, b, c... But you'll never have miniboss or mvp as a result. See what I mean? 

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...