summaryrefslogtreecommitdiff
path: root/doc/sample/npc_dynamic_shop.txt
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-26 22:36:41 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-26 22:36:41 +0000
commit6096ce0b42a3eee07dc70ae5ef489aa4c30bf515 (patch)
treee91f8afd3b7b8b80f0c55aae07f7a478f469c37a /doc/sample/npc_dynamic_shop.txt
parent23e1b7db5ba2277a406fc84c30e87c324a83097c (diff)
downloadhercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.gz
hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.bz2
hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.xz
hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.zip
* Merged changes from trunk [14496:14630/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14632 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'doc/sample/npc_dynamic_shop.txt')
-rw-r--r--doc/sample/npc_dynamic_shop.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/sample/npc_dynamic_shop.txt b/doc/sample/npc_dynamic_shop.txt
index 1a1f174c9..79d0c4fdb 100644
--- a/doc/sample/npc_dynamic_shop.txt
+++ b/doc/sample/npc_dynamic_shop.txt
@@ -7,21 +7,22 @@ end;
OnSellItem:
for(set @i, 0; @i < getarraysize(@sold_nameid); set @i, @i + 1){
- if(countitem(@sold_nameid[@i]) < @sold_quantity[@i] && @sold_quantity[@i] <= 0){
+ if(countitem(@sold_nameid[@i]) < @sold_quantity[@i] || @sold_quantity[@i] <= 0){
mes "omgh4x!";
close;
}
if(@sold_nameid[@i] == 501){
+ delitem 501, @sold_quantity[@i];
set $@rpotsleft, $@rpotsleft + @sold_quantity[@i];
set Zeny, Zeny + @sold_quantity[@i]*20;
- delitem 501, @sold_quantity[@i];
} else {
if(@sold_nameid[@i] == 502){
+ delitem 502, @sold_quantity[@i];
set $@opotsleft, $@opotsleft + @sold_quantity[@i];
set Zeny, Zeny + @sold_quantity[@i]*100;
- delitem 502, @sold_quantity[@i];
} else {
mes "Sorry, I don't need your items.";
+ close;
}
}
}
@@ -34,7 +35,7 @@ OnBuyItem:
for(set @i, 0; @i < getarraysize(@bought_nameid); set @i, @i + 1){
if(@bought_quantity[@i] <= 0){
mes "omgh4x!";
- end;
+ close;
}
if(@bought_nameid[@i] == 501){
if(@bought_quantity[@i] > $@rpotsleft){