summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-14 04:35:38 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-14 04:35:38 -0300
commit7c13373524c6100aae67127cb1e3d6f3a5f4ab79 (patch)
tree2e73fd90d1aa1965bc7bc5113f054f425c6b50a2
parent6c32e39f7bdc985b54b8da23a947deb26ea7d71c (diff)
downloadserverdata-7c13373524c6100aae67127cb1e3d6f3a5f4ab79.tar.gz
serverdata-7c13373524c6100aae67127cb1e3d6f3a5f4ab79.tar.bz2
serverdata-7c13373524c6100aae67127cb1e3d6f3a5f4ab79.tar.xz
serverdata-7c13373524c6100aae67127cb1e3d6f3a5f4ab79.zip
Rewrite partly Elanore and use partly the quest system.
She would not work otherwise.
-rw-r--r--db/quest_db.conf6
-rw-r--r--npc/002-1/elanore.txt117
2 files changed, 33 insertions, 90 deletions
diff --git a/db/quest_db.conf b/db/quest_db.conf
index 846fbb10..ecae46d6 100644
--- a/db/quest_db.conf
+++ b/db/quest_db.conf
@@ -46,7 +46,11 @@ quest_db: (
// Kaizei Quests (140~179)
-// Other Quests (180~219)
+// Magic Quests (180~219)
+{
+ Id: 180
+ Name: "MagicQuest_Healing"
+},
// Test Quests, Debug Quests, etc. (1000+)
{
diff --git a/npc/002-1/elanore.txt b/npc/002-1/elanore.txt
index b60e6085..07ff832b 100644
--- a/npc/002-1/elanore.txt
+++ b/npc/002-1/elanore.txt
@@ -16,31 +16,22 @@ function script ElanoreFix {
}
function script elanore_decrease_exp {
- @Q_heal_exp = MAGIC_EXPERIENCE >> 24;
- if (@Q_heal_exp < 8) goto L_OnPcKillWipe;
- @Q_heal_exp = @Q_heal_exp - 8;
- goto L_OnPcKillFinish;
+ .@heal_exp = getq2(MagicQuest_Healing);
-L_OnPcKillWipe:
- @Q_heal_exp = 0;
- goto L_OnPcKillFinish;
+ if (.@heal_exp < 8)
+ .@heal_exp = 0;
+ else
+ .@heal_exp -= 8;
-L_OnPcKillFinish:
- MAGIC_EXPERIENCE = (MAGIC_EXPERIENCE & ~(255 << 24)) | (@Q_heal_exp << 24);
- goto L_Return;
-
-L_Return:
+ setq2(MagicQuest_Healing, .@heal_exp);
return;
}
002-1,75,62,0 script Elanore#_M NPC108,{
@has_magic = getskilllv(SKILL_MAGIC);
- @Q_MASK = NIBBLE_1_MASK;
- @Q_SHIFT = NIBBLE_1_SHIFT;
-
- @Q_status = (QUEST_MAGIC2 & @Q_MASK) >> @Q_SHIFT;
- @Q_heal_exp = MAGIC_EXPERIENCE >> 24;
+ @Q_status = getq(MagicQuest_Healing);
+ .@heal_exp = getq2(MagicQuest_Healing);
// Set up SkillUp function
@SUP_id = SKILL_MAGIC_LIFE;
@@ -62,70 +53,22 @@ L_Return:
callsub S_Update_Var;
if (sc_check(SC_POISON) || sc_check(SC_DPOISON)) goto L_CurePoison;
if (BaseLevel > 20) goto L_NoHeal;
- @temp = rand2(4);
- if(@temp == 1) goto L_Heal2;
- if(@temp == 2) goto L_Heal3;
- if(@temp == 3) goto L_Heal4;
- goto L_Heal1;
-
-L_Heal1:
- mesn l("Elanore the Healer");
- mes "\"You don't look too well; let me treat your wounds.\"";
- next;
- goto L_Heal_L;
-
-L_Heal2:
- mesn l("Elanore the Healer");
- mes "\"I will make quick work of your wounds.\"";
- next;
- goto L_Heal_L;
-
-L_Heal3:
mesn l("Elanore the Healer");
- mes "\"Need a healing?\"";
+ mesq any(
+ l("You don't look too well; let me treat your wounds."),
+ l("I will make quick work of your wounds."),
+ l("Need a healing?"),
+ l("Sometimes you just need to run from battle."));
next;
- goto L_Heal_L;
-
-L_Heal4:
- mesn l("Elanore the Healer");
- mes "\"Sometimes you just need to run from battle.\"";
- next;
- goto L_Heal_L;
-
-L_Heal_L:
- @temp = rand2(3);
- if(@temp == 1) goto L_Heal_2;
- if(@temp == 2) goto L_Heal_3;
- if(@temp == 3) goto L_Heal_4;
- goto L_Heal_1;
-
-L_Heal_1:
- mesn l("Elanore the Healer");
- mesq l("Here you go!");
- percentheal 100, 100;
- goto L_close;
-
-L_Heal_2:
-
- mesn l("Elanore the Healer");
- mesq l("Painless, wasn't it?");
- percentheal 100, 100;
- goto L_close;
-
-L_Heal_3:
-
mesn l("Elanore the Healer");
- mesq l("You should be more careful.");
+ mesq any(
+ l("Here you go!"),
+ l("Painless, wasn't it?"),
+ l("You should be more careful."),
+ l("Much better, right?!"));
percentheal 100, 100;
goto L_close;
-L_Heal_4:
-
- mesn l("Elanore the Healer");
- mes "\"Much better, right?!\"";
- heal 10000,10000;
- goto L_close;
-
L_NoHeal:
if (MAGIC_FLAGS)
goto L_Chat;
@@ -282,7 +225,7 @@ L_T_Initial_Noroom:
L_T_ChkAdvTo2:
mesn l("Elanore the Healer");
- if (@Q_heal_exp < 20) goto L_T_ChkAdvTo2_fail;
+ if (.@heal_exp < 20) goto L_T_ChkAdvTo2_fail;
mes "Elanore smiles at you.";
mes "\"From what I have been hearing, you seem to be doing well on your way to becoming a healer. I have decided to accept you as a student of the School of Life Magic.\"";
next;
@@ -314,17 +257,17 @@ L_T_AdvTo2_skip:
L_T_ChkAdvTo2_fail:
mes "\"I think I would like to observe you for a little longer to see if you would make a good healer.\"";
- if (@Q_heal_exp < 5)
+ if (.@heal_exp < 5)
mes "\"You are still at the beginning of your path, but do keep practicing.\"";
- if ((@Q_heal_exp >= 5) && (@Q_heal_exp < 15))
+ if ((.@heal_exp >= 5) && (.@heal_exp < 15))
mes "\"You are making progress, but you still need more practice.\"";
- if (@Q_heal_exp >= 15)
+ if (.@heal_exp >= 15)
mes "\"You have made good progress, but please do continue in your efforts.\"";
goto L_close;
L_T_ChkAdvToLOH:
if (getskilllv(SKILL_MAGIC) < 2) goto L_T_LOH_adv_abort0;
- if (@Q_heal_exp < 30) goto L_T_LOH_adv_abort1;
+ if (.@heal_exp < 30) goto L_T_LOH_adv_abort1;
mesn l("Elanore the Healer");
mesq l("I will now teach you how to heal by laying on your hands. The technique is similar to the spell I taught you at the beginning, but this time you transfer your own health instead of drawing health from a lifestone.");
@@ -356,7 +299,7 @@ L_T_LOH_adv_abort1:
L_T_Explain3:
if (getskilllv(SKILL_MAGIC) < 3) goto L_T_Explain3_abort;
- if (@Q_heal_exp < 50) goto L_T_Explain3_fail;
+ if (.@heal_exp < 50) goto L_T_Explain3_fail;
mesn l("Elanore the Healer");
mesc l("Elanore smiles.");
@@ -425,11 +368,11 @@ L_T_Explain3_abort:
L_T_Explain3_fail:
mesn l("Elanore the Healer");
- if (@Q_heal_exp < 30)
+ if (.@heal_exp < 30)
mes "\"You seem to have regressed as a healer. This is worrisome; please mend your ways or I will not teach you any further.\"";
- if ((@Q_heal_exp >= 30) && (@Q_heal_exp < 40))
+ if ((.@heal_exp >= 30) && (.@heal_exp < 40))
mes "\"You still need more practice in the art of healing.\"";
- if ((@Q_heal_exp >= 40))
+ if ((.@heal_exp >= 40))
mes "\"You are doing well, but you need some more practice as a healer first.\"";
goto L_close;
@@ -589,11 +532,8 @@ L_Bye:
goto L_close;
L_close:
- @Q_MASK = 0;
- @Q_SHIFT = 0;
@has_magic = 0;
@Q_STATUS_MAX = 0;
- @Q_heal_exp = 0;
@Q_status = 0;
@SUP_id = 0;
@SUP_name$ = "";
@@ -604,11 +544,10 @@ L_close:
@STATUS_WAITING_FOR_KADIYA = 0;
@STATUS_READY_TO_LEARN_CURE_POISON = 0;
@STATUS_LEARNED_CURE_POISON = 0;
- @temp = 0;
@xp = 0;
close;
S_Update_Var:
- QUEST_MAGIC2 = (QUEST_MAGIC2 & ~(@Q_MASK) | (@Q_status << @Q_SHIFT));
+ setq(MagicQuest_Healing, @Q_status);
return;
}