Spells.2da #548 Darkfire is disabled in stock Nwn2 – if you want it …
change MetaMagic to 0x7F (all non-invokation metamagics except Permanent)
change Cleric to 3
change REMOVED to 0
edit Dialog.Tlk #3782
Caster Level(s): Cleric 3 Innate Level: 3 School: Evocation Descriptor(s): Fire Component(s): Verbal, Somatic Range: Touch Area of Effect / Target: Creature, Melee Weapon Duration: 1 min. / level Save: None Spell Resistance: No This spell allows you to immolate a melee weapon. In addition to its normal damage, the weapon inflicts 1d6 points of damage, +1 per two caster levels (maximum of +10) of Fire damage. The caster can target either a specific melee weapon in his inventory or a creature to enchant the weapon that it's wielding.
replace the ImpactScript x2_s0_darkfire with this →
//::///////////////////////////////////////////////
//:: Darkfire
//:: 'x2_s0_darkfire'
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Caster Level(s): Cleric 3
Innate Level: 3
School: Evocation
Descriptor(s): Fire
Component(s): Verbal, Somatic
Range: Touch
Area of Effect / Target: Creature, Melee Weapon
Duration: 1 min. / level
Save: None
Spell Resistance: No
This spell allows you to immolate a melee weapon. In addition to its normal
damage, the weapon inflicts 1d6 points of damage, +1 per two caster levels
(maximum of +10) of Fire damage. The caster can target either a specific
melee weapon in his inventory or a creature to enchant the weapon that it's
wielding.
*/
//:://////////////////////////////////////////////
//:: Created By: Andrew Nobbs
//:: Created On: Dec 04, 2002
//:://////////////////////////////////////////////
//:: Updated by Andrew Nobbs May 08, 2003
//:: 2003-07-29: Rewritten, Georg Zoeller
//:: 2022-10-13: reinstated and rewritten, kevL
#include "x2_inc_spellhook"
#include "nwn2_inc_metmag"
const string sMETA = "ohcs_DarkfireMeta";
const string sCL = "ohcs_DarkfireCL";
//
void main()
{
if (!X2PreSpellCastCode())
return;
object oCaster = OBJECT_SELF;
object oTarget = IPGetTargetedOrEquippedMeleeWeapon();
if (GetIsObjectValid(oTarget))
{
int iCasterlevel = GetCasterLevel(oCaster);
if (iCasterlevel < 1) iCasterlevel = 1;
float fDur = ApplyMetamagicDurationMods(TurnsToSeconds(iCasterlevel));
// note if the item is on the ground there is no possessor
object oPossessor = GetItemPossessor(oTarget);
if (GetIsObjectValid(oPossessor))
{
SignalEvent(oPossessor, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
effect eHit = EffectVisualEffect(VFX_IMP_PULSE_FIRE);
effect eHi0 = EffectVisualEffect(VFX_IMP_FLAME_M);
eHit = EffectLinkEffects(eHit, eHi0);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHit, oPossessor);
// note that if the item is passed off to another character the DurCessatePositive
// visual will still affect only the original possessor
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDur, oPossessor, fDur);
}
// limit iCasterlevel to 20
// - this value will appear on the item's Examine sheet
// but it's halved for damage bonus in the OnHit script (x2_s3_darkfire)
if (iCasterlevel > 20)
iCasterlevel = 20;
itemproperty ip = ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_DARKFIRE, iCasterlevel);
IPSafeAddItemProperty(oTarget, ip, fDur, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING);
ip = ItemPropertyVisualEffect(ITEM_VISUAL_FIRE);
IPSafeAddItemProperty(oTarget, ip, fDur, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, TRUE);
int iMeta = GetMetaMagicFeat();
if (iMeta == METAMAGIC_EMPOWER || iMeta == METAMAGIC_MAXIMIZE)
{
// store Metamagic on the weapon
SetLocalInt(oTarget, sMETA, iMeta);
AssignCommand(GetModule(), DelayCommand(fDur, DeleteLocalInt(oTarget, sMETA)));
}
else
DeleteLocalInt(oTarget, sMETA);
// store Casterlevel halved on the weapon
SetLocalInt(oTarget, sCL, iCasterlevel / 2);
AssignCommand(GetModule(), DelayCommand(fDur, DeleteLocalInt(oTarget, sCL)));
}
else
FloatingTextStrRefOnCreature(83615, oCaster); // "* Spell Failed - Target must be a melee weapon or creature with a melee weapon equipped *"
}
edit Iprp_OnHitSpell.2da #127 OnHIT_Darkfire
change Name to 3781
replace the ImpactScript x2_s3_darkfire with this →
//::///////////////////////////////////////////////
//:: OnHit Darkfire
//:: 'x2_s3_darkfire'
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
OnHit Castspell Fire Damage property for the Darkfire weapon spell
(x2_s0_darkfire).
We need to use this property because we cannot add both constant and
variable damage with EffectDamage().
Behavior:
The Casterlevel is set as a variable on the weapon. So is Metamagic -
Empowered or Maximized.
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-07-17
//:://////////////////////////////////////////////
//:: 2022-10-13: reinstated and rewritten, kevL
const string sMETA = "ohcs_DarkfireMeta";
const string sCL = "ohcs_DarkfireCL";
// OBJECT_SELF is possessor of the item
// - but note that GetCasterLevel(OBJECT_SELF) returns the level of the
// originating caster ... go figur (note that level is stored as the CostValue
// in the applied ItemProperty construct)
// - also note that GetMetaMagicFeat() returns the metamagic with which the
// application-spell was cast IF the originating spellcaster is using the
// weapon BUT -1 if a different character uses the weapon ... go figur
// - so store the value of Metamagic in the application-script and check it here
// for the Empowered or Maximized flags
void main()
{
object oTarget = GetSpellTargetObject();
if (GetIsObjectValid(oTarget))
{
object oWeapon = GetSpellCastItem();
int iFire;
switch (GetLocalInt(oWeapon, sMETA))
{
default:
iFire = d6();
break;
case METAMAGIC_EMPOWER:
iFire = d6();
iFire += iFire / 2;
break;
case METAMAGIC_MAXIMIZE:
iFire = 6;
break;
}
iFire += GetLocalInt(oWeapon, sCL);
int iHit;
if (iFire <= 10) iHit = VFX_IMP_FLAME_S;
else iHit = VFX_IMP_FLAME_M;
effect eHit = EffectVisualEffect(iHit);
effect eFire = EffectDamage(iFire, DAMAGE_TYPE_FIRE);
eFire = EffectLinkEffects(eFire, eHit);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eFire, oTarget);
}
}
thanks to @temyankee for getting me interested in this and @Lance_Botelle for just being Lance
[edit] 221015 - fix potential bug w/ using GetCasterLevel() → store CL on the weapon
[edit] fix dialog.Tlk description : Duration is 1 min/level
[edit] ensure metamagic gets deleted on reapplication