//:://///////////////////////////////////////////// //:: Holy Sword //:: X2_S0_HolySwrd //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Grants holy avenger properties. */ //::////////////////////////////////////////////// //:: Created By: Andrew Nobbs //:: Created On: Nov 28, 2002 //::////////////////////////////////////////////// //:: Updated by Andrew Nobbs May 08, 2003 //:: 2003-07-07: Stacking Spell Pass, Georg Zoeller #include "x2_inc_spellhook" #include "x2_inc_toollib" void AddHolyAvengerEffectToWeapon(object oWeapon, float fDuration) { IPSafeAddItemProperty(oWeapon, ItemPropertyHolyAvenger(), fDuration, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, TRUE, TRUE); } void main() { // Spellcast Hook Code // Added 2003-07-07 by Georg Zoeller // If you want to make changes to all spells, // check x2_inc_spellhook.nss to find out more if ( !X2PreSpellCastCode() ) // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell. return; // End of Spellcast Hook. //Declare major variables int nMetaMagic = GetMetaMagicFeat(); float fDuration = RoundsToSeconds(GetCasterLevel(OBJECT_SELF)); if ( nMetaMagic == METAMAGIC_EXTEND ) fDuration *= 2.0; //Duration is +100% // Get the true target. object oWeapon = IPGetTargetedOrEquippedMeleeWeapon(); if ( GetIsObjectValid(oWeapon) ) { object oPossessor = GetItemPossessor(oWeapon); SignalEvent(oPossessor, EventSpellCastAt(OBJECT_SELF, GetSpellId(), FALSE)); if ( fDuration > 0.0 ) { // Impact visual effect. ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP), oPossessor); // Spell expiration visual. ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), oPossessor, fDuration); // Add the bonus to the weapon. AddHolyAvengerEffectToWeapon(oWeapon, fDuration); } // Special visual effects for casting this spell. location lTarget = GetLocation(GetSpellTargetObject()); TLVFXPillar(VFX_IMP_GOOD_HELP, lTarget, 4, 0.0, 6.0); DelayCommand(1.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SUPER_HEROISM), lTarget)); } else FloatingTextStrRefOnCreature(83615, OBJECT_SELF); // "* Spell Failed - Target must be a melee weapon or creature with a melee weapon equipped *" }