summaryrefslogtreecommitdiff
path: root/npc/sample/npc_dynamic_shop.txt
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-05 13:23:07 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-05 13:23:07 +0000
commit288490094a7fe9167747dc78d416940759a31197 (patch)
tree53dc4f5c2375f4b688b53ca8841630ddec5e1f88 /npc/sample/npc_dynamic_shop.txt
parent8ec1c47aed09c90343949d57c92760ba84738a46 (diff)
downloadhercules-288490094a7fe9167747dc78d416940759a31197.tar.gz
hercules-288490094a7fe9167747dc78d416940759a31197.tar.bz2
hercules-288490094a7fe9167747dc78d416940759a31197.tar.xz
hercules-288490094a7fe9167747dc78d416940759a31197.zip
- Massive EOL normalization & 'svn:eol-style native' flag setting for all txt/conf/h/c files.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/sample/npc_dynamic_shop.txt')
-rw-r--r--npc/sample/npc_dynamic_shop.txt166
1 files changed, 83 insertions, 83 deletions
diff --git a/npc/sample/npc_dynamic_shop.txt b/npc/sample/npc_dynamic_shop.txt
index 59e76c72c..c580b2847 100644
--- a/npc/sample/npc_dynamic_shop.txt
+++ b/npc/sample/npc_dynamic_shop.txt
@@ -1,84 +1,84 @@
-- shop dyn_shop1 -1,501:50
-
-prontera.gat,181,200,4 script Dynamic Shop 123,{
-callshop "dyn_shop1",0;
-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){
- mes "omgh4x!";
- end;
- }
- if(@sold_nameid[@i] == 501){
- set $@rpotsleft, $@rpotsleft + @sold_quantity[@i];
- set Zeny, Zeny + @sold_quantity[@i]*20;
- delitem 501, @sold_quantity[@i];
- } else {
- if(@sold_nameid[@i] == 502){
- 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.";
- }
- }
-}
-deletearray @sold_quantity, getarraysize(@sold_quantity);
-deletearray @sold_nameid, getarraysize(@sold_nameid);
-mes "Deal completed.";
-close;
-
-OnBuyItem:
-for(set @i, 0; @i < getarraysize(@bought_nameid); set @i, @i + 1){
- if(@bought_quantity[@i] <= 0){
- mes "omgh4x!";
- end;
- }
- if(@bought_nameid[@i] == 501){
- if(@bought_quantity[@i] > $@rpotsleft){
- if($@rpotsleft > 0){
- set @bought_quantity[@i], $@rpotsleft;
- } else {
- mes "We are out of red potions!";
- close;
- }
- }
- if(Zeny >= 40*@bought_quantity[@i]){
- set Zeny, Zeny - 40*@bought_quantity[@i];
- getitem 501, @bought_quantity[@i];
- set $@rpotsleft, $@rpotsleft - @bought_quantity[@i];
- } else {
- mes "You have insufficient cash.";
- close;
- }
- } else {
- if(@bought_quantity[@i] > $@opotsleft){
- if($@opotsleft > 0){
- set @bought_quantity[@i], $@opotsleft;
- } else {
- mes "We are out of orange potions!";
- close;
- }
- }
- if(Zeny >= 200*@bought_quantity[@i]){
- set Zeny, Zeny - 200*@bought_quantity[@i];
- getitem 502, @bought_quantity[@i];
- set $@opotsleft, $@opotsleft - @bought_quantity[@i];
- } else {
- mes "You have insufficient cash.";
- close;
- }
- }
-}
-deletearray @bought_quantity, getarraysize(@bought_quantity);
-deletearray @bought_nameid, getarraysize(@bought_nameid);
-mes "Trade done.";
-close;
-
-OnInit:
-npcshopitem "dyn_shop1", 501,40,502,200;
-set $@rpotsleft, 10;
-set $@opotsleft, 10;
-end;
+- shop dyn_shop1 -1,501:50
+
+prontera.gat,181,200,4 script Dynamic Shop 123,{
+callshop "dyn_shop1",0;
+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){
+ mes "omgh4x!";
+ end;
+ }
+ if(@sold_nameid[@i] == 501){
+ set $@rpotsleft, $@rpotsleft + @sold_quantity[@i];
+ set Zeny, Zeny + @sold_quantity[@i]*20;
+ delitem 501, @sold_quantity[@i];
+ } else {
+ if(@sold_nameid[@i] == 502){
+ 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.";
+ }
+ }
+}
+deletearray @sold_quantity, getarraysize(@sold_quantity);
+deletearray @sold_nameid, getarraysize(@sold_nameid);
+mes "Deal completed.";
+close;
+
+OnBuyItem:
+for(set @i, 0; @i < getarraysize(@bought_nameid); set @i, @i + 1){
+ if(@bought_quantity[@i] <= 0){
+ mes "omgh4x!";
+ end;
+ }
+ if(@bought_nameid[@i] == 501){
+ if(@bought_quantity[@i] > $@rpotsleft){
+ if($@rpotsleft > 0){
+ set @bought_quantity[@i], $@rpotsleft;
+ } else {
+ mes "We are out of red potions!";
+ close;
+ }
+ }
+ if(Zeny >= 40*@bought_quantity[@i]){
+ set Zeny, Zeny - 40*@bought_quantity[@i];
+ getitem 501, @bought_quantity[@i];
+ set $@rpotsleft, $@rpotsleft - @bought_quantity[@i];
+ } else {
+ mes "You have insufficient cash.";
+ close;
+ }
+ } else {
+ if(@bought_quantity[@i] > $@opotsleft){
+ if($@opotsleft > 0){
+ set @bought_quantity[@i], $@opotsleft;
+ } else {
+ mes "We are out of orange potions!";
+ close;
+ }
+ }
+ if(Zeny >= 200*@bought_quantity[@i]){
+ set Zeny, Zeny - 200*@bought_quantity[@i];
+ getitem 502, @bought_quantity[@i];
+ set $@opotsleft, $@opotsleft - @bought_quantity[@i];
+ } else {
+ mes "You have insufficient cash.";
+ close;
+ }
+ }
+}
+deletearray @bought_quantity, getarraysize(@bought_quantity);
+deletearray @bought_nameid, getarraysize(@bought_nameid);
+mes "Trade done.";
+close;
+
+OnInit:
+npcshopitem "dyn_shop1", 501,40,502,200;
+set $@rpotsleft, 10;
+set $@opotsleft, 10;
+end;
} \ No newline at end of file