// summon emergency help for lair nParm = level // 1 = minor - costs 100 mana // 2 = medium - costs 200 mana // 3 = major - costs 300 mana // Summoned creatures only stay around for 4 game minutes // A portion of them will set on follow or recon of master, and others will // be set to Guard Lair, Guard Mana, and Guard Throne. #include "rtsh_multiplay" const int SUMMON_DURATION_EMERGENCY = 25; // decremented by 1 every 10 seconds ////////////////////////////// // PROTOTYPES ////////////////////////////// void fnDoSummon(object oPC,int nLevel); ///////////////////////////////////////////////////////////////////[ MAIN ]///// void main() { object oLeader=OBJECT_SELF; int nParm=GetLocalInt(oLeader,"nParm"); int nCost=0; int nMana; if (nParm==1) nCost=100; else if (nParm==2) nCost=200; else if (nParm==3) nCost=300; if (nCost>0) { // valid cost nMana=fnGetTeamMana(oLeader); if (nMana>=nCost) { // have enough nMana=nMana-nCost; fnSetTeamMana(oLeader,nMana); fnDoSummon(oLeader,nParm); } // have enough else { // not enough SendMessageToPC(oLeader,"Insufficient mana to perform. That costs "+IntToString(nCost)+" mana and you only have "+IntToString(nMana)+"."); } // not enough } // valid cost else { // error SendMessageToPC(oLeader,"Error in summoning"); PrintString("ERROR 'leader_summon': nParm="+IntToString(nParm)); } // error } ///////////////////////////////////////////////////////////////////[ MAIN ]///// ////////////////////////////// // FUNCTIONS ////////////////////////////// /* AI VALUES nMState 11 = Guard Lair 14 = Recon 5 = Follow 2 = Guard nParm = type 4 = mana, 5 = throne nFollowDist = distance 0 = 3.0, 1 = 7.0, 2 = 5.0 nRun oDestWP = whom to follow */ void fnPossessiveScript() { // PURPOSE: Possessive script to run the AI for the summoned unit object oMe=OBJECT_SELF; int nTimer=GetLocalInt(oMe,"nTimer"); if (nTimer>0) { // remain spawned if (!GetIsInCombat(oMe)&&!GetIsDMPossessed(oMe)) { // possible to act object oEnemy=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oMe,CREATURE_TYPE_PERCEPTION,PERCEPTION_SEEN,CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY); if (!GetIsObjectValid(oEnemy)) { // no enemies in area ExecuteScript("rts_unit_ai",oMe); } // no enemies in area } // possible to act SetLocalInt(oMe,"nTimer",nTimer-1); DelayCommand(10.0,fnPossessiveScript()); } // remain spawned else { // despawn ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_UNSUMMON),GetLocation(oMe)); DestroyObject(oMe); } // despawn } // fnPossessiveScript() void fnMinorSpiders(object oPC) { // PURPOSE: Do a minor summon for spider cultists object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); effect eCreate; object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","SPID"); SetLocalInt(oCreature,"nRun",TRUE); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=8) { // spawn 8 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 8 creatures } // fnMinorSpiders() void fnMediumSpiders(object oPC) { // PURPOSE: Do a minor summon for spider cultists object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=12) { // spawn 12 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 12 creatures } // fnMediumSpiders() void fnMajorSpiders(object oPC) { // PURPOSE: Do a minor summon for spider cultists object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergh1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergh1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=10) { // spawn 10 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"spidemergh2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","SPID"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 10 creatures } // fnMaforSpiders() void fnMinorUndead(object oPC) { // PURPOSE: Do a minor summon for undead object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=12) { // spawn 12 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 12 creatures } // fnMinorUndead() void fnMediumUndead(object oPC) { // PURPOSE: Do a medium summon for undead object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=4) { // spawn 4 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 4 creatures nN=1; while(nN<=4) { // spawn 4 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 4 creatures } // fnMediumUndead() void fnMajorUndead(object oPC) { // PURPOSE: Do a major summon for undead object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergh1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergh1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=8) { // spawn 8 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"undemergh2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UND"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 8 creatures } // fnMajorUndead() void fnMinorUnclean(object oPC) { // PURPOSE: Do a minor summon for unclean object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=8) { // spawn 8 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergl2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 8 creatures nN=1; while(nN<=4) { // spawn 4 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergl3",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 4 creatures } // fnMinorUnclean() void fnMediumUnclean(object oPC) { // PURPOSE: Do a medium summon for Unclean object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=8) { // spawn 8 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 8 creatures } // fnMediumUnclean() void fnMajorUnclean(object oPC) { // PURPOSE: Do a major summon for Unclean object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_evil",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergh2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergh1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=6) { // spawn 6 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"uncemergh3",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","UNC"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 6 creatures } // fnMajorUnclean() void fnMinorDwarves(object oPC) { // PURPOSE: Do a minor summon for dwarves object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_good",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=8) { // spawn 8 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergl1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 8 creatures } // fnMinorDwarves() void fnMediumDwarves(object oPC) { // PURPOSE: Do a minor summon for dwarves object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_good",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergm1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=8) { // spawn 8 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 8 creatures } // fnMediumDwarves() void fnMajorDwarves(object oPC) { // PURPOSE: Do a major summon for dwarves object oGate=CreateObject(OBJECT_TYPE_PLACEABLE,"gate_good",GetLocation(oPC)); effect eSummon=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); object oCreature; int nN; DelayCommand(5.0,DestroyObject(oGate)); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergh1",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",5); // follow SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergh2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",14); // Recon SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN=1; while(nN<=12) { // spawn 12 creatures oCreature=CreateObject(OBJECT_TYPE_CREATURE,"dwfemergm2",GetLocation(oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT,eSummon,oCreature); SetLocalObject(oCreature,"oDestWP",oPC); SetLocalInt(oCreature,"nMState",11); // Guard Lair SetLocalString(oCreature,"sTeamID","DWF"); SetAILevel(oCreature,AI_LEVEL_NORMAL); DelayCommand(0.1,SetLocalInt(oCreature,"nTimer",SUMMON_DURATION_EMERGENCY)); DelayCommand(0.2,AssignCommand(oCreature,fnPossessiveScript())); //AddHenchman(oPC,oCreature); SetLocalInt(oCreature,"nRun",TRUE); nN++; } // spawn 12 creatures } // fnMajorDwarves() void fnDoSummon(object oPC,int nLevel) { // PURPOSE: Perform the summoning string sTeamID=GetLocalString(oPC,"sTeamID"); sTeamID=GetStringUpperCase(sTeamID); if (nLevel==1) { // minor if (sTeamID=="SPID") fnMinorSpiders(oPC); else if (sTeamID=="UND") fnMinorUndead(oPC); else if (sTeamID=="UNC") fnMinorUnclean(oPC); else if (sTeamID=="DWF") fnMinorDwarves(oPC); } // minor else if (nLevel==2) { // medium if (sTeamID=="SPID") fnMediumSpiders(oPC); else if (sTeamID=="UND") fnMediumUndead(oPC); else if (sTeamID=="UNC") fnMediumUnclean(oPC); else if (sTeamID=="DWF") fnMediumDwarves(oPC); } // medium else if (nLevel==3) { // major if (sTeamID=="SPID") fnMajorSpiders(oPC); else if (sTeamID=="UND") fnMajorUndead(oPC); else if (sTeamID=="UNC") fnMajorUnclean(oPC); else if (sTeamID=="DWF") fnMajorDwarves(oPC); } // major } // fnDoSummon()