Ragnarok RO: Add limited shopping items to refresh item inventory tutorial

Ragnarok RO : Add limited shopping items to refresh item inventory tutorial

Hello everyone, I am Essie. In the game, we have ordinary basic equipment, so we must have the top set, and often a set of the top set may dominate the game. Then the GM needs to set the game settings and restrictions. In the last article, I told you how to create NPC merchants, add items and set prices. Today, Aixi will share with you how to add purchase restrictions in Ragnarok RO Items and Refresh Item Inventory Tutorial.

Let's get straight to the point:

The inventory store definition is divided into 4 parts: map, X coordinate, Y coordinate, NPC orientation

Marketshop (fixed format)

Store NPC name (this name cannot be repeated)

Appearance ID, Item ID: Price: Stock {, Item ID: Price: Stock..}

Pandas server----npc----custom----tutorial directory test.ras Create purchase limit merchant NPC

prontera,150,180,3 marketshop tab testmarketshop0 tab 726,714:1000:2,512:-1:20,513:-1:10

Still take the place of Prontera (150,1 60) as an example, towards 3 tab marketshop (fixed format) tab testmarketshop0 (NPC name of purchase limit merchant) tab 726 (Elf ID npc merchant model), 714 (precious metal): 1000 ( Selling price): 2 (stock), 512 (apple): -1 (price): 20 (stock), 513 (banana): -1 (price): 10 (stock)

Note: Price -1 is the official default configuration price of 15

 

Go back to the game and enter the command: @reloadscript (reload script)

 

 

 

In this way, even if our purchase-restricted merchant NPC is created, it is actually an extra inventory, which is not much different from creating a merchant NPC.

Another way to define the restricted purchase merchant NPC: This method will tell the player to only sell a few restricted purchases every day, and then click the NPC every day to automatically refresh the inventory without adding it manually

 

Definition format: - tab marketshop tab testmarketshop0 tab 726,714:1000

prontera, 152, 160,3 script 7 TestMarketshop1Npc 726,{

mes "[TestMarketshop1Npc]" ;

mes"We sell a limited number of <ITEM>luxury metal <INFO>714</INFO></ITEM> every day";

close2 ;

callshop” testmarketshop1" ;

end;

}

In this definition, the purchase-restricted merchant NPC will not appear on the map, and you have to click on the NPC to choose to open or close the store in the dialogue. When clicking on the NPC, it will tell the player that the purchase limit of two products will be limited, and there will be a dialogue and prompt, callshop (close the store NPC)

<ITEM>Glamorous Metal<INFO>This script is created hyperlinks can go back to the fourth article to view detailed instructions

After the script is created, go back to the game and enter the command: @reloadscript (reload the script)

 

 

 

Then start to buy, there will be a reminder of purchase limit, when you want to buy again after buying, it will prompt that the product is out of stock, please come back later

So how to make him refresh the new inventory after the goods are sold out? Here you need to use the npcshopupdate command: npcshopupdate "store NPC name", item ID, price, inventory

prontera, 154, 160,3 tab script tab TestMarketshopRefresh tab 726,{

npctalk "The store is refreshed!

npcshopupdate "testmarketshop0" ,714,0,5;

npcshopupdate " testmarketshop0" ,512,0,5;

npcshopupdate "testmarketshop0" ,513,0,5;

npcshopupdate "tes tmarketshop1" ,714,0,5;

end;

}

Npctalk (npc talks with npctalk)

The refreshed product example 714, 0 0 means the price remains unchanged, and the inventory is filled in later

Go back to the game and enter the command: @reloadscript to load the script

prontera, 156,160,3 > script > TestMarketshop3Refresh- 4 M_ 04,{

mes

"Please enter the price and quantity of <ITEM>Gorgeous Metal <INFO>714</INFO></ITEM>";

next ;

input . @price;

input . @number ;

mes "The price is: "+. @price;

mes "The number is: " + . @number;

mes "I will refresh for you";

close2;

npctalk "The store is refreshed!";

npcshopupdate” tes tmarket shop0" ,714, . @price,. @number;

end ;

}

(Script logic: input command function, a pop-up window allows players to input numbers or strings. The @price variable uses mes to print out the data input by the player. This allows the player to specify the refresh inventory and price. Everyone knows it here. If it is enabled, it is definitely impossible for players to play like this....hhhhhh everyone knows)

 

We can also learn how the official definition of NPCs that sell luxury metals is limited.

In the Pandas server file -----npc > re > merchants >Emperium Seller.txt document 

(The following can be used as a reference, we create our own limited purchase merchant NPC creation definition logic and official definition logic)

prt_ in,212,169,3 script- Guild Clerk 4 _M_ 04,{

if ( gettime(DT_ DAYOFWEEK) >= 1 && gettime(DT_ DAYOFWEEK) <= 6 && gettime(DT_HOUR) > >=18 && gettime(DT_ HOUR )<=23) {

mes”[Guild Clerk]";

mes "The Emperium to be distributed to the guild office today has arrived. If you want to purchase, please put as many as you want ~;

next ;

(Note: The general meaning of the phrase The Emperium to be distributed to is that you can buy as much as possible during our sales time, and you can also translate directly by yourself)

mes”[Guild Clerk]";

mes "It seems that many people are looking for Emperium today. It's just a personal feling.;

close2 ;

callshop "emp_ seller#slo" ;

end ;

}

(Note: gettime is the day of the week when the server time DT_DAYOFWEEK is returned, here it means Monday to Saturday, so the return is 1-6, Sunday is 0 and then DT_HOUR is the number of hours in 24-hour format, 18-23 instructions The time is between 18:00 and 23:00. The logical definition of the entire if is that if it is Monday to Saturday and the hour is between 18:00 and 23:00, the logic {in brackets} will be executed. The definition of if is also relatively simple , if the condition inside {} brackets is true, execute the above code and end as a total code instruction, otherwise, execute the code)

mes”[Guild Clerk]";

mes"Our guild office actively supports the smooth gathering of adventurers." ;

next ;

mes "[Guild Clerk]";

mes"As part of that" ,

mes "we are selling a limited quantity of 100 <ITEM> Emperium< INFO> 714</INFO></ITEM> every day;

mes"from ^0000ff18:00 to 23:59^000000 from ^0000ffMonday to Saturday^000000." ;

next;

mes "[Guild Clerk]";

mes' 'Please note that our guild office does not sell al1 the time because we have to run around to supply Emperium outside pof the hours .”

close ;

(Note: If it wasn’t for this time period, our office is not sold now, because we have to run in takeaway in order to provide luxurious metals. Here it made a packaging story)

OnHour00 :

npcshopupdate” emp_ seller#s1o" ,714,0, 100;

end;

}

marketshop- emp_ seller#slo> FAKE_ NPC, 714: 1000000 : 100

(marketshop is an officially defined NPC that specializes in selling precious metals. The price is 1 million and 100 in stock. It opens the store through the emp_seller NPC)

OnHour00 is a label that calls the following code at 0:00 every day:

(He called an npcshopupdate here, which means that the refresh time is to refresh the inventory of commodity 714 at 0:00 every day. 0 means that the price is different or 100wan, and 100 means inventory)

The above code is the official definition of the NPC definition logic for merchants who sell luxurious metals. It is considered to have completed the definition of creating an NPC with limited purchases, inventory, and refresh time as we said today. You can learn from it for reference.

So that's all for today's sharing tutorial, see you next time! I'm Chiwang Aixi

There are a lot of fun things you can do with a server!

Guess you like

Origin blog.csdn.net/V13807970340/article/details/131106096