//:://///////////////////////////////////////////// //:: Summon Monster IX //:: NW_S0_Summon9 //::////////////////////////////////////////////// #include "wm_include" #include "x2_inc_spellhook" void main() { if (WildMagicOverride()) { return; } //Declare major variables int nMetaMagic = GetMetaMagicFeat(); object oMod = GetModule(); int nLevel = GetCasterLevel(OBJECT_SELF); int nSummon = GetLocalInt(oMod, "SUMMONTIME"); int nDuration; if (nSummon > 0) { nDuration = ((nLevel * nSummon) + 10); } else { nDuration = 24; } string sResRef = ""; // ResRef of the creature to summon. //Make metamagic check for extend if (nMetaMagic == METAMAGIC_EXTEND) { nDuration = nDuration *2; //Duration is +100% } // Check for a Book of Summons object oBook = GetItemPossessedBy(OBJECT_SELF, "bookofsummons"); if ( oBook != OBJECT_INVALID ) { sResRef = GetLocalString(oBook, "summons9"); } if ( sResRef == "" ) { // Either no Book of Summons, or variable not set. // Go with the defaults. int nRoll = d4(); if(GetHasFeat(FEAT_ANIMAL_DOMAIN_POWER)) { switch (nRoll) { case 1: sResRef == "wog_s_airelder01"; break; case 2: sResRef == "wog_s_waterpr001"; break; case 3: sResRef == "WoG_S_EARTHPRINCE"; break; case 4: sResRef == "wog_s_fireprn001"; break; } } else { switch (nRoll) { case 1: sResRef == "WoG_S_AIRELDER"; break; case 2: sResRef == "WoG_S_WATELDER"; break; case 3: sResRef == "WoG_S_EARTHELD"; break; case 4: sResRef == "WoG_S_FIREELDER"; break; } } float fDuration; if (nSummon > 0) { fDuration = RoundsToSeconds(nDuration); } else { fDuration = HoursToSeconds(nDuration); } effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); effect eSummon = EffectSummonCreature(sResRef); //Apply the VFX impact and summon effect ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, GetSpellTargetLocation()); ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), fDuration); } }