TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CreatureTemplate Struct Reference

#include <Creature.h>

Public Member Functions

uint32 GetRandomValidModelId () const
 
uint32 GetFirstValidModelId () const
 
uint32 GetFirstInvisibleModel () const
 
uint32 GetFirstVisibleModel () const
 
SkillType GetRequiredLootSkill () const
 
bool IsExotic () const
 
bool IsTameable (bool canTameExotic) const
 

Static Public Member Functions

static int32 DifficultyIDToDifficultyEntryIndex (uint32 difficulty)
 

Public Attributes

uint32 Entry
 
uint32 DifficultyEntry [MAX_CREATURE_DIFFICULTIES]
 
uint32 KillCredit [MAX_KILL_CREDIT]
 
uint32 Modelid1
 
uint32 Modelid2
 
uint32 Modelid3
 
uint32 Modelid4
 
std::string Name
 
std::string FemaleName
 
std::string SubName
 
std::string IconName
 
uint32 GossipMenuId
 
int16 minlevel
 
int16 maxlevel
 
int32 expansion
 
uint32 expansionUnknown
 
uint32 faction
 
uint64 npcflag
 
float speed_walk
 
float speed_run
 
float scale
 
uint32 rank
 
uint32 dmgschool
 
uint32 BaseAttackTime
 
uint32 RangeAttackTime
 
float BaseVariance
 
float RangeVariance
 
uint32 unit_class
 
uint32 unit_flags
 
uint32 unit_flags2
 
uint32 dynamicflags
 
uint32 family
 
uint32 trainer_type
 
uint32 trainer_class
 
uint32 trainer_race
 
uint32 type
 
uint32 type_flags
 
uint32 type_flags2
 
uint32 lootid
 
uint32 pickpocketLootId
 
uint32 SkinLootId
 
int32 resistance [MAX_SPELL_SCHOOL]
 
uint32 spells [CREATURE_MAX_SPELLS]
 
uint32 VehicleId
 
uint32 mingold
 
uint32 maxgold
 
std::string AIName
 
uint32 MovementType
 
uint32 InhabitType
 
float HoverHeight
 
float ModHealth
 
float ModHealthExtra
 
float ModMana
 
float ModManaExtra
 
float ModArmor
 
float ModDamage
 
float ModExperience
 
bool RacialLeader
 
uint32 movementId
 
bool RegenHealth
 
uint32 MechanicImmuneMask
 
uint32 flags_extra
 
uint32 ScriptID
 

Member Function Documentation

static int32 CreatureTemplate::DifficultyIDToDifficultyEntryIndex ( uint32  difficulty)
inlinestatic
177  {
178  switch (difficulty)
179  {
180  case DIFFICULTY_NONE:
181  case DIFFICULTY_NORMAL:
182  case DIFFICULTY_10_N:
183  case DIFFICULTY_40:
186  return -1;
187  case DIFFICULTY_HEROIC:
188  case DIFFICULTY_25_N:
191  return 0;
192  case DIFFICULTY_10_HC:
195  return 1;
196  case DIFFICULTY_25_HC:
197  return 2;
198  case DIFFICULTY_LFR:
199  case DIFFICULTY_LFR_NEW:
203  default:
204  return -1;
205  }
206  }
Definition: DBCEnums.h:404
Definition: DBCEnums.h:406
Definition: DBCEnums.h:411
Definition: DBCEnums.h:407
Definition: DBCEnums.h:413
Definition: DBCEnums.h:416
Definition: DBCEnums.h:414
Definition: DBCEnums.h:415
Definition: DBCEnums.h:409
Definition: DBCEnums.h:408
Definition: DBCEnums.h:419
Definition: DBCEnums.h:410
Definition: DBCEnums.h:418
Definition: DBCEnums.h:417
Definition: DBCEnums.h:422
Definition: DBCEnums.h:421
Definition: DBCEnums.h:412
Definition: DBCEnums.h:420
Definition: DBCEnums.h:405

+ Here is the caller graph for this function:

uint32 CreatureTemplate::GetFirstInvisibleModel ( ) const
109 {
110  CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid1);
111  if (modelInfo && modelInfo->is_trigger)
112  return Modelid1;
113 
114  modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid2);
115  if (modelInfo && modelInfo->is_trigger)
116  return Modelid2;
117 
118  modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid3);
119  if (modelInfo && modelInfo->is_trigger)
120  return Modelid3;
121 
122  modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid4);
123  if (modelInfo && modelInfo->is_trigger)
124  return Modelid4;
125 
126  return 11686;
127 }
bool is_trigger
Definition: Creature.h:323
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: Creature.h:317
uint32 Modelid1
Definition: Creature.h:84
uint32 Modelid3
Definition: Creature.h:86
uint32 Modelid2
Definition: Creature.h:85
uint32 Modelid4
Definition: Creature.h:87

+ Here is the caller graph for this function:

uint32 CreatureTemplate::GetFirstValidModelId ( ) const
100 {
101  if (Modelid1) return Modelid1;
102  if (Modelid2) return Modelid2;
103  if (Modelid3) return Modelid3;
104  if (Modelid4) return Modelid4;
105  return 0;
106 }
uint32 Modelid1
Definition: Creature.h:84
uint32 Modelid3
Definition: Creature.h:86
uint32 Modelid2
Definition: Creature.h:85
uint32 Modelid4
Definition: Creature.h:87

+ Here is the caller graph for this function:

uint32 CreatureTemplate::GetFirstVisibleModel ( ) const
130 {
131  CreatureModelInfo const* modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid1);
132  if (modelInfo && !modelInfo->is_trigger)
133  return Modelid1;
134 
135  modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid2);
136  if (modelInfo && !modelInfo->is_trigger)
137  return Modelid2;
138 
139  modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid3);
140  if (modelInfo && !modelInfo->is_trigger)
141  return Modelid3;
142 
143  modelInfo = sObjectMgr->GetCreatureModelInfo(Modelid4);
144  if (modelInfo && !modelInfo->is_trigger)
145  return Modelid4;
146 
147  return 17519;
148 }
bool is_trigger
Definition: Creature.h:323
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: Creature.h:317
uint32 Modelid1
Definition: Creature.h:84
uint32 Modelid3
Definition: Creature.h:86
uint32 Modelid2
Definition: Creature.h:85
uint32 Modelid4
Definition: Creature.h:87

+ Here is the caller graph for this function:

uint32 CreatureTemplate::GetRandomValidModelId ( ) const
87 {
88  uint8 c = 0;
89  uint32 modelIDs[4];
90 
91  if (Modelid1) modelIDs[c++] = Modelid1;
92  if (Modelid2) modelIDs[c++] = Modelid2;
93  if (Modelid3) modelIDs[c++] = Modelid3;
94  if (Modelid4) modelIDs[c++] = Modelid4;
95 
96  return ((c>0) ? modelIDs[urand(0, c-1)] : 0);
97 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32_t uint32
Definition: Define.h:150
uint32 Modelid1
Definition: Creature.h:84
uint32 Modelid3
Definition: Creature.h:86
uint32 Modelid2
Definition: Creature.h:85
uint8_t uint8
Definition: Define.h:152
uint32 Modelid4
Definition: Creature.h:87

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SkillType CreatureTemplate::GetRequiredLootSkill ( ) const
inline
151  {
153  return SKILL_HERBALISM;
155  return SKILL_MINING;
157  return SKILL_ENGINEERING;
158  else
159  return SKILL_SKINNING; // normal case
160  }
Definition: SharedDefines.h:3942
Definition: SharedDefines.h:3664
Definition: SharedDefines.h:3980
Definition: SharedDefines.h:3934
Definition: SharedDefines.h:3938
Definition: SharedDefines.h:3671
Definition: SharedDefines.h:3665
uint32 type_flags
Definition: Creature.h:117

+ Here is the caller graph for this function:

bool CreatureTemplate::IsExotic ( ) const
inline
163  {
164  return (type_flags & CREATURE_TYPEFLAGS_EXOTIC) != 0;
165  }
Definition: SharedDefines.h:3672
uint32 type_flags
Definition: Creature.h:117
bool CreatureTemplate::IsTameable ( bool  canTameExotic) const
inline
168  {
170  return false;
171 
172  // if can tame exotic then can tame any tameable
173  return canTameExotic || !IsExotic();
174  }
Definition: SharedDefines.h:3554
uint32 family
Definition: Creature.h:112
Definition: SharedDefines.h:3656
uint32 type
Definition: Creature.h:116
bool IsExotic() const
Definition: Creature.h:162
uint32 type_flags
Definition: Creature.h:117

+ Here is the caller graph for this function:

Member Data Documentation

std::string CreatureTemplate::AIName
uint32 CreatureTemplate::BaseAttackTime
float CreatureTemplate::BaseVariance
uint32 CreatureTemplate::DifficultyEntry[MAX_CREATURE_DIFFICULTIES]
uint32 CreatureTemplate::dmgschool
uint32 CreatureTemplate::dynamicflags
uint32 CreatureTemplate::Entry
int32 CreatureTemplate::expansion
uint32 CreatureTemplate::expansionUnknown
uint32 CreatureTemplate::faction
uint32 CreatureTemplate::family
std::string CreatureTemplate::FemaleName
uint32 CreatureTemplate::flags_extra
uint32 CreatureTemplate::GossipMenuId
float CreatureTemplate::HoverHeight
std::string CreatureTemplate::IconName
uint32 CreatureTemplate::InhabitType
uint32 CreatureTemplate::KillCredit[MAX_KILL_CREDIT]
uint32 CreatureTemplate::lootid
uint32 CreatureTemplate::maxgold
int16 CreatureTemplate::maxlevel
uint32 CreatureTemplate::MechanicImmuneMask
uint32 CreatureTemplate::mingold
int16 CreatureTemplate::minlevel
float CreatureTemplate::ModArmor
float CreatureTemplate::ModDamage
uint32 CreatureTemplate::Modelid1
uint32 CreatureTemplate::Modelid2
uint32 CreatureTemplate::Modelid3
uint32 CreatureTemplate::Modelid4
float CreatureTemplate::ModExperience
float CreatureTemplate::ModHealth
float CreatureTemplate::ModHealthExtra
float CreatureTemplate::ModMana
float CreatureTemplate::ModManaExtra
uint32 CreatureTemplate::movementId
uint32 CreatureTemplate::MovementType
std::string CreatureTemplate::Name
uint64 CreatureTemplate::npcflag
uint32 CreatureTemplate::pickpocketLootId
bool CreatureTemplate::RacialLeader
uint32 CreatureTemplate::RangeAttackTime
float CreatureTemplate::RangeVariance
uint32 CreatureTemplate::rank
bool CreatureTemplate::RegenHealth
int32 CreatureTemplate::resistance[MAX_SPELL_SCHOOL]
float CreatureTemplate::scale
uint32 CreatureTemplate::ScriptID
uint32 CreatureTemplate::SkinLootId
float CreatureTemplate::speed_run
float CreatureTemplate::speed_walk
uint32 CreatureTemplate::spells[CREATURE_MAX_SPELLS]
std::string CreatureTemplate::SubName
uint32 CreatureTemplate::trainer_class
uint32 CreatureTemplate::trainer_race
uint32 CreatureTemplate::trainer_type
uint32 CreatureTemplate::type
uint32 CreatureTemplate::type_flags
uint32 CreatureTemplate::type_flags2
uint32 CreatureTemplate::unit_class
uint32 CreatureTemplate::unit_flags
uint32 CreatureTemplate::unit_flags2
uint32 CreatureTemplate::VehicleId

The documentation for this struct was generated from the following files: