summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-04-14 03:09:39 -0300
committerJesusaves <cpntb1@ymail.com>2021-04-14 03:09:39 -0300
commitd19385d0fc05d3649bfb74df584d0dd676620da0 (patch)
tree55dd76285132e5ba5077be473bac4a3cfe1907d4
parent9100e5509a016748a9d5d08db3f22947836349e4 (diff)
downloadserverdata-d19385d0fc05d3649bfb74df584d0dd676620da0.tar.gz
serverdata-d19385d0fc05d3649bfb74df584d0dd676620da0.tar.bz2
serverdata-d19385d0fc05d3649bfb74df584d0dd676620da0.tar.xz
serverdata-d19385d0fc05d3649bfb74df584d0dd676620da0.zip
TMWA summons are weird
-rw-r--r--npc/magic/config.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/npc/magic/config.txt b/npc/magic/config.txt
index 00817e7f..85693d64 100644
--- a/npc/magic/config.txt
+++ b/npc/magic/config.txt
@@ -91,12 +91,13 @@ function script GetManaExp {
}
-// SkillID, MobID{, SkillLevelPerMob=2{, Level Override}}
+// SkillID, MobID{, SkillLevelPerMob=2{, Level Override{, Summon=True}}}
function script SummonMagic {
.@sk=getarg(0);
.@id=getarg(1);
.@adj=getarg(2,2);
.@lv=getarg(3,getskilllv(.@sk));
+ .@sm=getarg(4, true);
if (.@adj < 1) {
debugmes "\033[31mInvalid MobPerSkillLevel for SummonMagic (.@adj): "+.@adj+"\033[0m";
@@ -104,6 +105,9 @@ function script SummonMagic {
end;
}
+ if (!.@sm)
+ getmapxy(.@m$, .@x, .@y, 0);
+
// Cause effect
// Summoned monsters live from 45 to 60 seconds, and each skill levels grants 10s extra life
// The 35~50 is not a defect, remember skill starts at level 1...
@@ -113,7 +117,10 @@ function script SummonMagic {
// Abizit makes lifetime vary (like AdjustSpellpower)
.@lifetime = .@lifetime * (50 + abizit() * rand2(5,6)) / 100;
// Unfortunately this version does not returns the summoned monster GID
- summon("Summoned Monster", .@id, .@lifetime);
+ if (.@sm)
+ summon("Summoned Monster", .@id, .@lifetime);
+ else
+ monster(.@m$, .@x, .@y, "Invoked Monster", .@id, 1);
/*
.@mids=summon("Summoned Monster", .@id, .@lifetime);
.@bhp=getunitdata(.@mids, UDT_MAXHP);
@@ -198,20 +205,21 @@ function script rectharm {
}
-// SK_summon(ID, amount, mexp)
+// SK_summon(ID, amount, mexp{, summon=True})
function script SK_summon {
.@mob=getarg(0);
.@amt=getarg(1);
.@mex=getarg(2, 1);
+ .@sum=getarg(3, true);
if ($@GM_OVERRIDE || debug) debugmes "Skill "+@skillId+" Lv "+@skillLv;
if (rand2(10) < abizit()) {
// Summon Magic (with magic level bonus)
- SummonMagic(@skillId, .@mob, .@amt, MAGIC_LVL+@skillLv-1, @skillLv);
+ SummonMagic(@skillId, .@mob, .@amt, MAGIC_LVL+@skillLv-1, @skillLv, .@sum);
} else if (rand2(10) < abizit()) {
// Re-roll
dispbottom l("You cannot complete the casting correctly!");
- SummonMagic(@skillId, .@mob, 1, 1, 1);
+ SummonMagic(@skillId, .@mob, 1, 1, 1, .@sum);
} 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!");