Misc cleanups
This commit is contained in:
@@ -1412,27 +1412,26 @@ namespace Game.Entities
|
|||||||
return null;
|
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)
|
if (x == 0.0f && y == 0.0f && z == 0.0f)
|
||||||
{
|
|
||||||
GetClosePoint(out x, out y, out z, GetCombatReach());
|
GetClosePoint(out x, out y, out z, GetCombatReach());
|
||||||
ang = GetOrientation();
|
|
||||||
}
|
if (o == 0.0f)
|
||||||
Position pos = new Position();
|
o = GetOrientation();
|
||||||
pos.Relocate(x, y, z, ang);
|
|
||||||
return SummonCreature(id, pos, spwtype, despwtime, 0, visibleBySummonerOnly);
|
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();
|
Map map = GetMap();
|
||||||
if (map != null)
|
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)
|
if (summon != null)
|
||||||
{
|
{
|
||||||
summon.SetTempSummonType(spwtype);
|
summon.SetTempSummonType(despawnType);
|
||||||
return summon;
|
return summon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1112,7 +1112,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
damage /= (uint)victim.GetHealthMultiplierForTarget(this);
|
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())
|
if (!victim.ToCreature().HasLootRecipient())
|
||||||
victim.ToCreature().SetLootRecipient(this);
|
victim.ToCreature().SetLootRecipient(this);
|
||||||
|
|||||||
@@ -3543,14 +3543,14 @@ namespace Game.Spells
|
|||||||
owner.ToPlayer().SendPacket(petCastFailed);
|
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)
|
if (result == SpellCastResult.SpellCastOk)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CastFailed packet = new CastFailed();
|
CastFailed packet = new CastFailed();
|
||||||
packet.Visual = spellVisual;
|
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);
|
caster.SendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1954,9 +1954,11 @@ namespace Game.Entities
|
|||||||
uint oldMSTime = Time.GetMSTime();
|
uint oldMSTime = Time.GetMSTime();
|
||||||
|
|
||||||
mSpellAreaMap.Clear(); // need for reload case
|
mSpellAreaMap.Clear(); // need for reload case
|
||||||
|
mSpellAreaForAreaMap.Clear();
|
||||||
mSpellAreaForQuestMap.Clear();
|
mSpellAreaForQuestMap.Clear();
|
||||||
mSpellAreaForQuestEndMap.Clear();
|
mSpellAreaForQuestEndMap.Clear();
|
||||||
mSpellAreaForAuraMap.Clear();
|
mSpellAreaForAuraMap.Clear();
|
||||||
|
mSpellAreaForQuestAreaMap.Clear();
|
||||||
|
|
||||||
// 0 1 2 3 4 5 6 7 8 9
|
// 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");
|
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user