Jump to content
  • 0
Sign in to follow this  
fiction

Q> About compatibility Shop variables

Question

Hi to all,

   In herc, what is the way to manipualte custom shops via npcshopdelitem, npcshopadditem, etc?

For example, in rathena, when i use shops that the currency is an item, i use itemshop, like this...

-    itemshop    asdfas    -1,7828,13036:100,13411:100

and then i call that shop via  callshop "asdfas",0;

How can i do that here in herc?

Greetings.-

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

In case that i use SQL Queries to fill the entry, how can i do here?.


In rathena i use query sqls to fill my menu and the shop, and then order alphabetically.


For example:

	OnInit:
		.@mob_db$  = "mob_db";
		.@item_db$ = "item_db";


.@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  `type` = 6 AND `mexp` = 0 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 `mexp` = 0 AND LEFT( `name_japanese`, 1 ) = '"+ .alphabet$[.@i] +"' GROUP BY `name_japanese` ORDER BY `name_japanese` LIMIT 128;", .@id );
      
      		for ( .@j = 0; .@j < .@nb; .@j++ )
			
			npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 3;
			
			}
	freeloop 0;
	end;

}

// Shop Normal Cards
-	itemshop	card_mob#A	-1,30004,1515:1
-	itemshop	card_mob#B	-1,30004,1515:1
-	itemshop	card_mob#C	-1,30004,1515:1
-	ietmshop	card_mob#D	-1,30004,1515:1
...

 

Share this post


Link to post
Share on other sites
  • 0

at first itemshop not exists in client or packets, this is some kind of fake shop in rathena, probably limited market (bargarian shop) or cash shop.

For shop with data synced to sql table automatically you can use market shop type, see https://github.com/HerculesWS/Hercules/blob/stable/doc/script_commands.txt#L310

or search in npc folder shop types what you want.

 

If you asking how fill shop with all existing items in db, you can use one of trader shop type and add items by sql queries.

 

Share this post


Link to post
Share on other sites
  • 0

@4144
Hercules has our own dynamic shop system, implement right after Hercules founded

 

by your definition, yes, we also has our own fake shop in hercules

 

@fiction

that's my script by the way ... you see my name in rathena repo

Share this post


Link to post
Share on other sites
  • 0

I mean in client no itemshop. Exists normal shop. cash shop, market (aka bargarian) and barter. Herc using all of them in some way in official or custom way.

But here no shop with name item shop. Checked source, itemshop using really cash shop.

 

Share this post


Link to post
Share on other sites
  • 0

Thank you @AnnieRuru, @4144 and yes, indeed is part of your script, but i made some modification (I hope you do not mind hehe), because i don't want to trade in Zeny, i want to trade in custom items.

I'll try to re-read the documentation of herc and try to adapt it.

Share this post


Link to post
Share on other sites
  • 0

For this you can use trader with type NST_CUSTOM. See in docs or npc folder (it using cash shop on client too(

 

If you using 2019 clients you also can use barter shop. See here information about barter shops

 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.