*Add a new modelid function..
*Attempt to fix some Linux compile issues.. --HG-- branch : trunk
This commit is contained in:
+10
-2
@@ -30,26 +30,34 @@ update creature_template set scriptname = 'boss_krik_thir' where entry = '';
|
||||
#include "precompiled.h"
|
||||
#include "def_azjol_nerub.h"
|
||||
|
||||
enum
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MIND_FLAY = 52586,
|
||||
H_SPELL_MIND_FLAY = 59367,
|
||||
SPELL_CURSE_OF_FATIGUE = 52592,
|
||||
H_SPELL_CURSE_OF_FATIGUE = 59368,
|
||||
SPELL_FRENZY = 28747, //maybe 53361
|
||||
};
|
||||
|
||||
enum Mobs
|
||||
{
|
||||
MOB_SKITTERING_SWARMER = 28735,
|
||||
MOB_SKITTERING_SWARMER_CONTROLLER = 32593,
|
||||
MOB_SKITTERING_INFECTIOR = 28736,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SUMMON_SKITTERING_SWARMER = 52438, //AOE Effect 140, maybe 52439
|
||||
SPELL_SUMMON_SKITTERING_SWARMER_1 = 52439, //Summon 3x 28735
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1601000,
|
||||
SAY_SLAY_1 = -1601001,
|
||||
SAY_SLAY_2 = -1601002,
|
||||
SAY_DEATH = -1601003,
|
||||
|
||||
//Not in db
|
||||
SAY_SEND_GROUP_1 = -1601004,
|
||||
SAY_SEND_GROUP_2 = -1601005,
|
||||
|
||||
+18
-3
@@ -88,9 +88,24 @@ VendorItem const* VendorItemData::FindItem(uint32 item_id) const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32 CreatureInfo::GetRandomValidModelIdIncludingNativeId(uint32 native_id) const
|
||||
{
|
||||
uint8 c = 0;
|
||||
uint32 modelIDs[5];
|
||||
|
||||
if (Modelid1) modelIDs[c++] = Modelid1;
|
||||
if (Modelid2) modelIDs[c++] = Modelid2;
|
||||
if (Modelid3) modelIDs[c++] = Modelid3;
|
||||
if (Modelid4) modelIDs[c++] = Modelid4;
|
||||
if (native_id != Modelid1 && native_id != Modelid2
|
||||
&& native_id != Modelid3 && native_id != Modelid4) modelIDs[c++] = native_id;
|
||||
|
||||
return ((c>0) ? modelIDs[urand(0,c-1)] : 0);
|
||||
}
|
||||
|
||||
uint32 CreatureInfo::GetRandomValidModelId() const
|
||||
{
|
||||
uint32 c = 0;
|
||||
uint8 c = 0;
|
||||
uint32 modelIDs[4];
|
||||
|
||||
if (Modelid1) modelIDs[c++] = Modelid1;
|
||||
@@ -724,7 +739,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
|
||||
}
|
||||
LoadCreaturesAddon();
|
||||
}
|
||||
SetDisplayId(GetCreatureInfo()->GetRandomValidModelId());
|
||||
SetDisplayId(GetCreatureInfo()->GetRandomValidModelIdIncludingNativeId(GetNativeDisplayId()));
|
||||
return bResult;
|
||||
}
|
||||
|
||||
@@ -1844,7 +1859,7 @@ void Creature::Respawn(bool force)
|
||||
else
|
||||
setDeathState( JUST_ALIVED );
|
||||
|
||||
SetDisplayId(cinfo->GetRandomValidModelId());
|
||||
SetDisplayId(cinfo->GetRandomValidModelIdIncludingNativeId(GetNativeDisplayId()));
|
||||
|
||||
//Call AI respawn virtual function
|
||||
AI()->JustRespawned();
|
||||
|
||||
@@ -236,6 +236,7 @@ struct CreatureInfo
|
||||
uint32 MechanicImmuneMask;
|
||||
uint32 flags_extra;
|
||||
uint32 ScriptID;
|
||||
uint32 GetRandomValidModelIdIncludingNativeId(uint32 native_id) const;
|
||||
uint32 GetRandomValidModelId() const;
|
||||
uint32 GetFirstValidModelId() const;
|
||||
|
||||
|
||||
@@ -39,12 +39,14 @@ class Item;
|
||||
class Object;
|
||||
class Player;
|
||||
class Unit;
|
||||
class GameObject;
|
||||
class WorldPacket;
|
||||
class WorldSocket;
|
||||
class WorldSession;
|
||||
class QueryResult;
|
||||
class LoginQueryHolder;
|
||||
class CharacterHandler;
|
||||
class AreaTableEntry;
|
||||
|
||||
enum AccountDataType
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user