summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2016-01-24 20:27:39 +0100
committerReid <reidyaro@gmail.com>2016-01-24 22:25:26 +0100
commit52b0e7b2714fe4931e65a79683c4db7228ebd80c (patch)
tree3aa2d0ceab6cb49cc2bde8804000a9c60a2fe5a9
parenta852cbe209ce0fff6713db3bebc485a1c6d4619b (diff)
downloadserverdata-52b0e7b2714fe4931e65a79683c4db7228ebd80c.tar.gz
serverdata-52b0e7b2714fe4931e65a79683c4db7228ebd80c.tar.bz2
serverdata-52b0e7b2714fe4931e65a79683c4db7228ebd80c.tar.xz
serverdata-52b0e7b2714fe4931e65a79683c4db7228ebd80c.zip
Improve Plush and the savepoint functions.
Add bed functions into a different file and prevent the use of unlimited heal by disallowing the feature to switch of savepoint while keeping the reservation on the INN.
-rw-r--r--npc/001-2-28/plush.txt19
-rw-r--r--npc/001-2-29/savepoint.txt78
-rw-r--r--npc/functions/beds.txt30
-rw-r--r--npc/scripts.conf1
4 files changed, 46 insertions, 82 deletions
diff --git a/npc/001-2-28/plush.txt b/npc/001-2-28/plush.txt
index 86853ea2..902159fa 100644
--- a/npc/001-2-28/plush.txt
+++ b/npc/001-2-28/plush.txt
@@ -29,20 +29,13 @@
emotion 3;
Zeny = Zeny - .@price;
INN_Register = REDPLUSH_INN;
+ PC_Is_Dead = false;
- speech 5, l("Do you want to choose your room yourself?");
-
- switch (select (l("[Yes]"),
- l("[No]")))
- {
- case 1:
- speech 5, l("Okay. You can go upstairs and choose a room.");
- break;
- case 2:
- speech 5, l("Okay. I registered you on the @@ room of the upper level.", (Sex == G_FEMALE) ? "4th" : "2nd");
- savepoint "001-2-29.gat", 29, (Sex == G_FEMALE) ? 49 : 35;
- break;
- }
+ speech 5,
+ l("I registered you on the @@ room of the upper level.",
+ (Sex == G_FEMALE) ? "4th" : "2nd"),
+ l("You can go upstairs and choose a different room if you want.");
+ savepoint "001-2-29.gat", 29, (Sex == G_FEMALE) ? 49 : 35;
}
}
diff --git a/npc/001-2-29/savepoint.txt b/npc/001-2-29/savepoint.txt
index 3977b473..62e84015 100644
--- a/npc/001-2-29/savepoint.txt
+++ b/npc/001-2-29/savepoint.txt
@@ -4,30 +4,15 @@
// Description:
// Saves locations in 001-2-29 map.
-001-2-29,29,28,0 script #001-2-29-1 NPC_SAVE_POINT,0,0,0,0,{
- narrator 4,
- l("Do you want to use this place as save point?");
-
- if (select (l("[Yes]"), l("[No]")) == 1)
- {
- savepointparticle "001-2-29.gat", 29, 28;
- }
- closedialog;
- close;
+001-2-29,29,28,0 script #001-2-29-1 NPC_SAVE_POINT,0,0,{
+ bedClic ("001-2-29.gat", 29, 28, REDPLUSH_INN);
OnInit:
.distance = 2;
end;
OnTouch:
- if (PC_Is_Dead && INN_Register == REDPLUSH_INN)
- {
- INN_Register = NO_INN;
- percentheal 100,100;
-
- PC_Is_Dead = 0;
- }
- close;
+ bedTouch;
OnPCDieEvent:
PC_Is_Dead = 1;
@@ -35,79 +20,34 @@ OnPCDieEvent:
}
001-2-29,29,35,0 script #001-2-29-2 NPC_SAVE_POINT,0,0,{
- narrator 4,
- l("Do you want to use this place as save point?");
-
- if (select (l("[Yes]"), l("[No]")) == 1)
- {
- savepointparticle "001-2-29.gat", 29, 35;
- }
- closedialog;
- close;
+ bedClic ("001-2-29.gat", 29, 35, REDPLUSH_INN);
OnInit:
.distance = 2;
end;
OnTouch:
- if (PC_Is_Dead && INN_Register == REDPLUSH_INN)
- {
- INN_Register = NO_INN;
- percentheal 100,100;
-
- PC_Is_Dead = 0;
- }
- close;
+ bedTouch;
}
001-2-29,29,42,0 script #001-2-29-3 NPC_SAVE_POINT,0,0,{
- narrator 4,
- l("Do you want to use this place as save point?");
-
- if (select (l("[Yes]"), l("[No]")) == 1)
- {
- savepointparticle "001-2-29.gat", 29, 42;
- }
- closedialog;
- close;
+ bedClic ("001-2-29.gat", 29, 42, REDPLUSH_INN);
OnInit:
.distance = 2;
end;
OnTouch:
- if (PC_Is_Dead && INN_Register == REDPLUSH_INN)
- {
- INN_Register = NO_INN;
- percentheal 100,100;
-
- PC_Is_Dead = 0;
- }
- close;
+ bedTouch;
}
001-2-29,29,49,0 script #001-2-29-4 NPC_SAVE_POINT,0,0,{
- narrator 4,
- l("Do you want to use this place as save point?");
-
- if (select (l("[Yes]"), l("[No]")) == 1)
- {
- savepointparticle "001-2-29.gat", 29, 49;
- }
- closedialog;
- close;
+ bedClic ("001-2-29.gat", 29, 49, REDPLUSH_INN);
OnInit:
.distance = 2;
end;
OnTouch:
- if (PC_Is_Dead && INN_Register == REDPLUSH_INN)
- {
- INN_Register = NO_INN;
- percentheal 100,100;
-
- PC_Is_Dead = 0;
- }
- close;
+ bedTouch;
}
diff --git a/npc/functions/beds.txt b/npc/functions/beds.txt
new file mode 100644
index 00000000..1649c73f
--- /dev/null
+++ b/npc/functions/beds.txt
@@ -0,0 +1,30 @@
+// Evol functions.
+// Authors:
+// 4144
+// Reid
+// Description:
+// Beds utility functions
+
+function script bedTouch {
+ if (PC_Is_Dead)
+ {
+ PC_Is_Dead = 0;
+ if (INN_Register == REDPLUSH_INN)
+ {
+ INN_Register = NO_INN;
+ percentheal 100,100;
+ }
+ }
+ close;
+}
+
+function script bedClic {
+ narrator 4, l("Do you want to use this place as save point?");
+
+ if (select (l("[Yes]"), l("[No]")) == 1)
+ {
+ savepointparticle (getarg (0), getarg (1), getarg (2), getarg (3));
+ }
+ closedialog;
+ close;
+}
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 444e1967..320bf1d3 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -20,6 +20,7 @@ npc: npc/functions/masks.txt
npc: npc/functions/sailordialogue.txt
npc: npc/functions/sailortalk.txt
npc: npc/functions/savepoint.txt
+npc: npc/functions/beds.txt
npc: npc/functions/shops.txt
npc: npc/functions/villagertalk.txt
npc: npc/functions/npcmovegraph.txt