Restock System

Hi, thanks for the plugin, it works perfectly!

Is there any way to make not bypass the gvg and the WoE mapflags and storage mapflags, so users can restock only when they get back to town ?

Have a great day!

 
Hi, thanks for the plugin, it works perfectly!

Is there any way to make not bypass the gvg and the WoE mapflags and storage mapflags, so users can restock only when they get back to town ?

Have a great day!
On script, search forOnRestock:

Below it add

Code:
if (getmapflag(strcharinfo(PC_MAP), mf_town) == 0) {
    restkid = 0;
    end;
}
Above changes will allow restock only when you are in town
 
Thank you for you quick answer. I follow the instructions, it worked, I can only restock in towns, but I still got a problem.
 

For exemple if I am in a dungeon and I used all of my Grappe Juice, when I get back in town, the Grappe Juice are not restocked (though there are in my restock list). Any help for that cases ?

Thanks !!

 
Thank you for you quick answer. I follow the instructions, it worked, I can only restock in towns, but I still got a problem.

For exemple if I am in a dungeon and I used all of my Grappe Juice, when I get back in town, the Grappe Juice are not restocked (though there are in my restock list). Any help for that cases ?

Thanks !!
I probably need to preHook pc_setpos which will check if map changed, and force check the restock list
 
Oh, can you do that ?
I know it's I am asking a lot.. but who knows, maybe you're in a charitable mood. 
default_biggrin.png
 

Thanks!

Thank you for you quick answer. I follow the instructions, it worked, I can only restock in towns, but I still got a problem.
 
For exemple if I am in a dungeon and I used all of my Grappe Juice, when I get back in town, the Grappe Juice are not restocked (though there are in my restock list). Any help for that cases ?
Thanks !!
I probably need to preHook pc_setpos which will check if map changed, and force check the restock list
Oh, can you do that ?
I know it's I am asking a lot.. but who knows, maybe you're in a charitable mood.  
default_biggrin.png
 

Thanks!

 
Error on make plugins on latest emulator.

 
hello @Dastgir does it restock item's after all item consumed?

or

does it restock item's which are consumed? e.g if u consumed 20 fly wing out of 50, it should restock 20 fly wing only.

that way player will not run out of pot's in PvP & WoE else every time player has to check how much pot's left. 

 
Last edited by a moderator:
does it restock item's after all item consumed?
It will check if the last of selected item was consumed and do ::OnRestock NPC Event to restock the items to the selected amount. Works very well and without any ms of lag. Thanks to @Dastgir
 

Fixed and corrected. Works fine on current branch.

How to enable:
Move "restock.c" to "src/plugins" and open "Makefile" with editor. add "restock" to line "MYPLUGINS = "

Move "atcommand_restock.txt" to "npc/custom" and add "npc/custom/atcommand_restock.txt" to your "scripts_custom.

conf" for autostart.Open file "conf/plugins.conf" and add "  "restock",  " to enable this plugin after you'll restart the map serve

Do "make all" on console. To enable all changes. Enjoy @restock and @restock2

If you want to disable @restock on Castles/WoE just configure your atcommand_restock.txt and do a mapcheck on "OnRestock:" like

 

getmapxy(.@playermap$, .@playerx, .@playery, UNITTYPE_PC);

if (getmapflag(.@playermap$, "mf_gvg_castle") == 1) {
dispbottom "Atcommand disabled on this map.";
end;
}




View attachment restock.c

View attachment atcommand_restock.txt
 

Code:
CREATE TABLE `restock` (
	`charid` INT(10) NOT NULL,
	`restockid` INT(6) NOT NULL,
	`restkq` INT(5) NOT NULL,
	`restkf` INT(10) NOT NULL DEFAULT '1'
)
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM
;
 
Last edited by a moderator:
If you want to make Arrows and Bullets Auto-Equip after they have been restocked:

 

Code:
		if (.@qu){
			.@ru = restkid;
	++		if (getiteminfo(.@ru, ITEMINFO_TYPE) == 10) autoequip(.@ru, 1);
			restock_item(.@ru,.@qu,.@fr);
			if (.@fr == 1) .@from$ = "Storage";
			if (.@fr == 2) .@from$ = "Guild Storage";
			sleep2 500;
			if (countitem(.@ru) == 0) {
				announce "Trying to restock "+.@qu+"x "+.@ru+" from "+.@from$+". Failed. Amount does not fit.",bc_self,0xFF8F01;
			}
	++		if (getiteminfo(.@ru, ITEMINFO_TYPE) == 10) autoequip(.@ru, 0);
			restkid = 0;
		}
 
@Dastgir if you dont mind can i request a restock system for rathena emulator ^_^ i like this script using herc very nice

 
Back
Top