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
+1 -1
View File
@@ -301,7 +301,7 @@ namespace Scripts.World
public override bool OnCheck(Player player, Unit target)
{
return target && player.isHonorOrXPTarget(target);
return target && player.IsHonorOrXPTarget(target);
}
}
}
+1 -1
View File
@@ -106,7 +106,7 @@ namespace Scripts.World
{
GameObject go = player.FindNearestGameObject(AreaTriggerConst.GoCoilfangWaterfall, 35.0f);
if (go)
if (go.getLootState() == LootState.Ready)
if (go.GetLootState() == LootState.Ready)
go.UseDoorOrButton();
return false;
+3 -3
View File
@@ -61,7 +61,7 @@ namespace Scripts.World
{
if (me.GetEntry() == CreatureIds.CenarionHoldIndantry)
Talk(GuardsConst.SaySilAggro, who);
SpellInfo spell = me.reachWithSpellAttack(who);
SpellInfo spell = me.ReachWithSpellAttack(who);
if (spell != null)
DoCast(who, spell.Id);
}
@@ -103,7 +103,7 @@ namespace Scripts.World
return;
// Make sure our attack is ready and we arn't currently casting
if (me.isAttackReady() && !me.IsNonMeleeSpellCast(false))
if (me.IsAttackReady() && !me.IsNonMeleeSpellCast(false))
{
//If we are within range melee the target
if (me.IsWithinMeleeRange(me.GetVictim()))
@@ -136,7 +136,7 @@ namespace Scripts.World
else
me.AttackerStateUpdate(me.GetVictim());
me.resetAttackTimer();
me.ResetAttackTimer();
}
}
else
+1 -1
View File
@@ -370,7 +370,7 @@ namespace Scripts.World
public override bool OnCastItemCombatSpell(Player player, Unit victim, SpellInfo spellInfo, Item item)
{
// spell proc chance gets severely reduced on victims > 60 (formula unknown)
if (victim.getLevel() > 60)
if (victim.GetLevel() > 60)
{
// gives ~0.1% proc chance at lvl 70
float lvlPenaltyFactor = 9.93f;
+6 -6
View File
@@ -950,7 +950,7 @@ namespace Scripts.World.NpcSpecial
{
Creature patient = ObjectAccessor.GetCreature(me, guid);
if (patient)
patient.setDeathState(DeathState.JustDied);
patient.SetDeathState(DeathState.JustDied);
}
}
@@ -1156,7 +1156,7 @@ namespace Scripts.World.NpcSpecial
{
me.RemoveUnitFlag(UnitFlags.InCombat);
me.AddUnitFlag(UnitFlags.NotSelectable);
me.setDeathState(DeathState.JustDied);
me.SetDeathState(DeathState.JustDied);
me.AddDynamicFlag(UnitDynFlags.Dead);
if (!DoctorGUID.IsEmpty())
@@ -1320,10 +1320,10 @@ namespace Scripts.World.NpcSpecial
if (!UpdateVictim())
return;
if (me.isAttackReady())
if (me.IsAttackReady())
{
DoCastVictim(Spells.Deathtouch, true);
me.resetAttackTimer();
me.ResetAttackTimer();
}
}
}
@@ -1501,7 +1501,7 @@ namespace Scripts.World.NpcSpecial
if (ExplosionTimer <= diff)
{
DoCast(me, Spells.TonkMineDetonate, true);
me.setDeathState(DeathState.Dead); // unsummon it
me.SetDeathState(DeathState.Dead); // unsummon it
}
else
ExplosionTimer -= diff;
@@ -1582,7 +1582,7 @@ namespace Scripts.World.NpcSpecial
{
Unit unit = Global.ObjAccessor.GetUnit(me, pair.Key);
if (unit)
unit.getHostileRefManager().deleteReference(me);
unit.GetHostileRefManager().deleteReference(me);
_damageTimes.Remove(pair.Key);
}