Fixed Vardison's Infinite Minion Summoning

This commit is contained in:
Robert Fritzen 2015-07-21 15:06:46 -05:00
parent 9add24b42e
commit 3d2152c5bb

View file

@ -503,11 +503,11 @@ function ShadowOrb::onDestroyed(%this, %obj, %prevState) {
if (%obj.isRemoved) { if (%obj.isRemoved) {
return; return;
} }
if(isObject($TWM2::VardisonManager.OrbSFX)) {
$TWM2::VardisonManager.OrbSFX.schedule(500, "delete");
}
%obj.isRemoved = true; %obj.isRemoved = true;
Parent::onDestroyed(%this, %obj, %prevState); Parent::onDestroyed(%this, %obj, %prevState);
if(isObject(%orb.sfx)) {
%obj.sfx.schedule(500, "delete");
}
%obj.schedule(500, "delete"); %obj.schedule(500, "delete");
$TWM2::VardisonManager.orbDestroyed(); $TWM2::VardisonManager.orbDestroyed();
} }
@ -725,15 +725,17 @@ function VardisonThink(%Boss) {
//If we're not ready to dish out an attack, let's check what else we need to do... //If we're not ready to dish out an attack, let's check what else we need to do...
// Are we low on minions? // Are we low on minions?
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison1_MaxMinions[%dLevel]) { if($TWM2::VardisonManager.minionCount < $TWM2::Vardison1_MaxMinions[%dLevel]) {
//How many players am I up against? if(%Boss.canSummonMinions) {
%pCount = $HostGamePlayerCount; //How many players am I up against?
//How low is my health? %pCount = $HostGamePlayerCount;
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100); //How low is my health?
%BackwardsHP = 100 - %percentage; %percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%chance = %BackwardsHP * %pCount * (%Boss.canSummonMinions ? 1 : 0); %BackwardsHP = 100 - %percentage;
//Using our test factor, determine if I need minions. %chance = %BackwardsHP * %pCount;
if(%chance <= getRandom(1, 100)) { //Using our test factor, determine if I need minions.
%needMinions = true; if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
} }
} }
//Do I need to be moving towards the enemy? //Do I need to be moving towards the enemy?
@ -759,15 +761,17 @@ function VardisonThink(%Boss) {
//If we're not ready to dish out an attack, let's check what else we need to do... //If we're not ready to dish out an attack, let's check what else we need to do...
// Are we low on minions? // Are we low on minions?
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison2_MaxMinions[%dLevel]) { if($TWM2::VardisonManager.minionCount < $TWM2::Vardison2_MaxMinions[%dLevel]) {
//How many players am I up against? if(%Boss.canSummonMinions) {
%pCount = $HostGamePlayerCount; //How many players am I up against?
//How low is my health? %pCount = $HostGamePlayerCount;
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100); //How low is my health?
%BackwardsHP = 100 - %percentage; %percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%chance = %BackwardsHP * %pCount * (%Boss.canSummonMinions ? 1 : 0); %BackwardsHP = 100 - %percentage;
//Using our test factor, determine if I need minions. %chance = %BackwardsHP * %pCount;
if(%chance <= getRandom(1, 100)) { //Using our test factor, determine if I need minions.
%needMinions = true; if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
} }
} }
//Phase 2 is stationary unless you're on Hard or WTF mode //Phase 2 is stationary unless you're on Hard or WTF mode
@ -800,16 +804,18 @@ function VardisonThink(%Boss) {
else { else {
//If we're not ready to dish out an attack, let's check what else we need to do... //If we're not ready to dish out an attack, let's check what else we need to do...
// Are we low on minions? // Are we low on minions?
if($TWM2::VardisonManager.minionCount < $TWM2::Vardison3_MaxMinions[%dLevel]) { if($TWM2::VardisonManager.minionCount < $TWM2::Vardison3_MaxMinions[%dLevel] && %boss.canSummonMinions) {
//How many players am I up against? if(%Boss.canSummonMinions) {
%pCount = $HostGamePlayerCount; //How many players am I up against?
//How low is my health? %pCount = $HostGamePlayerCount;
%percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100); //How low is my health?
%BackwardsHP = 100 - %percentage; %percentage = mCeil((mFloor(%boss.getDamageLeft()*100) / mFloor(%boss.getMaxDamage()*100)) * 100);
%chance = %BackwardsHP * %pCount * (%Boss.canSummonMinions ? 1 : 0); %BackwardsHP = 100 - %percentage;
//Using our test factor, determine if I need minions. %chance = %BackwardsHP * %pCount;
if(%chance <= getRandom(1, 100)) { //Using our test factor, determine if I need minions.
%needMinions = true; if(%chance <= getRandom(1, 100)) {
%needMinions = true;
}
} }
} }
//Do I need to be moving towards the enemy? //Do I need to be moving towards the enemy?
@ -980,24 +986,27 @@ function VardisonSummonOrb(%Boss) {
} }
function VardisonSummonMinions(%Boss) { function VardisonSummonMinions(%Boss) {
%currentCount = $TWM2::VardisonManager.minionCount; if(%Boss.canSummonMinions) {
%dLevel = $TWM2::VardisonDifficulty; %currentCount = $TWM2::VardisonManager.minionCount;
%max = 0; %dLevel = $TWM2::VardisonDifficulty;
switch(%Boss.phase) { %max = 0;
case 1: switch(%Boss.phase) {
%max = $TWM2::Vardison1_MaxMinions[%dLevel]; case 1:
case 2: %max = $TWM2::Vardison1_MaxMinions[%dLevel];
%max = $TWM2::Vardison2_MaxMinions[%dLevel]; case 2:
case 3: %max = $TWM2::Vardison2_MaxMinions[%dLevel];
%max = $TWM2::Vardison3_MaxMinions[%dLevel]; case 3:
%max = $TWM2::Vardison3_MaxMinions[%dLevel];
}
%factor = %dLevel / 4;
%Low = 1;
%High = mCeil((%max - %currentCount) * %factor);
for(%i = 0; %i < getRandom(%Low, %High); %i++) {
VardisonDoMinionSummon(%Boss);
}
%Boss.canSummonMinions = false;
$TWM2::VardisonManager.schedule($TWM2::Vardison_MinionCooldown[%dLevel] * 1000, cooldownOff, %Boss, "minions");
} }
%Low = 1;
%High = %max - %currentCount;
for(%i = 0; %i < getRandom(%Low, %High); %i++) {
VardisonDoMinionSummon(%Boss);
}
%Boss.canSummonMinions = false;
$TWM2::VardisonManager.schedule($TWM2::Vardison_MinionCooldown[%dLevel] * 1000, cooldownOff, %Boss, "minions");
} }
function VardisonDoMinionSummon(%Boss) { function VardisonDoMinionSummon(%Boss) {
@ -1642,12 +1651,12 @@ function VardisonManager::summonOrb(%this, %boss) {
setTargetName(%orb.target, addtaggedstring("\c7Shadow Rift")); setTargetName(%orb.target, addtaggedstring("\c7Shadow Rift"));
//SFX //SFX
%orb.sfx = new ParticleEmissionDummy(){ $TWM2::VardisonManager.OrbSFX = new ParticleEmissionDummy(){
position = %orb.getPosition(); position = %orb.getPosition();
dataBlock = "defaultEmissionDummy"; dataBlock = "defaultEmissionDummy";
emitter = "ShadowOrbEmitter"; emitter = "ShadowOrbEmitter";
}; };
MissionCleanup.add(%orb.sfx); MissionCleanup.add($TWM2::VardisonManager.OrbSFX);
// //
%this.orbKillSched = %this.schedule($TWM2::Vardison_OrbKillTime, orbKill, %boss, %orb); %this.orbKillSched = %this.schedule($TWM2::Vardison_OrbKillTime, orbKill, %boss, %orb);
} }
@ -1657,10 +1666,11 @@ function VardisonManager::orbKill(%this, %boss, %orb) {
%cl = ClientGroup.getObject(%i); %cl = ClientGroup.getObject(%i);
if(isObject(%cl.player) && %cl.player.getState() !$= "dead") { if(isObject(%cl.player) && %cl.player.getState() !$= "dead") {
//Bye Bye :) //Bye Bye :)
%cl.player.rapierShield = false;
%cl.player.setInvincible(false); %cl.player.setInvincible(false);
%cl.player.damage(%boss, %cl.player.getPosition(), 10000, $DamageType::ShadowOrb); %cl.player.damage(%boss, %cl.player.getPosition(), 10000, $DamageType::ShadowOrb);
%cl.player.blowup(); %cl.player.blowup();
MessageAll('msgDeath', "\c2"@%cl.player.namebase@" has been annihilated by the Shadow Rift."); MessageAll('msgDeath', "\c2"@%cl.namebase@" has been annihilated by the Shadow Rift.");
//If Vardison Restores HP from rift kills, do that now :P //If Vardison Restores HP from rift kills, do that now :P
if($TWM2::Vardison_OrbRegenHP[$TWM2::VardisonDifficulty]) { if($TWM2::Vardison_OrbRegenHP[$TWM2::VardisonDifficulty]) {
%boss.setDamageLevel(%boss.getDamageLevel() - 0.35); %boss.setDamageLevel(%boss.getDamageLevel() - 0.35);
@ -1674,8 +1684,8 @@ function VardisonManager::orbKill(%this, %boss, %orb) {
}; };
%wipeEmit.schedule(500, "delete"); %wipeEmit.schedule(500, "delete");
//Delete the orb & it's effects //Delete the orb & it's effects
if(isObject(%orb.sfx)) { if(isObject($TWM2::VardisonManager.OrbSFX)) {
%obj.sfx.schedule(500, "delete"); $TWM2::VardisonManager.OrbSFX.schedule(500, "delete");
} }
%orb.schedule(500, "delete"); %orb.schedule(500, "delete");
if(isObject(%this.orbFire)) { if(isObject(%this.orbFire)) {