summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/magic.txt
diff options
context:
space:
mode:
authorThe Kandiman <kandiman@kandiman.(none)>2011-09-10 20:15:17 -0400
committerThe Kandiman <kandiman@kandiman.(none)>2011-09-11 16:48:18 -0400
commit1cb0e75cbd356485ebe35bb3f5af10e1454e57a5 (patch)
tree594bbf4a1bb428ef527f6ce6ec79e4eb3e478607 /world/map/npc/functions/magic.txt
parenta9868851cfe19c503cc72b0289889c564b41dd20 (diff)
downloadserverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.tar.gz
serverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.tar.bz2
serverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.tar.xz
serverdata-1cb0e75cbd356485ebe35bb3f5af10e1454e57a5.zip
Tab conversion and formatting project.
npc/functions and npc/items complete.
Diffstat (limited to 'world/map/npc/functions/magic.txt')
-rw-r--r--world/map/npc/functions/magic.txt235
1 files changed, 118 insertions, 117 deletions
diff --git a/world/map/npc/functions/magic.txt b/world/map/npc/functions/magic.txt
index c4abcab6..bbd242c8 100644
--- a/world/map/npc/functions/magic.txt
+++ b/world/map/npc/functions/magic.txt
@@ -10,27 +10,27 @@
// ------------------------------------------------------------
// Gain initial magic skill
// ------------------------------------------------------------
-function script MagicGainBasic {
+function|script|MagicGainBasic|{
- set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
- close;
+ set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
+ close;
}
// ------------------------------------------------------------
// Initialise Menu for selecting a choice of things to ask about
// ------------------------------------------------------------
-function script MagicTalkOptionsSetup {
- set @QQ_ELANORE, 1;
- set @QQ_MANASEED, 2;
- set @QQ_MANAPOTION, 4;
- set @QQ_WYARA, 8;
- set @QQ_SAGATHA, 16;
- set @QQ_AULDSBEL, 32;
- set @QQ_IMP, 64;
- set @QQ_OLDWIZ, 128;
- set @QQ_ASTRALSOUL, 256;
- return;
+function|script|MagicTalkOptionsSetup|{
+ set @QQ_ELANORE, 1;
+ set @QQ_MANASEED, 2;
+ set @QQ_MANAPOTION, 4;
+ set @QQ_WYARA, 8;
+ set @QQ_SAGATHA, 16;
+ set @QQ_AULDSBEL, 32;
+ set @QQ_IMP, 64;
+ set @QQ_OLDWIZ, 128;
+ set @QQ_ASTRALSOUL, 256;
+ return;
}
// ------------------------------------------------------------
@@ -40,114 +40,115 @@ function script MagicTalkOptionsSetup {
// ------------------------------------------------------------
-function script MagicTalkMenu {
- setarray @choice$, "", "", "", "", "", "", "", "", "", "";
- set @choices_nr, 0;
- setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+function|script|MagicTalkMenu|{
+ setarray @choice$, "", "", "", "", "", "", "", "", "", "";
+ set @choices_nr, 0;
+ setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
+
+ if (@ignore & @QQ_ELANORE)
+ goto L_Q_post_elanore;
+ set @choice$[@choices_nr], "...Elanore the Healer?";
+ set @choice_idx[@choices_nr], @QQ_ELANORE;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_ELANORE)
- goto L_Q_post_elanore;
- set @choice$[@choices_nr], "...Elanore the Healer?";
- set @choice_idx[@choices_nr], @QQ_ELANORE;
- set @choices_nr, @choices_nr + 1;
L_Q_post_elanore:
+ if (@ignore == @QQ_MANASEED)
+ goto L_Q_post_manaseed;
+ if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
+ goto L_Q_post_manaseed;
+ set @choice$[@choices_nr], "...the Mana Seed?";
+ set @choice_idx[@choices_nr], @QQ_MANASEED;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore == @QQ_MANASEED)
- goto L_Q_post_manaseed;
- if (!(MAGIC_FLAGS & (MFLAG_KNOWS_MANASEED | MFLAG_MANASEED_RUMOUR)))
- goto L_Q_post_manaseed;
- set @choice$[@choices_nr], "...the Mana Seed?";
- set @choice_idx[@choices_nr], @QQ_MANASEED;
- set @choices_nr, @choices_nr + 1;
L_Q_post_manaseed:
+ if (@ignore & @QQ_MANAPOTION)
+ goto L_Q_post_manapotion;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
+ goto L_Q_post_manapotion;
+ set @choice$[@choices_nr], "...Mana Potions?";
+ set @choice_idx[@choices_nr], @QQ_MANAPOTION;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_MANAPOTION)
- goto L_Q_post_manapotion;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_MANAPOTION))
- goto L_Q_post_manapotion;
- set @choice$[@choices_nr], "...Mana Potions?";
- set @choice_idx[@choices_nr], @QQ_MANAPOTION;
- set @choices_nr, @choices_nr + 1;
L_Q_post_manapotion:
+ if (@ignore & @QQ_WYARA)
+ goto L_Q_post_wyara;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
+ goto L_Q_post_wyara;
+ set @choice$[@choices_nr], "...Wyara the Witch?";
+ set @choice_idx[@choices_nr], @QQ_WYARA;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_WYARA)
- goto L_Q_post_wyara;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_WYARA))
- goto L_Q_post_wyara;
- set @choice$[@choices_nr], "...Wyara the Witch?";
- set @choice_idx[@choices_nr], @QQ_WYARA;
- set @choices_nr, @choices_nr + 1;
L_Q_post_wyara:
+ if (@ignore & @QQ_SAGATHA)
+ goto L_Q_post_sagatha;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
+ goto L_Q_post_sagatha;
+ set @choice$[@choices_nr], "...Sagatha the Witch?";
+ set @choice_idx[@choices_nr], @QQ_SAGATHA;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_SAGATHA)
- goto L_Q_post_sagatha;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_SAGATHA))
- goto L_Q_post_sagatha;
- set @choice$[@choices_nr], "...Sagatha the Witch?";
- set @choice_idx[@choices_nr], @QQ_SAGATHA;
- set @choices_nr, @choices_nr + 1;
L_Q_post_sagatha:
+ if (@ignore & @QQ_AULDSBEL)
+ goto L_Q_post_auldsbel;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
+ goto L_Q_post_auldsbel;
+ set @choice$[@choices_nr], "...Auldsbel the Wizard?";
+ set @choice_idx[@choices_nr], @QQ_AULDSBEL;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_AULDSBEL)
- goto L_Q_post_auldsbel;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_AULDSBEL))
- goto L_Q_post_auldsbel;
- set @choice$[@choices_nr], "...Auldsbel the Wizard?";
- set @choice_idx[@choices_nr], @QQ_AULDSBEL;
- set @choices_nr, @choices_nr + 1;
L_Q_post_auldsbel:
+ if (@ignore & @QQ_OLDWIZ)
+ goto L_Q_post_oldwiz;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD))
+ goto L_Q_post_oldwiz;
+ set @choice$[@choices_nr], "...the Old Wizard?";
+ set @choice_idx[@choices_nr], @QQ_OLDWIZ;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_OLDWIZ)
- goto L_Q_post_oldwiz;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_OLD_WIZARD))
- goto L_Q_post_oldwiz;
- set @choice$[@choices_nr], "...the Old Wizard?";
- set @choice_idx[@choices_nr], @QQ_OLDWIZ;
- set @choices_nr, @choices_nr + 1;
L_Q_post_oldwiz:
+ if (@ignore & @QQ_IMP)
+ goto L_Q_post_imp;
+ if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
+ goto L_Q_post_imp;
+ set @choice$[@choices_nr], "...the Earth Spirit in the desert well?";
+ set @choice_idx[@choices_nr], @QQ_IMP;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_IMP)
- goto L_Q_post_imp;
- if (!(MAGIC_FLAGS & MFLAG_KNOWS_IMP))
- goto L_Q_post_imp;
- set @choice$[@choices_nr], "...the Earth Spirit in the desert well?";
- set @choice_idx[@choices_nr], @QQ_IMP;
- set @choices_nr, @choices_nr + 1;
L_Q_post_imp:
+ if (@ignore & @QQ_ASTRALSOUL)
+ goto L_Q_post_astralsoul;
+ if (!(getskilllv(SKILL_MAGIC)))
+ goto L_Q_post_astralsoul;
+ if (!(getskilllv(SKILL_POOL)))
+ goto L_Q_post_astralsoul;
+ set @choice$[@choices_nr], "...ways to improve my magic?";
+ set @choice_idx[@choices_nr], @QQ_ASTRALSOUL;
+ set @choices_nr, @choices_nr + 1;
- if (@ignore & @QQ_ASTRALSOUL)
- goto L_Q_post_astralsoul;
- if (!(getskilllv(SKILL_MAGIC)))
- goto L_Q_post_astralsoul;
- if (!(getskilllv(SKILL_POOL)))
- goto L_Q_post_astralsoul;
- set @choice$[@choices_nr], "...ways to improve my magic?";
- set @choice_idx[@choices_nr], @QQ_ASTRALSOUL;
- set @choices_nr, @choices_nr + 1;
L_Q_post_astralsoul:
-
- set @choice$[@choices_nr], "...never mind.";
- set @choice_idx[@choices_nr], 0;
- set @choices_nr, @choices_nr + 1;
-
- menu @choice$[0], -,
- @choice$[1], -,
- @choice$[2], -,
- @choice$[3], -,
- @choice$[4], -,
- @choice$[5], -,
- @choice$[6], -,
- @choice$[7], -,
- @choice$[8], -,
- @choice$[9], -;
-
- set @menu, @menu - 1;
-
- if (@menu >= @choices_nr)
- set @menu, 0;
-
- set @c, @choice_idx[@menu];
- return;
+ set @choice$[@choices_nr], "...never mind.";
+ set @choice_idx[@choices_nr], 0;
+ set @choices_nr, @choices_nr + 1;
+
+ menu
+ @choice$[0], -,
+ @choice$[1], -,
+ @choice$[2], -,
+ @choice$[3], -,
+ @choice$[4], -,
+ @choice$[5], -,
+ @choice$[6], -,
+ @choice$[7], -,
+ @choice$[8], -,
+ @choice$[9], -;
+
+ set @menu, @menu - 1;
+
+ if (@menu >= @choices_nr)
+ set @menu, 0;
+
+ set @c, @choice_idx[@menu];
+ return;
}
@@ -158,19 +159,19 @@ L_Q_post_astralsoul:
// @SUP_name$ name of the skill to level up
// @SUP_xp # of experience points to award if the level up succeeds
// ------------------------------------------------------------
-function script SkillUp {
- if (getskilllv(@SUP_id) >= @SUP_lvl)
- goto L_shortcut;
-
- misceffect sfx_skillup, strcharinfo(0);
- setskill @SUP_id, @SUP_lvl;
- getexp @SUP_xp, 0;
- if (@SUP_xp)
- mes "[" + @SUP_xp + " experience points]";
- mes "[Level " + @SUP_lvl + " in " + @SUP_name$ + "]";
- return;
+function|script|SkillUp|{
+ if (getskilllv(@SUP_id) >= @SUP_lvl)
+ goto L_shortcut;
+
+ misceffect sfx_skillup, strcharinfo(0);
+ setskill @SUP_id, @SUP_lvl;
+ getexp @SUP_xp, 0;
+ if (@SUP_xp)
+ mes "[" + @SUP_xp + " experience points]";
+ mes "[Level " + @SUP_lvl + " in " + @SUP_name$ + "]";
+ return;
L_shortcut:
- mes "[You already have level " + getskilllv(@SUP_id) + " in " + @SUP_name$ + "]";
- return;
+ mes "[You already have level " + getskilllv(@SUP_id) + " in " + @SUP_name$ + "]";
+ return;
}