Misc cleanups

This commit is contained in:
hondacrx
2021-03-04 11:47:12 -05:00
parent 102034a891
commit 64bafe8d73
4 changed files with 14 additions and 13 deletions
+9 -10
View File
@@ -1412,27 +1412,26 @@ namespace Game.Entities
return null;
}
public TempSummon SummonCreature(uint id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TempSummonType.ManualDespawn, uint despwtime = 0, bool visibleBySummonerOnly = false)
public TempSummon SummonCreature(uint entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TempSummonType.ManualDespawn, uint despawnTime = 0, bool visibleBySummonerOnly = false)
{
if (x == 0.0f && y == 0.0f && z == 0.0f)
{
GetClosePoint(out x, out y, out z, GetCombatReach());
ang = GetOrientation();
}
Position pos = new Position();
pos.Relocate(x, y, z, ang);
return SummonCreature(id, pos, spwtype, despwtime, 0, visibleBySummonerOnly);
if (o == 0.0f)
o = GetOrientation();
return SummonCreature(entry, new Position(x, y, z, o), despawnType, despawnTime, 0, visibleBySummonerOnly);
}
public TempSummon SummonCreature(uint entry, Position pos, TempSummonType spwtype = TempSummonType.ManualDespawn, uint duration = 0, uint vehId = 0, bool visibleBySummonerOnly = false)
public TempSummon SummonCreature(uint entry, Position pos, TempSummonType despawnType = TempSummonType.ManualDespawn, uint despawnTime = 0, uint vehId = 0, bool visibleBySummonerOnly = false)
{
Map map = GetMap();
if (map != null)
{
TempSummon summon = map.SummonCreature(entry, pos, null, duration, ToUnit(), 0, vehId, visibleBySummonerOnly);
TempSummon summon = map.SummonCreature(entry, pos, null, despawnTime, ToUnit(), 0, vehId, visibleBySummonerOnly);
if (summon != null)
{
summon.SetTempSummonType(spwtype);
summon.SetTempSummonType(despawnType);
return summon;
}
}
+1 -1
View File
@@ -1112,7 +1112,7 @@ namespace Game.Entities
damage /= (uint)victim.GetHealthMultiplierForTarget(this);
if (victim.GetTypeId() != TypeId.Player && !victim.IsControlledByPlayer() || victim.IsVehicle())
if (victim.GetTypeId() != TypeId.Player && (!victim.IsControlledByPlayer() || victim.IsVehicle()))
{
if (!victim.ToCreature().HasLootRecipient())
victim.ToCreature().SetLootRecipient(this);
+2 -2
View File
@@ -3543,14 +3543,14 @@ namespace Game.Spells
owner.ToPlayer().SendPacket(petCastFailed);
}
public static void SendCastResult(Player caster, SpellInfo spellInfo, Networking.Packets.SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError = SpellCustomErrors.None, uint? param1 = null, uint? param2 = null)
public static void SendCastResult(Player caster, SpellInfo spellInfo, SpellCastVisual spellVisual, ObjectGuid castCount, SpellCastResult result, SpellCustomErrors customError = SpellCustomErrors.None, uint? param1 = null, uint? param2 = null)
{
if (result == SpellCastResult.SpellCastOk)
return;
CastFailed packet = new CastFailed();
packet.Visual = spellVisual;
FillSpellCastFailedArgs(packet, cast_count, spellInfo, result, customError, param1, param2, caster);
FillSpellCastFailedArgs(packet, castCount, spellInfo, result, customError, param1, param2, caster);
caster.SendPacket(packet);
}
+2
View File
@@ -1954,9 +1954,11 @@ namespace Game.Entities
uint oldMSTime = Time.GetMSTime();
mSpellAreaMap.Clear(); // need for reload case
mSpellAreaForAreaMap.Clear();
mSpellAreaForQuestMap.Clear();
mSpellAreaForQuestEndMap.Clear();
mSpellAreaForAuraMap.Clear();
mSpellAreaForQuestAreaMap.Clear();
// 0 1 2 3 4 5 6 7 8 9
SQLResult result = DB.World.Query("SELECT spell, area, quest_start, quest_start_status, quest_end_status, quest_end, aura_spell, racemask, gender, flags FROM spell_area");