From 89b2609fd667de01847f64cce7fb80654a655034 Mon Sep 17 00:00:00 2001 From: M59Gar Date: Mon, 28 Mar 2016 04:18:11 -0400 Subject: [PATCH] Witchery School --- kod/include/blakston.khd | 38 ++- kod/object/active/holder/nomoveon/battler.kod | 73 +++++ .../holder/nomoveon/battler/monster.kod | 59 +++- .../active/holder/nomoveon/battler/player.kod | 109 +++++++- .../item/passitem/pforget/forgetxwi.kod | 4 +- kod/object/passive/skill.kod | 36 +++ kod/object/passive/skill/makefile | 3 +- kod/object/passive/skill/witchery.kod | 29 ++ .../passive/skill/witchery/ancientpact.kod | 92 +++++++ .../skill/witchery/arcaneknowledge.kod | 92 +++++++ .../passive/skill/witchery/bloodrunes.kod | 94 +++++++ .../skill/witchery/efficientcasting.kod | 93 +++++++ kod/object/passive/skill/witchery/makefile | 16 ++ .../passive/skill/witchery/ostracization.kod | 77 ++++++ .../skill/witchery/rotememorization.kod | 92 +++++++ .../skill/witchery/unhallowedrunes.kod | 91 +++++++ kod/object/passive/spell.kod | 108 +++++++- kod/object/passive/spell/debuff/hex.kod | 255 ++++++++++++++++++ .../passive/spell/debuff/hex/antireshex.kod | 26 ++ .../spell/debuff/hex/antireshex/algidity.kod | 81 ++++++ .../debuff/hex/antireshex/conductivity.kod | 82 ++++++ .../spell/debuff/hex/antireshex/corrosion.kod | 81 ++++++ .../debuff/hex/antireshex/corruption.kod | 84 ++++++ .../debuff/hex/antireshex/flammability.kod | 80 ++++++ .../spell/debuff/hex/antireshex/frailty.kod | 82 ++++++ .../spell/debuff/hex/antireshex/humility.kod | 81 ++++++ .../spell/debuff/hex/antireshex/makefile | 17 ++ .../debuff/hex/antireshex/vulnerability.kod | 82 ++++++ .../passive/spell/debuff/hex/becloud.kod | 92 +++++++ .../passive/spell/debuff/hex/bestill.kod | 89 ++++++ .../passive/spell/debuff/hex/blackmantle.kod | 85 ++++++ .../passive/spell/debuff/hex/drainhex.kod | 34 +++ .../spell/debuff/hex/drainhex/barbs.kod | 100 +++++++ .../spell/debuff/hex/drainhex/leeches.kod | 100 +++++++ .../spell/debuff/hex/drainhex/makefile | 12 + .../passive/spell/debuff/hex/drainhex/sap.kod | 108 ++++++++ .../passive/spell/debuff/hex/exhaustion.kod | 84 ++++++ .../passive/spell/debuff/hex/fester.kod | 86 ++++++ kod/object/passive/spell/debuff/hex/makefile | 19 ++ kod/object/passive/spell/debuff/hex/mute.kod | 80 ++++++ kod/object/passive/spell/debuff/hex/slow.kod | 84 ++++++ .../passive/spell/debuff/hex/weaken.kod | 101 +++++++ kod/object/passive/spell/debuff/makefile | 3 +- kod/object/passive/spell/heal.kod | 57 +++- kod/object/passive/spell/hospice.kod | 51 +++- kod/object/passive/spell/majheal.kod | 51 +++- kod/util/settings.kod | 25 +- kod/util/system.kod | 29 +- 48 files changed, 3309 insertions(+), 38 deletions(-) create mode 100644 kod/object/passive/skill/witchery.kod create mode 100644 kod/object/passive/skill/witchery/ancientpact.kod create mode 100644 kod/object/passive/skill/witchery/arcaneknowledge.kod create mode 100644 kod/object/passive/skill/witchery/bloodrunes.kod create mode 100644 kod/object/passive/skill/witchery/efficientcasting.kod create mode 100644 kod/object/passive/skill/witchery/makefile create mode 100644 kod/object/passive/skill/witchery/ostracization.kod create mode 100644 kod/object/passive/skill/witchery/rotememorization.kod create mode 100644 kod/object/passive/skill/witchery/unhallowedrunes.kod create mode 100644 kod/object/passive/spell/debuff/hex.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/algidity.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/conductivity.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/corrosion.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/corruption.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/flammability.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/frailty.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/humility.kod create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/makefile create mode 100644 kod/object/passive/spell/debuff/hex/antireshex/vulnerability.kod create mode 100644 kod/object/passive/spell/debuff/hex/becloud.kod create mode 100644 kod/object/passive/spell/debuff/hex/bestill.kod create mode 100644 kod/object/passive/spell/debuff/hex/blackmantle.kod create mode 100644 kod/object/passive/spell/debuff/hex/drainhex.kod create mode 100644 kod/object/passive/spell/debuff/hex/drainhex/barbs.kod create mode 100644 kod/object/passive/spell/debuff/hex/drainhex/leeches.kod create mode 100644 kod/object/passive/spell/debuff/hex/drainhex/makefile create mode 100644 kod/object/passive/spell/debuff/hex/drainhex/sap.kod create mode 100644 kod/object/passive/spell/debuff/hex/exhaustion.kod create mode 100644 kod/object/passive/spell/debuff/hex/fester.kod create mode 100644 kod/object/passive/spell/debuff/hex/makefile create mode 100644 kod/object/passive/spell/debuff/hex/mute.kod create mode 100644 kod/object/passive/spell/debuff/hex/slow.kod create mode 100644 kod/object/passive/spell/debuff/hex/weaken.kod diff --git a/kod/include/blakston.khd b/kod/include/blakston.khd index c8c06f4a1c..1b6524d5ed 100644 --- a/kod/include/blakston.khd +++ b/kod/include/blakston.khd @@ -2066,7 +2066,16 @@ SKID_PROFICIENCY_SHORT_SWORD = 457 % Duplicate, for the easily confused. SKID_PROFICIENCY_SHORTSWORD = 457 - + + % Witchery skills + SKID_ARCANE_KNOWLEDGE = 458 + SKID_ROTE_MEMORIZATION = 459 + SKID_EFFICIENT_CASTING = 460 + SKID_ANCIENT_PACT = 461 + SKID_UNHALLOWED_RUNES = 462 + SKID_BLOOD_RUNES = 463 + SKID_OSTRACIZATION = 464 + % Sorcery skills SKID_LINK_ONE = 480 SKID_LINK_TWO = 481 @@ -2305,6 +2314,26 @@ SID_BATTLE_CONTROL = 240 + SID_HEX_VULNERABILITY = 250 + SID_HEX_SLOW = 251 + SID_HEX_LEECHES = 252 + SID_HEX_FRAILTY = 253 + SID_HEX_BARBS = 254 + SID_HEX_HUMILITY = 255 + SID_HEX_CORRUPTION = 256 + SID_HEX_FLAMMABILITY = 257 + SID_HEX_CONDUCTIVITY = 258 + SID_HEX_ALGIDITY = 259 + SID_HEX_CORROSION = 260 + SID_HEX_FESTER = 261 + SID_HEX_MUTE = 262 + SID_HEX_WEAKEN = 263 + SID_HEX_EXHAUSTION = 264 + SID_HEX_SAP = 265 + SID_HEX_BESTILL = 266 + SID_HEX_BECLOUD = 267 + SID_HEX_BLACK_MANTLE = 268 + SID_GREY_GHOST = 300 % Depreciated spell IDs @@ -2386,9 +2415,10 @@ SS_WITCHERY = 8 % Subschools - SS_WITCHERY_XAERDUN = 1 - SS_WITCHERY_NEQUZON = 2 - SS_WITCHERY_IWODACH = 3 + SSS_WITCHERY_XAERDUN = 1 + SSS_WITCHERY_NEQUZON = 2 + SSS_WITCHERY_IWODACH = 3 + SSS_WITCHERY_RAUMLAR = 4 % We may use skill an spell schools in the same routines, thus no overlap. SKS_FENCING = 10 diff --git a/kod/object/active/holder/nomoveon/battler.kod b/kod/object/active/holder/nomoveon/battler.kod index 2b5aaca711..6ffb435fad 100644 --- a/kod/object/active/holder/nomoveon/battler.kod +++ b/kod/object/active/holder/nomoveon/battler.kod @@ -214,6 +214,10 @@ properties: plStatusEffects = $ ptStatusEffectTimer = $ + % Negative values mean more vulnerable to hexes, positive values resist + % -100 is doubled effect, 100 is total immunity + piHexResistance = 0 + messages: % The first lump of code here deals with resistances and immunities/etc. @@ -2236,5 +2240,74 @@ messages: return FALSE; } + GetHexes() + { + local oEnch, lHexes; + + lHexes = $; + foreach oEnch in plEnchantments + { + if Send(Nth(oEnch,2),@UseHexBehavior) + { + lHexes = Cons(Nth(oEnch,2),lHexes); + } + } + + return lHexes; + } + + GetNumHexes() + { + local oEnch, iNumHexes; + + iNumHexes = 0; + foreach oEnch in plEnchantments + { + if Send(Nth(oEnch,2),@UseHexBehavior) + { + iNumHexes = iNumHexes + 1; + } + } + + return iNumHexes; + } + + RemoveRandomHex(exempt=$) + { + local lHexes; + + lHexes = Send(self,@GetHexes); + if exempt <> $ + AND lHexes <> $ + AND FindListElem(lHexes,exempt) <> 0 + { + lHexes = DelListElem(lHexes,exempt); + } + + if lHexes <> $ + AND Length(lHexes) > 0 + { + Send(self,@RemoveEnchantment, + #what=Nth(lHexes,Random(1,Length(lHexes)))); + } + + return; + } + + GetHexResistance() + { + return bound(piHexResistance,-100,100); + } + + GetHexIncEffect(iSpellPower=0) + { + return iSpellPower+1; + } + + GetCasterMaxHexes() + { + return Send(SETTINGS_OBJECT,@GetHexesMax); + } + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/active/holder/nomoveon/battler/monster.kod b/kod/object/active/holder/nomoveon/battler/monster.kod index 10b7c1c0f8..25438dea74 100644 --- a/kod/object/active/holder/nomoveon/battler/monster.kod +++ b/kod/object/active/holder/nomoveon/battler/monster.kod @@ -2122,7 +2122,7 @@ messages: GetOffense(what = $, stroke_obj=$) "This returns the battler's ability to-hit. Ranges from 1 to 2000." { - local iAttack; + local iAttack, i; if piOffense = $ { @@ -2132,7 +2132,7 @@ messages: { iAttack = piOffense; } - + if piChampionStatus = CHAMPION_DEADLY OR piChampionStatus = CHAMPION_INDOMITABLE { @@ -2149,6 +2149,13 @@ messages: iAttack = iAttack * 3 / 4; } + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iAttack = Send(Nth(i,2),@ModifyHitRoll, + #who=self,#what=what,#hit_roll=iAttack, + #state=Nth(i,3)); + } + return Bound(iAttack,1,2000); } @@ -2156,7 +2163,7 @@ messages: "This returns the battler's ability to avoid being hit. Ranges from " "1 to 2000." { - local iDefense, iShocked; + local iDefense, iShocked, i; if piDefense = $ { @@ -2166,7 +2173,14 @@ messages: { iDefense = piDefense; } - + + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iDefense = Send(Nth(i,2),@ModifyDefensePower, + #who=self,#what=what,#defense_power=iDefense, + #state=Nth(i,3)); + } + if piChampionStatus = CHAMPION_TOUGH OR piChampionStatus = CHAMPION_INDOMITABLE { @@ -2207,7 +2221,7 @@ messages: % This returns the damage done to target "what" GetDamage(what = $, stroke_obj=$) { - local iDamage, iMultiplier; + local iDamage, iMultiplier, i; iMultiplier = 1; @@ -2243,7 +2257,14 @@ messages: { iMultiplier = 3; } - + + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iDamage = Send(Nth(i,2),@ModifyDamage, + #who=self,#what=what,#damage=iDamage, + #state=Nth(i,3)); + } + return Bound(iDamage,0,$) * iMultiplier; } @@ -2290,6 +2311,12 @@ messages: local iDamage, iResist, iPercentClass, i, each_obj, bAttackerEmpowered, oSpell, iCorrode, iCorrodeMultiple, iCorrodeReduction; + % Check for stat steals + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&DrainHex) + { + Send(Nth(i,2),@StealStat,#who=what,#what=self,#state=Nth(i,3)); + } + if NOT precision { damage = damage * 100; @@ -5223,16 +5250,32 @@ messages: HealHitPoint() { - local iPercentClass, i, each_obj; + local iPercentClass, i, each_obj, iModifiedGain; if piHit_points >= piMax_Hit_points * 100 { return; } + % Start with full 100% of hit point + iModifiedGain = 100; + + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iModifiedGain = Send(Nth(i,2),@ModifyRegenAmount, + #state=Nth(i,3),#regen=iModifiedGain); + } + + % Don't drain below zero + if iModifiedGain < 0 + AND piHit_points <= 100 + { + iModifiedGain = 0; + } + % We set a mark to see if the healing changes our threshold iPercentClass = piHit_points / (piMax_Hit_points * 20); - piHit_points = piHit_points + 100; + piHit_points = piHit_points + iModifiedGain; if iPercentClass <> (piHit_points / (piMax_Hit_points * 20)) { Send(self,@HitPointThresholdHeal); diff --git a/kod/object/active/holder/nomoveon/battler/player.kod b/kod/object/active/holder/nomoveon/battler/player.kod index 17fedaf7e8..07c68a561f 100644 --- a/kod/object/active/holder/nomoveon/battler/player.kod +++ b/kod/object/active/holder/nomoveon/battler/player.kod @@ -1556,7 +1556,7 @@ messages: AddExertion(amount = 0, SetToThreshold = FALSE) { - local iExertionAdded, iPercentReduced, iVigorLost; + local iExertionAdded, iPercentReduced, iVigorLost, i; % If we cannot gain vigor due to Second Wind, return out if trying % to take away exertion @@ -1569,6 +1569,12 @@ messages: if iExertionAdded > 0 { + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iExertionAdded = Send(Nth(i,2),@ModifyExertion, + #state=Nth(i,3),#amount=iExertionAdded); + } + % Parliament adjustment for exertion reduction. Remove a % from % the amount added. iPercentReduced = Send(Send(SYS,@GetParliament),@GetFactionVigorBonus,#who=self); @@ -3204,11 +3210,24 @@ messages: HealthTimer() { - local iDifference; + local iDifference, i; iDifference = bound(piMax_Health*100 - piHealth,-100,100); ptHealth = $; + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iDifference = Send(Nth(i,2),@ModifyRegenAmount, + #state=Nth(i,3),#regen=iDifference); + } + + % Don't regen below zero. + if iDifference < 0 + AND piHealth <= 100 + { + iDifference = 0; + } + if iDifference > 0 { Send(self,@GainHealth,#amount=iDifference,#precision=TRUE); @@ -5264,6 +5283,13 @@ messages: iOffense = iOffense / 2; } + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iOffense = Send(Nth(i,2),@ModifyHitRoll, + #who=self,#what=what,#hit_roll=iOffense, + #state=Nth(i,3)); + } + if Send(self,@GetStance) <> $ { iOffense = Send(Send(self,@GetStance),@LastPriorityModifyHitRoll, @@ -5337,6 +5363,13 @@ messages: #type=STATUS_SHOCKED)); } + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iDefense = Send(Nth(i,2),@ModifyDefensePower, + #who=self,#what=what,#defense_power=iDefense, + #state=Nth(i,3)); + } + if Send(self,@GetStance) <> $ { iDefense = Send(Send(self,@GetStance),@LastPriorityModifyDefensePower, @@ -5499,6 +5532,13 @@ messages: % Convert to high precision. Super dirty, will be cleaned up shortly. iDamageBonus = iDamageBonus*100; + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iDamage = Send(Nth(i,2),@ModifyDamage, + #who=self,#what=what,#damage=iDamage, + #state=Nth(i,3)); + } + iDamage = iDamage + iDamageBonus; return iDamage; @@ -5647,6 +5687,12 @@ messages: bAttackerEmpowered, bShielded, iCorrode, iCorrodeMultiple, iCorrodeReduction, iDamagePreArmor; + % Check for stat steals + foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&DrainHex) + { + Send(Nth(i,2),@StealStat,#who=what,#what=self,#state=Nth(i,3)); + } + if NOT precision { damage = damage * 100; @@ -6668,7 +6714,7 @@ messages: "Have we waited long enough since the last attack/spell? Sets new " "valid attack time (time in msec, default 1 second)." { - local i, iChilled, iChilledMultiple, iChilledTotal; + local i, n, iChilled, iChilledMultiple, iChilledTotal; if ptAttackTimer <> $ { @@ -6684,6 +6730,12 @@ messages: i = time; } + foreach n in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex) + { + i = Send(Nth(n,2),@ModifyDelay, + #state=Nth(n,3),#iDelay=i); + } + if i > 0 { iChilled = Send(self,@GetStatusEffect,#type=STATUS_CHILLED); @@ -16033,5 +16085,56 @@ messages: return $; } + GetHexIncEffect(iSpellPower=0) + { + local iRunesEff, oRunes; + + iRunesEff = 0; + oRunes = Send(SYS,@FindSkillByNum,#num=SKID_UNHALLOWED_RUNES); + + if oRunes <> $ + AND Send(self,@GetSkillAbility,#Skill_num=SKID_UNHALLOWED_RUNES) > 0 + AND Send(oRunes,@DoSkill,#who=self) + { + iRunesEff = Send(oRunes,@GetIncHexEffectiveness,#who=self); + } + + return iSpellPower + 1 + iRunesEff; + } + + GetHexResistance() + { + local iArcaneKnowledgeRes, oKnowledge; + + iArcaneKnowledgeRes = 0; + oKnowledge = Send(SYS,@FindSkillByNum,#num=SKID_ARCANE_KNOWLEDGE); + + if oKnowledge <> $ + AND Send(self,@GetSkillAbility,#Skill_num=SKID_ARCANE_KNOWLEDGE) > 0 + AND Send(oKnowledge,@DoSkill,#who=self) + { + iArcaneKnowledgeRes = Send(oKnowledge,@GetHexResistance,#who=self); + } + + return bound(piHexResistance+iArcaneKnowledgeRes,-100,100); + } + + GetCasterMaxHexes() + { + local iHexesMax, oRunes; + + iHexesMax = Send(SETTINGS_OBJECT,@GetHexesMax); + oRunes = Send(SYS,@FindSkillByNum,#num=SKID_BLOOD_RUNES); + + if oRunes <> $ + AND Send(self,@GetSkillAbility,#Skill_num=SKID_BLOOD_RUNES) > 0 + AND Send(oRunes,@DoSkill,#who=self) + { + iHexesMax = iHexesMax + Send(oRunes,@GetMaxHexesIncrease); + } + + return iHexesMax; + } + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/item/passitem/pforget/forgetxwi.kod b/kod/object/item/passitem/pforget/forgetxwi.kod index 09eea4f3db..0b69793ded 100644 --- a/kod/object/item/passitem/pforget/forgetxwi.kod +++ b/kod/object/item/passitem/pforget/forgetxwi.kod @@ -23,7 +23,7 @@ resources: classvars: viForget_school = SS_WITCHERY - viForget_subschool = SS_WITCHERY_XAERDUN + viForget_subschool = SSS_WITCHERY_XAERDUN vrDesc = forgetpotionXaerdunWitchery_desc_rsc properties: @@ -44,7 +44,7 @@ messages: oSpell = send(SYS,@FindSpellByNum,#num=iSpellNum); if Send(oSpell,@GetSchool) = viForget_school - % AND Send(oSpell,@GetSubSchool) = viForget_subschool + AND Send(oSpell,@GetSubSchool) = viForget_subschool AND Send(oSpell,@CanForget) { send(poApply_target,@RemoveSpell,#num=iSpellNum); diff --git a/kod/object/passive/skill.kod b/kod/object/passive/skill.kod index e99c07bdd6..9312c166f0 100644 --- a/kod/object/passive/skill.kod +++ b/kod/object/passive/skill.kod @@ -41,6 +41,9 @@ resources: skill_school_qor = "Qor" skill_school_jala = "Jala" skill_school_sorcery = "Sorcery" + skill_school_witchery_xaerdun = "Witchery, through Xaerdun" + skill_school_witchery_nequzon = "Witchery, through Nequzon" + skill_school_witchery_iwodach = "Witchery, through Iwodach" skill_meditate_ratio_rsc = \ "\n\nIt will cost you %i training points to improve in this skill." @@ -61,6 +64,7 @@ classvars: viSkill_num = $ viSchool = $ + viSubSchool = $ viSkill_level = 1 @@ -150,6 +154,22 @@ messages: oSchool = skill_school_jala; } + if viSchool = SS_WITCHERY + { + if viSubSchool = SSS_WITCHERY_XAERDUN + { + oSchool = skill_school_witchery_xaerdun; + } + if viSubSchool = SSS_WITCHERY_NEQUZON + { + oSchool = skill_school_witchery_nequzon; + } + if viSubSchool = SSS_WITCHERY_IWODACH + { + oSchool = skill_school_witchery_iwodach; + } + } + return oSchool; } @@ -199,6 +219,22 @@ messages: rSchool = skill_school_jala; } + if viSchool = SS_WITCHERY + { + if viSubSchool = SSS_WITCHERY_XAERDUN + { + rSchool = skill_school_witchery_xaerdun; + } + if viSubSchool = SSS_WITCHERY_NEQUZON + { + rSchool = skill_school_witchery_nequzon; + } + if viSubSchool = SSS_WITCHERY_IWODACH + { + rSchool = skill_school_witchery_iwodach; + } + } + % Base description. AddPacket(4,skill_desc_rsc, 4,rSchool, 4,viSkill_Level, 4,vrDesc); diff --git a/kod/object/passive/skill/makefile b/kod/object/passive/skill/makefile index 55c9f53b65..81d8d8339e 100644 --- a/kod/object/passive/skill/makefile +++ b/kod/object/passive/skill/makefile @@ -6,6 +6,7 @@ DEPEND = ..\skill.bof BOFS = profic.bof stroke.bof dodge.bof parry.bof assess.bof block.bof \ - secwind.bof disarm.bof banditry.bof stance.bof sorcery.bof + secwind.bof disarm.bof banditry.bof stance.bof sorcery.bof \ + witchery.bof !include $(KODDIR)\kod.mak diff --git a/kod/object/passive/skill/witchery.kod b/kod/object/passive/skill/witchery.kod new file mode 100644 index 0000000000..9d34d4f480 --- /dev/null +++ b/kod/object/passive/skill/witchery.kod @@ -0,0 +1,29 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +WitcherySkill is Skill + +constants: + + include blakston.khd + +resources: + +classvars: + + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + +properties: + +messages: + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/ancientpact.kod b/kod/object/passive/skill/witchery/ancientpact.kod new file mode 100644 index 0000000000..898898ed2e --- /dev/null +++ b/kod/object/passive/skill/witchery/ancientpact.kod @@ -0,0 +1,92 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +AncientPact is WitcherySkill + +constants: + + include blakston.khd + +resources: + + ancient_pact_name_rsc = "ancient pact" + ancient_pact_icon_rsc = slashico.bgf + ancient_pact_desc_rsc = \ + "Alliances made long ago with minor demons allow students of Iwodach " + "to increase the durations of their hexes." + + ancient_pact_increase = \ + "You call upon an ancient pact to increase the duration of your hex." + +classvars: + + vrName = ancient_pact_name_rsc + vrIcon = ancient_pact_icon_rsc + vrDesc = ancient_pact_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_ANCIENT_PACT + viSubSchool = SSS_WITCHERY_IWODACH + viSkill_level = 4 + viChance_to_increase = 16 + viMeditate_ratio = 45 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + + piDurationIncrease = 15 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetMysticism); + } + + GetDurationIncrease(who=$) + { + local iAbility, iStat, iTotalIncrease; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + iTotalIncrease = piDurationIncrease; + + iTotalIncrease = iTotalIncrease + iStat/10 + + ((iTotalIncrease * (iAbility+1))/100); + + return iTotalIncrease; + } + + DoSkill(who=$) + { + local iAbility, iStat; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=ancient_pact_increase); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/arcaneknowledge.kod b/kod/object/passive/skill/witchery/arcaneknowledge.kod new file mode 100644 index 0000000000..95856879a3 --- /dev/null +++ b/kod/object/passive/skill/witchery/arcaneknowledge.kod @@ -0,0 +1,92 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ArcaneKnowledge is WitcherySkill + +constants: + + include blakston.khd + +resources: + + arcane_knowledge_name_rsc = "arcane knowledge" + arcane_knowledge_icon_rsc = slashico.bgf + arcane_knowledge_desc_rsc = \ + "Studying the ancient demonic arts allows a clever practitioner " + "to resist the effects of hexes." + + arcane_knowledge_resist = \ + "You resist a portion of the hex." + +classvars: + + vrName = arcane_knowledge_name_rsc + vrIcon = arcane_knowledge_icon_rsc + vrDesc = arcane_knowledge_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_ARCANE_KNOWLEDGE + viSubSchool = SSS_WITCHERY_XAERDUN + viSkill_level = 2 + viChance_to_increase = 18 + viMeditate_ratio = 35 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + + piHexResistance = 15 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetMysticism); + } + + GetHexResistance(who=$) + { + local iAbility, iStat, iTotalResistance; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + iTotalResistance = piHexResistance; + + iTotalResistance = iTotalResistance + iStat/10 + + ((iTotalResistance * (iAbility+1))/100); + + return iTotalResistance; + } + + DoSkill(who=$) + { + local iAbility, iStat; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=arcane_knowledge_resist); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/bloodrunes.kod b/kod/object/passive/skill/witchery/bloodrunes.kod new file mode 100644 index 0000000000..a9141a36e6 --- /dev/null +++ b/kod/object/passive/skill/witchery/bloodrunes.kod @@ -0,0 +1,94 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +BloodRunes is WitcherySkill + +constants: + + include blakston.khd + +resources: + + blood_runes_name_rsc = "blood runes" + blood_runes_icon_rsc = slashico.bgf + blood_runes_desc_rsc = \ + "Drawing the necessary runes in blood allows a skilled ally of Xaerdun " + "to layer an additional hex on a victim." + + blood_runes_increase = \ + "You draw your runes in blood." + +classvars: + + vrName = blood_runes_name_rsc + vrIcon = blood_runes_icon_rsc + vrDesc = blood_runes_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_BLOOD_RUNES + viSubSchool = SSS_WITCHERY_XAERDUN + viSkill_level = 6 + viChance_to_increase = 10 + viMeditate_ratio = 99 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + + piMaxHexesIncrease = 1 + + piHealthCost = 30 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetMysticism); + } + + GetMaxHexesIncrease(who=$) + { + return piMaxHexesIncrease; + } + + DoSkill(who=$) + { + local iAbility, iStat, iHealthCost; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + iHealthCost = (piHealthCost * (100-(iAbility/2))) / 100; + if Send(who,@GetHealth) > iHealthCost + { + Send(who,@LoseHealth,#amount=iHealthCost); + } + else + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=blood_runes_increase); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/efficientcasting.kod b/kod/object/passive/skill/witchery/efficientcasting.kod new file mode 100644 index 0000000000..87ca408e6b --- /dev/null +++ b/kod/object/passive/skill/witchery/efficientcasting.kod @@ -0,0 +1,93 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +EfficientCasting is WitcherySkill + +constants: + + include blakston.khd + +resources: + + efficient_casting_name_rsc = "efficient casting" + efficient_casting_icon_rsc = slashico.bgf + efficient_casting_desc_rsc = \ + "Intelligent adaption enables the casting of hexes while expending " + "less physical energy." + + efficient_casting_reduction = \ + "You perform your hex efficiently." + +classvars: + + vrName = efficient_casting_name_rsc + vrIcon = efficient_casting_icon_rsc + vrDesc = efficient_casting_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_EFFICIENT_CASTING + viSubSchool = SSS_WITCHERY_IWODACH + viSkill_level = 4 + viChance_to_increase = 14 + viMeditate_ratio = 55 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + + % Reduces costs by this percent + piCostReduction = 25 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetIntellect); + } + + GetCostReduction(who=$) + { + local iAbility, iStat, iTotalReduction; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + iTotalReduction = piCostReduction; + + iTotalReduction = iTotalReduction + iStat/10 + + ((iTotalReduction * (iAbility+1))/100); + + return iTotalReduction; + } + + DoSkill(who=$) + { + local iAbility, iStat; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=efficient_casting_reduction); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/makefile b/kod/object/passive/skill/witchery/makefile new file mode 100644 index 0000000000..2cc8defefd --- /dev/null +++ b/kod/object/passive/skill/witchery/makefile @@ -0,0 +1,16 @@ +# +# Makefile for compiling the Blakod +# + +!include $(TOPDIR)\common.mak + +DEPEND = ..\witchery.bof +BOFS = arcaneknowledge.bof \ + rotememorization.bof \ + efficientcasting.bof \ + ancientpact.bof \ + unhallowedrunes.bof \ + bloodrunes.bof \ + ostracization.bof + +!include $(KODDIR)\kod.mak diff --git a/kod/object/passive/skill/witchery/ostracization.kod b/kod/object/passive/skill/witchery/ostracization.kod new file mode 100644 index 0000000000..b31ab13f51 --- /dev/null +++ b/kod/object/passive/skill/witchery/ostracization.kod @@ -0,0 +1,77 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Ostracization is WitcherySkill + +constants: + + include blakston.khd + +resources: + + ostracization_name_rsc = "ostracization" + ostracization_icon_rsc = slashico.bgf + ostracization_desc_rsc = \ + "Ancient practitioners of witchery were often ostracized and exiled. " + "Over the centuries, having found that type of energy useful, " + "the most powerful hexmages imbued pure hatred into their spells. " + "When the process is successful, the hex on a victim never expires." + + ostracization_increase = \ + "Your curse applies permanently." + +classvars: + + vrName = ostracization_name_rsc + vrIcon = ostracization_icon_rsc + vrDesc = ostracization_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_OSTRACIZATION + viSubSchool = SSS_WITCHERY_NEQUZON + viSkill_level = 6 + viChance_to_increase = 10 + viMeditate_ratio = 99 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetMysticism); + } + + DoSkill(who=$) + { + local iAbility, iStat; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=ostracization_increase); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/rotememorization.kod b/kod/object/passive/skill/witchery/rotememorization.kod new file mode 100644 index 0000000000..7279eaca2c --- /dev/null +++ b/kod/object/passive/skill/witchery/rotememorization.kod @@ -0,0 +1,92 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +RoteMemorization is WitcherySkill + +constants: + + include blakston.khd + +resources: + + rote_memorization_name_rsc = "rote memorization" + rote_memorization_icon_rsc = slashico.bgf + rote_memorization_desc_rsc = \ + "Constant practice enables the casting of hexes while expending " + "less spiritual resources." + + rote_memorization_reduction = \ + "You perform your hex quickly." + +classvars: + + vrName = rote_memorization_name_rsc + vrIcon = rote_memorization_icon_rsc + vrDesc = rote_memorization_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_ROTE_MEMORIZATION + viSubSchool = SSS_WITCHERY_NEQUZON + viSkill_level = 3 + viChance_to_increase = 16 + viMeditate_ratio = 45 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + + piCostReduction = 15 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetIntellect); + } + + GetCostReduction(who=$) + { + local iAbility, iStat, iTotalReduction; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + iTotalReduction = piCostReduction; + + iTotalReduction = iTotalReduction + iStat/10 + + ((iTotalReduction * (iAbility+1))/100); + + return iTotalReduction; + } + + DoSkill(who=$) + { + local iAbility, iStat; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=rote_memorization_reduction); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/skill/witchery/unhallowedrunes.kod b/kod/object/passive/skill/witchery/unhallowedrunes.kod new file mode 100644 index 0000000000..64d0686f57 --- /dev/null +++ b/kod/object/passive/skill/witchery/unhallowedrunes.kod @@ -0,0 +1,91 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +UnhallowedRunes is WitcherySkill + +constants: + + include blakston.khd + +resources: + + unhallowed_runes_name_rsc = "unhallowed runes" + unhallowed_runes_icon_rsc = slashico.bgf + unhallowed_runes_desc_rsc = \ + "The use of demonic runes can increase the power of a hex." + + unhallowed_runes_increase = \ + "You employ unhallowed runes to increase the effectiveness of your hex." + +classvars: + + vrName = unhallowed_runes_name_rsc + vrIcon = unhallowed_runes_icon_rsc + vrDesc = unhallowed_runes_desc_rsc + + viIndefinite = ARTICLE_NONE + viDefinite = ARTICLE_NONE + + viSkill_Num = SKID_UNHALLOWED_RUNES + viSubSchool = SSS_WITCHERY_XAERDUN + viSkill_level = 5 + viChance_to_increase = 13 + viMeditate_ratio = 66 + +properties: + + plPrerequisites = $ + + piChanceToIncrease = 100 + + piIncHexEffectiveness = 15 + +messages: + + GetRequisiteStat(who=$) + "Varies from skill to skill and spell to spell." + { + return Send(who,@GetMysticism); + } + + GetIncHexEffectiveness(who=$) + { + local iAbility, iStat, iTotalIncrease; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + iTotalIncrease = piIncHexEffectiveness; + + iTotalIncrease = iTotalIncrease + iStat/10 + + ((iTotalIncrease * (iAbility+1))/100); + + return iTotalIncrease; + } + + DoSkill(who=$) + { + local iAbility, iStat; + + iAbility = Send(who,@GetSkillAbility,#Skill_num=viSkill_num); + iStat = Send(self,@GetRequisiteStat,#who=who); + + if bound(iAbility-6,1,93) + iStat/10 <= Random(1,100) + { + return FALSE; + } + + Send(who,@MsgSendUser,#message_rsc=unhallowed_runes_increase); + + propagate; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell.kod b/kod/object/passive/spell.kod index 961c757ab0..2acff1e7e5 100644 --- a/kod/object/passive/spell.kod +++ b/kod/object/passive/spell.kod @@ -87,6 +87,11 @@ resources: spell_fail_wav = spelfail.wav spell_desc_rsc = "SCHOOL : %s LEVEL : %i \n\n%s%s%s%r%r%r" + spell_school_witchery = "Witchery" + spell_school_witchery_xaerdun = "Witchery, through Xaerdun" + spell_school_witchery_nequzon = "Witchery, through Nequzon" + spell_school_witchery_iwodach = "Witchery, through Iwodach" + spell_school_witchery_raumlar = "Witchery, through Raumlar" spell_school_riija = "Riija" spell_school_shalille = "Shal'ille" spell_school_qor = "Qor" @@ -158,6 +163,7 @@ classvars: viSpell_Num = $ viSchool = $ + viSubSchool = $ viSpell_level = 1 viMana = 1 @@ -169,6 +175,11 @@ classvars: % improvements in 100 casts, but 1 improvement per X points. viMeditate_ratio = 100 + % If this is TRUE, then all spells that use this behavior will remove + % other spells that use this behavior when they are cast on a victim. + % E.g. A newly cast Hex will remove previous Hexes. + piUseHexBehavior = FALSE + viShow_enchantment_icon = ENCHANTMENT_SHOW_ALL % Default animation speed for icon; if set to 0, then no animation. @@ -280,7 +291,26 @@ messages: iSchool = viSchool; } - if iSchool = SS_RIIJA + if iSchool = SS_WITCHERY + { + if viSubSchool = SSS_WITCHERY_XAERDUN + { + rSchool = spell_school_witchery_xaerdun; + } + if viSubSchool = SSS_WITCHERY_NEQUZON + { + rSchool = spell_school_witchery_nequzon; + } + if viSubSchool = SSS_WITCHERY_IWODACH + { + rSchool = spell_school_witchery_iwodach; + } + if viSubSchool = SSS_WITCHERY_RAUMLAR + { + rSchool = spell_school_witchery_raumlar; + } + } + else if iSchool = SS_RIIJA { rSchool = spell_school_riija; } @@ -446,6 +476,7 @@ messages: if viSchool = SS_QOR OR viSchool = SS_SHALILLE OR viSchool = SS_FAREN + OR viSchool = SS_WITCHERY { return Send(who,@GetMysticism); } @@ -1392,7 +1423,8 @@ messages: "half the exertion, and no reagents." { local num, iAbility, lReagent, cReagentClass, iLists, lItems, - iNumNeeded, oUserObject, oRoom, iVigorReduction, iExertion; + iNumNeeded, oUserObject, oRoom, iVigorReduction, iExertion, + iManaCost, oRote, oEfficientCasting; oRoom = Send(who,@GetOwner); if NOT IsClass(who,&Player) @@ -1410,9 +1442,29 @@ messages: if NOT Send(who,@PlayerIsImmortal) { + iManaCost = Send(self,@GetManaCost,#who=who,#iSpellPower=iSpellpower); + + if piUseHexBehavior + { + oRote = Send(SYS,@FindSkillByNum,#num=SKID_ROTE_MEMORIZATION); + } + else + { + oRote = $; + } + + % Hexes can be cast for less mana via skill + if oRote <> $ + AND Send(who,@GetSkillAbility,#Skill_num=SKID_ROTE_MEMORIZATION) > 0 + AND Send(oRote,@DoSkill,#who=who) + { + iManaCost = (iManaCost * (100-Send(oRote, + @GetCostReduction,#who=who))) / 100; + iManaCost = bound(iManaCost,0,$); + } + % Reduce magic points of caster - Send(who,@LoseMana,#amount=Send(self,@GetManaCost,#who=who, - #iSpellPower=iSpellpower)); + Send(who,@LoseMana,#amount=iManaCost); iVigorReduction = 0; if Send(who,@GetSkillAbility,#Skill_num=SKID_EFFICIENCY) > 0 @@ -1426,6 +1478,26 @@ messages: iExertion = Bound(viSpellExertion-iVigorReduction,0,$); + % Hexes can be cast efficiently via skill + if piUseHexBehavior + { + oEfficientCasting = Send(SYS,@FindSkillByNum, + #num=SKID_EFFICIENT_CASTING); + } + else + { + oEfficientCasting = $; + } + + if oEfficientCasting <> $ + AND Send(who,@GetSkillAbility,#Skill_num=SKID_EFFICIENT_CASTING) > 0 + AND Send(oEfficientCasting,@DoSkill,#who=who) + { + iExertion = (iExertion * (100-Send(oEfficientCasting, + @GetCostReduction,#who=who))) / 100; + iExertion = bound(iExertion,0,$); + } + % Spell casting requires exertion (which is in 10^-4 units) Send(who,@AddExertion,#amount=10000*iExertion); @@ -1503,6 +1575,20 @@ messages: { local oTarget, oRoom; + if piUseHexBehavior + { + foreach oTarget in lTargets + { + if Send(oTarget,@GetNumHexes) > Send(SETTINGS_OBJECT,@GetHexesMax) + { + if Send(oTarget,@GetNumHexes) > Send(who,@GetCasterMaxHexes) + { + Post(oTarget,@RemoveRandomHex,#exempt=self); + } + } + } + } + if IsClass(who,&DM) { ClearTempString(); @@ -2666,5 +2752,19 @@ messages: return TRUE; } + UseHexBehavior() + { + % Hex behavior spells are typically negative debuffs, and will + % remove other hex behavior spells when they are cast to create + % a natural limit. E.g. A newly cast hex removes an old hex. + return piUseHexBehavior; + } + + GetSubSchool() + { + % Some schools have subschools. + return viSubSchool; + } + end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex.kod b/kod/object/passive/spell/debuff/hex.kod new file mode 100644 index 0000000000..411807441a --- /dev/null +++ b/kod/object/passive/spell/debuff/hex.kod @@ -0,0 +1,255 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Hex is Debuff + +constants: + + include blakston.khd + +resources: + + hex_replacing_msg = \ + "Your %s hex replaces a %s curse already affecting your target." + hex_cannot_replace = \ + "Your target is already affected by the maximum number of hexes!" + hex_on_default = \ + "You feel hexy." + hex_off_default = \ + "You feel less hexy." + + target_is_hex_immune_msg = \ + "Your paltry hex has no effect!" + + hex_success_caster_default = \ + "%s%s is now hexed!" + already_hexed = "%s%s is already cursed by that hex!" + + has_been_hexed_default = "%s%s has been hexed!" + +classvars: + + vrAlreadyEnchanted = already_hexed + vrEnchantment_On = hex_on_default + vrEnchantment_Off = hex_off_default + vrSuccess = hex_success_caster_default + vrInformRoom = has_been_hexed_default + + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + + viResistanceType = 0 + +properties: + + piFlatDuration = 10000 + piBaseEffect = 0 + + piUseHexBehavior = TRUE + +messages: + + CanPayCosts(who=$,lTargets=$,iSpellPower=0,bItemCast=FALSE) + { + if Length(lTargets) <> 1 + { + return FALSE; + } + + if (Send(First(lTargets),@GetNumHexes) >= + Send(SETTINGS_OBJECT,@GetHexesMax)) + AND NOT Send(SETTINGS_OBJECT,@GetHexesReplace) + { + Send(who,@MsgSendUser,#message_rsc=hex_cannot_replace); + return FALSE; + } + + propagate; + } + + CastSpell(who=$,lTargets=$,iSpellPower=0) + { + local oTarget, oPlayer, oRoom, each_obj; + + oTarget = First(lTargets); + + oRoom = Send(oTarget,@GetOwner); + if oRoom <> $ + AND IsClass(oRoom,&Room) + { + foreach each_obj in Send(oRoom,@GetHolderActive) + { + oPlayer = Send(oRoom,@HolderExtractObject,#data=each_obj); + if IsClass(oPlayer,&Player) + { + if oPlayer <> oTarget + AND oPlayer <> who + { + Send(oPlayer,@MsgSendUser,#message_rsc=vrInformRoom, + #parm1=Send(oTarget,@GetCapDef), + #parm2=Send(oTarget,@GetName)); + } + } + } + } + + % Spell effects + Send(self,@DoSpell,#what=who,#oTarget=oTarget, + #iDuration=Send(self,@GetDuration,#iSpellPower=iSpellPower), + #iSpellPower=iSpellPower); + + propagate; + } + + DoSpell(what=$,oTarget=$,iDuration=0,iSpellPower=0) + { + local iCasterIncHexEffect, iTargetHexResistance, iHexEffect; + + iCasterIncHexEffect = Send(what,@GetHexIncEffect, + #iSpellPower=iSpellPower,#what=self); + iTargetHexResistance = Send(oTarget,@GetHexResistance); + + iHexEffect = iCasterIncHexEffect - iTargetHexResistance; + + if iHexEffect = 0 + { + if IsClass(what,&User) + { + Send(what,@MsgSendUser,#message_rsc=target_is_hex_immune_msg); + } + return; + } + + if IsClass(oTarget,&Player) + { + if NOT (IsClass(oTarget,&DM) AND Send(oTarget,@PlayerIsImmortal)) + { + Send(oTarget,@MsgSendUser,#message_rsc=vrEnchantment_On); + } + } + + % Iwodach level 4, increase hex duration + if Send(what,@GetSkillAbility,#Skill_num=SKID_ANCIENT_PACT) > 0 + AND Send(Send(SYS,@FindSkillByNum,#num=SKID_ANCIENT_PACT), + @DoSkill,#who=what) + { + iDuration = iDuration + Send(Send(SYS,@FindSkillByNum, + #num=SKID_ANCIENT_PACT), + @GetDurationIncrease,#who=what); + } + + % Nequzon level 6, hexes don't expire + if Send(what,@GetSkillAbility,#Skill_num=SKID_OSTRACIZATION) > 0 + AND Send(Send(SYS,@FindSkillByNum,#num=SKID_OSTRACIZATION), + @DoSkill,#who=what) + { + iDuration = $; + } + + Send(what,@MsgSendUser,#message_rsc=vrSuccess, + #parm1=Send(oTarget,@GetCapDef),#parm2=Send(oTarget,@GetName)); + Send(oTarget,@StartEnchantment,#what=self,#time=iDuration, + #state=iHexEffect); + + propagate; + } + + GetDuration(iSpellPower=0) + { + return piFlatDuration; + } + + EndEnchantment(who=$,report=TRUE) + { + if IsClass(who,&Player) + { + if report + { + Send(who,@MsgSendUser,#message_rsc=vrEnchantment_Off); + } + } + + if viResistanceType <> 0 + { + Post(who,@DrawResistances); + } + + return; + } + + RestartEnchantmentEffect(who=$,state=$) + { + Send(who,@MsgSendUser,#message_rsc=vrEnchantment_On); + + return; + } + + ModifyHitRoll(who=$,what=$,hit_roll=$) + { + return hit_roll; + } + + ModifyDamage(who=$,what=$,damage=$) + { + return damage; + } + + ModifyDefensePower(who=$,what=$,defense_power=0) + { + return defense_power; + } + + ModifyDefenseDamage(who=$,what=$,damage=$,atype=0,aspell=0) + { + return damage; + } + + ModifyPostcastDelay(who=$,what=$,iDelay=$,atype=0,aspell=0,iHexEffect=0) + { + return iDelay; + } + + ModifyResistance(resistance_list=$,iState=0) + { + local iChange; + + if viResistanceType <> 0 + { + iChange = piBaseEffect * iState / 100; + + resistance_list = Send(SYS,@AddResistance,#what=viResistanceType, + #value=-iChange,#resistance_list=resistance_list); + } + + return resistance_list; + } + + ModifyRegenAmount(regen=0) + { + return regen; + } + + ModifyHeal(amount=0) + { + return amount; + } + + ModifyExertion(amount=0,state=0) + { + return amount; + } + + ModifyDelay(iDelay=$,state=0) + { + return iDelay; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex.kod b/kod/object/passive/spell/debuff/hex/antireshex.kod new file mode 100644 index 0000000000..b267922489 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex.kod @@ -0,0 +1,26 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +AntiResistanceHex is Hex + +constants: + + include blakston.khd + +resources: + +classvars: + +properties: + +messages: + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/algidity.kod b/kod/object/passive/spell/debuff/hex/antireshex/algidity.kod new file mode 100644 index 0000000000..f60f02a66d --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/algidity.kod @@ -0,0 +1,81 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Algidity is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + algidity_cast_rsc = \ + "%s%s becomes surrounded by drifting ice zephyrs." + algidity_already_enchanted = \ + "That poor soul is already afflicted by algidity." + algidity_start = "Drifting ice zephyrs surround you." + algidity_stop = "The drifting ice zephyrs depart." + has_been_hexed_algidity = \ + "%s%s becomes surrounded by drifting ice zephyrs!" + + algidity_name_rsc = "algidity" + algidity_icon_rsc = ienfeebl.bgf + algidity_desc_rsc = \ + "Summons minor ice zephyrs to empower cold attacks against your victim." + " This hex requires two orc teeth to cast." + + algidity_sound = qenfeebl.wav + +classvars: + + vrName = algidity_name_rsc + vrIcon = algidity_icon_rsc + vrDesc = algidity_desc_rsc + + vrAlreadyEnchanted = algidity_already_enchanted + vrEnchantment_On = algidity_start + vrEnchantment_Off = algidity_stop + vrSuccess = algidity_cast_rsc + vrInformRoom = has_been_hexed_algidity + + viSpell_num = SID_HEX_ALGIDITY + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_NEQUZON + viSpell_level = 3 + viMana = 30 + viSpell_Exertion = 15 + + viFlash = FLASH_BAD + + vrSucceed_wav = algidity_sound + viChance_To_Increase = 18 + viMeditate_ratio = 40 + + viResistanceType = -ATCK_SPELL_COLD + +properties: + + % Effectively reduces cold resistance by this percent base + piBaseEffect = 40 + + piFlatDuration = 18000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/conductivity.kod b/kod/object/passive/spell/debuff/hex/antireshex/conductivity.kod new file mode 100644 index 0000000000..73d5145914 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/conductivity.kod @@ -0,0 +1,82 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Conductivity is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + conductivity_cast_rsc = \ + "%s%s becomes surrounded by minor lightning demons." + conductivity_already_enchanted = \ + "That poor soul is already afflicted by conductivity." + conductivity_start = "Minor lightning demons surround you." + conductivity_stop = "The minor lightning demons depart." + has_been_hexed_conductivity = \ + "%s%s becomes surrounded by minor lightning demons!" + + conductivity_name_rsc = "conductivity" + conductivity_icon_rsc = ienfeebl.bgf + conductivity_desc_rsc = \ + "Summons minor lightning gremlins to empower shock attacks " + "against your victim. " + "This hex requires two orc teeth to cast." + + conductivity_sound = qenfeebl.wav + +classvars: + + vrName = conductivity_name_rsc + vrIcon = conductivity_icon_rsc + vrDesc = conductivity_desc_rsc + + vrAlreadyEnchanted = conductivity_already_enchanted + vrEnchantment_On = conductivity_start + vrEnchantment_Off = conductivity_stop + vrSuccess = conductivity_cast_rsc + vrInformRoom = has_been_hexed_conductivity + + viSpell_num = SID_HEX_CONDUCTIVITY + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_NEQUZON + viSpell_level = 4 + viMana = 30 + viSpell_Exertion = 15 + + viFlash = FLASH_BAD + + vrSucceed_wav = conductivity_sound + viChance_To_Increase = 18 + viMeditate_ratio = 40 + + viResistanceType = -ATCK_SPELL_SHOCK + +properties: + + % Effectively reduces shock resistance by this percent base + piBaseEffect = 40 + + piFlatDuration = 18000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/corrosion.kod b/kod/object/passive/spell/debuff/hex/antireshex/corrosion.kod new file mode 100644 index 0000000000..4c728a61ff --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/corrosion.kod @@ -0,0 +1,81 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Corrosion is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + corrosion_cast_rsc = \ + "%s%s begins smoking from corrosion." + corrosion_already_enchanted = \ + "That poor soul is already afflicted by corrosion." + corrosion_start = "You begin to smoke from corrosion." + corrosion_stop = "You stop corroding." + has_been_hexed_corrosion = \ + "%s%s begins smoking from corrosion!" + + corrosion_name_rsc = "corrosion" + corrosion_icon_rsc = ienfeebl.bgf + corrosion_desc_rsc = \ + "Corrodes your victim, empowering acid attacks against them." + " This hex requires two orc teeth to cast." + + corrosion_sound = qenfeebl.wav + +classvars: + + vrName = corrosion_name_rsc + vrIcon = corrosion_icon_rsc + vrDesc = corrosion_desc_rsc + + vrAlreadyEnchanted = corrosion_already_enchanted + vrEnchantment_On = corrosion_start + vrEnchantment_Off = corrosion_stop + vrSuccess = corrosion_cast_rsc + vrInformRoom = has_been_hexed_corrosion + + viSpell_num = SID_HEX_CORROSION + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_NEQUZON + viSpell_level = 2 + viMana = 30 + viSpell_Exertion = 15 + + viFlash = FLASH_BAD + + vrSucceed_wav = corrosion_sound + viChance_To_Increase = 20 + viMeditate_ratio = 30 + + viResistanceType = -ATCK_SPELL_ACID + +properties: + + % Effectively reduces acid resistance by this percent base + piBaseEffect = 30 + + piFlatDuration = 18000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/corruption.kod b/kod/object/passive/spell/debuff/hex/antireshex/corruption.kod new file mode 100644 index 0000000000..5be4fba1b5 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/corruption.kod @@ -0,0 +1,84 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Corruption is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + corruption_cast_rsc = \ + "%s%s's limbs begin crawling with corrupted energies." + corruption_already_enchanted = \ + "That poor soul is already afflicted by corruption." + corruption_start = \ + "Your limbs begin crawling with corrupted energies." + corruption_stop = \ + "The corrupted energies vanish from your limbs." + has_been_hexed_corruption = \ + "%s%s's limbs begin crawling with corrupted energies!." + + corruption_name_rsc = "corruption" + corruption_icon_rsc = ienfeebl.bgf + corruption_desc_rsc = \ + "Sickens your victim with corrupted energies, making them more " + "vulnerable to unholy assaults. " + "This hex requires two orc teeth to cast." + + corruption_sound = qenfeebl.wav + +classvars: + + vrName = corruption_name_rsc + vrIcon = corruption_icon_rsc + vrDesc = corruption_desc_rsc + + vrAlreadyEnchanted = corruption_already_enchanted + vrEnchantment_On = corruption_start + vrEnchantment_Off = corruption_stop + vrSuccess = corruption_cast_rsc + vrInformRoom = has_been_hexed_corruption + + viSpell_num = SID_HEX_CORRUPTION + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_IWODACH + viSpell_level = 3 + viMana = 7 + viSpell_Exertion = 30 + + viFlash = FLASH_BAD + + vrSucceed_wav = corruption_sound + viChance_To_Increase = 10 + viMeditate_ratio = 100 + + viResistanceType = -ATCK_SPELL_UNHOLY + +properties: + + % Effectively reduces unholy resistance by this percent base + piBaseEffect = 40 + + piFlatDuration = 18000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/flammability.kod b/kod/object/passive/spell/debuff/hex/antireshex/flammability.kod new file mode 100644 index 0000000000..165fe6e3be --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/flammability.kod @@ -0,0 +1,80 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Flammability is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + flammability_cast_rsc = \ + "%s%s becomes surrounded by tiny dancing flames." + flammability_already_enchanted = \ + "That poor soul is already afflicted by flammability." + flammability_start = "Tiny dancing flames surround you." + flammability_stop = "The tiny dancing flames depart." + has_been_hexed_flammability = \ + "%s%s becomes surrounded by tiny dancing flames!" + + flammability_name_rsc = "flammability" + flammability_icon_rsc = ienfeebl.bgf + flammability_desc_rsc = \ + "Summons minor flame elementals to empower fire attacks against your victim." + " This hex requires two orc teeth to cast." + + flammability_sound = qenfeebl.wav + +classvars: + + vrName = flammability_name_rsc + vrIcon = flammability_icon_rsc + vrDesc = flammability_desc_rsc + + vrAlreadyEnchanted = flammability_already_enchanted + vrEnchantment_On = flammability_start + vrEnchantment_Off = flammability_stop + vrSuccess = flammability_cast_rsc + vrInformRoom = has_been_hexed_flammability + + viSpell_num = SID_HEX_FLAMMABILITY + viSchool = SS_WITCHERY + viSpell_level = 4 + viMana = 30 + viSpell_Exertion = 15 + + viFlash = FLASH_BAD + + vrSucceed_wav = flammability_sound + viChance_To_Increase = 18 + viMeditate_ratio = 40 + + viResistanceType = -ATCK_SPELL_FIRE + +properties: + + % Effectively reduces fire resistance by this percent base + piBaseEffect = 40 + + piFlatDuration = 18000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/frailty.kod b/kod/object/passive/spell/debuff/hex/antireshex/frailty.kod new file mode 100644 index 0000000000..d6aa2351c7 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/frailty.kod @@ -0,0 +1,82 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Frailty is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + frailty_cast_rsc = \ + "%s%s suddenly seems frail." + frailty_already_enchanted = \ + "That poor soul is already afflicted by frailty." + frailty_start = "You suddenly feel frail." + frailty_stop = "The feeling of frailty passes." + has_been_hexed_frailty = \ + "%s%s suddenly seems more frail somehow." + + frailty_name_rsc = "frailty" + frailty_icon_rsc = ienfeebl.bgf + frailty_desc_rsc = \ + "Weakens the target's bones, making them more vulnerable to " + "physical assault. " + "This hex requires two orc teeth to cast." + + frailty_sound = qenfeebl.wav + +classvars: + + vrName = frailty_name_rsc + vrIcon = frailty_icon_rsc + vrDesc = frailty_desc_rsc + + vrAlreadyEnchanted = frailty_already_enchanted + vrEnchantment_On = frailty_start + vrEnchantment_Off = frailty_stop + vrSuccess = frailty_cast_rsc + vrInformRoom = has_been_hexed_frailty + + viSpell_num = SID_HEX_FRAILTY + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_IWODACH + viSpell_level = 5 + viMana = 30 + viSpell_Exertion = 15 + + viFlash = FLASH_BAD + + vrSucceed_wav = frailty_sound + viChance_To_Increase = 15 + viMeditate_ratio = 40 + + viResistanceType = ATCK_WEAP_ALL + +properties: + + % Effectively reduces weapon resistance by this percent base + piBaseEffect = 20 + + piFlatDuration = 12000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,3],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/humility.kod b/kod/object/passive/spell/debuff/hex/antireshex/humility.kod new file mode 100644 index 0000000000..0c48ca8a77 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/humility.kod @@ -0,0 +1,81 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Humility is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + humility_cast_rsc = \ + "%s%s quavers before all that is holy." + humility_already_enchanted = \ + "That poor soul is already afflicted by humility." + humility_start = "You quaver before all that is holy." + humility_stop = "Your usual arrogance returns." + has_been_hexed_humility = \ + "%s%s quavers before all that is holy!." + + humility_name_rsc = "humility" + humility_icon_rsc = ienfeebl.bgf + humility_desc_rsc = \ + "Humbles your victim, reducing their resistance to holy retributions. " + "This hex requires two orc teeth to cast." + + humility_sound = qenfeebl.wav + +classvars: + + vrName = humility_name_rsc + vrIcon = humility_icon_rsc + vrDesc = humility_desc_rsc + + vrAlreadyEnchanted = humility_already_enchanted + vrEnchantment_On = humility_start + vrEnchantment_Off = humility_stop + vrSuccess = humility_cast_rsc + vrInformRoom = has_been_hexed_humility + + viSpell_num = SID_HEX_HUMILITY + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_IWODACH + viSpell_level = 3 + viMana = 7 + viSpell_Exertion = 30 + + viFlash = FLASH_BAD + + vrSucceed_wav = humility_sound + viChance_To_Increase = 10 + viMeditate_ratio = 100 + + viResistanceType = -ATCK_SPELL_HOLY + +properties: + + % Effectively reduces holy resistance by this percent base + piBaseEffect = 40 + + piFlatDuration = 18000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/antireshex/makefile b/kod/object/passive/spell/debuff/hex/antireshex/makefile new file mode 100644 index 0000000000..e212c383bb --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/makefile @@ -0,0 +1,17 @@ +# +# Makefile for compiling the Blakod +# + +!include $(TOPDIR)\common.mak + +DEPEND = ..\antireshex.bof +BOFS = vulnerability.bof \ + frailty.bof \ + humility.bof \ + corruption.bof \ + flammability.bof \ + conductivity.bof \ + algidity.bof \ + corrosion.bof + +!include $(KODDIR)\kod.mak diff --git a/kod/object/passive/spell/debuff/hex/antireshex/vulnerability.kod b/kod/object/passive/spell/debuff/hex/antireshex/vulnerability.kod new file mode 100644 index 0000000000..1da4a240a3 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/antireshex/vulnerability.kod @@ -0,0 +1,82 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Vulnerability is AntiResistanceHex + +constants: + + include blakston.khd + +resources: + + vulnerability_cast_rsc = \ + "%s%s's skin becomes the consistency of parchment." + vulnerability_already_enchanted = \ + "That poor soul is already afflicted by vulnerability." + vulnerability_start = "Your skin becomes the consistency of parchment." + vulnerability_stop = "Your vulnerable skin returns to normal." + has_been_hexed_vulnerability = \ + "%s%s's skin becomes the consistency of parchment." + + vulnerability_name_rsc = "vulnerability" + vulnerability_icon_rsc = ienfeebl.bgf + vulnerability_desc_rsc = \ + "Thins the target's skin, making them more vulnerable to " + "the elements. " + "This hex requires two orc teeth to cast." + + vuln_sound = qenfeebl.wav + +classvars: + + vrName = vulnerability_name_rsc + vrIcon = vulnerability_icon_rsc + vrDesc = vulnerability_desc_rsc + + vrAlreadyEnchanted = vulnerability_already_enchanted + vrEnchantment_On = vulnerability_start + vrEnchantment_Off = vulnerability_stop + vrSuccess = vulnerability_cast_rsc + vrInformRoom = has_been_hexed_vulnerability + + viSpell_num = SID_HEX_VULNERABILITY + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_NEQUZON + viSpell_level = 5 + viMana = 30 + viSpell_Exertion = 25 + + viFlash = FLASH_BAD + + vrSucceed_wav = vuln_sound + viChance_To_Increase = 15 + viMeditate_ratio = 40 + + viResistanceType = -ATCK_SPELL_ALL + +properties: + + % Effectively reduces magical resistance by this percent base + piBaseEffect = 20 + + piFlatDuration = 12000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/becloud.kod b/kod/object/passive/spell/debuff/hex/becloud.kod new file mode 100644 index 0000000000..513b9a05d9 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/becloud.kod @@ -0,0 +1,92 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Becloud is Hex + +constants: + + include blakston.khd + +resources: + + becloud_cast_rsc = "%s%s seems to be having trouble seeing clearly." + becloud_already_enchanted = \ + "That poor soul is already afflicted by becloud." + becloud_start = "You suddenly have trouble seeing clearly." + becloud_stop = "Your vision sharpens." + has_been_hexed_becloud = \ + "%s%s seems to be having trouble seeing clearly!" + + becloud_name_rsc = "becloud" + becloud_icon_rsc = ienfeebl.bgf + becloud_desc_rsc = \ + "Clouds your victim's vision, lowering their offense. " + "This hex requires two orc teeth to cast." + + becloud_sound = qenfeebl.wav + +classvars: + + vrName = becloud_name_rsc + vrIcon = becloud_icon_rsc + vrDesc = becloud_desc_rsc + + vrAlreadyEnchanted = becloud_already_enchanted + vrEnchantment_On = becloud_start + vrEnchantment_Off = becloud_stop + vrSuccess = becloud_cast_rsc + vrInformRoom = has_been_hexed_becloud + + viSpell_num = SID_HEX_BECLOUD + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 4 + viMana = 12 + viSpell_Exertion = 22 + + viFlash = FLASH_BAD + + vrSucceed_wav = becloud_sound + viChance_To_Increase = 15 + viMeditate_ratio = 70 + +properties: + + % Lower this percentage of offense + piBaseEffect = 7 + + piFlatDuration = 25000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + + ModifyHitRoll(who=$,what=$,hit_roll=$,state=0) + { + local oWeapon; + + oWeapon = Send(who,@GetWeapon); + if oWeapon <> $ + AND IsClass(oWeapon,&RangedWeapon) + { + return (hit_roll * (100 - ((piBaseEffect * state)/100)))/100; + } + + return hit_roll; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/bestill.kod b/kod/object/passive/spell/debuff/hex/bestill.kod new file mode 100644 index 0000000000..fe18be9006 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/bestill.kod @@ -0,0 +1,89 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Bestill is Hex + +constants: + + include blakston.khd + +resources: + + bestill_cast_rsc = "%s%s begins responding to attacks more slowly." + bestill_already_enchanted = \ + "That poor soul is already afflicted by bestill." + bestill_start = "You begin responding to attacks more slowly!" + bestill_stop = "You feel your reflexes returning to normal." + has_been_hexed_bestill = \ + "%s%s begins responding to attacks more slowly!" + + bestill_name_rsc = "bestill" + bestill_icon_rsc = ienfeebl.bgf + bestill_desc_rsc = \ + "Slows your victim's reflexes, lowering their defense. " + "This hex requires two orc teeth to cast." + + bestill_sound = qenfeebl.wav + +classvars: + + vrName = bestill_name_rsc + vrIcon = bestill_icon_rsc + vrDesc = bestill_desc_rsc + + vrAlreadyEnchanted = bestill_already_enchanted + vrEnchantment_On = bestill_start + vrEnchantment_Off = bestill_stop + vrSuccess = bestill_cast_rsc + vrInformRoom = has_been_hexed_bestill + + viSpell_num = SID_HEX_BESTILL + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 3 + viMana = 10 + viSpell_Exertion = 30 + + viFlash = FLASH_BAD + + vrSucceed_wav = bestill_sound + viChance_To_Increase = 20 + viMeditate_ratio = 40 + +properties: + + % Reduce defense by this base percentage + piBaseEffect = 7 + + piFlatDuration = 25000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + + CastSpell(who=$,lTargets=$,iSpellPower=0) + { + Post(who,@DrawDefense); + propagate; + } + + ModifyDefensePower(who=$,what=$,defense_power=0,state=0) + { + return (defense_power * (100 - ((piBaseEffect * state)/100)))/100; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/blackmantle.kod b/kod/object/passive/spell/debuff/hex/blackmantle.kod new file mode 100644 index 0000000000..b63bba1202 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/blackmantle.kod @@ -0,0 +1,85 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +BlackMantle is Hex + +constants: + + include blakston.khd + +resources: + + black_mantle_cast_rsc = \ + "%s%s becomes shrouded in slicing whispers of darkness." + black_mantle_already_enchanted = "That poor soul is already black mantled." + black_mantle_start = "Whispering slices of darkness surround you." + black_mantle_stop = "The whispering darkness around you departs." + has_been_hexed_black_mantle = \ + "%s%s becomes shrouded in slicing whispers of darkness!" + + black_mantle_name_rsc = "black mantle" + black_mantle_icon_rsc = ienfeebl.bgf + black_mantle_desc_rsc = \ + "Shrouds your victim in a legion of wight spirits, who will " + "hamper any attempt at healing. " + "This hex requires two orc teeth to cast." + + black_mantle_sound = qenfeebl.wav + +classvars: + + vrName = black_mantle_name_rsc + vrIcon = black_mantle_icon_rsc + vrDesc = black_mantle_desc_rsc + + vrAlreadyEnchanted = black_mantle_already_enchanted + vrEnchantment_On = black_mantle_start + vrEnchantment_Off = black_mantle_stop + vrSuccess = black_mantle_cast_rsc + vrInformRoom = has_been_hexed_black_mantle + + viSpell_num = SID_HEX_BLACK_MANTLE + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_IWODACH + viSpell_level = 6 + viMana = 40 + viSpell_Exertion = 20 + + viFlash = FLASH_BAD + + vrSucceed_wav = black_mantle_sound + viChance_To_Increase = 10 + viMeditate_ratio = 200 + +properties: + + % Reduces heals by this percentage minus state + piBaseEffect = 120 + + piFlatDuration = 25000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + + ModifyHeal(amount = 0,state=0) + { + amount = amount * (piBaseEffect-state) / 100; + return amount; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/drainhex.kod b/kod/object/passive/spell/debuff/hex/drainhex.kod new file mode 100644 index 0000000000..62af65e5f6 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/drainhex.kod @@ -0,0 +1,34 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +DrainHex is Hex + +constants: + + include blakston.khd + +resources: + + +classvars: + +properties: + + piFlatDuration = 25000 + +messages: + + StealStat(who=$,what=$,state=0) + { + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/drainhex/barbs.kod b/kod/object/passive/spell/debuff/hex/drainhex/barbs.kod new file mode 100644 index 0000000000..27b2f56314 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/drainhex/barbs.kod @@ -0,0 +1,100 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Barbs is DrainHex + +constants: + + include blakston.khd + +resources: + + barbs_cast_rsc = \ + "%s%s becomes the focal point of a thousand ethereal barbs." + barbs_already_enchanted = \ + "That poor soul is already afflicted by barbs." + barbs_start = "Ethereal barbs jab into your spirit!" + barbs_stop = "The phantom barbs jabbing your spirit disappear." + has_been_hexed_barbs = \ + "%s%s becomes the focal point of a thousand ethereal barbs!" + + barbs_name_rsc = "barbs" + barbs_icon_rsc = ienfeebl.bgf + barbs_desc_rsc = \ + "Afflicts your victim's spirit with ethereal barbs that grant all " + "who strike them a bit of sapped mana." + "This hex requires two orc teeth to cast." + + barbs_sound = qenfeebl.wav + + barbed_msg = "Your attack steals %i mana!" + +classvars: + + vrName = barbs_name_rsc + vrIcon = barbs_icon_rsc + vrDesc = barbs_desc_rsc + + vrAlreadyEnchanted = barbs_already_enchanted + vrEnchantment_On = barbs_start + vrEnchantment_Off = barbs_stop + vrSuccess = barbs_cast_rsc + vrInformRoom = has_been_hexed_barbs + + viSpell_num = SID_HEX_BARBS + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_NEQUZON + viSpell_level = 1 + viMana = 30 + viSpell_Exertion = 5 + + viFlash = FLASH_BAD + + vrSucceed_wav = barbs_sound + viChance_To_Increase = 25 + viMeditate_ratio = 30 + +properties: + + % Take and give this much mana when struck + piBaseEffect = 2 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + + StealStat(who=$,what=$,state=0) + { + local iStealAmount; + + iStealAmount = piBaseEffect * state / 100; + if Send(what,@GetMana) > iStealAmount + { + Send(what,@LoseMana,#amount=iStealAmount); + Send(who,@GainMana,#amount=iStealAmount,#bRespectMax=TRUE); + + if IsClass(who,&User) + { + Send(who,@MsgSendUser,#message_rsc=barbed_msg, + #parm1=iStealAmount); + } + } + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/drainhex/leeches.kod b/kod/object/passive/spell/debuff/hex/drainhex/leeches.kod new file mode 100644 index 0000000000..03d4c5820b --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/drainhex/leeches.kod @@ -0,0 +1,100 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Leeches is DrainHex + +constants: + + include blakston.khd + +resources: + + leeches_cast_rsc = "%s%s becomes infested with phantom leeches." + leeches_already_enchanted = \ + "That poor soul is already afflicted by leeches." + leeches_start = "Phantom leeches appear on your skin!" + leeches_stop = "The phantom leeches crawling upon you disappear." + has_been_hexed_leeches = \ + "%s%s becomes infested with phantom leeches!" + + leeched_msg = "Your strike leeches %i health!" + leeched_from_msg = "You shiver as %i health drains away." + + leeches_name_rsc = "leeches" + leeches_icon_rsc = ienfeebl.bgf + leeches_desc_rsc = \ + "Afflicts your victim with phantom leeches that grant all who strike them " + "a bit of sapped health. " + "This hex requires two orc teeth to cast." + + leeches_sound = qenfeebl.wav + +classvars: + + vrName = leeches_name_rsc + vrIcon = leeches_icon_rsc + vrDesc = leeches_desc_rsc + + vrAlreadyEnchanted = leeches_already_enchanted + vrEnchantment_On = leeches_start + vrEnchantment_Off = leeches_stop + vrSuccess = leeches_cast_rsc + vrInformRoom = has_been_hexed_leeches + + viSpell_num = SID_HEX_LEECHES + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 2 + viMana = 15 + viSpell_Exertion = 15 + + viFlash = FLASH_BAD + + vrSucceed_wav = leeches_sound + viChance_To_Increase = 10 + viMeditate_ratio = 70 + +properties: + + % Take and give this much health when struck (/100) + piBaseEffect = 200 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,3],plReagents); + + return; + } + + StealStat(who=$,what=$,state=0) + { + local iStealAmount; + + iStealAmount = piBaseEffect * state / 100; + if Send(what,@GetExactHealth) > iStealAmount + { + Send(what,@LoseHealth,#amount=iStealAmount,#precision=TRUE); + Send(who,@GainHealthNormal,#amount=iStealAmount,#precision=TRUE); + + if IsClass(who,&User) + { + Send(who,@MsgSendUser,#message_rsc=leeched_msg, + #parm1=iStealAmount/100); + } + } + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/drainhex/makefile b/kod/object/passive/spell/debuff/hex/drainhex/makefile new file mode 100644 index 0000000000..7b14246cc8 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/drainhex/makefile @@ -0,0 +1,12 @@ +# +# Makefile for compiling the Blakod +# + +!include $(TOPDIR)\common.mak + +DEPEND = ..\drainhex.bof +BOFS = leeches.bof \ + barbs.bof \ + sap.bof + +!include $(KODDIR)\kod.mak diff --git a/kod/object/passive/spell/debuff/hex/drainhex/sap.kod b/kod/object/passive/spell/debuff/hex/drainhex/sap.kod new file mode 100644 index 0000000000..5b572543ea --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/drainhex/sap.kod @@ -0,0 +1,108 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Sap is DrainHex + +constants: + + include blakston.khd + +resources: + + sap_cast_rsc = "%s%s becomes surrounded by a draining aura." + sap_already_enchanted = \ + "That poor soul is already afflicted by sap." + sap_start = "A draining aura surrounds you!" + sap_stop = "The draining aura around you vanishes." + has_been_hexed_sap = \ + "%s%s becomes surrounded by a draining aura!" + + sap_name_rsc = "sap" + sap_icon_rsc = ienfeebl.bgf + sap_desc_rsc = \ + "Surrounds your victim with a draining aura that steals vigor " + "and gives it to those that strike them. " + "This hex requires two orc teeth to cast." + + sap_sound = qenfeebl.wav + + sapped_msg = "Your attack drains %i vigor!" + +classvars: + + vrName = sap_name_rsc + vrIcon = sap_icon_rsc + vrDesc = sap_desc_rsc + + vrAlreadyEnchanted = sap_already_enchanted + vrEnchantment_On = sap_start + vrEnchantment_Off = sap_stop + vrSuccess = sap_cast_rsc + vrInformRoom = has_been_hexed_sap + + viSpell_num = SID_HEX_SAP + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 3 + viMana = 5 + viSpell_Exertion = 30 + + viFlash = FLASH_BAD + + vrSucceed_wav = sap_sound + viChance_To_Increase = 20 + viMeditate_ratio = 40 + +properties: + + % Take and give this much vigor when struck (/10000) + piBaseEffect = 20000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + + StealStat(who=$,what=$,state=0) + { + local iStealAmount; + + iStealAmount = piBaseEffect * state / 100; + if IsClass(what,&Monster) + OR Send(what,@GetVigor)*1000 > iStealAmount + { + if IsClass(what,&Player) + { + Send(what,@AddExertion,#amount=iStealAmount); + } + + if IsClass(what,&Monster) + { + iStealAmount = iStealAmount / 2; + } + + if IsClass(who,&Player) + { + Send(who,@AddExertion,#amount=-iStealAmount); + Send(who,@MsgSendUser,#message_rsc=sapped_msg, + #parm1=iStealAmount/10000); + } + } + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/exhaustion.kod b/kod/object/passive/spell/debuff/hex/exhaustion.kod new file mode 100644 index 0000000000..f89ec32eb9 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/exhaustion.kod @@ -0,0 +1,84 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Exhaustion is Hex + +constants: + + include blakston.khd + +resources: + + exhaustion_cast_rsc = "%s%s suddenly seems tired." + exhaustion_already_enchanted = \ + "That poor soul is already afflicted by exhaustion." + exhaustion_start = "Your every action begins to take a greater toll." + exhaustion_stop = "The strange exhaustion passes." + has_been_hexed_exhaustion = \ + "%s%s suddenly seems tired!" + + exhaustion_name_rsc = "exhaustion" + exhaustion_icon_rsc = ienfeebl.bgf + exhaustion_desc_rsc = \ + "Bonds a spiritual burden to the victim's soul that makes every effort " + "more exhausting." + "This hex requires three orc teeth to cast." + + exhaustion_sound = qenfeebl.wav + +classvars: + + vrName = exhaustion_name_rsc + vrIcon = exhaustion_icon_rsc + vrDesc = exhaustion_desc_rsc + + vrAlreadyEnchanted = exhaustion_already_enchanted + vrEnchantment_On = exhaustion_start + vrEnchantment_Off = exhaustion_stop + vrSuccess = exhaustion_cast_rsc + vrInformRoom = has_been_hexed_exhaustion + + viSpell_num = SID_HEX_EXHAUSTION + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 2 + viMana = 10 + viSpell_Exertion = 30 + + viFlash = FLASH_BAD + + vrSucceed_wav = exhaustion_sound + viChance_To_Increase = 25 + viMeditate_ratio = 30 + +properties: + + % Vigor costs increase by this percent + piBaseEffect = 50 + + piFlatDuration = 80000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,3],plReagents); + + return; + } + + ModifyExertion(amount=0,state=0) + { + return (amount * (100 + ((piBaseEffect*state)/100))) / 100; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/fester.kod b/kod/object/passive/spell/debuff/hex/fester.kod new file mode 100644 index 0000000000..915b2a7509 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/fester.kod @@ -0,0 +1,86 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Fester is Hex + +constants: + + include blakston.khd + +resources: + + fester_cast_rsc = \ + "%s%s begins to fester and reek." + fester_already_enchanted = \ + "That poor soul is already afflicted by fester." + fester_start = "You begin to fester and reek." + fester_stop = "The strange affliction fades, and you begin healing normally." + has_been_hexed_fester = \ + "%s%s begins to fester and reek!" + + fester_name_rsc = "fester" + fester_icon_rsc = ienfeebl.bgf + fester_desc_rsc = \ + "Afflicts your victim with festering rot, slowing physical " + "regenerations. " + "This hex requires one orc tooth to cast." + + fester_sound = qenfeebl.wav + +classvars: + + vrName = fester_name_rsc + vrIcon = fester_icon_rsc + vrDesc = fester_desc_rsc + + vrAlreadyEnchanted = fester_already_enchanted + vrEnchantment_On = fester_start + vrEnchantment_Off = fester_stop + vrSuccess = fester_cast_rsc + vrInformRoom = has_been_hexed_fester + + viSpell_num = SID_HEX_FESTER + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 1 + viMana = 10 + viSpell_Exertion = 20 + + viFlash = FLASH_BAD + + vrSucceed_wav = fester_sound + viChance_To_Increase = 25 + viMeditate_ratio = 30 + +properties: + + % Reduce regenerations by this percentage minus state + piBaseEffect = 50 + + piFlatDuration = 120000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,1],plReagents); + + return; + } + + ModifyRegenAmount(state=0,regen=0) + { + regen = regen * (piBaseEffect-state) / 100; + return regen; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/makefile b/kod/object/passive/spell/debuff/hex/makefile new file mode 100644 index 0000000000..3416984bdf --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/makefile @@ -0,0 +1,19 @@ +# +# Makefile for compiling the Blakod +# + +!include $(TOPDIR)\common.mak + +DEPEND = ..\hex.bof +BOFS = slow.bof \ + fester.bof \ + mute.bof \ + weaken.bof \ + exhaustion.bof \ + bestill.bof \ + becloud.bof \ + blackmantle.bof \ + drainhex.bof \ + antireshex.bof + +!include $(KODDIR)\kod.mak diff --git a/kod/object/passive/spell/debuff/hex/mute.kod b/kod/object/passive/spell/debuff/hex/mute.kod new file mode 100644 index 0000000000..560528b333 --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/mute.kod @@ -0,0 +1,80 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Mute is Hex + +constants: + + include blakston.khd + +resources: + + mute_cast_rsc = \ + "%s%s suddenly goes silent." + mute_already_enchanted = \ + "That poor soul is already afflicted by mute." + mute_start = "You find yourself unable to speak." + mute_stop = \ + "The strange affliction fades, and you find yourself able to speak again." + has_been_hexed_mute = \ + "%s%s suddenly goes silent!" + + mute_name_rsc = "mute" + mute_icon_rsc = ienfeebl.bgf + mute_desc_rsc = \ + "Temporarily prevents the victim from communicating. " + "This hex requires two orc teeth to cast." + + mute_sound = qenfeebl.wav + +classvars: + + vrName = mute_name_rsc + vrIcon = mute_icon_rsc + vrDesc = mute_desc_rsc + + vrAlreadyEnchanted = mute_already_enchanted + vrEnchantment_On = mute_start + vrEnchantment_Off = mute_stop + vrSuccess = mute_cast_rsc + vrInformRoom = has_been_hexed_mute + + viSpell_num = SID_HEX_MUTE + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 1 + viMana = 2 + viSpell_Exertion = 2 + + viFlash = FLASH_BAD + + vrSucceed_wav = mute_sound + viChance_To_Increase = 25 + viMeditate_ratio = 30 + +properties: + + % This much chance to prevent communication + piBaseEffect = 33 + + piFlatDuration = 25000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/slow.kod b/kod/object/passive/spell/debuff/hex/slow.kod new file mode 100644 index 0000000000..b7fa202bce --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/slow.kod @@ -0,0 +1,84 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Slow is Hex + +constants: + + include blakston.khd + +resources: + + slow_cast_rsc = "%s%s begins moving more slowly." + slow_already_enchanted = "That poor soul is already slowed." + slow_start = "The world speeds up around you." + slow_stop = "The world around you slows to a normal pace." + has_been_hexed_slow = \ + "%s%s begins moving more slowly." + + slow_name_rsc = "slow" + slow_icon_rsc = ienfeebl.bgf + slow_desc_rsc = \ + "Slows your victim considerably. " + "This hex requires two orc teeth to cast." + + slow_sound = qenfeebl.wav + +classvars: + + vrName = slow_name_rsc + vrIcon = slow_icon_rsc + vrDesc = slow_desc_rsc + + vrAlreadyEnchanted = slow_already_enchanted + vrEnchantment_On = slow_start + vrEnchantment_Off = slow_stop + vrSuccess = slow_cast_rsc + vrInformRoom = has_been_hexed_slow + + viSpell_num = SID_HEX_SLOW + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_XAERDUN + viSpell_level = 5 + viMana = 30 + viSpell_Exertion = 20 + + viFlash = FLASH_BAD + + vrSucceed_wav = slow_sound + viChance_To_Increase = 15 + viMeditate_ratio = 50 + +properties: + + % Increases postcast delays by this percent + piBaseEffect = 25 + + piFlatDuration = 30000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,2],plReagents); + + return; + } + + ModifyDelay(iDelay=$,state=0) + { + iDelay = iDelay * (100 + ((piBaseEffect * state)/100)) / 100; + + return iDelay; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/hex/weaken.kod b/kod/object/passive/spell/debuff/hex/weaken.kod new file mode 100644 index 0000000000..9a0c6319eb --- /dev/null +++ b/kod/object/passive/spell/debuff/hex/weaken.kod @@ -0,0 +1,101 @@ +% Meridian 59, Copyright 1994-2012 Andrew Kirmse and Chris Kirmse. +% All rights reserved. +% +% This software is distributed under a license that is described in +% the LICENSE file that accompanies it. +% +% Meridian is a registered trademark. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Weaken is Hex + +constants: + + include blakston.khd + +resources: + + weaken_cast_rsc = \ + "%s%s suddenly seems weaker somehow." + weaken_already_enchanted = \ + "That poor soul is already afflicted by weaken." + weaken_start = "Your limbs feel weak." + weaken_stop = \ + "Your limbs regain their old strength." + has_been_hexed_weaken = \ + "%s%s suddenly seems weaker somehow." + + weaken_name_rsc = "weaken" + weaken_icon_rsc = ienfeebl.bgf + weaken_desc_rsc = \ + "Weakens the victim's muscles, hampering their ability to land damaging " + "melee strikes. " + "This hex requires two orc teeth to cast." + + weaken_sound = qenfeebl.wav + +classvars: + + vrName = weaken_name_rsc + vrIcon = weaken_icon_rsc + vrDesc = weaken_desc_rsc + + vrAlreadyEnchanted = weaken_already_enchanted + vrEnchantment_On = weaken_start + vrEnchantment_Off = weaken_stop + vrSuccess = weaken_cast_rsc + vrInformRoom = has_been_hexed_weaken + + viSpell_num = SID_HEX_WEAKEN + viSchool = SS_WITCHERY + viSubSchool = SSS_WITCHERY_IWODACH + viSpell_level = 1 + viMana = 15 + viSpell_Exertion = 20 + + viFlash = FLASH_BAD + + vrSucceed_wav = weaken_sound + viChance_To_Increase = 25 + viMeditate_ratio = 30 + +properties: + + % Weaken outgoing melee damage by up to this percent + piBaseEffect = 20 + + piFlatDuration = 60000 + +messages: + + ResetReagents() + { + plReagents = $; + plReagents = Cons([&OrcTooth,3],plReagents); + + return; + } + + ModifyDamage(who=$,what=$,damage=$,state=0) + { + local oWeapon; + + oWeapon = $; + if IsClass(who,&Player) + { + oWeapon = Send(who,@GetWeapon); + } + + if IsClass(who,&Monster) + OR (oWeapon <> $ + AND NOT IsClass(oWeapon,&RangedWeapon)) + { + return (damage * (100 - ((piBaseEffect * state)/100)))/100; + } + + return damage; + } + +end +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/kod/object/passive/spell/debuff/makefile b/kod/object/passive/spell/debuff/makefile index 0259c0a07f..ff0a3c1daf 100644 --- a/kod/object/passive/spell/debuff/makefile +++ b/kod/object/passive/spell/debuff/makefile @@ -12,6 +12,7 @@ BOFS = blind.bof \ forget.bof \ hold.bof \ seduce.bof \ - vertigo.bof + vertigo.bof \ + hex.bof !include $(KODDIR)\kod.mak diff --git a/kod/object/passive/spell/heal.kod b/kod/object/passive/spell/heal.kod index 5916c53ec9..167025e75b 100644 --- a/kod/object/passive/spell/heal.kod +++ b/kod/object/passive/spell/heal.kod @@ -26,6 +26,13 @@ resources: "of the mage who heals another good soul. " "Requires one herb to cast." + heal_harm_rsc = \ + "%s%s's corrupted spell harms you for ~r~B%i~B~n hitpoints!" + heal_harm_self_rsc = \ + "Your corrupted spell harms you for ~r~B%i~B~n hitpoints!" + heal_harm_other_rsc = \ + "Your corrupted heal harms %s%s for ~r~B%i~B~n hitpoints!" + heal_cast_rsc = \ "%s%s's spell heals some minor injuries, restoring ~g~B%i~B~n hitpoints." heal_cast_self = \ @@ -108,19 +115,57 @@ messages: CastSpell(who = $, lTargets = $, iSpellPower=0) { - local iHeal, oTarget; + local iHeal, oTarget, i; oTarget = First(lTargets); iHeal = Random(100,500) + ((iSpellPower + 1)*5) + (Send(oTarget,@GetKarma)*5); iHeal = Bound(iHeal,0,1000); + + foreach i in Send(oTarget,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iHeal = Send(Nth(i,2),@ModifyHeal,#amount=iHeal,#state=Nth(i,3)); + } - iHeal = Send(oTarget,@GainHealthNormal,#amount=iHeal,#precision=TRUE); - - % A little boost for casting on newbies, even if you're the newbie! - if NOT Send(oTarget,@CheckPlayerFlag,#flag=PFLAG_PKILL_ENABLE) + if iHeal < 0 + AND Send(who,@AllowPlayerAttack,#victim=oTarget) + { + if who <> oTarget + { + Send(who,@MsgSendUser,#message_rsc=heal_harm_other_rsc, + #parm1=Send(oTarget,@GetDef), + #parm2=Send(oTarget,@GetName), + #parm3=-iHeal/100); + Send(oTarget,@MsgSendUser,#message_rsc=heal_harm_rsc, + #parm1=Send(who,@GetCapDef), + #parm2=Send(who,@GetName), + #parm3=-iHeal/100); + Send(oTarget,@AssessDamage,#what=who, + #damage=-iHeal, + #aspell=ATCK_SPELL_ALL+ATCK_SPELL_HOLY, + #precision=TRUE); + } + else + { + Send(who,@MsgSendUser,#message_rsc=heal_harm_self_rsc, + #parm1=Send(who,@GetCapDef), + #parm2=Send(who,@GetName), + #parm3=-iHeal/100); + Send(who,@AssessDamage,#what=who, + #damage=-iHeal, + #aspell=ATCK_SPELL_ALL+ATCK_SPELL_HOLY, + #precision=TRUE); + } + propagate; + } + else { - iHeal = iHeal + random(200,500); + % A little boost for casting on newbies, even if you're the newbie! + if NOT Send(oTarget,@CheckPlayerFlag,#flag=PFLAG_PKILL_ENABLE) + { + iHeal = iHeal + random(200,500); + } + iHeal = Send(oTarget,@GainHealthNormal,#amount=iHeal,#precision=TRUE); } if who <> oTarget diff --git a/kod/object/passive/spell/hospice.kod b/kod/object/passive/spell/hospice.kod index 28336c16db..6b0abea5f6 100644 --- a/kod/object/passive/spell/hospice.kod +++ b/kod/object/passive/spell/hospice.kod @@ -26,6 +26,13 @@ resources: "another good soul. " "Requires three herbs to cast." + hospice_heal_harm_rsc = \ + "%s%s's corrupted spell harms you for ~r~B%i~B~n hitpoints!" + hospice_heal_harm_self_rsc = \ + "Your corrupted spell harms you for ~r~B%i~B~n hitpoints!" + hospice_heal_harm_other_rsc = \ + "Your corrupted heal harms %s%s for ~r~B%i~B~n hitpoints!" + hospice_cast_rsc = \ "%s%s's spell rejuvenates you, restoring ~g~B%i~B~n hitpoints." hospice_cast_self = \ @@ -109,14 +116,54 @@ messages: CastSpell(who = $, lTargets = $, iSpellPower = 0) { - local iHeal, oTarget; + local iHeal, oTarget, i; oTarget = First(lTargets); iHeal = Random(-300,300) + iSpellPower*20 + Send(oTarget,@GetKarma)*10; iHeal = Bound(iHeal,0,2500); - iHeal = Send(oTarget,@GainHealthNormal,#amount=iHeal,#precision=TRUE); + foreach i in Send(oTarget,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iHeal = Send(Nth(i,2),@ModifyHeal,#amount=iHeal,#state=Nth(i,3)); + } + + if iHeal < 0 + AND Send(who,@AllowPlayerAttack,#victim=oTarget) + { + if who <> oTarget + { + Send(who,@MsgSendUser,#message_rsc=hospice_heal_harm_other_rsc, + #parm1=Send(oTarget,@GetDef), + #parm2=Send(oTarget,@GetName), + #parm3=-iHeal/100); + Send(oTarget,@MsgSendUser,#message_rsc=hospice_heal_harm_rsc, + #parm1=Send(who,@GetCapDef), + #parm2=Send(who,@GetName), + #parm3=-iHeal/100); + Send(oTarget,@AssessDamage,#what=who, + #damage=-iHeal, + #aspell=ATCK_SPELL_ALL+ATCK_SPELL_HOLY, + #precision=TRUE); + } + else + { + Send(who,@MsgSendUser,#message_rsc=hospice_heal_harm_self_rsc, + #parm1=Send(who,@GetCapDef), + #parm2=Send(who,@GetName), + #parm3=-iHeal/100); + Send(who,@AssessDamage,#what=who, + #damage=-iHeal, + #aspell=ATCK_SPELL_ALL+ATCK_SPELL_HOLY, + #precision=TRUE); + } + propagate; + } + else + { + iHeal = Send(oTarget,@GainHealthNormal,#amount=iHeal,#precision=TRUE); + } + if who <> oTarget { Send(who,@MsgSendUser,#message_rsc=hospice_cast_on_other, diff --git a/kod/object/passive/spell/majheal.kod b/kod/object/passive/spell/majheal.kod index 6e98dab19a..0113697676 100644 --- a/kod/object/passive/spell/majheal.kod +++ b/kod/object/passive/spell/majheal.kod @@ -26,6 +26,13 @@ resources: "on evil souls will reduce your own karmic standing. " "Requires herbs to cast." + major_heal_harm_rsc = \ + "%s%s's corrupted spell harms you for ~r~B%i~B~n hitpoints!" + major_heal_harm_self_rsc = \ + "Your corrupted spell harms you for ~r~B%i~B~n hitpoints!" + major_heal_harm_other_rsc = \ + "Your corrupted heal harms %s%s for ~r~B%i~B~n hitpoints!" + majorheal_cast_rsc = \ "%s%s's spell floods you with pure healing energy, " "restoring ~g~B%i~B~n hitpoints." @@ -101,14 +108,54 @@ messages: CastSpell(who = $, lTargets = $, iSpellPower = 0) { - local iHeal, oTarget; + local iHeal, oTarget, i; oTarget = First(lTargets); iHeal = Random(700,1300) + iSpellPower*20 + Send(oTarget,@GetKarma)*20; iHeal = Bound(iHeal,0,5000); - iHeal = Send(oTarget,@GainHealthNormal,#amount=iHeal,#precision=TRUE); + foreach i in Send(oTarget,@GetEnchantmentsByClass,#enchClass=&Hex) + { + iHeal = Send(Nth(i,2),@ModifyHeal,#amount=iHeal,#state=Nth(i,3)); + } + + if iHeal < 0 + AND Send(who,@AllowPlayerAttack,#victim=oTarget) + { + if who <> oTarget + { + Send(who,@MsgSendUser,#message_rsc=major_heal_harm_other_rsc, + #parm1=Send(oTarget,@GetDef), + #parm2=Send(oTarget,@GetName), + #parm3=-iHeal/100); + Send(oTarget,@MsgSendUser,#message_rsc=major_heal_harm_rsc, + #parm1=Send(who,@GetCapDef), + #parm2=Send(who,@GetName), + #parm3=-iHeal/100); + Send(oTarget,@AssessDamage,#what=who, + #damage=-iHeal, + #aspell=ATCK_SPELL_ALL+ATCK_SPELL_HOLY, + #precision=TRUE); + } + else + { + Send(who,@MsgSendUser,#message_rsc=major_heal_harm_self_rsc, + #parm1=Send(who,@GetCapDef), + #parm2=Send(who,@GetName), + #parm3=-iHeal/100); + Send(who,@AssessDamage,#what=who, + #damage=-iHeal, + #aspell=ATCK_SPELL_ALL+ATCK_SPELL_HOLY, + #precision=TRUE); + } + propagate; + } + else + { + iHeal = Send(oTarget,@GainHealthNormal,#amount=iHeal,#precision=TRUE); + } + if who <> oTarget { Send(who,@MsgSendUser,#message_rsc=majorheal_cast_on_other, diff --git a/kod/util/settings.kod b/kod/util/settings.kod index cb1e20bab3..effc8a5b7f 100644 --- a/kod/util/settings.kod +++ b/kod/util/settings.kod @@ -295,9 +295,16 @@ properties: piPostMaxHPBuildingSystem = POST_MAX_HP_SYSTEM_MASTERY_POINTS % Expansion modules - bSorcerySchoolExpansion = TRUE + pbSorcerySchoolExpansion = TRUE % Are Sorcery's reserved buffs purgeable? - bReservedSpellsPurgeable = FALSE + pbReservedSpellsPurgeable = FALSE + + pbWitcherySchoolExpansion = TRUE + % How many hexes can a player or mob have at most? General case. + piMaxHexesOnVictim = 1 + + % Do hexes replace each other when at the limit? Or just fail? + pbHexesReplace = TRUE messages: @@ -780,12 +787,22 @@ messages: GetSorcerySchoolExpansion() { - return bSorcerySchoolExpansion; + return pbSorcerySchoolExpansion; } GetReservedSpellsPurgeable() { - return bReservedSpellsPurgeable; + return pbReservedSpellsPurgeable; + } + + GetHexesMax() + { + return piMaxHexesOnVictim; + } + + GetHexesReplace() + { + return pbHexesReplace; } end diff --git a/kod/util/system.kod b/kod/util/system.kod index f99af28fe8..2fe9fa66c0 100644 --- a/kod/util/system.kod +++ b/kod/util/system.kod @@ -3422,6 +3422,25 @@ messages: Send(self,@CreateOneSpellIfNew,#num=SID_BATTLE_CONTROL,#class=&BattleControl); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_VULNERABILITY,#class=&Vulnerability); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_SLOW,#class=&Slow); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_BARBS,#class=&Barbs); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_LEECHES,#class=&Leeches); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_FRAILTY,#class=&Frailty); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_HUMILITY,#class=&Humility); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_CORRUPTION,#class=&Corruption); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_FLAMMABILITY,#class=&Flammability); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_CONDUCTIVITY,#class=&Conductivity); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_ALGIDITY,#class=&Algidity); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_CORROSION,#class=&Corrosion); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_FESTER,#class=&Fester); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_MUTE,#class=&Mute); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_WEAKEN,#class=&Weaken); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_SAP,#class=&Sap); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_BESTILL,#class=&Bestill); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_BECLOUD,#class=&Becloud); + Send(self,@CreateOneSpellIfNew,#num=SID_HEX_BLACK_MANTLE,#class=&BlackMantle); + % Trance may be searched for frequently, leave at end of list Send(self,@CreateOneSpellIfNew,#num=SID_TRANCE,#class=&Trance); @@ -3644,7 +3663,15 @@ messages: Send(self,@CreateOneSKillIfNew,#num=SKID_SECOND_WIND,#class=&SecondWind); Send(self,@CreateOneSKillIfNew,#num=SKID_DISARM,#class=&Disarm); - + + Send(self,@CreateOneSKillIfNew,#num=SKID_ARCANE_KNOWLEDGE,#class=&ArcaneKnowledge); + Send(self,@CreateOneSKillIfNew,#num=SKID_ROTE_MEMORIZATION,#class=&RoteMemorization); + Send(self,@CreateOneSKillIfNew,#num=SKID_EFFICIENT_CASTING,#class=&EfficientCasting); + Send(self,@CreateOneSKillIfNew,#num=SKID_ANCIENT_PACT,#class=&AncientPact); + Send(self,@CreateOneSKillIfNew,#num=SKID_UNHALLOWED_RUNES,#class=&UnhallowedRunes); + Send(self,@CreateOneSKillIfNew,#num=SKID_BLOOD_RUNES,#class=&BloodRunes); + Send(self,@CreateOneSKillIfNew,#num=SKID_OSTRACIZATION,#class=&Ostracization); + Send(self,@CreateOneSKillIfNew,#num=SKID_AWARENESS,#class=&Awareness); Send(self,@CreateOneSKillIfNew,#num=SKID_LIGHT_FEET,#class=&LightFeet); Send(self,@CreateOneSKillIfNew,#num=SKID_STAB,#class=&Stab);