Core/Misc: Added helper function Unit::SetFullPower * Also renamed Unit::getPowerType and Unit::setPowerType to follow style guidelines

This commit is contained in:
hondacrx
2018-01-03 13:57:16 -05:00
parent 8b43b08f6f
commit 9d3e87fd87
30 changed files with 106 additions and 124 deletions
@@ -57,8 +57,8 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
{
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
{
//Summon Astral Flare
Creature AstralFlare = DoSpawnCreature(17096, RandomHelper.Rand32() % 37, RandomHelper.Rand32() % 37, 0, 0, TempSummonType.TimedDespawnOOC, 5000);
//Summon Astral Flare
Creature AstralFlare = DoSpawnCreature(17096, RandomHelper.Rand32() % 37, RandomHelper.Rand32() % 37, 0, 0, TempSummonType.TimedDespawnOOC, 5000);
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
if (AstralFlare && target)
@@ -67,23 +67,23 @@ namespace Scripts.EasternKingdoms.Karazhan.Curator
AstralFlare.GetAI().AttackStart(target);
}
//Reduce Mana by 10% of max health
int mana = me.GetMaxPower(PowerType.Mana);
//Reduce Mana by 10% of max health
int mana = me.GetMaxPower(PowerType.Mana);
if (mana != 0)
{
mana /= 10;
me.ModifyPower(PowerType.Mana, -mana);
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
{
Talk(TextIds.SayEvocate);
me.InterruptNonMeleeSpells(false);
DoCast(me, SpellIds.Evocation);
_scheduler.DelayAll(TimeSpan.FromSeconds(20));
//Evocating = true;
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
return;
//Evocating = true;
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
return;
}
else
{
@@ -421,7 +421,7 @@ namespace Scripts.EasternKingdoms.Karazhan.Moroes
{
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
if (target)
if (target.getPowerType() == PowerType.Mana)
if (target.GetPowerType() == PowerType.Mana)
DoCast(target, SpellIds.Manaburn);
ManaBurn_Timer = 5000; // 3 sec cast
}