Some refactoring of code. and some cleanups

This commit is contained in:
hondacrx
2019-09-21 12:11:16 -04:00
parent 7c405230cc
commit 35c06c09fd
214 changed files with 1235 additions and 1341 deletions
+4 -4
View File
@@ -37,7 +37,7 @@ namespace Scripts.Pets
_isViper = Info.Entry == NpcViper ? true : false;
me.SetMaxHealth((uint)(107 * (me.getLevel() - 40) * 0.025f));
me.SetMaxHealth((uint)(107 * (me.GetLevel() - 40) * 0.025f));
// Add delta to make them not all hit the same time
uint delta = (RandomHelper.Rand32() % 7) * 100;
me.SetBaseAttackTime(WeaponAttackType.BaseAttack, Info.BaseAttackTime + delta);
@@ -48,8 +48,8 @@ namespace Scripts.Pets
{
Unit owner = me.ToTempSummon().GetSummoner();
if (owner)
if (owner.getAttackerForHelper())
AttackStart(owner.getAttackerForHelper());
if (owner.GetAttackerForHelper())
AttackStart(owner.GetAttackerForHelper());
}
if (!_isViper)
@@ -69,7 +69,7 @@ namespace Scripts.Pets
{
if ((RandomHelper.Rand32() % 5) == 0)
{
me.setAttackTimer(WeaponAttackType.BaseAttack, (RandomHelper.Rand32() % 10) * 100);
me.SetAttackTimer(WeaponAttackType.BaseAttack, (RandomHelper.Rand32() % 10) * 100);
_spellTimer = (RandomHelper.Rand32() % 10) * 100;
AttackStart(who);
}
+1 -1
View File
@@ -169,7 +169,7 @@ namespace Scripts.Pets
if (!owner)
return;
Unit target = owner.getAttackerForHelper();
Unit target = owner.GetAttackerForHelper();
_events.Update(diff);