Core/Creatures: Allow scripts to change creature loot id (must be done before death)
Port From (https://github.com/TrinityCore/TrinityCore/commit/155cf58236f7adbd169f57e0578c96fd7ce2173f)
This commit is contained in:
@@ -55,6 +55,7 @@ namespace Game.Entities
|
||||
|
||||
bool DisableReputationGain;
|
||||
|
||||
uint? _lootId;
|
||||
LootModes m_LootMode; // Bitmask (default: LOOT_MODE_DEFAULT) that determines what loot will be lootable
|
||||
|
||||
// Waypoint path
|
||||
|
||||
@@ -1189,9 +1189,24 @@ namespace Game.Entities
|
||||
{
|
||||
_pickpocketLootRestore = GameTime.GetGameTime() + WorldConfig.GetIntValue(WorldCfg.CreaturePickpocketRefill);
|
||||
}
|
||||
|
||||
public void ResetPickPocketRefillTimer() { _pickpocketLootRestore = 0; }
|
||||
|
||||
public bool CanGeneratePickPocketLoot() { return _pickpocketLootRestore <= GameTime.GetGameTime(); }
|
||||
|
||||
public uint GetLootId()
|
||||
{
|
||||
if (_lootId.HasValue)
|
||||
return _lootId.Value;
|
||||
|
||||
return GetCreatureTemplate().LootId;
|
||||
}
|
||||
|
||||
public void SetLootId(uint? lootId)
|
||||
{
|
||||
_lootId = lootId;
|
||||
}
|
||||
|
||||
public void SetTappedBy(Unit unit, bool withGroup = true)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
|
||||
Reference in New Issue
Block a user