summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-13 10:36:05 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-13 10:36:05 -0300
commit5062fac8ea8ecbbb3f2206361caa849677361c87 (patch)
treee739f7da94a974246c21c1386e76125545231cb6
parent45f8912b8e8a3b6c8c4599577e77a496273fdb31 (diff)
downloadserverdata-5062fac8ea8ecbbb3f2206361caa849677361c87.tar.gz
serverdata-5062fac8ea8ecbbb3f2206361caa849677361c87.tar.bz2
serverdata-5062fac8ea8ecbbb3f2206361caa849677361c87.tar.xz
serverdata-5062fac8ea8ecbbb3f2206361caa849677361c87.zip
Replace Banker's code with Evol2 standards (total rewrite/fully fixed)
Cashier Shade OK
-rw-r--r--db/quest_db.conf212
-rw-r--r--npc/functions/banker.txt432
2 files changed, 172 insertions, 472 deletions
diff --git a/db/quest_db.conf b/db/quest_db.conf
index ef64fe4b..da5151cd 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -24,221 +24,17 @@ quest_db: (
)
},
******************************************************************************/
-// Drasil Island Quests (0~19)
+// General Quests (0~19)
{
Id: 0
- Name: "ShipQuests_Julia"
-},
-{
- Id: 1
- Name: "ShipQuests_Arpan"
-},
-{
- Id: 2
- Name: "ShipQuests_Alige"
-},
-{
- Id: 3
- Name: "ShipQuests_Peter"
-},
-{
- Id: 4
- Name: "ShipQuests_Nard"
-},
-{
- Id: 5
- Name: "ShipQuests_Knife"
-},
-{
- Id: 6
- Name: "ShipQuests_ArpanMoney"
-},
-{
- Id: 7
- Name: "ShipQuests_Door"
-},
-{
- Id: 8
- Name: "ShipQuests_Couwan"
-},
-{
- Id: 9
- Name: "ShipQuests_TreasureChest"
-},
-{
- Id: 10
- Name: "ShipQuests_Ale"
-},
-{
- Id: 11
- Name: "ShipQuests_Astapolos"
-},
-{
- Id: 12
- Name: "ShipQuests_Gulukan"
-},
-{
- Id: 13
- Name: "ShipQuests_Jalad"
-},
-{
- Id: 14
- Name: "ShipQuests_QMuller"
-},
-{
- Id: 15
- Name: "ShipQuests_Tibbo"
-},
-{
- Id: 16
- Name: "ShipQuests_Gugli"
-},
-{
- Id: 17
- Name: "ShipQuests_ChefGado"
-},
-{
- Id: 18
- Name: "General_Cookies"
-},
-
-// Artis Quests (20~49)
-{
- Id: 20
- Name: "ArtisQuests_LazyBrother"
-},
-{
- Id: 21
- Name: "ArtisQuests_Urchin"
-},
-{
- Id: 22
- Name: "ArtisQuests_CatchPiou"
-},
-{
- Id: 23
- Name: "ArtisQuests_Fishman"
-},
-{
- Id: 24
- Name: "ArtisQuests_QOnan"
-},
-// ID 25 IS FREE
-{
- Id: 26
- Name: "General_Rumly"
-},
-{
- Id: 27
- Name: "ArtisQuests_Enora"
-},
-// ID 28 IS FREE
-{
- Id: 29
- Name: "ArtisQuests_Fexil"
-},
-{
- Id: 30
- Name: "ArtisQuests_Lloyd"
-},
-{
- Id: 31
- Name: "General_Janus"
-},
-{
- Id: 32
- Name: "ArtisQuests_MonaDad"
-},
-{
- Id: 33
- Name: "Artis_Legion_Progress"
-},
-{
- Id: 34
- Name: "ArtisQuests_TrainingLegion"
-},
-{
- Id: 35
- Name: "ThiefQuests_Artis"
-},
-
-// Argaes Quests (50~99)
-{
- Id: 50
- Name: "HurnscaldQuests_Hinnak"
-},
-{
- Id: 51
- Name: "HurnscaldQuests_Soup"
-},
-{
- Id: 52
- Name: "HurnscaldQuests_Inspector"
-},
-{
- Id: 53
- Name: "HurnscaldQuests_ForestBow"
-},
-{
- Id: 54
- Name: "HurnscaldQuests_WoodenShield"
-},
-{
- Id: 55
- Name: "General_Cooking"
-},
-{
- Id: 56
- Name: "General_Brotherhood"
-},
-{
- Id: 57
- Name: "HurnscaldQuests_Kfahr"
-},
-{
- Id: 58
- Name: "ArgaesQuest_Galimatia"
-},
-{
- Id: 59
- Name: "HurnscaldQuests_Rossy"
-},
-{
- Id: 60
- Name: "HurnscaldQuests_BloodDonor"
-},
-{
- Id: 61
- Name: "General_CptHal"
-},
-{
- Id: 62
- Name: "HurnscaldQuest_Bandits"
-},
-
-// Event and General Quests (100~149)
-{
- Id: 100
Name: "General_Narrator"
},
{
- Id: 101
- Name: "Halloween_VisitArtis"
-},
-{
- Id: 102
- Name: "Halloween_BarrelQuest"
-},
-{
- Id: 103
- Name: "General_SmearedHands"
-},
-{
- Id: 104
- Name: "General_MerchantRequest"
+ Id: 1
+ Name: "General_Banker"
},
-// Tonori Quests (150~199)
+// Tonori Quests (20~49)
{
Id: 150
Name: "TonoriQuest_Kylian"
diff --git a/npc/functions/banker.txt b/npc/functions/banker.txt
index 4bfe9f9a..4222619e 100644
--- a/npc/functions/banker.txt
+++ b/npc/functions/banker.txt
@@ -1,268 +1,172 @@
+// Bank scripts
+function script Banking {
+ do
+ {
+ if (BankVault > 0) {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("You currently have @@ GP on your bank account.",
+ format_number(BankVault)),
+ l("What do you want to do with your money?");
+ } else {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("What do you want to do with your money?");
+ }
+
+ select
+ rif(Zeny > 0, l("Deposit.")),
+ rif(BankVault > 0, l("Withdraw.")),
+ l("I'm done.");
+
+ switch (@menu)
+ {
+ case 1:
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("How much do you want to deposit?");
+
+ menuint
+ l("Other."), -1,
+ rif(Zeny >= 1000, format_number(1000) + " GP."), 1000,
+ rif(Zeny >= 2500, format_number(2500) + " GP."), 2500,
+ rif(Zeny >= 5000, format_number(5000) + " GP."), 5000,
+ rif(Zeny >= 10000, format_number(10000) + " GP."), 10000,
+ rif(Zeny >= 25000, format_number(25000) + " GP."), 25000,
+ rif(Zeny >= 50000, format_number(50000) + " GP."), 50000,
+ rif(Zeny >= 100000, format_number(100000) + " GP."), 100000,
+ l("All of my money."), -2,
+ l("I changed my mind."), -3;
+
+ switch (@menuret) {
+ case -1:
+ input @menuret;
+ break;
+ case -2:
+ @menuret = Zeny;
+ }
+
+ if (@menuret > 0) {
+ if (@menuret > Zeny) {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("You do not have enough Gold on yourself.");
+ break;
+ }
+
+ @menuret = min(MAX_BANK_ZENY, @menuret); // make sure the variable can't overflow
+ .@before = BankVault; // amount before the deposit
+ .@max = MAX_BANK_ZENY - BankVault; // maximum possible deposit
+ .@deposit = min(.@max, @menuret); // actual deposit
+
+ if (.@deposit > 0) {
+ BankVault += .@deposit; // add to bank
+ Zeny -= .@deposit; // remove from inventory
+
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("You made a cash deposit of @@ GP.", format_number(.@deposit));
+ }
+ }
+ break;
+
+ case 2:
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("How much do you want to withdraw?");
+
+ menuint
+ l("Other."), -1,
+ rif(BankVault >= 1000, format_number(1000) + " GP."), 1000,
+ rif(BankVault >= 2500, format_number(2500) + " GP."), 2500,
+ rif(BankVault >= 5000, format_number(5000) + " GP."), 5000,
+ rif(BankVault >= 10000, format_number(10000) + " GP."), 10000,
+ rif(BankVault >= 25000, format_number(25000) + " GP."), 25000,
+ rif(BankVault >= 50000, format_number(50000) + " GP."), 50000,
+ rif(BankVault >= 100000, format_number(100000) + " GP."), 100000,
+ l("All of my money."), -2,
+ l("I changed my mind."), -3;
+
+ switch (@menuret)
+ {
+ case -1:
+ input @menuret;
+ break;
+ case -2:
+ @menuret = BankVault;
+ }
+
+ if (@menuret > 0) {
+ if (@menuret > BankVault) {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("You do not have enough Gold Pieces on your bank account.");
+ break;
+ }
+
+ @menuret = min(MAX_ZENY, @menuret); // make sure the variable can't overflow
+ .@before = Zeny; // amount before the withdrawal
+ .@max = MAX_ZENY - Zeny; // maximum possible withdrawal
+ .@withdrawal = min(.@max, @menuret); // actual withdrawal
+
+ if (.@withdrawal > 0) {
+ Zeny += .@withdrawal; // add to inventory
+ BankVault -= .@withdrawal; // remove from bank
+
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
+ l("You withdrew a total of @@ GP.", format_number(.@withdrawal));
+ }
+ }
+ break;
+ default: return;
+ }
+ } while (true);
+}
function script Banker {
- if (BankAccount == 0)
- goto L_Start;
- callsub S_MoveAccount;
- goto L_Start;
-
-L_Start:
- if(@npcname$ == "") set @npcname$, strnpcinfo(1);
- mes "[" + @npcname$ + "]";
- mes "\"Welcome to the bank!";
- mes "How can I help you?\"";
- next;
- menu
- "Open my storage", L_Storage,
- "Deposit", L_Dep,
- "Withdraw", L_With,
- "Check my balance", L_Balance,
- "Change Bank Options", L_Change,
- "Nevermind", L_Nev;
-
-L_Storage:
- if (#BankOptions & OPT_STORAGE_CLOSE) close2;
- openstorage;
- if (#BankOptions & OPT_STORAGE_CLOSE) goto L_Return;
- goto L_Start;
-
-L_Dep:
- mes "[" + @npcname$ + "]";
- mes "\"How much would you like to deposit?\"";
- next;
- menu
- "Other", L_Dep_Input,
- "5,000 GP", L_Dep_5k,
- "10,000 GP", L_Dep_10k,
- "25,000 GP", L_Dep_25k,
- "50,000 GP", L_Dep_50k,
- "100,000 GP", L_Dep_100k,
- "250,000 GP", L_Dep_250k,
- "500,000 GP", L_Dep_500k,
- "1,000,000 GP", L_Dep_1kk,
- "All of my money", L_Dep_All,
- "I've changed my mind", L_Start,
- "Quit", L_Return;
-
-L_Dep_Input:
- input @Amount;
- if (@Amount >= 0)
- goto L_Dep_Continue;
- mes "[" + @npcname$ + "]";
- mes "\"I need a positive amount. What would you like to do?\"";
- menu
- "Go back", L_Start,
- "Try again", L_Dep_Input,
- "Deposit all", L_Dep_All,
- "Nevermind", L_Nev;
-
-L_Dep_5k:
- if (Zeny<5000)
- goto L_NoMoney;
- @Amount = 5000;
- goto L_Dep_Continue;
-
-L_Dep_10k:
- if (Zeny<10000)
- goto L_NoMoney;
- @Amount = 10000;
- goto L_Dep_Continue;
-
-L_Dep_25k:
- if (Zeny<25000)
- goto L_NoMoney;
- @Amount = 25000;
- goto L_Dep_Continue;
-
-L_Dep_50k:
- if (Zeny<50000)
- goto L_NoMoney;
- @Amount = 50000;
- goto L_Dep_Continue;
-
-L_Dep_100k:
- if (Zeny<100000)
- goto L_NoMoney;
- @Amount = 100000;
- goto L_Dep_Continue;
-
-L_Dep_250k:
- if (Zeny<250000)
- goto L_NoMoney;
- @Amount = 250000;
- goto L_Dep_Continue;
-
-L_Dep_500k:
- if (Zeny<500000)
- goto L_NoMoney;
- @Amount = 500000;
- goto L_Dep_Continue;
-
-L_Dep_1kk:
- if (Zeny<1000000)
- goto L_NoMoney;
- @Amount = 1000000;
- goto L_Dep_Continue;
-
-L_Dep_All:
- if (Zeny<1)
- goto L_NoMoney;
- @Amount = Zeny;
- goto L_Dep_Continue;
-
-L_Dep_Continue:
- if (Zeny < @Amount)
- goto L_NoMoney;
- Zeny = Zeny - @Amount;
- #BankAccount = #BankAccount + @Amount;
- goto L_Balance;
-
-L_With:
- mes "[" + @npcname$ + "]";
- mes "\"How much would you like to withdraw?\"";
- menu
- "Other", L_With_Input,
- "5,000 GP", L_With_5k,
- "10,000 GP", L_With_10k,
- "25,000 GP", L_With_25k,
- "50,000 GP", L_With_50k,
- "100,000 GP", L_With_100k,
- "250,000 GP", L_With_250k,
- "500,000 GP", L_With_500k,
- "1,000,000 GP", L_With_1kk,
- "All of my money", L_With_All,
- "I've changed my mind", L_Start,
- "Quit", L_Return;
-
-L_With_Input:
- input @Amount;
- if (@Amount >= 0)
- goto L_With_Continue;
- mes "[" + @npcname$ + "]";
- mes "\"I need a positive amount. What would you like to do?\"";
- menu
- "Go back", L_Start,
- "Try again", L_With_Input,
- "Withdraw all", L_With_All,
- "Nevermind", L_Nev;
-
-L_With_5k:
- if (#BankAccount < 5000)
- goto L_NoMoney;
- @Amount = 5000;
- goto L_With_Continue;
-
-L_With_10k:
- if (#BankAccount < 10000)
- goto L_NoMoney;
- @Amount = 10000;
- goto L_With_Continue;
-
-L_With_25k:
- if (#BankAccount < 25000)
- goto L_NoMoney;
- @Amount = 25000;
- goto L_With_Continue;
-
-L_With_50k:
- if (#BankAccount < 50000)
- goto L_NoMoney;
- @Amount = 50000;
- goto L_With_Continue;
-
-L_With_100k:
- if (#BankAccount < 100000)
- goto L_NoMoney;
- @Amount = 100000;
- goto L_With_Continue;
-
-L_With_250k:
- if (#BankAccount < 250000)
- goto L_NoMoney;
- @Amount = 250000;
- goto L_With_Continue;
-
-L_With_500k:
- if (#BankAccount < 500000)
- goto L_NoMoney;
- @Amount = 500000;
- goto L_With_Continue;
-
-L_With_1kk:
- if (#BankAccount < 1000000)
- goto L_NoMoney;
- @Amount = 1000000;
- goto L_With_Continue;
-
-L_With_All:
- if (#BankAccount < 0)
- goto L_NoMoney;
- @Amount = #BankAccount;
- goto L_With_Continue;
-
-L_With_Continue:
- if (#BankAccount < @Amount)
- goto L_NoMoney;
- Zeny = Zeny + @Amount;
- #BankAccount = #BankAccount - @Amount;
- goto L_Balance;
-
-L_Balance:
- mes "[" + @npcname$ + "]";
- mes "\"Your current bank balance is:";
- mes #BankAccount + " GP\"";
- if (!(#BankOptions & OPT_BANK_CLOSE) || (#BankAccount >= 10000000 &&
- BaseLevel >= 85 && !(#BankOptions & OPT_BANK_GOTSHADE))) next;
- if (#BankAccount >= 10000000 && BaseLevel >= 85 && !(#BankOptions & OPT_BANK_GOTSHADE))
- goto L_GiveShade;
- if (#BankOptions & OPT_BANK_CLOSE) goto L_Return;
- goto L_Start;
-
-L_GiveShade:
- mes "\"Oh\"";
- next;
- mes "\"It seems you managed to amass quite a fortune!\"";
- next;
- mes "\"Thank you for using our services. Please accept this little gift.\"";
- #BankOptions = #BankOptions | OPT_BANK_GOTSHADE;
- getitem "CashiersShade", 1;
- if (#BankOptions & OPT_BANK_CLOSE) goto L_Return;
+ mesn;
+ mes l("\"Welcome to the bank!");
+ mes l("How can I help you?\"");
next;
- npcaction 9; // clear npc dialog
- goto L_Start;
-
-L_Nev:
- mes "[" + @npcname$ + "]";
- mes "\"Goodbye then.\"";
- return;
-
-L_NoMoney:
- mes "[" + @npcname$ + "]";
- mes "\"Oh dear, it seems that you don't have enough money.\"";
- goto L_Start;
-
-S_MoveAccount:
- #BankAccount = #BankAccount + BankAccount;
- BankAccount = 0;
- return;
-
-L_Change:
- setarray @menuitems$, "Keep the current settings", "Close NPC dialog after selecting storage option", "Close NPC dialog after checking your balance";
- if (#BankOptions & OPT_STORAGE_CLOSE) set @menuitems$[1], "Return to main menu after leaving storage";
- if (#BankOptions & OPT_BANK_CLOSE) set @menuitems$[2], "Return to main menu after leaving bank";
- menu
- @menuitems$[0], L_Start,
- @menuitems$[1], L_Change_Storage,
- @menuitems$[2], L_Change_Bank;
-
-L_Change_Storage:
- #BankOptions = (#BankOptions ^ OPT_STORAGE_CLOSE);
- goto L_Start;
-
-L_Change_Bank:
- #BankOptions = (#BankOptions ^ OPT_BANK_CLOSE);
- goto L_Start;
-
-L_Return:
- @npcname$ = "";
- return;
+ do
+ {
+ select
+ l("I would like to store some items."),
+ l("I would like to perform money transactions."),
+ l("Did I received any mail?"),
+ l("Bye.");
+
+ switch (@menu) {
+ case 1:
+ closeclientdialog;
+ openstorage;
+ close;
+ break;
+ case 2:
+ Banking();
+ // Shader quest
+ if (BankVault >= 10000000 &&
+ BaseLevel >= 85 &&
+ getq(General_Banker) < 1) {
+ mesq l("Oh.");
+ next;
+ mesq l("It seems you managed to amass quite a fortune!");
+ next;
+ mesq l("Thank you for using our services. Please accept this little gift.");
+ setq General_Banker, 1;
+ getitem CashiersShade, 1;
+ next;
+ }
+ break;
+ case 3:
+ // NOTE: These values are HARDCODED, do not try changing it!
+ mesc l("Note: Transfering items on mail cost %s GP/item", fnum(2500));
+ mesc l("Money transference will have a %d %% fee as well.", 2);
+ next;
+ closeclientdialog;
+ openmail();
+ close;
+ break;
+ }
+ if (@menu != 4) {
+ speech S_FIRST_BLANK_LINE | S_LAST_NEXT | S_NO_NPC_NAME,
+ l("Something else?");
+ }
+ } while (@menu != 4);
+ closeclientdialog;
+ goodbye;
+ close;
}