//:://///////////////////////////////////////////// //:: Blade Thrist //:: X2_S0_BldeThst //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Grants a +3 enhancement bonus to a slashing weapon. */ //::////////////////////////////////////////////// //:: Created By: Andrew Nobbs //:: Created On: Nov 27, 2002 //::////////////////////////////////////////////// //:: Updated by Andrew Nobbs May 08, 2003 //:: 2003-07-07: Stacking Spell Pass, Georg Zoeller //:: 2003-07-21: Complete Rewrite to make use of Item Property System #include "x2_i0_spells" #include "x2_inc_spellhook" void AddEnhanceEffectToWeapon(object oWeapon, float fDuration) { IPSafeAddItemProperty(oWeapon, ItemPropertyEnhancementBonus(3), fDuration, X2_IP_ADDPROP_POLICY_REPLACE_EXISTING, FALSE, 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(2 * 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)); // Only works on slashing weapons. if ( GetSlashingWeapon(oWeapon) ) { if ( fDuration > 0.0 ) { // Impact visual effect. ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_SUPER_HEROISM), oPossessor); // Spell expiration visual. ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE), oPossessor, fDuration); // Add the bonus to the weapon. AddEnhanceEffectToWeapon(oWeapon, fDuration); } } else FloatingTextStrRefOnCreature(83621, OBJECT_SELF); // "* Invalid Target - This spell must be cast on a slashing weapon *" } else FloatingTextStrRefOnCreature(83615, OBJECT_SELF); // "* Spell Failed - Target must be a melee weapon or creature with a melee weapon equipped *" }