// Modified by Deva Winblood. //:://///////////////////////////////////////////// //:: Summon Greater Undead //:: X2_S2_SumGrUnd //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* 2003-10-03 - GZ: Added Epic Progression The level of the Pale Master determines the type of undead that is summoned. Level 9 <= Mummy Warrior Level 10 <= Spectre Level 12 <= Vampire Rogue Level 14 <= Bodak Level 16 <= Ghoul King Level 18 <= Vampire Mage Level 20 <= Skeleton Blackguard Level 22 <= Lich Level 24 <= Lich Lord Level 26 <= Alhoon Level 28 <= Elder Alhoon Level 30 <= Lesser Demi Lich Lasts 14 + Casterlevel rounds */ //::////////////////////////////////////////////// //:: Created By: Andrew Nobbs //:: Created On: Feb 05, 2003 //::////////////////////////////////////////////// void fnWatch(object oMaster) { // PURPOSE: For summone critter to know when to despawn effect eUnsum=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oMe=OBJECT_SELF; SetLocalInt(oMe,"bWatcher",TRUE); //SendMessageToPC(oMaster,"DEBUG: '"+GetName(oMe)+"' Watching"); if (GetIsObjectValid(oMaster)==TRUE) { // valid master if (GetIsDead(oMaster)||GetCurrentAction(oMaster)==ACTION_REST||GetLocalInt(oMe,"bUnsummon")) { // despawn ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eUnsum,GetLocation(oMe),4.0); RemoveHenchman(oMaster,oMe); SetIsDestroyable(TRUE,FALSE,FALSE); DelayCommand(1.0,DestroyObject(oMe)); } // despawn DelayCommand(6.0,fnWatch(oMaster)); } // valid master else { // destroy self ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY,eUnsum,GetLocation(oMe),4.0); RemoveHenchman(oMaster,oMe); SetIsDestroyable(TRUE,FALSE,FALSE); DelayCommand(1.0,DestroyObject(oMe)); DelayCommand(6.0,fnWatch(oMaster)); } // destroy self } // fnWatch() void fnSetWatchers(object oMaster,float fDur) { // PURPOSE: Fire the watcher routines int nN=1; object oSum; oSum=GetAssociate(ASSOCIATE_TYPE_SUMMONED,oMaster,nN); while(GetIsObjectValid(oSum)) { // check for watch //SendMessageToPC(oMaster,"DEBUG: Summoned '"+GetName(oSum)+"'"); if (GetLocalInt(oSum,"bWatcher")!=TRUE) { // fire watch AssignCommand(oSum,fnWatch(oMaster)); DelayCommand(fDur,SetLocalInt(oSum,"bUnsummon",TRUE)); } // fire watch nN++; oSum=GetAssociate(ASSOCIATE_TYPE_SUMMONED,oMaster,nN); } // check for watch } // fnSetWatchers() void PMUpgradeSummon(object oSelf, string sScript) { object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED,oSelf); ExecuteScript ( sScript, oSummon); } void main() { int nCasterLevel = GetLevelByClass(CLASS_TYPE_PALEMASTER,OBJECT_SELF); int nDuration = 14 + nCasterLevel; effect eSummon; //-------------------------------------------------------------------------- // Summon the appropriate creature based on the summoner level //-------------------------------------------------------------------------- if (nCasterLevel >= 30) { // * Demi Lich eSummon = EffectSummonCreature("sumdemilich",496,0.0f,1); } else if (nCasterLevel >= 28) { // * Mega Alhoon eSummon = EffectSummonCreature("summalhoon",496,0.0f,1); } else if (nCasterLevel >= 26) { // * Alhoon eSummon = EffectSummonCreature("sumalhoon",496,0.0f,1); } else if (nCasterLevel >= 24) { // * Lich eSummon = EffectSummonCreature("sumlich2",496,0.0f,0); } else if (nCasterLevel >= 22) { // * Lich eSummon = EffectSummonCreature("sumlich",496,0.0f,0); } else if (nCasterLevel >= 20) { // * Skeleton Blackguard eSummon = EffectSummonCreature("sumskelbg",VFX_IMP_HARM,0.0f,0); } else if (nCasterLevel >= 18) { // * Vampire Mage eSummon = EffectSummonCreature("sumvampmage",VFX_FNF_SUMMON_UNDEAD,0.0f,1); } else if (nCasterLevel >= 16) { // * Ghoul King eSummon = EffectSummonCreature("sumghoulking",VFX_IMP_HARM,0.0f,0); } else if (nCasterLevel >= 14) { // * Greater Bodak eSummon = EffectSummonCreature("sumgbodak",VFX_IMP_HARM,0.0f,0); } else if (nCasterLevel >= 12) { // * Vampire Rogue eSummon = EffectSummonCreature("sumvamprog",VFX_FNF_SUMMON_UNDEAD,0.0f,1); } else if (nCasterLevel >= 10) { eSummon = EffectSummonCreature("sumspectre",VFX_FNF_SUMMON_UNDEAD, 0.0f,1); } else { // * Mummy eSummon = EffectSummonCreature("summummy",VFX_IMP_HARM, 0.0f,0); } ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_LOS_EVIL_10),GetSpellTargetLocation()); //Apply the summon visual and summon the two undead. //ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetSpellTargetLocation()); ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eSummon, GetSpellTargetLocation(), HoursToSeconds(nDuration)); // * If the character has a special pale master item equipped (variable set via OnEquip) // * run a script on the summoned monster. string sScript = GetLocalString(OBJECT_SELF,"X2_S_PM_SPECIAL_ITEM"); if (sScript != "") { object oSelf = OBJECT_SELF; DelayCommand(1.0,PMUpgradeSummon(oSelf,sScript)); } DelayCommand(3.0,fnSetWatchers(OBJECT_SELF,HoursToSeconds(nDuration))); }