mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
*Fix the bug that triggers are visible.
--HG-- branch : trunk
This commit is contained in:
@@ -1444,9 +1444,9 @@ float Creature::GetSpellDamageMod(int32 Rank)
|
||||
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const CreatureData *data)
|
||||
{
|
||||
SetZoneScript();
|
||||
if(m_zoneScript)
|
||||
if(m_zoneScript && data)
|
||||
{
|
||||
Entry = m_zoneScript->GetCreatureEntry(guidlow, Entry);
|
||||
Entry = m_zoneScript->GetCreatureEntry(guidlow, data);
|
||||
if(!Entry)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1128,13 +1128,14 @@ void ObjectMgr::LoadCreatures()
|
||||
}
|
||||
|
||||
// I do not know why but in db most display id are not zero
|
||||
if(data.displayid == 11686)
|
||||
/*if(data.displayid == 11686 || data.displayid == 24719)
|
||||
{
|
||||
(const_cast<CreatureInfo*>(cInfo))->flags_extra |= CREATURE_FLAG_EXTRA_TRIGGER;
|
||||
}
|
||||
else if(data.displayid == cInfo->Modelid_A1 || data.displayid == cInfo->Modelid_A2
|
||||
|| data.displayid == cInfo->Modelid_H1 || data.displayid == cInfo->Modelid_H2)
|
||||
data.displayid = 0;
|
||||
*/
|
||||
|
||||
if(data.equipmentId > 0) // -1 no equipment, 0 use default
|
||||
{
|
||||
|
||||
@@ -168,15 +168,18 @@ void OPvPWintergrasp::ChangeDefender()
|
||||
m_timer = 600000; // for test, should be 2 hour 30 min
|
||||
}
|
||||
|
||||
uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, uint32 entry)
|
||||
uint32 OPvPWintergrasp::GetCreatureEntry(uint32 guidlow, const CreatureData *data)
|
||||
{
|
||||
if(m_defender == TEAM_ALLIANCE)
|
||||
{
|
||||
TeamPairMap::const_iterator itr = m_creEntryPair.find(entry);
|
||||
TeamPairMap::const_iterator itr = m_creEntryPair.find(data->id);
|
||||
if(itr != m_creEntryPair.end())
|
||||
{
|
||||
const_cast<CreatureData*>(data)->displayid = 0;
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
return data->id;
|
||||
}
|
||||
|
||||
void OPvPWintergrasp::OnCreatureCreate(Creature *creature, bool add)
|
||||
|
||||
@@ -80,7 +80,7 @@ class OPvPWintergrasp : public OutdoorPvP
|
||||
explicit OPvPWintergrasp() : m_tenacityStack(0) {}
|
||||
bool SetupOutdoorPvP();
|
||||
|
||||
uint32 GetCreatureEntry(uint32 guidlow, uint32 entry);
|
||||
uint32 GetCreatureEntry(uint32 guidlow, const CreatureData *data);
|
||||
//uint32 GetGameObjectEntry(uint32 guidlow, uint32 entry);
|
||||
|
||||
void OnCreatureCreate(Creature *creature, bool add);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
struct CreatureData;
|
||||
class Creature;
|
||||
class GameObject;
|
||||
|
||||
@@ -29,7 +30,7 @@ class TRINITY_DLL_SPEC ZoneScript
|
||||
public:
|
||||
explicit ZoneScript() {}
|
||||
|
||||
virtual uint32 GetCreatureEntry(uint32 guidlow, uint32 entry) { return entry; }
|
||||
virtual uint32 GetCreatureEntry(uint32 guidlow, const CreatureData *data) { return data->id; }
|
||||
virtual uint32 GetGameObjectEntry(uint32 guidlow, uint32 entry) { return entry; }
|
||||
|
||||
virtual void OnCreatureCreate(Creature *, bool add) {}
|
||||
|
||||
Reference in New Issue
Block a user