Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.12 KB | None | 0 0
  1. From 31d08d3a14ee579bb9fb75ccdc517874e6ee0c78 Mon Sep 17 00:00:00 2001
  2. From: toni <toni@toni-EP45-UD3L.(none)>
  3. Date: Fri, 22 Apr 2011 12:13:12 -0300
  4. Subject: [PATCH] Storage options for the banker function
  5.  
  6. ---
  7.  db/const.txt             |    5 ++++
  8.  npc/functions/banker.txt |   49 +++++++++++++++++++++++++++++++++++++++++++++-
  9.  2 files changed, 53 insertions(+), 1 deletions(-)
  10.  
  11. diff --git a/db/const.txt b/db/const.txt
  12. index 29b9e72..d67ae93 100644
  13. --- a/db/const.txt
  14. +++ b/db/const.txt
  15. @@ -369,3 +369,8 @@ E10_ISLAND_MENU_OFFER_LIFESTONE 15
  16.  E10_COLLECT_EGGS_ID 1246
  17.  E10_TOKEN_ID 666
  18.  E10_MIDREWARD_ID 1247 // Valentine's Glasses (as described)
  19. +
  20. +// Storage Options
  21. +OPT_STORAGE_CLOSE, 1;
  22. +OPT_BANK_CLOSE, 2;
  23. +OPT_ALL_CLOSE, 3;
  24. diff --git a/npc/functions/banker.txt b/npc/functions/banker.txt
  25. index 00f033c..16a8c24 100644
  26. --- a/npc/functions/banker.txt
  27. +++ b/npc/functions/banker.txt
  28. @@ -1,6 +1,6 @@
  29. -//
  30.  
  31.  function   script  Banker  {
  32. +
  33.     if (BankAccount > 0) callsub S_MoveAccount;
  34.  
  35.  L_Start:
  36. @@ -13,13 +13,16 @@ L_Start:
  37.         "Withdraw", L_With,
  38.         "Check my balance", L_Balance,
  39.         "Open my storage", L_Storage,
  40. +       "Change Bank Options", L_Change,
  41.         "Nevermind", L_Nev;
  42.    
  43.     close;
  44.    
  45.  // need to close window before opening storage.
  46.  L_Storage:
  47. +   if (#BankOptions & OPT_STORAGE_CLOSE) close2;
  48.     openstorage;
  49. +   if (#BankOptions & OPT_STORAGE_CLOSE) end;
  50.     goto L_Start;
  51.  
  52.  L_Dep:
  53. @@ -187,6 +190,7 @@ L_Balance:
  54.     mes "[" + @npcname$ + "]";
  55.     mes "\"Your current bank balance is:";
  56.     mes #BankAccount + " GP\"";
  57. +   if (#BankOptions & OPT_BANK_CLOSE) close;
  58.     goto L_Start;
  59.    
  60.  L_Nev:
  61. @@ -203,4 +207,47 @@ S_MoveAccount:
  62.     set #BankAccount, #BankAccount + BankAccount;
  63.     set BankAccount, 0;
  64.     return;
  65. +
  66. +L_Change:
  67. +   if (#BankOptions ^ OPT_ALL_CLOSE == 0) goto L_Offer_Default_Options;
  68. +   if (#BankOptions == 0) goto L_Change_Options;
  69. +
  70. +   if (#BankOptions & OPT_STORAGE_CLOSE)
  71. +   menu
  72. +       "Return to main menu after leaving storage", L_Change_Storage,
  73. +       "Close NPC dialog after using bank", L_Change_Bank,
  74. +       "Keep the current settings", L_Start;
  75. +
  76. +   if (#BankOptions & OPT_BANK_CLOSE)
  77. +   menu
  78. +       "Close NPC dialog after selecting storage option", L_Change_Storage,
  79. +       "Return to main menu after leaving bank", L_Change_Bank,
  80. +       "Keep the current settings", -;
  81. +   goto L_Start;
  82. +
  83. +L_Offer_Default_Options:
  84. +   menu
  85. +       "Return to main menu after leaving storage", L_Change_Storage,
  86. +       "Return to main menu after leaving bank", L_Change_Bank,
  87. +       "Return bank and storage options to default.", -,
  88. +       "Keep the current settings", L_Start;
  89. +   set #BankOptions, 0;
  90. +   goto L_Start;
  91. +
  92. +L_Change_Options:
  93. +   menu
  94. +       "Close NPC dialog after selecting storage option", L_Change_Storage,
  95. +       "Close NPC dialog after using bank", L_Change_Bank,
  96. +       "Change bank and storage options as defined above", -,
  97. +       "Keep the current settings", L_Start;
  98. +   set #BankOptions, (#BankOptions | OPT_ALL_CLOSE);
  99. +   goto L_Start;
  100. +
  101. +L_Change_Storage:
  102. +   set #BankOptions, (#BankOptions ^ OPT_STORAGE_CLOSE);
  103. +   goto L_Start;
  104. +
  105. +L_Change_Bank:
  106. +   set #BankOptions, (#BankOptions ^ OPT_BANK_CLOSE);
  107. +   goto L_Start;
  108.  }
  109. --
  110. 1.7.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement