From b9d13e8d1d9a675c84b1422152a320f56233352c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 26 Jun 2020 01:44:26 -0300 Subject: Summoning when blacklisted will, for the first time, cause nature to fight you Later attempts will silently fail. --- npc/config/magic.txt | 17 ++++++++++++++++- npc/functions/hub.txt | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/config/magic.txt b/npc/config/magic.txt index 81c23de5f..675f36e42 100644 --- a/npc/config/magic.txt +++ b/npc/config/magic.txt @@ -185,6 +185,21 @@ function script ShowAbizit { } +// alignment_cansummon() +function script alignment_cansummon { + if (alignment() < 0 && !isequippedcnt(AegisShield)) { + if (!@hatesummon) { + dispbottom l("Nature itself express hate against you!"); + getmapxy(.@m$, .@x, .@y, 0); + .@opo=monster(.@m$, .@x, .@y, "Failed summon", .@mob, 1); + unitattack(.@opo, getcharid(3)); + @hatesummon=true; + } + return false; + } + return true; +} + // SK_summon(ID, amount, mexp) function script SK_summon { .@mob=getarg(0); @@ -193,7 +208,7 @@ function script SK_summon { if ($@GM_OVERRIDE || debug) debugmes "Skill "+@skillId+" Lv "+@skillLv; // Blocked from summoning magic - if (alignment() < 0 && !isequippedcnt(AegisShield)) + if (!alignment_cansummon()) return; if (rand2(5) < abizit()) { diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt index 99d197994..062ba7733 100644 --- a/npc/functions/hub.txt +++ b/npc/functions/hub.txt @@ -568,7 +568,7 @@ function script HUB_SkillInvoke { SK_summon(.@mobId, 4, any(4,5)); break; case TMW2_DUCKY: - if (alignment() < 0 && !isequippedcnt(AegisShield)) + if (!alignment_cansummon()) break; SummonMagic(@skillId, Duck, 2, @skillLv); GetManaExp(@skillId, 1); -- cgit v1.2.3-60-g2f50