Core/Creatures: Allow overriding non-gossip based trainer ids for creatures
Port From (https://github.com/TrinityCore/TrinityCore/commit/689d3a667af8c3e2662b77d14edf201771130bee)
This commit is contained in:
@@ -27,6 +27,8 @@ namespace Game.Entities
|
||||
|
||||
bool _isMissingCanSwimFlagOutOfCombat;
|
||||
|
||||
uint? _trainerId;
|
||||
|
||||
public ulong m_PlayerDamageReq;
|
||||
public float m_SightDistance;
|
||||
public float m_CombatDistance;
|
||||
|
||||
@@ -1128,6 +1128,19 @@ namespace Game.Entities
|
||||
// exited position so it won't run away (home) and evade if it's hostile
|
||||
SetHomePosition(GetPosition());
|
||||
}
|
||||
|
||||
public uint GetTrainerId()
|
||||
{
|
||||
if (_trainerId.HasValue)
|
||||
return _trainerId.Value;
|
||||
|
||||
return Global.ObjectMgr.GetCreatureDefaultTrainer(GetEntry());
|
||||
}
|
||||
|
||||
public void SetTrainerId(uint? trainerId)
|
||||
{
|
||||
_trainerId = trainerId;
|
||||
}
|
||||
|
||||
public override bool IsMovementPreventedByCasting()
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
uint trainerId = Global.ObjectMgr.GetCreatureDefaultTrainer(npc.GetEntry());
|
||||
uint trainerId = npc.GetTrainerId();
|
||||
if (trainerId != 0)
|
||||
SendTrainerList(npc, trainerId);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user