///:://///////////////////////////////////////////// //:: Shelgarn's Persistent Blade //:: X2_S0_PersBlde //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Summons a dagger to battle for the caster */ //::////////////////////////////////////////////// //:: Created By: Andrew Nobbs //:: Created On: Nov 26, 2002 //::////////////////////////////////////////////// //:: Last Updated By: Georg Zoeller, Aug 2003 #include "x2_i0_spells" #include "x2_inc_spellhook" //Creates the weapon that the creature will be using. void spellsCreateItemForSummoned(object oCaster, float fDuration) { //Declare major variables int nStat = GetIsMagicStatBonus(oCaster) / 2; // GZ: Just in case... if (nStat >20) { nStat =20; } else if (nStat <1) { nStat = 1; } object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED); object oWeapon; if (GetIsObjectValid(oSummon)) { //Create item on the creature, epuip it and add properties. oWeapon = CreateItemOnObject("NW_WSWDG001", oSummon); // GZ: Fix for weapon being dropped when killed SetDroppableFlag(oWeapon,FALSE); AssignCommand(oSummon, ActionEquipItem(oWeapon, INVENTORY_SLOT_RIGHTHAND)); // GZ: Check to prevent invalid item properties from being applies if (nStat>0) { AddItemProperty(DURATION_TYPE_TEMPORARY, ItemPropertyAttackBonus(nStat), oWeapon,fDuration); } AddItemProperty(DURATION_TYPE_TEMPORARY, ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1,5),oWeapon,fDuration); } } 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 Spell Cast Hook //Declare major variables int nMetaMagic = GetMetaMagicFeat(); int nDuration = GetCasterLevel(OBJECT_SELF); if (nDuration <1) { nDuration = 1; } if (nDuration<4) { nDuration=4; } effect eSummon = EffectSummonCreature("X2_S_FAERIE001"); effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); //Make metamagic check for extend if (nMetaMagic == METAMAGIC_EXTEND) { nDuration = nDuration *2; //Duration is +100% } //Apply the VFX impact and summon effect ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation()); ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), RoundsToSeconds(nDuration)); object oSelf = OBJECT_SELF; DelayCommand(1.0, spellsCreateItemForSummoned(oSelf,RoundsToSeconds(nDuration))); }