355 lines
11 KiB
Plaintext
355 lines
11 KiB
Plaintext
#include "nw_i0_generic"
|
|
#include "spawner"
|
|
#include "nw_i0_plot"
|
|
|
|
|
|
|
|
void main()
|
|
{
|
|
|
|
// Initialise variables & objects
|
|
|
|
object oPC = GetPCSpeaker();
|
|
object oMod = GetModule();
|
|
|
|
object oPC2;
|
|
object oTarget;
|
|
object oTarget2;
|
|
object oSpawn, oSpawn2;
|
|
|
|
int iW1,iW2,iW3,iW4,iW5,iW6,iW7,iW8,iW9,iW10,iW11,iW12,
|
|
iL1,iL2,iL3,iL4,iL5,iL6,iL7,iL8,iL9,iL10;
|
|
|
|
location lTarget;
|
|
location bTarget;
|
|
string sHench;
|
|
int nInt;
|
|
string sPRes;
|
|
string sPRes2;
|
|
int iDice;
|
|
int iFlag1=0,iFlag2=0,iFlag3=0,iFlag4=0,iFlag5=0,iFlag6=0,iFlag7=0,iFlag8=0,
|
|
iFlag9=0,iFlag10=0;
|
|
int iChampSide = GetLocalInt(oPC, "champ_side");
|
|
int iBetConfirm = GetLocalInt(oPC, "bet_confirmed");
|
|
|
|
if (iBetConfirm!=1)
|
|
{
|
|
SetLocalInt(oPC, "wager", 0);
|
|
SetLocalInt(oPC, "team_bet", 0);
|
|
SetLocalInt(oPC, "champside", 0);
|
|
}
|
|
|
|
//SetLocalInt(oPC, "npc_duel", 1);
|
|
SetLocalInt(oPC, "npc_duel2", 1);
|
|
// Set Holy War mode ON
|
|
|
|
SetLocalInt(oMod, "hwar_on", 1);
|
|
SetLocalInt(oMod, "war_won", 0);
|
|
SetLocalInt(oPC, "champ_won", 0);
|
|
SetLocalInt(oMod, "iFireFlag", 0);
|
|
SetLocalInt(oMod, "turn_flag", 0);
|
|
SetLocalInt(oMod, "iDfire", 1);
|
|
|
|
// Flag all monsters as being in the arena
|
|
|
|
SetLocalInt(oMod, "sw_hw", 1);
|
|
SetLocalInt(oMod, "sw_dr", 1);
|
|
SetLocalInt(oMod, "sw_bl", 1);
|
|
SetLocalInt(oMod, "sw_pf", 1);
|
|
SetLocalInt(oMod, "sw_df", 1);
|
|
SetLocalInt(oMod, "sw_pm", 1);
|
|
SetLocalInt(oMod, "sw_bm", 1);
|
|
SetLocalInt(oMod, "sw_lm", 1);
|
|
SetLocalInt(oMod, "sw_ll", 1);
|
|
SetLocalInt(oMod, "sw_xx", 1);
|
|
|
|
// Reset scoreboard death status
|
|
|
|
SetLocalString(oMod, "notime4_x", "");
|
|
SetLocalString(oMod, "death_x", "");
|
|
SetLocalString(oMod, "notime3_x", "");
|
|
SetLocalString(oMod, "mistress2_x", "");
|
|
SetLocalString(oMod, "zep_marilithb001_x", "");
|
|
SetLocalString(oMod, "bard2_x", "");
|
|
SetLocalString(oMod, "zep_halfdrafn001_x", "");
|
|
SetLocalString(oMod, "zep_pitfiend001_x", "");
|
|
SetLocalString(oMod, "dopple_x", "");
|
|
SetLocalString(oMod, "zep_balrog001_x", "");
|
|
SetLocalString(oMod, "dragon1_x", "");
|
|
SetLocalString(oMod, "darcher_x", "");
|
|
|
|
SetLocalString(oMod, "notime2_x", "");
|
|
SetLocalString(oMod, "notime1_x", "");
|
|
SetLocalString(oMod, "boss002_x", "");
|
|
SetLocalString(oMod, "beli2_x", "");
|
|
SetLocalString(oMod, "pwar3_x", "");
|
|
SetLocalString(oMod, "hdrag2_x", "");
|
|
SetLocalString(oMod, "pfiend2_x", "");
|
|
SetLocalString(oMod, "horod2_x", "");
|
|
SetLocalString(oMod, "div2_x", "");
|
|
SetLocalString(oMod, "dragon2_x", "");
|
|
|
|
// Reset match champion flag and kill comparative
|
|
|
|
SetLocalInt(oMod, "notime4_ch", 0);
|
|
SetLocalInt(oMod, "death_ch", 0);
|
|
SetLocalInt(oMod, "notime3_ch", 0);
|
|
SetLocalInt(oMod, "mistress2_ch", 0);
|
|
SetLocalInt(oMod, "zep_marilithb001_ch", 0);
|
|
SetLocalInt(oMod, "bard2_ch", 0);
|
|
SetLocalInt(oMod, "zep_halfdrafn001_ch", 0);
|
|
SetLocalInt(oMod, "zep_pitfiend001_ch", 0);
|
|
SetLocalInt(oMod, "dopple_ch", 0);
|
|
SetLocalInt(oMod, "zep_balrog001_ch", 0);
|
|
SetLocalInt(oMod, "dragon1_ch", 0);
|
|
SetLocalInt(oMod, "darcher_ch", 0);
|
|
|
|
SetLocalInt(oMod, "notime2_ch", 0);
|
|
SetLocalInt(oMod, "notime1_ch", 0);
|
|
SetLocalInt(oMod, "boss002_ch", 0);
|
|
SetLocalInt(oMod, "beli2_ch", 0);
|
|
SetLocalInt(oMod, "pwar3_ch", 0);
|
|
SetLocalInt(oMod, "hdrag2_ch", 0);
|
|
SetLocalInt(oMod, "pfiend2_ch", 0);
|
|
SetLocalInt(oMod, "horod2_ch", 0);
|
|
SetLocalInt(oMod, "div2_ch", 0);
|
|
SetLocalInt(oMod, "dragon2_ch", 0);
|
|
|
|
SetLocalInt(oMod, "notime4_HWk", 0);
|
|
SetLocalInt(oMod, "death_HWk", 0);
|
|
SetLocalInt(oMod, "notime3_HWk", 0);
|
|
SetLocalInt(oMod, "mistress2_HWk", 0);
|
|
SetLocalInt(oMod, "zep_marilithb001_HWk", 0);
|
|
SetLocalInt(oMod, "bard2_HWk", 0);
|
|
SetLocalInt(oMod, "zep_halfdrafn001_HWk", 0);
|
|
SetLocalInt(oMod, "zep_pitfiend001_HWk", 0);
|
|
SetLocalInt(oMod, "dopple_HWk", 0);
|
|
SetLocalInt(oMod, "zep_balrog001_HWk", 0);
|
|
SetLocalInt(oMod, "dragon1_HWk", 0);
|
|
SetLocalInt(oMod, "darcher_HWk", 0);
|
|
|
|
SetLocalInt(oMod, "notime2_HWk", 0);
|
|
SetLocalInt(oMod, "notime1_HWk", 0);
|
|
SetLocalInt(oMod, "boss002_HWk", 0);
|
|
SetLocalInt(oMod, "beli2_HWk", 0);
|
|
SetLocalInt(oMod, "pwar3_HWk", 0);
|
|
SetLocalInt(oMod, "hdrag2_HWk", 0);
|
|
SetLocalInt(oMod, "pfiend2_HWk", 0);
|
|
SetLocalInt(oMod, "horod2_HWk", 0);
|
|
SetLocalInt(oMod, "div2_HWk", 0);
|
|
SetLocalInt(oMod, "dragon2_HWk", 0);
|
|
|
|
// Reset Match Champ stats
|
|
|
|
SetLocalString(oMod, "sChamp", "");
|
|
SetLocalInt(oMod, "champ_count", 0);
|
|
SetLocalInt(oMod, "MostKills", 0);
|
|
SetLocalInt(oPC, "iHappy", 0);
|
|
|
|
// Reset team casualties
|
|
|
|
SetLocalInt(oMod, "hell_cas", 0);
|
|
SetLocalInt(oMod, "heav_cas", 0);
|
|
|
|
// Reset exploit flag
|
|
|
|
SetLocalInt(oMod, "xcheck", 0);
|
|
SetLocalInt(oMod, "iDfire", 0);
|
|
|
|
// Reset disabled options in spawner convo
|
|
|
|
SetLocalInt(oMod, "scre_state", 0);
|
|
SetLocalInt(oMod, "scre2_state", 0);
|
|
SetLocalInt(oMod, "scre_state3", 0);
|
|
SetLocalInt(oMod, "scre_state4", 0);
|
|
SetLocalInt(oMod, "scre_state5", 0);
|
|
|
|
// reset the player allegiance flags
|
|
|
|
SetLocalInt(oMod, "turn_flag", 0);
|
|
oPC2 = GetFirstPC();
|
|
while (GetIsObjectValid(oPC2))
|
|
{
|
|
sPRes2 = GetResRef(oPC);
|
|
sPRes2+="_HWd";
|
|
sPRes = GetResRef(oPC);
|
|
sPRes+="_HWk";
|
|
SetLocalInt(oMod, sPRes, 0);
|
|
SetLocalInt(oMod, sPRes2, 0);
|
|
SetLocalInt(oPC2, "pc_HWdam", 0);
|
|
SetLocalInt(oPC2, "pc_HWhit", 0);
|
|
SetLocalInt(oPC2, "pc_side", 0);
|
|
SetLocalInt(oPC2, "join_switch", 0);
|
|
SetLocalInt(oPC2, "champ_won", 0);
|
|
RemoveJournalQuestEntry("war_hell", oPC2, TRUE, TRUE);
|
|
RemoveJournalQuestEntry("war_heav", oPC2, TRUE, TRUE);
|
|
SetLocalInt(oPC2, "pc_HWswing", 0);
|
|
oPC2 = GetNextPC();
|
|
}
|
|
|
|
// Reset war victory journal entry
|
|
|
|
RemoveJournalQuestEntry("war_hell", oPC, TRUE, TRUE);
|
|
RemoveJournalQuestEntry("war_heav", oPC, TRUE, TRUE);
|
|
|
|
// Lock arena gate
|
|
|
|
oTarget = GetObjectByTag("arena_gate");
|
|
SetLocked(oTarget, TRUE);
|
|
|
|
// Move PC out of the battle
|
|
|
|
oTarget = GetWaypointByTag("safe_wp");
|
|
lTarget = GetLocation(oTarget);
|
|
AssignCommand(oPC, ClearAllActions());
|
|
AssignCommand(oPC, ActionJumpToLocation(lTarget));
|
|
CastPC(0.2, SPELL_ETHEREALNESS, oPC);
|
|
|
|
|
|
// Set up spawnpoints
|
|
|
|
oTarget2 = GetWaypointByTag("monster_wp2");
|
|
lTarget = GetLocation(oTarget);
|
|
bTarget = GetLocation(oTarget2);
|
|
oTarget = GetWaypointByTag("monster_wp2");
|
|
lTarget = GetLocation(oTarget);
|
|
|
|
|
|
int pChampion = GetLocalInt(oPC, "pChampion");
|
|
|
|
switch (pChampion)
|
|
{
|
|
case 1:{FloatingTextStringOnCreature("The impossible happened", oPC);}break;
|
|
case 2:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "dragon1", bTarget);
|
|
;iW1=1;}break;
|
|
case 3:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_halfdrafn001", lTarget);
|
|
;iW2=1;}break;
|
|
case 4:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_marilithb001", lTarget);
|
|
;iW3=1;}break;
|
|
case 5:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "bard2", lTarget);
|
|
;iW4=1;}break;
|
|
case 6:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_pitfiend001", lTarget);
|
|
;iW5=1;}break;
|
|
case 7:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "zep_balrog001", lTarget);
|
|
;iW6=1;}break;
|
|
case 8:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "dopple", lTarget);
|
|
;iW7=1;}break;
|
|
case 9:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "mistress2", bTarget);
|
|
;iW8=1;}break;
|
|
case 10:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "notime3", lTarget);
|
|
;iW9=1;}break;
|
|
case 11:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "notime4", lTarget);
|
|
;iW10=1;}break;
|
|
case 12:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "darcher", lTarget);
|
|
;iW10=1;}break;
|
|
case 13:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "death", lTarget);
|
|
;iW12=1;}break;
|
|
case 14:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "notime2", bTarget);
|
|
;iL1=1;}break;
|
|
case 15:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "div2", lTarget);
|
|
;iL2=1;}break;
|
|
case 16:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "horod2", bTarget);
|
|
;iL3=1;}break;
|
|
case 17:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "pfiend2", bTarget);
|
|
;iL4=1;}break;
|
|
case 18:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "hdrag2", bTarget);
|
|
;iL5=1;}break;
|
|
case 19:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "pwar3", bTarget);
|
|
;iL6=1;}break;
|
|
case 20:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "beli2", bTarget);
|
|
;iL7=1;}break;
|
|
case 21:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "boss002", bTarget);
|
|
;iL8=1;}break;
|
|
case 22:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "notime1", bTarget);
|
|
;iL9=1;}break;
|
|
case 23:{oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "dragon2", bTarget);
|
|
;iL10=1;}break;
|
|
}
|
|
|
|
|
|
|
|
// Set up spawnpoints
|
|
|
|
oTarget2 = GetWaypointByTag("monster_wp");
|
|
lTarget = GetLocation(oTarget);
|
|
bTarget = GetLocation(oTarget2);
|
|
oTarget = GetWaypointByTag("monster_wp");
|
|
lTarget = GetLocation(oTarget);
|
|
|
|
|
|
|
|
// Spawn Dark team
|
|
|
|
iDice = d20();
|
|
iDice+= d3();
|
|
if (iDice==pChampion){++iDice;}
|
|
if (iDice>23){iDice=2;}
|
|
|
|
switch (iDice)
|
|
{
|
|
case 1:{FloatingTextStringOnCreature("The impossible happened", oPC);}break;
|
|
case 2:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "dragon1", bTarget);
|
|
;iW1=1;}break;
|
|
case 3:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "zep_halfdrafn001", lTarget);
|
|
;iW2=1;}break;
|
|
case 4:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "zep_marilithb001", lTarget);
|
|
;iW3=1;}break;
|
|
case 5:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "bard2", lTarget);
|
|
;iW4=1;}break;
|
|
case 6:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "zep_pitfiend001", lTarget);
|
|
;iW5=1;}break;
|
|
case 7:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "zep_balrog001", lTarget);
|
|
;iW6=1;}break;
|
|
case 8:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "dopple", lTarget);
|
|
;iW7=1;}break;
|
|
case 9:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "mistress2", bTarget);
|
|
;iW8=1;}break;
|
|
case 10:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "notime3", lTarget);
|
|
;iW9=1;}break;
|
|
case 11:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "notime4", lTarget);
|
|
;iW10=1;}break;
|
|
case 12:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "darcher", lTarget);
|
|
;iW10=1;}break;
|
|
case 13:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "death", lTarget);
|
|
;iW12=1;}break;
|
|
case 14:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "notime2", bTarget);
|
|
;iL1=1;}break;
|
|
case 15:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "div2", lTarget);
|
|
;iL2=1;}break;
|
|
case 16:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "horod2", bTarget);
|
|
;iL3=1;}break;
|
|
case 17:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "pfiend2", bTarget);
|
|
;iL4=1;}break;
|
|
case 18:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "hdrag2", bTarget);
|
|
;iL5=1;}break;
|
|
case 19:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "pwar3", bTarget);
|
|
;iL6=1;}break;
|
|
case 20:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "beli2", bTarget);
|
|
;iL7=1;}break;
|
|
case 21:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "boss002", bTarget);
|
|
;iL8=1;}break;
|
|
case 22:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "notime1", bTarget);
|
|
;iL9=1;}break;
|
|
case 23:{oSpawn2 = CreateObject(OBJECT_TYPE_CREATURE, "dragon2", bTarget);
|
|
;iL10=1;}break;
|
|
}
|
|
DelayCommand(1.0, SetAILevel(oSpawn, AI_LEVEL_HIGH));
|
|
DelayCommand(1.0, SetAILevel(oSpawn2, AI_LEVEL_HIGH));
|
|
|
|
|
|
|
|
DelayCommand(1.5, ChangeToStandardFaction(oSpawn, STANDARD_FACTION_COMMONER));
|
|
DelayCommand(1.5, AssignCommand(oSpawn, SetIsEnemy(oSpawn2)));
|
|
DelayCommand(1.5, AssignCommand(oSpawn2, SetIsEnemy(oPC)));
|
|
DelayCommand(1.5, AssignCommand(oSpawn2, SetIsEnemy(oSpawn)));
|
|
|
|
|
|
// Spawn Effect
|
|
|
|
nInt = GetObjectType(oTarget);
|
|
if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), oTarget));
|
|
else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), GetLocation(oTarget)));
|
|
|
|
}
|
|
|