diff options
-rw-r--r-- | src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp | 12 | ||||
-rw-r--r-- | src/game/Creature.cpp | 21 | ||||
-rw-r--r-- | src/game/Creature.h | 1 | ||||
-rw-r--r-- | src/game/WorldSession.h | 2 |
4 files changed, 31 insertions, 5 deletions
diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp index 938cba19cf7..0d2058f6340 100644 --- a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp @@ -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, diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index dda642c9504..8b55c9da616 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -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(); diff --git a/src/game/Creature.h b/src/game/Creature.h index 8f123dad406..781de31b049 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -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; diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 35426d004d0..92cdf157674 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -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 { |