summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/003-1/constableperry.txt27
-rw-r--r--npc/003-3/malindou.txt10
-rw-r--r--npc/017-3/_import.txt1
-rw-r--r--npc/017-3/vault.txt33
-rw-r--r--npc/functions/lockpicks.txt14
-rw-r--r--npc/functions/util.txt24
6 files changed, 103 insertions, 6 deletions
diff --git a/npc/003-1/constableperry.txt b/npc/003-1/constableperry.txt
index f0f88e622..b529727c3 100644
--- a/npc/003-1/constableperry.txt
+++ b/npc/003-1/constableperry.txt
@@ -4,9 +4,10 @@
// Jesusalva
// Description:
// Constable Perry invites players to the TMW2 Project
+// Part of the THIEF/MERCHANT branches
003-1,47,75,0 script Constable Perry NPC_MOUBOO,{
-
+ if (JobLevel > 20 && THIEF_RANK == 0) goto L_Quest;
//hello;
mesn;
mesq l("Hello there! I am a constable. I keep law and order here.");
@@ -19,6 +20,30 @@
mesq l("You can even join the project there. Contributors are greatly appreciated! %%N");
close;
+L_Quest:
+ if (MERC_RANK == 0)
+ goto L_Recruit;
+ mesn;
+ mesq l("Hello there, @@, protector of law and order.", mercrank());
+ mesq l("I see you have collected some experience. Let me try to rank you up!");
+ next;
+ if (MERC_EXP > (MERC_RANK+1)**5) {
+ MERC_EXP-=(MERC_RANK+1)**5;
+ MERC_RANK+=1;
+ mesn;
+ mesq l("Congrats! You rank up! You are now a(n) @@!", mercrank());
+ } else {
+ mesn;
+ mesq l("Well, you need more experience. Keep trying!");
+ }
+ close;
+
+L_Recruit:
+ mesn;
+ mesq l("You seem to be doing some money. Would you consider fighting for good, and against all thiefs?");
+ mesq l("...Of course, Hasan is an exception.");
+ close;
+
OnInit:
.sex = G_MALE;
.distance = 5;
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index acfcf69b5..4a8d77ac2 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -86,6 +86,16 @@ OnInit:
$MANA_BLVL=40;
$MANA_JLVL=10;
}
+ // Current UPDATE value: Qui Set 06 13:50:37 -03 2018
+ if ($UPDATE < 1536252637) {
+ $UPDATE=1536252637;
+ debugmes "";
+ debugmes "* Clearing invalid (deleted) items";
+ debugmes "* Initial Vault Values";
+ debugmes "";
+ DelItemFromEveryPlayer(802);
+ $VAULT_01738039=0;
+ }
diff --git a/npc/017-3/_import.txt b/npc/017-3/_import.txt
index 3f6ffc567..1dff8d16d 100644
--- a/npc/017-3/_import.txt
+++ b/npc/017-3/_import.txt
@@ -6,4 +6,5 @@
"npc/017-3/doctor.txt",
"npc/017-3/doug.txt",
"npc/017-3/loratay.txt",
+"npc/017-3/vault.txt",
"npc/017-3/workers.txt",
diff --git a/npc/017-3/vault.txt b/npc/017-3/vault.txt
new file mode 100644
index 000000000..8770bdeea
--- /dev/null
+++ b/npc/017-3/vault.txt
@@ -0,0 +1,33 @@
+// TMW2/LoF Script.
+// Author:
+// Jesusalva
+// Notes:
+// Based on BenB idea.
+
+017-3,80,39,0 script Vault NPC_NO_SPRITE,{
+ mesn;
+ mesq l("There's a shiny safe here. How much money is inside? Nobody is looking at, great!");
+ // 2*3 = 6 possibilities, 5 attempts
+ if (LockPicking(2, 3)) {
+ Zeny=Zeny+$VAULT_01738039;
+ mesn;
+ mesq l("Booty!");
+ } else {
+ mesn;
+ mesq l("Arrested!");
+ .@inch=(Zeny/100);
+ Zeny-=.@inch;
+ $VAULT_01738039+=.@inch;
+ atcommand("@jailfor 5mn "+strcharinfo(0));
+ }
+ close;
+
+OnInit:
+ .distance=3;
+ end;
+
+OnClock0201:
+ $VAULT_01738039+=rand(5,25);
+ end;
+}
+
diff --git a/npc/functions/lockpicks.txt b/npc/functions/lockpicks.txt
index df17d4c67..d3bb0d837 100644
--- a/npc/functions/lockpicks.txt
+++ b/npc/functions/lockpicks.txt
@@ -10,7 +10,7 @@
// THIEF_RANK
// Position on the Thief Tree
-// LockPicking(num_pins, max_pins, prize)
+// LockPicking(num_pins, max_pins)
// Returns 0 upon failure, 1 upon success
// Closes script if an error happen or if you give up / cannot try.
//
@@ -27,14 +27,13 @@ function script LockPicking {
.@d=getarg(0,1);
.@m=getarg(1,3);
- .@p=getarg(2,100);
// Invalid Argument (kill script)
if (.@d < 1 || .@m < 2 || .@m > 5)
end;
// You must be rank (number of locks - 1) to try
- if (THIEF_RANK < .@d) {
+ if (THIEF_RANK+1 < .@d) {
mesc l("This lock is beyond your current capacity."), 1;
close;
}
@@ -58,6 +57,7 @@ function script LockPicking {
// Each thief rank grants you an extra attempt.
// Each pin takes one attempt.
// It's not multiplied, so 3 pins with 3 positions: 6 chances, 9 possibilities.
+ // There's no penalty, but the attempt is counted working or not!
// Remember if you fail, all previous pins will be cleared (@pos)
for (.@i=0; .@i < (.@d+.@m+THIEF_RANK) ; .@i++) {
mesc l("You are trying to open the @@th pin. What to do?", @pos+1);
@@ -77,12 +77,16 @@ function script LockPicking {
mesc l("*click*");
@pos+=1;
} else {
- mesc l("This didn't work.");
+ mesc l("This didn't work. All pins are now unset!");
+ @pos=0;
}
- if (@pos > .@d)
+ if (@pos > .@d) {
+ THIEF_EXP += .@d*.@m;
return 1;
+ }
}
+ THIEF_EXP += 1;
return 0;
}
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 181f02ca0..17cf3fefe 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -338,3 +338,27 @@ function script abizit {
return (MAGIC_EXP/.@base);
}
+
+// Returns, based on a 1-5 range, the title for both thief and merc ranks
+// thiefrank() / mercrank()
+function script thiefrank {
+ switch (THIEF_RANK) {
+ case 5: return l("Bandit Lord");
+ case 4: return l("Assassin");
+ case 3: return l("Rogue");
+ case 2: return l("Bandit");
+ case 1: return l("Thief");
+ default: return l("Error");
+ }
+}
+function script mercrank {
+ switch (MERC_RANK) {
+ case 5: return l("Constable");
+ case 4: return l("Guardian");
+ case 3: return l("Merchant");
+ case 2: return l("Trader");
+ case 1: return l("Fair Person");
+ default: return l("Error");
+ }
+}
+