Core/Objects: Implemented vignettes
Port From (https://github.com/TrinityCore/TrinityCore/commit/fccf6fb72b60b08dfbe6d5fb17fba55239944fca)
This commit is contained in:
@@ -3032,6 +3032,26 @@ namespace Framework.Constants
|
|||||||
IgnoreTransport = 0x20
|
IgnoreTransport = 0x20
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum VignetteFlags
|
||||||
|
{
|
||||||
|
InfiniteAOI = 0x000001,
|
||||||
|
ShowOnMap = 0x000002,
|
||||||
|
PingMinimap = 0x000004,
|
||||||
|
TestVisibilityRules = 0x000008,
|
||||||
|
VerticalRangeIsAbsolute = 0x000010,
|
||||||
|
Unique = 0x000020,
|
||||||
|
ZoneInfiniteAOI = 0x000040,
|
||||||
|
PersistsThroughDeath = 0x000080,
|
||||||
|
|
||||||
|
DontShowOnMinimap = 0x000200,
|
||||||
|
HasTooltip = 0x000400,
|
||||||
|
|
||||||
|
AdditionalHeightReq = 0x008000, // Must be within 10 yards of vignette Z coord (hardcoded in client)
|
||||||
|
HideOnContinentMaps = 0x010000,
|
||||||
|
NoPaddingAboveUiWidgets = 0x020000
|
||||||
|
}
|
||||||
|
|
||||||
public enum WorldMapTransformsFlags
|
public enum WorldMapTransformsFlags
|
||||||
{
|
{
|
||||||
Dungeon = 0x04
|
Dungeon = 0x04
|
||||||
|
|||||||
@@ -1566,6 +1566,11 @@ namespace Framework.Database
|
|||||||
"ExitAnimKitID, VehicleEnterAnimKitID, VehicleRideAnimKitID, VehicleExitAnimKitID, CameraModeID FROM vehicle_seat" +
|
"ExitAnimKitID, VehicleEnterAnimKitID, VehicleRideAnimKitID, VehicleExitAnimKitID, CameraModeID FROM vehicle_seat" +
|
||||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||||
|
|
||||||
|
// Vignette.db2
|
||||||
|
PrepareStatement(HotfixStatements.SEL_VIGNETTE, "SELECT ID, Name, PlayerConditionID, VisibleTrackingQuestID, QuestFeedbackEffectID, Flags, MaxHeight, " +
|
||||||
|
"MinHeight, VignetteType, RewardQuestID, UiWidgetSetID FROM vignette WHERE (`VerifiedBuild` > 0) = ?");
|
||||||
|
PrepareStatement(HotfixStatements.SEL_VIGNETTE_LOCALE, "SELECT ID, Name_lang FROM vignette_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
|
||||||
|
|
||||||
// WmoAreaTable.db2
|
// WmoAreaTable.db2
|
||||||
PrepareStatement(HotfixStatements.SEL_WMO_AREA_TABLE, "SELECT AreaName, ID, WmoID, NameSetID, WmoGroupID, SoundProviderPref, SoundProviderPrefUnderwater, " +
|
PrepareStatement(HotfixStatements.SEL_WMO_AREA_TABLE, "SELECT AreaName, ID, WmoID, NameSetID, WmoGroupID, SoundProviderPref, SoundProviderPrefUnderwater, " +
|
||||||
"AmbienceID, UwAmbience, ZoneMusic, UwZoneMusic, IntroSound, UwIntroSound, AreaTableID, Flags FROM wmo_area_table" +
|
"AmbienceID, UwAmbience, ZoneMusic, UwZoneMusic, IntroSound, UwIntroSound, AreaTableID, Flags FROM wmo_area_table" +
|
||||||
@@ -2340,6 +2345,9 @@ namespace Framework.Database
|
|||||||
|
|
||||||
SEL_VEHICLE_SEAT,
|
SEL_VEHICLE_SEAT,
|
||||||
|
|
||||||
|
SEL_VIGNETTE,
|
||||||
|
SEL_VIGNETTE_LOCALE,
|
||||||
|
|
||||||
SEL_WMO_AREA_TABLE,
|
SEL_WMO_AREA_TABLE,
|
||||||
SEL_WMO_AREA_TABLE_LOCALE,
|
SEL_WMO_AREA_TABLE_LOCALE,
|
||||||
|
|
||||||
|
|||||||
@@ -377,6 +377,7 @@ namespace Game.DataStorage
|
|||||||
UnitPowerBarStorage = ReadDB2<UnitPowerBarRecord>("UnitPowerBar.db2", HotfixStatements.SEL_UNIT_POWER_BAR, HotfixStatements.SEL_UNIT_POWER_BAR_LOCALE);
|
UnitPowerBarStorage = ReadDB2<UnitPowerBarRecord>("UnitPowerBar.db2", HotfixStatements.SEL_UNIT_POWER_BAR, HotfixStatements.SEL_UNIT_POWER_BAR_LOCALE);
|
||||||
VehicleStorage = ReadDB2<VehicleRecord>("Vehicle.db2", HotfixStatements.SEL_VEHICLE);
|
VehicleStorage = ReadDB2<VehicleRecord>("Vehicle.db2", HotfixStatements.SEL_VEHICLE);
|
||||||
VehicleSeatStorage = ReadDB2<VehicleSeatRecord>("VehicleSeat.db2", HotfixStatements.SEL_VEHICLE_SEAT);
|
VehicleSeatStorage = ReadDB2<VehicleSeatRecord>("VehicleSeat.db2", HotfixStatements.SEL_VEHICLE_SEAT);
|
||||||
|
VignetteStorage = ReadDB2<VignetteRecord>("Vignette.db2", HotfixStatements.SEL_VIGNETTE, HotfixStatements.SEL_VIGNETTE_LOCALE);
|
||||||
WMOAreaTableStorage = ReadDB2<WMOAreaTableRecord>("WMOAreaTable.db2", HotfixStatements.SEL_WMO_AREA_TABLE, HotfixStatements.SEL_WMO_AREA_TABLE_LOCALE);
|
WMOAreaTableStorage = ReadDB2<WMOAreaTableRecord>("WMOAreaTable.db2", HotfixStatements.SEL_WMO_AREA_TABLE, HotfixStatements.SEL_WMO_AREA_TABLE_LOCALE);
|
||||||
WorldEffectStorage = ReadDB2<WorldEffectRecord>("WorldEffect.db2", HotfixStatements.SEL_WORLD_EFFECT);
|
WorldEffectStorage = ReadDB2<WorldEffectRecord>("WorldEffect.db2", HotfixStatements.SEL_WORLD_EFFECT);
|
||||||
WorldMapOverlayStorage = ReadDB2<WorldMapOverlayRecord>("WorldMapOverlay.db2", HotfixStatements.SEL_WORLD_MAP_OVERLAY);
|
WorldMapOverlayStorage = ReadDB2<WorldMapOverlayRecord>("WorldMapOverlay.db2", HotfixStatements.SEL_WORLD_MAP_OVERLAY);
|
||||||
@@ -813,6 +814,7 @@ namespace Game.DataStorage
|
|||||||
public static DB6Storage<UnitPowerBarRecord> UnitPowerBarStorage;
|
public static DB6Storage<UnitPowerBarRecord> UnitPowerBarStorage;
|
||||||
public static DB6Storage<VehicleRecord> VehicleStorage;
|
public static DB6Storage<VehicleRecord> VehicleStorage;
|
||||||
public static DB6Storage<VehicleSeatRecord> VehicleSeatStorage;
|
public static DB6Storage<VehicleSeatRecord> VehicleSeatStorage;
|
||||||
|
public static DB6Storage<VignetteRecord> VignetteStorage;
|
||||||
public static DB6Storage<WMOAreaTableRecord> WMOAreaTableStorage;
|
public static DB6Storage<WMOAreaTableRecord> WMOAreaTableStorage;
|
||||||
public static DB6Storage<WorldEffectRecord> WorldEffectStorage;
|
public static DB6Storage<WorldEffectRecord> WorldEffectStorage;
|
||||||
public static DB6Storage<WorldMapOverlayRecord> WorldMapOverlayStorage;
|
public static DB6Storage<WorldMapOverlayRecord> WorldMapOverlayStorage;
|
||||||
|
|||||||
@@ -120,4 +120,25 @@ namespace Game.DataStorage
|
|||||||
}
|
}
|
||||||
public bool IsEjectable() { return HasFlag(VehicleSeatFlagsB.Ejectable); }
|
public bool IsEjectable() { return HasFlag(VehicleSeatFlagsB.Ejectable); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sealed class VignetteRecord
|
||||||
|
{
|
||||||
|
public uint ID;
|
||||||
|
public LocalizedString Name;
|
||||||
|
public uint PlayerConditionID;
|
||||||
|
public uint VisibleTrackingQuestID;
|
||||||
|
public uint QuestFeedbackEffectID;
|
||||||
|
public int Flags;
|
||||||
|
public float MaxHeight;
|
||||||
|
public float MinHeight;
|
||||||
|
public sbyte VignetteType;
|
||||||
|
public int RewardQuestID;
|
||||||
|
public int UiWidgetSetID;
|
||||||
|
|
||||||
|
public VignetteFlags GetFlags() { return (VignetteFlags)Flags; }
|
||||||
|
public bool IsInfiniteAOI()
|
||||||
|
{
|
||||||
|
return GetFlags().HasFlag(VignetteFlags.InfiniteAOI | VignetteFlags.ZoneInfiniteAOI);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1724,6 +1724,13 @@ namespace Game.Entities
|
|||||||
if (CreateVehicleKit(vehId, entry, true))
|
if (CreateVehicleKit(vehId, entry, true))
|
||||||
UpdateDisplayPower();
|
UpdateDisplayPower();
|
||||||
|
|
||||||
|
if (!IsPet())
|
||||||
|
{
|
||||||
|
uint vignetteId = GetCreatureTemplate().VignetteID;
|
||||||
|
if (vignetteId != 0)
|
||||||
|
SetVignette(vignetteId);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2052,6 +2059,10 @@ namespace Game.Entities
|
|||||||
RemoveUnitFlag(UnitFlags.InCombat);
|
RemoveUnitFlag(UnitFlags.InCombat);
|
||||||
|
|
||||||
SetMeleeDamageSchool((SpellSchools)cInfo.DmgSchool);
|
SetMeleeDamageSchool((SpellSchools)cInfo.DmgSchool);
|
||||||
|
|
||||||
|
uint vignetteId = cInfo.VignetteID;
|
||||||
|
if (vignetteId != 0)
|
||||||
|
SetVignette(vignetteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializeMovementAI();
|
InitializeMovementAI();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Game.Entities
|
|||||||
public List<uint> GossipMenuIds = new();
|
public List<uint> GossipMenuIds = new();
|
||||||
public Dictionary<Difficulty, CreatureDifficulty> difficultyStorage = new();
|
public Dictionary<Difficulty, CreatureDifficulty> difficultyStorage = new();
|
||||||
public uint RequiredExpansion;
|
public uint RequiredExpansion;
|
||||||
public uint VignetteID; // @todo Read Vignette.db2
|
public uint VignetteID;
|
||||||
public uint Faction;
|
public uint Faction;
|
||||||
public ulong Npcflag;
|
public ulong Npcflag;
|
||||||
public float SpeedWalk;
|
public float SpeedWalk;
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public override void CleanupsBeforeDelete(bool finalCleanup)
|
public override void CleanupsBeforeDelete(bool finalCleanup)
|
||||||
{
|
{
|
||||||
|
SetVignette(0);
|
||||||
|
|
||||||
base.CleanupsBeforeDelete(finalCleanup);
|
base.CleanupsBeforeDelete(finalCleanup);
|
||||||
|
|
||||||
RemoveFromOwner();
|
RemoveFromOwner();
|
||||||
@@ -371,6 +373,10 @@ namespace Game.Entities
|
|||||||
_animKitId = (ushort)gameObjectAddon.AIAnimKitID;
|
_animKitId = (ushort)gameObjectAddon.AIAnimKitID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint vignetteId = GetGoInfo().GetSpawnVignette();
|
||||||
|
if (vignetteId != 0)
|
||||||
|
SetVignette(vignetteId);
|
||||||
|
|
||||||
LastUsedScriptID = GetGoInfo().ScriptId;
|
LastUsedScriptID = GetGoInfo().ScriptId;
|
||||||
|
|
||||||
m_stringIds[0] = goInfo.StringId;
|
m_stringIds[0] = goInfo.StringId;
|
||||||
@@ -2591,6 +2597,25 @@ namespace Game.Entities
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_vignette != null)
|
||||||
|
{
|
||||||
|
Player player = user.ToPlayer();
|
||||||
|
if (player != null)
|
||||||
|
{
|
||||||
|
Quest reward = Global.ObjectMgr.GetQuestTemplate((uint)m_vignette.Data.RewardQuestID);
|
||||||
|
if (reward != null && !player.GetQuestRewardStatus((uint)m_vignette.Data.RewardQuestID))
|
||||||
|
player.RewardQuest(reward, LootItemType.Item, 0, this, false);
|
||||||
|
|
||||||
|
if (m_vignette.Data.VisibleTrackingQuestID != 0)
|
||||||
|
player.SetRewardedQuest(m_vignette.Data.VisibleTrackingQuestID);
|
||||||
|
}
|
||||||
|
|
||||||
|
// only unregister it from visibility (need to keep vignette for other gameobject users in case its usable by multiple players
|
||||||
|
// to flag their quest completion
|
||||||
|
if (GetGoInfo().ClearObjectVignetteonOpening())
|
||||||
|
Vignettes.Remove(m_vignette, this);
|
||||||
|
}
|
||||||
|
|
||||||
if (spellId == 0)
|
if (spellId == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -3348,6 +3373,10 @@ namespace Game.Entities
|
|||||||
if (m_goTypeImpl != null)
|
if (m_goTypeImpl != null)
|
||||||
m_goTypeImpl.OnRelocated();
|
m_goTypeImpl.OnRelocated();
|
||||||
|
|
||||||
|
// TODO: on heartbeat
|
||||||
|
if (m_vignette != null)
|
||||||
|
Vignettes.Update(m_vignette, this);
|
||||||
|
|
||||||
UpdateObjectVisibility(false);
|
UpdateObjectVisibility(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3423,6 +3452,24 @@ namespace Game.Entities
|
|||||||
SendMessageToSet(activateAnimKit, true);
|
SendMessageToSet(activateAnimKit, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override VignetteData GetVignette() { return m_vignette; }
|
||||||
|
|
||||||
|
public void SetVignette(uint vignetteId)
|
||||||
|
{
|
||||||
|
if (m_vignette != null)
|
||||||
|
{
|
||||||
|
if (m_vignette.Data.ID == vignetteId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Vignettes.Remove(m_vignette, this);
|
||||||
|
m_vignette = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
VignetteRecord vignette = CliDB.VignetteStorage.LookupByKey(vignetteId);
|
||||||
|
if (vignette != null)
|
||||||
|
m_vignette = Vignettes.Create(vignette, this);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetSpellVisualId(uint spellVisualId, ObjectGuid activatorGuid = default)
|
public void SetSpellVisualId(uint spellVisualId, ObjectGuid activatorGuid = default)
|
||||||
{
|
{
|
||||||
SetUpdateFieldValue(m_values.ModifyValue(m_gameObjectData).ModifyValue(m_gameObjectData.SpellVisualID), spellVisualId);
|
SetUpdateFieldValue(m_values.ModifyValue(m_gameObjectData).ModifyValue(m_gameObjectData.SpellVisualID), spellVisualId);
|
||||||
@@ -3900,6 +3947,8 @@ namespace Game.Entities
|
|||||||
ushort _animKitId;
|
ushort _animKitId;
|
||||||
uint _worldEffectID;
|
uint _worldEffectID;
|
||||||
|
|
||||||
|
VignetteData m_vignette;
|
||||||
|
|
||||||
Dictionary<ObjectGuid, PerPlayerState> m_perPlayerState;
|
Dictionary<ObjectGuid, PerPlayerState> m_perPlayerState;
|
||||||
|
|
||||||
GameObjectState m_prevGoState; // What state to set whenever resetting
|
GameObjectState m_prevGoState; // What state to set whenever resetting
|
||||||
|
|||||||
@@ -745,6 +745,24 @@ namespace Game.Entities
|
|||||||
_ => 0,
|
_ => 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public uint GetSpawnVignette() => type switch
|
||||||
|
{
|
||||||
|
|
||||||
|
GameObjectTypes.Chest => Chest.SpawnVignette,
|
||||||
|
GameObjectTypes.Goober => Goober.SpawnVignette,
|
||||||
|
GameObjectTypes.NewFlag => NewFlag.SpawnVignette,
|
||||||
|
GameObjectTypes.NewFlagDrop => NewFlagDrop.SpawnVignette,
|
||||||
|
GameObjectTypes.CapturePoint => CapturePoint.SpawnVignette,
|
||||||
|
GameObjectTypes.GatheringNode => GatheringNode.SpawnVignette,
|
||||||
|
_ => 0
|
||||||
|
};
|
||||||
|
|
||||||
|
public bool ClearObjectVignetteonOpening() => type switch
|
||||||
|
{
|
||||||
|
GameObjectTypes.GatheringNode => GatheringNode.ClearObjectVignetteonOpening != 0,
|
||||||
|
_ => false
|
||||||
|
};
|
||||||
|
|
||||||
public uint GetSpellFocusType()
|
public uint GetSpellFocusType()
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
|||||||
@@ -1553,6 +1553,8 @@ namespace Game.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual VignetteData GetVignette() { return null; }
|
||||||
|
|
||||||
public TempSummon SummonCreature(uint entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TempSummonType.ManualDespawn, TimeSpan despawnTime = default, ObjectGuid privateObjectOwner = default)
|
public TempSummon SummonCreature(uint entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TempSummonType.ManualDespawn, TimeSpan despawnTime = default, ObjectGuid privateObjectOwner = default)
|
||||||
{
|
{
|
||||||
if (x == 0.0f && y == 0.0f && z == 0.0f)
|
if (x == 0.0f && y == 0.0f && z == 0.0f)
|
||||||
|
|||||||
@@ -230,6 +230,22 @@ namespace Game.Entities
|
|||||||
|
|
||||||
UpdateCriteria(CriteriaType.EnterTopLevelArea, newZone);
|
UpdateCriteria(CriteriaType.EnterTopLevelArea, newZone);
|
||||||
UpdateCriteria(CriteriaType.LeaveTopLevelArea, oldZone);
|
UpdateCriteria(CriteriaType.LeaveTopLevelArea, oldZone);
|
||||||
|
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
|
||||||
|
foreach (var vignette in GetMap().GetInfiniteAOIVignettes())
|
||||||
|
{
|
||||||
|
if (!vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (vignette.ZoneID == newZone && Vignettes.CanSee(this, vignette))
|
||||||
|
vignette.FillPacket(vignetteUpdate.Added);
|
||||||
|
else if (vignette.ZoneID == oldZone)
|
||||||
|
vignetteUpdate.Removed.Add(vignette.Guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!vignetteUpdate.Added.IDs.Empty() || !vignetteUpdate.Removed.Empty())
|
||||||
|
SendPacket(vignetteUpdate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5644,6 +5644,17 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
UpdateVisibilityForPlayer();
|
UpdateVisibilityForPlayer();
|
||||||
|
|
||||||
|
// Send map wide vignettes before UpdateZone, that will send zone wide vignettes
|
||||||
|
// But first send on new map will wipe all vignettes on client
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignetteUpdate.ForceUpdate = true;
|
||||||
|
|
||||||
|
foreach (VignetteData vignette in GetMap().GetInfiniteAOIVignettes())
|
||||||
|
if (!vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI) && Vignettes.CanSee(this, vignette))
|
||||||
|
vignette.FillPacket(vignetteUpdate.Added);
|
||||||
|
|
||||||
|
SendPacket(vignetteUpdate);
|
||||||
|
|
||||||
// update zone
|
// update zone
|
||||||
uint newzone, newarea;
|
uint newzone, newarea;
|
||||||
GetZoneAndAreaId(out newzone, out newarea);
|
GetZoneAndAreaId(out newzone, out newarea);
|
||||||
@@ -6034,13 +6045,23 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Sends / Updates
|
#region Sends / Updates
|
||||||
void BeforeVisibilityDestroy(WorldObject obj, Player p)
|
void BeforeVisibilityDestroy(WorldObject t, Player p)
|
||||||
{
|
{
|
||||||
if (!obj.IsTypeId(TypeId.Unit))
|
var creature = t.ToCreature();
|
||||||
return;
|
if (creature != null)
|
||||||
|
if (p.GetPetGUID() == creature.GetGUID() && creature.IsPet())
|
||||||
|
creature.ToPet().Remove(PetSaveMode.NotInSlot, true);
|
||||||
|
|
||||||
if (p.GetPetGUID() == obj.GetGUID() && obj.ToCreature().IsPet())
|
VignetteData vignette = t.GetVignette();
|
||||||
((Pet)obj).Remove(PetSaveMode.NotInSlot, true);
|
if (vignette != null)
|
||||||
|
{
|
||||||
|
if (!vignette.Data.IsInfiniteAOI())
|
||||||
|
{
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignetteUpdate.Removed.Add(vignette.Guid);
|
||||||
|
p.SendPacket(vignetteUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateVisibilityOf(ICollection<WorldObject> targets)
|
public void UpdateVisibilityOf(ICollection<WorldObject> targets)
|
||||||
@@ -6103,8 +6124,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (!CanSeeOrDetect(target, false, true))
|
if (!CanSeeOrDetect(target, false, true))
|
||||||
{
|
{
|
||||||
if (target.IsTypeId(TypeId.Unit))
|
BeforeVisibilityDestroy(target, this);
|
||||||
BeforeVisibilityDestroy(target.ToCreature(), this);
|
|
||||||
|
|
||||||
if (!target.IsDestroyedObject())
|
if (!target.IsDestroyedObject())
|
||||||
target.SendOutOfRangeForPlayer(this);
|
target.SendOutOfRangeForPlayer(this);
|
||||||
@@ -6158,6 +6178,16 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public void SendInitialVisiblePackets(WorldObject target)
|
public void SendInitialVisiblePackets(WorldObject target)
|
||||||
{
|
{
|
||||||
|
var sendVignette = (VignetteData vignette, Player where) =>
|
||||||
|
{
|
||||||
|
if (!vignette.Data.IsInfiniteAOI() && Vignettes.CanSee(where, vignette))
|
||||||
|
{
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignette.FillPacket(vignetteUpdate.Added);
|
||||||
|
where.SendPacket(vignetteUpdate);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Unit targetUnit = target.ToUnit();
|
Unit targetUnit = target.ToUnit();
|
||||||
if (targetUnit != null)
|
if (targetUnit != null)
|
||||||
{
|
{
|
||||||
@@ -6167,6 +6197,20 @@ namespace Game.Entities
|
|||||||
if (targetUnit.HasUnitState(UnitState.MeleeAttacking) && targetUnit.GetVictim() != null)
|
if (targetUnit.HasUnitState(UnitState.MeleeAttacking) && targetUnit.GetVictim() != null)
|
||||||
targetUnit.SendMeleeAttackStart(targetUnit.GetVictim());
|
targetUnit.SendMeleeAttackStart(targetUnit.GetVictim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VignetteData vignette = targetUnit.GetVignette();
|
||||||
|
if (vignette != null)
|
||||||
|
sendVignette(vignette, this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameObject targetGo = target.ToGameObject();
|
||||||
|
if (targetGo != null)
|
||||||
|
{
|
||||||
|
VignetteData vignette = targetGo.GetVignette();
|
||||||
|
if (vignette != null)
|
||||||
|
sendVignette(vignette, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -928,6 +928,20 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VignetteData vignette = victim.GetVignette();
|
||||||
|
if (vignette != null)
|
||||||
|
{
|
||||||
|
foreach (Player tapper in tappers)
|
||||||
|
{
|
||||||
|
Quest reward = Global.ObjectMgr.GetQuestTemplate((uint)vignette.Data.RewardQuestID);
|
||||||
|
if (reward != null)
|
||||||
|
tapper.RewardQuest(reward, LootItemType.Item, 0, victim, false);
|
||||||
|
|
||||||
|
if (vignette.Data.VisibleTrackingQuestID != 0)
|
||||||
|
tapper.SetRewardedQuest(vignette.Data.VisibleTrackingQuestID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
new KillRewarder(tappers.ToArray(), victim, false).Reward();
|
new KillRewarder(tappers.ToArray(), victim, false).Reward();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ namespace Game.Entities
|
|||||||
public UnitTypeMask UnitTypeMask { get; set; }
|
public UnitTypeMask UnitTypeMask { get; set; }
|
||||||
UnitState m_state;
|
UnitState m_state;
|
||||||
protected LiquidTypeRecord _lastLiquid;
|
protected LiquidTypeRecord _lastLiquid;
|
||||||
|
VignetteData m_vignette;
|
||||||
protected DeathState m_deathState;
|
protected DeathState m_deathState;
|
||||||
public Vehicle m_vehicle { get; set; }
|
public Vehicle m_vehicle { get; set; }
|
||||||
public Vehicle VehicleKit { get; set; }
|
public Vehicle VehicleKit { get; set; }
|
||||||
|
|||||||
@@ -684,6 +684,10 @@ namespace Game.Entities
|
|||||||
if (isInWater)
|
if (isInWater)
|
||||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.Swimming);
|
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.Swimming);
|
||||||
|
|
||||||
|
// TODO: on heartbeat
|
||||||
|
if (m_vignette != null)
|
||||||
|
Vignettes.Update(m_vignette, this);
|
||||||
|
|
||||||
return (relocated || turn);
|
return (relocated || turn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -538,6 +538,8 @@ namespace Game.Entities
|
|||||||
// This needs to be before RemoveFromWorld to make GetCaster() return a valid for aura removal
|
// This needs to be before RemoveFromWorld to make GetCaster() return a valid for aura removal
|
||||||
InterruptNonMeleeSpells(true);
|
InterruptNonMeleeSpells(true);
|
||||||
|
|
||||||
|
SetVignette(0);
|
||||||
|
|
||||||
if (IsInWorld)
|
if (IsInWorld)
|
||||||
RemoveFromWorld();
|
RemoveFromWorld();
|
||||||
else
|
else
|
||||||
@@ -939,6 +941,24 @@ namespace Game.Entities
|
|||||||
return collisionHeight1 == 0.0f ? MapConst.DefaultCollesionHeight : collisionHeight1;
|
return collisionHeight1 == 0.0f ? MapConst.DefaultCollesionHeight : collisionHeight1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override VignetteData GetVignette() { return m_vignette; }
|
||||||
|
|
||||||
|
public void SetVignette(uint vignetteId)
|
||||||
|
{
|
||||||
|
if (m_vignette != null)
|
||||||
|
{
|
||||||
|
if (m_vignette.Data.ID == vignetteId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Vignettes.Remove(m_vignette, this);
|
||||||
|
m_vignette = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var vignette = CliDB.VignetteStorage.LookupByKey(vignetteId);
|
||||||
|
if (vignette != null)
|
||||||
|
m_vignette = Vignettes.Create(vignette, this);
|
||||||
|
}
|
||||||
|
|
||||||
public override string GetDebugInfo()
|
public override string GetDebugInfo()
|
||||||
{
|
{
|
||||||
string str = $"{base.GetDebugInfo()}\nIsAIEnabled: {IsAIEnabled()} DeathState: {GetDeathState()} UnitMovementFlags: {GetUnitMovementFlags()} UnitMovementFlags2: {GetUnitMovementFlags2()} Class: {GetClass()}\n" +
|
string str = $"{base.GetDebugInfo()}\nIsAIEnabled: {IsAIEnabled()} DeathState: {GetDeathState()} UnitMovementFlags: {GetUnitMovementFlags()} UnitMovementFlags2: {GetUnitMovementFlags2()} Class: {GetClass()}\n" +
|
||||||
@@ -1574,6 +1594,9 @@ namespace Game.Entities
|
|||||||
SetEmoteState(Emote.OneshotNone);
|
SetEmoteState(Emote.OneshotNone);
|
||||||
SetStandState(UnitStandStateType.Stand);
|
SetStandState(UnitStandStateType.Stand);
|
||||||
|
|
||||||
|
if (m_vignette != null && !m_vignette.Data.GetFlags().HasFlag(VignetteFlags.PersistsThroughDeath))
|
||||||
|
SetVignette(0);
|
||||||
|
|
||||||
// players in instance don't have ZoneScript, but they have InstanceScript
|
// players in instance don't have ZoneScript, but they have InstanceScript
|
||||||
ZoneScript zoneScript = GetZoneScript() != null ? GetZoneScript() : GetInstanceScript();
|
ZoneScript zoneScript = GetZoneScript() != null ? GetZoneScript() : GetInstanceScript();
|
||||||
if (zoneScript != null)
|
if (zoneScript != null)
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||||
|
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Framework.Constants;
|
||||||
|
using Game.DataStorage;
|
||||||
|
using Game.Maps;
|
||||||
|
using Game.Networking.Packets;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Game.Entities
|
||||||
|
{
|
||||||
|
static class Vignettes
|
||||||
|
{
|
||||||
|
public static void UpdatePosition(VignetteData vignette, WorldObject owner)
|
||||||
|
{
|
||||||
|
vignette.Position = owner.GetPosition();
|
||||||
|
WmoLocation wmoLocation = owner.GetCurrentWmo();
|
||||||
|
if (wmoLocation != null)
|
||||||
|
{
|
||||||
|
vignette.WMOGroupID = (uint)wmoLocation.GroupId;
|
||||||
|
vignette.WMODoodadPlacementID = wmoLocation.UniqueId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SendVignetteUpdate(VignetteData vignette, WorldObject owner)
|
||||||
|
{
|
||||||
|
if (!owner.IsInWorld)
|
||||||
|
return;
|
||||||
|
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignette.FillPacket(vignetteUpdate.Updated);
|
||||||
|
vignetteUpdate.Write();
|
||||||
|
|
||||||
|
var sender = (Player receiver) =>
|
||||||
|
{
|
||||||
|
if (CanSee(receiver, vignette))
|
||||||
|
receiver.SendPacket(vignetteUpdate);
|
||||||
|
};
|
||||||
|
|
||||||
|
MessageDistDeliverer notifier = new(owner, sender, owner.GetVisibilityRange());
|
||||||
|
Cell.VisitWorldObjects(owner, notifier, owner.GetVisibilityRange());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SendVignetteAdded(VignetteData vignette, WorldObject owner)
|
||||||
|
{
|
||||||
|
if (!owner.IsInWorld)
|
||||||
|
return;
|
||||||
|
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignette.FillPacket(vignetteUpdate.Added);
|
||||||
|
vignetteUpdate.Write();
|
||||||
|
|
||||||
|
var sender = (Player receiver) =>
|
||||||
|
{
|
||||||
|
if (CanSee(receiver, vignette))
|
||||||
|
receiver.SendPacket(vignetteUpdate);
|
||||||
|
};
|
||||||
|
|
||||||
|
MessageDistDeliverer notifier = new(owner, sender, owner.GetVisibilityRange());
|
||||||
|
Cell.VisitWorldObjects(owner, notifier, owner.GetVisibilityRange());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VignetteData Create(VignetteRecord vignetteData, WorldObject owner)
|
||||||
|
{
|
||||||
|
VignetteData vignette = new();
|
||||||
|
vignette.Guid = ObjectGuid.Create(HighGuid.Vignette, owner.GetMapId(), vignetteData.ID, owner.GetMap().GenerateLowGuid(HighGuid.Vignette));
|
||||||
|
vignette.Object = owner.GetGUID();
|
||||||
|
vignette.Position = owner.GetPosition();
|
||||||
|
vignette.Data = vignetteData;
|
||||||
|
vignette.ZoneID = owner.GetZoneId(); // not updateable
|
||||||
|
UpdatePosition(vignette, owner);
|
||||||
|
|
||||||
|
if (vignetteData.IsInfiniteAOI())
|
||||||
|
owner.GetMap().AddInfiniteAOIVignette(vignette);
|
||||||
|
else
|
||||||
|
SendVignetteAdded(vignette, owner);
|
||||||
|
|
||||||
|
return vignette;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Update(VignetteData vignette, WorldObject owner)
|
||||||
|
{
|
||||||
|
UpdatePosition(vignette, owner);
|
||||||
|
|
||||||
|
if (vignette.Data.IsInfiniteAOI())
|
||||||
|
vignette.NeedUpdate = true;
|
||||||
|
else
|
||||||
|
SendVignetteUpdate(vignette, owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Remove(VignetteData vignette, WorldObject owner)
|
||||||
|
{
|
||||||
|
if (vignette.Data.IsInfiniteAOI())
|
||||||
|
owner.GetMap().RemoveInfiniteAOIVignette(vignette);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignetteUpdate.Removed.Add(vignette.Guid);
|
||||||
|
owner.SendMessageToSet(vignetteUpdate, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool CanSee(Player player, VignetteData vignette)
|
||||||
|
{
|
||||||
|
if (vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
|
||||||
|
if (vignette.ZoneID != player.GetZoneId())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (vignette.Data.VisibleTrackingQuestID != 0)
|
||||||
|
if (player.IsQuestRewarded(vignette.Data.VisibleTrackingQuestID))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
var playerCondition = CliDB.PlayerConditionStorage.LookupByKey(vignette.Data.PlayerConditionID);
|
||||||
|
if (playerCondition != null && !ConditionManager.IsPlayerMeetingCondition(player, playerCondition))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VignetteData
|
||||||
|
{
|
||||||
|
public ObjectGuid Guid;
|
||||||
|
public ObjectGuid Object;
|
||||||
|
public Position Position;
|
||||||
|
public VignetteRecord Data;
|
||||||
|
public uint ZoneID;
|
||||||
|
public uint WMOGroupID;
|
||||||
|
public uint WMODoodadPlacementID;
|
||||||
|
public bool NeedUpdate;
|
||||||
|
|
||||||
|
public void FillPacket(VignetteDataSet dataSet)
|
||||||
|
{
|
||||||
|
dataSet.IDs.Add(Guid);
|
||||||
|
|
||||||
|
VignetteDataPkt data = new();
|
||||||
|
data.ObjGUID = Object;
|
||||||
|
data.Position = Position;
|
||||||
|
data.VignetteID = (int)Data.ID;
|
||||||
|
data.ZoneID = ZoneID;
|
||||||
|
data.WMOGroupID = WMOGroupID;
|
||||||
|
data.WMODoodadPlacementID = WMODoodadPlacementID;
|
||||||
|
|
||||||
|
dataSet.Data.Add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2901,6 +2901,12 @@ namespace Game
|
|||||||
Log.outInfo(LogFilter.Sql, $"Creature (Entry: {cInfo.Entry}) has assigned gossip menu, but npcflag does not include UNIT_NPC_FLAG_GOSSIP.");
|
Log.outInfo(LogFilter.Sql, $"Creature (Entry: {cInfo.Entry}) has assigned gossip menu, but npcflag does not include UNIT_NPC_FLAG_GOSSIP.");
|
||||||
else if (cInfo.GossipMenuIds.Empty() && cInfo.Npcflag.HasAnyFlag((uint)NPCFlags.Gossip))
|
else if (cInfo.GossipMenuIds.Empty() && cInfo.Npcflag.HasAnyFlag((uint)NPCFlags.Gossip))
|
||||||
Log.outInfo(LogFilter.Sql, $"Creature (Entry: {cInfo.Entry}) has npcflag UNIT_NPC_FLAG_GOSSIP, but gossip menu is unassigned.");
|
Log.outInfo(LogFilter.Sql, $"Creature (Entry: {cInfo.Entry}) has npcflag UNIT_NPC_FLAG_GOSSIP, but gossip menu is unassigned.");
|
||||||
|
|
||||||
|
if (cInfo.VignetteID != 0 && !CliDB.VignetteStorage.HasRecord(cInfo.VignetteID))
|
||||||
|
{
|
||||||
|
Log.outInfo(LogFilter.Sql, $"Creature (Entry: {cInfo.Entry}) has non-existing Vignette {cInfo.VignetteID}, set to 0.");
|
||||||
|
cInfo.VignetteID = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void CheckCreatureMovement(string table, ulong id, CreatureMovementData creatureMovement)
|
void CheckCreatureMovement(string table, ulong id, CreatureMovementData creatureMovement)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ namespace Game.Maps
|
|||||||
m_VisibilityNotifyPeriod = SharedConst.DefaultVisibilityNotifyPeriod;
|
m_VisibilityNotifyPeriod = SharedConst.DefaultVisibilityNotifyPeriod;
|
||||||
i_gridExpiry = expiry;
|
i_gridExpiry = expiry;
|
||||||
m_terrain = Global.TerrainMgr.LoadTerrain(id);
|
m_terrain = Global.TerrainMgr.LoadTerrain(id);
|
||||||
|
_vignetteUpdateTimer = new(5200, 5200);
|
||||||
|
|
||||||
for (uint x = 0; x < MapConst.MaxGrids; ++x)
|
for (uint x = 0; x < MapConst.MaxGrids; ++x)
|
||||||
{
|
{
|
||||||
@@ -398,6 +399,41 @@ namespace Game.Maps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void AddInfiniteAOIVignette(VignetteData vignette)
|
||||||
|
{
|
||||||
|
_infiniteAOIVignettes.Add(vignette);
|
||||||
|
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignette.FillPacket(vignetteUpdate.Added);
|
||||||
|
vignetteUpdate.Write();
|
||||||
|
|
||||||
|
foreach (var player in GetPlayers())
|
||||||
|
if (Vignettes.CanSee(player, vignette))
|
||||||
|
player.SendPacket(vignetteUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveInfiniteAOIVignette(VignetteData vignette)
|
||||||
|
{
|
||||||
|
if (!_infiniteAOIVignettes.Remove(vignette))
|
||||||
|
return;
|
||||||
|
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignetteUpdate.Removed.Add(vignette.Guid);
|
||||||
|
vignetteUpdate.Write();
|
||||||
|
|
||||||
|
if (vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
|
||||||
|
{
|
||||||
|
foreach (var player in GetPlayers())
|
||||||
|
if (player.GetZoneId() == vignette.ZoneID)
|
||||||
|
player.SendPacket(vignetteUpdate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
SendToPlayers(vignetteUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VignetteData> GetInfiniteAOIVignettes() { return _infiniteAOIVignettes; }
|
||||||
|
|
||||||
void InitializeObject(WorldObject obj)
|
void InitializeObject(WorldObject obj)
|
||||||
{
|
{
|
||||||
if (!obj.IsTypeId(TypeId.Unit) || !obj.IsTypeId(TypeId.GameObject))
|
if (!obj.IsTypeId(TypeId.Unit) || !obj.IsTypeId(TypeId.GameObject))
|
||||||
@@ -663,6 +699,24 @@ namespace Game.Maps
|
|||||||
transport.Update(diff);
|
transport.Update(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_vignetteUpdateTimer.Update((int)diff))
|
||||||
|
{
|
||||||
|
foreach (VignetteData vignette in _infiniteAOIVignettes)
|
||||||
|
{
|
||||||
|
if (vignette.NeedUpdate)
|
||||||
|
{
|
||||||
|
VignetteUpdate vignetteUpdate = new();
|
||||||
|
vignette.FillPacket(vignetteUpdate.Updated);
|
||||||
|
vignetteUpdate.Write();
|
||||||
|
foreach (var player in GetPlayers())
|
||||||
|
if (Vignettes.CanSee(player, vignette))
|
||||||
|
player.SendPacket(vignetteUpdate);
|
||||||
|
|
||||||
|
vignette.NeedUpdate = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SendObjectUpdates();
|
SendObjectUpdates();
|
||||||
|
|
||||||
// Process necessary scripts
|
// Process necessary scripts
|
||||||
@@ -4780,6 +4834,9 @@ namespace Game.Maps
|
|||||||
MultiPersonalPhaseTracker _multiPersonalPhaseTracker = new();
|
MultiPersonalPhaseTracker _multiPersonalPhaseTracker = new();
|
||||||
|
|
||||||
Dictionary<int, int> _worldStateValues = new();
|
Dictionary<int, int> _worldStateValues = new();
|
||||||
|
|
||||||
|
List<VignetteData> _infiniteAOIVignettes = new();
|
||||||
|
PeriodicTimer _vignetteUpdateTimer;
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||||
|
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using Framework.Constants;
|
||||||
|
using Game.Entities;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Numerics;
|
||||||
|
|
||||||
|
namespace Game.Networking.Packets
|
||||||
|
{
|
||||||
|
public class VignetteDataPkt
|
||||||
|
{
|
||||||
|
public ObjectGuid ObjGUID;
|
||||||
|
public Vector3 Position;
|
||||||
|
public int VignetteID;
|
||||||
|
public uint ZoneID;
|
||||||
|
public uint WMOGroupID;
|
||||||
|
public uint WMODoodadPlacementID;
|
||||||
|
|
||||||
|
public void Write(WorldPacket data)
|
||||||
|
{
|
||||||
|
data.WriteVector3(Position);
|
||||||
|
data.WritePackedGuid(ObjGUID);
|
||||||
|
data.WriteInt32(VignetteID);
|
||||||
|
data.WriteUInt32(ZoneID);
|
||||||
|
data.WriteUInt32(WMOGroupID);
|
||||||
|
data.WriteUInt32(WMODoodadPlacementID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VignetteDataSet
|
||||||
|
{
|
||||||
|
public List<ObjectGuid> IDs = new();
|
||||||
|
public List<VignetteDataPkt> Data = new();
|
||||||
|
|
||||||
|
public void Write(WorldPacket data)
|
||||||
|
{
|
||||||
|
data.WriteInt32(IDs.Count);
|
||||||
|
data.WriteInt32(Data.Count);
|
||||||
|
foreach (ObjectGuid id in IDs)
|
||||||
|
data.WritePackedGuid(id);
|
||||||
|
|
||||||
|
foreach (VignetteDataPkt vignetteData in Data)
|
||||||
|
vignetteData.Write(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class VignetteUpdate : ServerPacket
|
||||||
|
{
|
||||||
|
public VignetteDataSet Added = new();
|
||||||
|
public VignetteDataSet Updated = new();
|
||||||
|
public List<ObjectGuid> Removed = new();
|
||||||
|
public bool ForceUpdate;
|
||||||
|
public bool InFogOfWar;
|
||||||
|
|
||||||
|
public VignetteUpdate() : base(ServerOpcodes.VignetteUpdate, ConnectionType.Instance) { }
|
||||||
|
|
||||||
|
public override void Write()
|
||||||
|
{
|
||||||
|
_worldPacket.WriteBit(ForceUpdate);
|
||||||
|
_worldPacket.WriteBit(InFogOfWar);
|
||||||
|
_worldPacket.WriteInt32(Removed.Count);
|
||||||
|
Added.Write(_worldPacket);
|
||||||
|
Updated.Write(_worldPacket);
|
||||||
|
foreach (ObjectGuid removed in Removed)
|
||||||
|
_worldPacket.WritePackedGuid(removed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4981,6 +4981,15 @@ namespace Game.Spells
|
|||||||
target.ToPlayer().SendOnCancelExpectedVehicleRideAura();
|
target.ToPlayer().SendOnCancelExpectedVehicleRideAura();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AuraEffectHandler(AuraType.SetVignette)]
|
||||||
|
void HandleSetVignette(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||||
|
return;
|
||||||
|
|
||||||
|
aurApp.GetTarget().SetVignette((uint)(apply ? GetMiscValue() : 0));
|
||||||
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.PreventResurrection)]
|
[AuraEffectHandler(AuraType.PreventResurrection)]
|
||||||
void HandlePreventResurrection(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandlePreventResurrection(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
--
|
||||||
|
-- Table structure for table `vignette`
|
||||||
|
--
|
||||||
|
DROP TABLE IF EXISTS `vignette`;
|
||||||
|
CREATE TABLE `vignette` (
|
||||||
|
`ID` int unsigned NOT NULL DEFAULT '0',
|
||||||
|
`Name` text,
|
||||||
|
`PlayerConditionID` int unsigned NOT NULL DEFAULT '0',
|
||||||
|
`VisibleTrackingQuestID` int unsigned NOT NULL DEFAULT '0',
|
||||||
|
`QuestFeedbackEffectID` int unsigned NOT NULL DEFAULT '0',
|
||||||
|
`Flags` int NOT NULL DEFAULT '0',
|
||||||
|
`MaxHeight` float NOT NULL DEFAULT '0',
|
||||||
|
`MinHeight` float NOT NULL DEFAULT '0',
|
||||||
|
`VignetteType` tinyint NOT NULL DEFAULT '0',
|
||||||
|
`RewardQuestID` int NOT NULL DEFAULT '0',
|
||||||
|
`UiWidgetSetID` int NOT NULL DEFAULT '0',
|
||||||
|
`VerifiedBuild` int NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`ID`,`VerifiedBuild`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `vignette_locale`
|
||||||
|
--
|
||||||
|
DROP TABLE IF EXISTS `vignette_locale`;
|
||||||
|
CREATE TABLE `vignette_locale` (
|
||||||
|
`ID` int unsigned NOT NULL DEFAULT '0',
|
||||||
|
`locale` varchar(4) NOT NULL,
|
||||||
|
`Name_lang` text,
|
||||||
|
`VerifiedBuild` int NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`ID`,`locale`,`VerifiedBuild`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||||
|
/*!50500 PARTITION BY LIST COLUMNS(locale)
|
||||||
|
(PARTITION deDE VALUES IN ('deDE') ENGINE = InnoDB,
|
||||||
|
PARTITION esES VALUES IN ('esES') ENGINE = InnoDB,
|
||||||
|
PARTITION esMX VALUES IN ('esMX') ENGINE = InnoDB,
|
||||||
|
PARTITION frFR VALUES IN ('frFR') ENGINE = InnoDB,
|
||||||
|
PARTITION itIT VALUES IN ('itIT') ENGINE = InnoDB,
|
||||||
|
PARTITION koKR VALUES IN ('koKR') ENGINE = InnoDB,
|
||||||
|
PARTITION ptBR VALUES IN ('ptBR') ENGINE = InnoDB,
|
||||||
|
PARTITION ruRU VALUES IN ('ruRU') ENGINE = InnoDB,
|
||||||
|
PARTITION zhCN VALUES IN ('zhCN') ENGINE = InnoDB,
|
||||||
|
PARTITION zhTW VALUES IN ('zhTW') ENGINE = InnoDB) */;
|
||||||
Reference in New Issue
Block a user