summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-03-28 15:57:12 -0300
committerJesusaves <cpntb1@ymail.com>2021-03-28 15:57:12 -0300
commitf60d49d6bbd6a94d170695513a11f76ec83b967d (patch)
tree2225d534158009c7f43c664e996b6290fe4590b9
parent94d1b1895a4a746e791f5c0a7dbba9405b36a85d (diff)
downloadserverdata-f60d49d6bbd6a94d170695513a11f76ec83b967d.tar.gz
serverdata-f60d49d6bbd6a94d170695513a11f76ec83b967d.tar.bz2
serverdata-f60d49d6bbd6a94d170695513a11f76ec83b967d.tar.xz
serverdata-f60d49d6bbd6a94d170695513a11f76ec83b967d.zip
Trait-based rebirth system. Requires a patch on server plugin.
-rw-r--r--db/constants.conf18
-rw-r--r--npc/012-3-3/manatree.txt39
-rw-r--r--npc/functions/global_event_handler.txt3
-rw-r--r--npc/functions/rebirth.txt97
-rw-r--r--npc/scripts.conf1
5 files changed, 151 insertions, 7 deletions
diff --git a/db/constants.conf b/db/constants.conf
index 895d575f..15943ded 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -5279,5 +5279,23 @@ more than one separator can be used in a row (so 12_3___456 is illegal).
KYLIAN_HETCHEL: 16
KYLIAN_HOCUS: 32
+ comment__: "OnPCBonusEvent constants"
+ PCB_ATKBONUS: 1
+ PCB_MATKBONUS: 2
+ PCB_DEFBONUS: 4
+ PCB_MDEFBONUS: 8
+ PCB_EVDBONUS: 16
+ PCB_HITBONUS: 32
+ PCB_CRITBONUS: 64
+ PCB_DOUBLEATK: 128
+ PCB_ALLSTATS: 256
+ PCB_HPBONUS: 512
+ PCB_MPBONUS: 1024
+ PCB_ASPDBONUS: 2048
+ PCB_WSPDBONUS: 4096
+ PCB_WEIGHTBONUS: 8192
+ PCB_EXPBONUS: 16384
+ PCB_NOKNOCKBACK: 32768
+
@include "conf/import/constants.conf"
}
diff --git a/npc/012-3-3/manatree.txt b/npc/012-3-3/manatree.txt
index 7f37ad30..ff90e604 100644
--- a/npc/012-3-3/manatree.txt
+++ b/npc/012-3-3/manatree.txt
@@ -1,18 +1,43 @@
-// Evol scripts.
+// The Mana World scripts.
// Author:
// Micksha
+// Jesusalva
// Description:
// The Manatree.
// THIS IS A PLACEHOLDER!
-012-3-3,39,33,0 script Manatree#012-3-3 NPC_MANATREE,{
- speech
- l("Magic is all around."),
- l("You just must listen to it, and feel it deep inside."),
- l("Now go, search for the unknown.");
-
+012-3-3,39,33,0 script Mana Tree? NPC_MANATREE,{
+ function mtRebirth;
+ mesc l("Magic is all around.");
+ next;
+ mesc l("You just must listen to it, and feel it deep inside.");
+ next;
+ if (BaseLevel >= 99) mtRebirth();
+ mesc l("Now go, search for the unknown.");
close;
+function mtRebirth {
+ /* TODO: When player reaches level cap he can do a quest (should be one that
+requires quite some time to fullfill and collect items etc.). It also is a quest
+that ends in his death (kind of a "last fight" situation where he goes into a
+monster investead area and fights until he dies). They then goes to afterlife and
+talk with a godlike figure and can choose either to stay death and get name
+engraved in eternal hall of heroes or be reborn with some benefits (can choose
+other races, has some boni or traits he can choose from and depending on how many
+monsters he killed before he died he gets some equippment, too, the more monster
+the better).
+ The quest itself might even happen at the afterworld.
+ */
+ mesc l("Do you want to rebirth?"), 1;
+ mesc l("(Level will go to 1 and exp bar will be zero-ed)");
+ mesc l("(Will be able to change race and chose a trait)");
+ mesc l("You'll keep %s your equipment, magic, quest progression, craft recipes, money, whatever else which is not a level. Not even Job level won't be reset!", b(l("ALL")));
+ next;
+ if (askyesno() == ASK_NO) return;
+ RebirthPrompt();
+ return;
+}
+
OnInit:
.distance = 2;
end;
diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt
index 3f10ae73..595769af 100644
--- a/npc/functions/global_event_handler.txt
+++ b/npc/functions/global_event_handler.txt
@@ -69,5 +69,8 @@ OnSkillInvoke:
callfunc("SkillInvoked");
end;
+OnPCBonusEvent:
+ callfunc("RebirthBonus");
+ end;
}
diff --git a/npc/functions/rebirth.txt b/npc/functions/rebirth.txt
new file mode 100644
index 00000000..e613b641
--- /dev/null
+++ b/npc/functions/rebirth.txt
@@ -0,0 +1,97 @@
+// TMW scripts.
+// Authors:
+// Jesusalva
+// Hocus
+// Description:
+// Controls rebirth logic
+
+// RebirthBonus ()
+function script RebirthBonus {
+ if (PCBONUS & PCB_ATKBONUS) {
+ bonus bAtk, 25;
+ }
+ if (PCBONUS & PCB_MATKBONUS) {
+ bonus bMatk, 25;
+ }
+ if (PCBONUS & PCB_DEFBONUS) {
+ bonus bDef, 20;
+ }
+ if (PCBONUS & PCB_MDEFBONUS) {
+ bonus bMdef, 10;
+ }
+ if (PCBONUS & PCB_EVDBONUS) {
+ bonus bFlee, 20;
+ }
+ if (PCBONUS & PCB_HITBONUS) {
+ bonus bHit, 25;
+ }
+ if (PCBONUS & PCB_CRITBONUS) {
+ bonus bCritical, 5;
+ }
+ if (PCBONUS & PCB_DOUBLEATK) {
+ bonus bDoubleAddRate, 5;
+ }
+ if (PCBONUS & PCB_ALLSTATS) {
+ bonus bAllStats, 1;
+ }
+ if (PCBONUS & PCB_HPBONUS) {
+ bonus bMaxHP, 500;
+ }
+ if (PCBONUS & PCB_MPBONUS) {
+ bonus bMaxSP, 200;
+ }
+ if (PCBONUS & PCB_ASPDBONUS) {
+ bonus bAspd, 10;
+ }
+ if (PCBONUS & PCB_WSPDBONUS) {
+ bonus bSpeedAddRate, 5;
+ }
+ if (PCBONUS & PCB_WEIGHTBONUS) {
+ bonus bAddMaxWeight, 1000;
+ }
+ if (PCBONUS & PCB_EXPBONUS) {
+ bonus2 bExpAddRace, RC_All, 10;
+ }
+ if (PCBONUS & PCB_NOKNOCKBACK) {
+ bonus bNoKnockback, 1;
+ }
+ return;
+}
+
+
+// RebirthPrompt ()
+function script RebirthPrompt {
+ setnpcdialogtitle l("Rebirth Trait Selection");
+ mesc l("Please select a trait.");
+ mesc l("This choice CANNOT be undone later."), 1;
+ menuint
+ l("Cancel"), 0,
+ rif(!(PCBONUS & PCB_ATKBONUS), l("Atk +25")), PCB_ATKBONUS,
+ rif(!(PCBONUS & PCB_MATKBONUS), l("Matk +25")), PCB_MATKBONUS,
+ rif(!(PCBONUS & PCB_DEFBONUS), l("Def +20")), PCB_DEFBONUS,
+ rif(!(PCBONUS & PCB_MDEFBONUS), l("MDEF +10")), PCB_MDEFBONUS,
+ rif(!(PCBONUS & PCB_EVDBONUS), l("Evasion +20")), PCB_EVDBONUS,
+ rif(!(PCBONUS & PCB_HITBONUS), l("Accuracy +25")), PCB_HITBONUS,
+ rif(!(PCBONUS & PCB_CRITBONUS), l("Crit +5%")), PCB_CRITBONUS,
+ rif(!(PCBONUS & PCB_DOUBLEATK), l("Double Attack +5%")), PCB_DOUBLEATK,
+ rif(!(PCBONUS & PCB_ALLSTATS), l("All Stats +1")), PCB_ALLSTATS,
+ rif(!(PCBONUS & PCB_HPBONUS), l("HP +500")), PCB_HPBONUS,
+ rif(!(PCBONUS & PCB_MPBONUS), l("MP +200")), PCB_MPBONUS,
+ rif(!(PCBONUS & PCB_ASPDBONUS), l("Atk. Speed +10")), PCB_ASPDBONUS,
+ rif(!(PCBONUS & PCB_WSPDBONUS), l("Walk +5%")), PCB_WSPDBONUS,
+ rif(!(PCBONUS & PCB_WEIGHTBONUS), l("Max Weight +1kg")), PCB_WEIGHTBONUS,
+ rif(!(PCBONUS & PCB_EXPBONUS), l("EXP Gain +10%")), PCB_EXPBONUS,
+ rif(!(PCBONUS & PCB_NOKNOCKBACK), l("Knockback Immunity")), PCB_NOKNOCKBACK;
+ if (@menuret == 0) return;
+ PCBONUS=PCBONUS|@menuret;
+ REBIRTH+=1;
+ resetlvl(3);
+ setnpcdialogtitle l("Rebirth Race Selection");
+ mesc l("Do you want to change your race?");
+ mesc l("This can only be reverted at rebirth! Beware!");
+ next;
+ if (askyesno() == ASK_NO) return;
+ BarberChangeRace();
+ return;
+}
+
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 210a1d78..88b6ec83 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -56,6 +56,7 @@
"npc/functions/treasure.txt",
"npc/functions/afk.txt",
"npc/functions/resetstatus.txt",
+"npc/functions/rebirth.txt",
// May rely on custom functions and thus must be handled by last
"npc/functions/util.txt",