summaryrefslogtreecommitdiff
path: root/npc/magic/config.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/config.txt')
-rw-r--r--npc/magic/config.txt83
1 files changed, 60 insertions, 23 deletions
diff --git a/npc/magic/config.txt b/npc/magic/config.txt
index ddb56902..57d42189 100644
--- a/npc/magic/config.txt
+++ b/npc/magic/config.txt
@@ -5,8 +5,24 @@
//
// Used for our pseudo-magic.
// These are only helpers, you can add more restrictions and effects freely.
-// FIXME
+// Here abizit() goes up to 10 instead of 5
function script abizit {
+ if (!getskilllv(SKILL_MAGIC)) return 0;
+ switch (getskilllv(SKILL_MAGIC)) {
+ case 1:
+ .@base = 10; break;
+ case 2:
+ .@base = 120; break;
+ case 3:
+ .@base = 1500; break;
+ case 4:
+ .@base = 20000; break;
+ case 5:
+ .@base = 250000; break;
+ default:
+ return 0;
+ }
+ return min(MAGIC_EXP/.@base, 10);
return 0;
}
@@ -41,8 +57,8 @@ function script AdjustSpellpower {
} else {
.@dmg = .@power; .@power = 100;
}
- // Abizit Influence (80%~130% at best, worst shot at perfect ctrl is 105%)
- .@dmg = .@dmg * (80 + abizit() * rand2(5,10)) / 100;
+ // Abizit Influence (50%~110% at best, perfect ctrl is 100%~110%)
+ .@dmg = .@dmg * (50 + abizit() * rand2(5,6)) / 100;
.@dmg = .@dmg * .@power / 100;
return .@dmg;
}
@@ -95,7 +111,7 @@ function script SummonMagic {
for (.@i = 0; .@i < (.@lv+(.@adj-1))/.@adj; .@i++) {
.@lifetime=rand2(35,50)+.@lv*10;
// Abizit makes lifetime vary (like AdjustSpellpower)
- .@lifetime = .@lifetime * (80 + abizit() * rand2(5,10)) / 100;
+ .@lifetime = .@lifetime * (50 + abizit() * rand2(5,6)) / 100;
// Unfortunately this version does not returns the summoned monster GID
summon("Summoned Monster", .@id, .@lifetime);
/*
@@ -104,7 +120,7 @@ function script SummonMagic {
// Each skill level raises HP in 5%
.@lvx=.@bhp + max(0, (.@lv-1)*.@bhp/20);
// Abizit makes bonus HP vary (like AdjustSpellpower)
- .@lvx = .@lvx * (80 + abizit() * rand2(5,10)) / 100;
+ .@lvx = .@lvx * (50 + abizit() * rand2(5,6)) / 100;
setunitdata(.@mids, UDT_MAXHP, .@lvx);
setunitdata(.@mids, UDT_HP, .@lvx);
// Reconfigure monster modes
@@ -186,17 +202,17 @@ function script rectharm {
function script SK_summon {
.@mob=getarg(0);
.@amt=getarg(1);
- .@mex=getarg(2);
+ .@mex=getarg(2, 1);
if ($@GM_OVERRIDE || debug) debugmes "Skill "+@skillId+" Lv "+@skillLv;
- if (rand2(5) < abizit()) {
+ if (rand2(10) < abizit()) {
// Summon Magic (with magic level bonus)
SummonMagic(@skillId, .@mob, .@amt, MAGIC_LVL+@skillLv-1, @skillLv);
- } else if (rand2(5) < abizit()) {
+ } else if (rand2(10) < abizit()) {
// Re-roll
dispbottom l("You cannot complete the casting correctly!");
SummonMagic(@skillId, .@mob, 1, 1, 1);
- } else if (abizit() <= 1 && any(true, false, false)) {
+ } else if (abizit() <= rand2(3)) {
// Spell overwhelms you, causing it to be spawned as aggro vs you. (33%)
dispbottom l("The spell takes a mind of its own backfires!");
getmapxy(.@m$, .@x, .@y, 0);
@@ -319,20 +335,41 @@ function script ShowAbizit {
mesn l("Current Magic Control");
// FIXME
- .@val=MAGIC_EXP+rand(-MAGIC_LVL*5, MAGIC_LVL*5);
- .@base=((MAGIC_LVL*2)**3);
- if (.@val > .@base*5)
- mescordialog l("You are perfectly in control of your magic."), 3, .@dial;
- else if (.@val > .@base*4)
- mescordialog l("You are mostly in control of your magic."), 2, .@dial;
- else if (.@val > .@base*3)
- mescordialog l("You are somewhat in control of your magic."), 4, .@dial;
- else if (.@val > .@base*2)
- mescordialog l("Your magic is more powerful than you, but you can control."), 7, .@dial;
- else if (.@val > .@base)
- mescordialog l("You still are overwhelmed by your magic."), 6, .@dial;
- else
- mescordialog l("You are completly overwhelmed by your magic."), 1, .@dial;
+ switch (abizit()) {
+ case 10:
+ mescordialog l("Magic flows naturally from you, readily and with ease. You feel in perfect control of your magic."), 3, .@dial;
+ break;
+ case 9:
+ mescordialog l("You feel in almost perfect control of your magic."), 2, .@dial;
+ break;
+ case 8:
+ mescordialog l("You feel that you have very good control of your magic."), 2, .@dial;
+ break;
+ case 7:
+ mescordialog l("You feel quite in control of your magic."), 4, .@dial;
+ break;
+ case 6:
+ mescordialog l("You feel mostly in control of your magic."), 4, .@dial;
+ break;
+ case 5:
+ mescordialog l("You feel somewhat in control of your magic."), 7, .@dial;
+ break;
+ case 4:
+ mescordialog l("You feel you still have a few difficulties in controlling your magic."), 7, .@dial;
+ break;
+ case 3:
+ mescordialog l("Trying to control your magic is still rather troublesome."), 6, .@dial;
+ break;
+ case 2:
+ mescordialog l("You feel that you have only the bare minimum of control over your magic."), 6, .@dial;
+ break;
+ case 1:
+ mescordialog l("You feel quite overwhelmed by your magic, but are beginning to see patterns."), 1, .@dial;
+ break;
+ case 0:
+ mescordialog l("You feel completely overwhelmed by your magic."), 1, .@dial;
+ break;
+ }
return;
}