aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXanadu <none@none>2010-03-25 17:09:45 +0100
committerXanadu <none@none>2010-03-25 17:09:45 +0100
commitd0c10d44b87b8a5fb0a2c0db19bf1468d1be4246 (patch)
treeb38b1d72679b2a90e841af1fe09674e9279e7026 /src
parent20de79f6baae006c4536cadb3d1a598bcb792363 (diff)
parent7d6923d8c764f6f0de0a82133c80add8eaf85dd1 (diff)
Merge
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/ObjectMgr.cpp263
-rw-r--r--src/game/ObjectMgr.h10
-rw-r--r--src/game/Vehicle.cpp56
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp5
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h10
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp11
-rw-r--r--src/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp51
-rw-r--r--src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp26
-rw-r--r--src/scripts/northrend/gundrak/boss_eck.cpp28
-rw-r--r--src/scripts/northrend/gundrak/boss_gal_darah.cpp172
-rw-r--r--src/scripts/northrend/gundrak/boss_moorabi.cpp42
-rw-r--r--src/scripts/northrend/gundrak/boss_slad_ran.cpp54
-rw-r--r--src/scripts/northrend/gundrak/gundrak.h2
-rw-r--r--src/scripts/northrend/gundrak/instance_gundrak.cpp2
14 files changed, 446 insertions, 286 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 1532e232754..ba06d8b9c84 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -2367,7 +2367,6 @@ void ObjectMgr::LoadItemPrototypes()
void ObjectMgr::LoadVehicleAccessories()
{
m_VehicleAccessoryMap.clear(); // needed for reload case
- VehicleAccessoryList mVehicleList;
uint32 count = 0;
@@ -2408,9 +2407,7 @@ void ObjectMgr::LoadVehicleAccessories()
continue;
}
- mVehicleList = GetVehicleAccessoryList(uiEntry);
- mVehicleList.push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion));
- m_VehicleAccessoryMap[uiEntry] = mVehicleList;
+ m_VehicleAccessoryMap[uiEntry].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion));
++count;
} while (result->NextRow());
@@ -8148,6 +8145,124 @@ void ObjectMgr::LoadMailLevelRewards()
sLog.outString( ">> Loaded %u level dependent mail rewards,", count );
}
+bool ObjectMgr::AddSpellToTrainer(int32 entry, int32 spell, Field *fields, std::set<uint32> *skip_trainers, std::set<uint32> *talentIds)
+{
+ CreatureInfo const* cInfo = GetCreatureTemplate(entry);
+
+ if(!cInfo && entry > 0)
+ {
+ sLog.outErrorDb("Table `npc_trainer` have entry for not existed creature template (Entry: %u), ignore", entry);
+ return false;
+ }
+
+ if(!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER))
+ {
+ if (skip_trainers->find(entry) == skip_trainers->end())
+ {
+ sLog.outErrorDb("Table `npc_trainer` have data for not creature template (Entry: %u) without trainer flag, ignore", entry);
+ skip_trainers->insert(entry);
+ }
+ return false;
+ }
+
+ SpellEntry const *spellinfo = sSpellStore.LookupEntry(spell);
+ if(!spellinfo)
+ {
+ sLog.outErrorDb("Table `npc_trainer` for Trainer (Entry: %u ) has non existing spell %u, ignore", entry,spell);
+ return false;
+ }
+
+ if(!SpellMgr::IsSpellValid(spellinfo))
+ {
+ sLog.outErrorDb("Table `npc_trainer` for Trainer (Entry: %u) has broken learning spell %u, ignore", entry, spell);
+ return false;
+ }
+
+ if(GetTalentSpellCost(spell))
+ {
+ if(talentIds->count(spell)==0)
+ {
+ sLog.outErrorDb("Table `npc_trainer` has talent as learning spell %u, ignore", spell);
+ talentIds->insert(spell);
+ }
+ return false;
+ }
+
+ TrainerSpellData& data = m_mCacheTrainerSpellMap[entry];
+
+ TrainerSpell& trainerSpell = data.spellList[spell];
+ trainerSpell.spell = spell;
+ trainerSpell.spellCost = fields[2].GetUInt32();
+ trainerSpell.reqSkill = fields[3].GetUInt32();
+ trainerSpell.reqSkillValue = fields[4].GetUInt32();
+ trainerSpell.reqLevel = fields[5].GetUInt32();
+
+ if(!trainerSpell.reqLevel)
+ trainerSpell.reqLevel = spellinfo->spellLevel;
+
+ // calculate learned spell for profession case when stored cast-spell
+ trainerSpell.learnedSpell[0] = spell;
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if(spellinfo->Effect[i] != SPELL_EFFECT_LEARN_SPELL)
+ continue;
+ if (trainerSpell.learnedSpell[0] == spell)
+ trainerSpell.learnedSpell[0] = 0;
+ // player must be able to cast spell on himself
+ if (spellinfo->EffectImplicitTargetA[i] != 0 && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ALLY
+ && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ANY && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_CASTER)
+ {
+ sLog.outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
+ continue;
+ }
+
+ trainerSpell.learnedSpell[i] = spellinfo->EffectTriggerSpell[i];
+ }
+
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (!trainerSpell.learnedSpell[i])
+ continue;
+ if(SpellMgr::IsProfessionSpell(trainerSpell.learnedSpell[i]))
+ {
+ data.trainerType = 2;
+ break;
+ }
+ }
+
+ return true;
+}
+
+int ObjectMgr::LoadReferenceTrainer(int32 trainer, int32 spell, std::set<uint32> *skip_trainers, std::set<uint32> *talentIds)
+{
+ QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer WHERE entry='%d'", spell);
+ if ( !result )
+ {
+ barGoLink bar( 1 );
+
+ bar.step();
+ return 0;
+ }
+
+ barGoLink bar( result->GetRowCount() );
+
+ uint32 count = 0;
+ do
+ {
+ bar.step();
+
+ Field* fields = result->Fetch();
+
+ int32 spell = fields[1].GetInt32();
+ if ( spell < 0 )
+ count += this->LoadReferenceTrainer(trainer, -spell, skip_trainers, talentIds);
+ else if ( this->AddSpellToTrainer(trainer, spell, fields, skip_trainers, talentIds) )
+ ++count;
+ } while (result->NextRow());
+
+ return count;
+}
+
void ObjectMgr::LoadTrainerSpell()
{
// For reload case
@@ -8182,97 +8297,62 @@ void ObjectMgr::LoadTrainerSpell()
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
- uint32 spell = fields[1].GetUInt32();
-
- CreatureInfo const* cInfo = GetCreatureTemplate(entry);
-
- if(!cInfo)
- {
- sLog.outErrorDb("Table `npc_trainer` have entry for not existed creature template (Entry: %u), ignore", entry);
- continue;
- }
+ int32 spell = fields[1].GetInt32();
+ if ( spell < 0 )
+ count += this->LoadReferenceTrainer(entry, -spell, &skip_trainers, &talentIds);
+ else if ( this->AddSpellToTrainer(entry, spell, fields, &skip_trainers, &talentIds) )
+ ++count;
- if(!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER))
- {
- if (skip_trainers.find(entry) == skip_trainers.end())
- {
- sLog.outErrorDb("Table `npc_trainer` have data for not creature template (Entry: %u) without trainer flag, ignore", entry);
- skip_trainers.insert(entry);
- }
- continue;
- }
+ } while (result->NextRow());
- SpellEntry const *spellinfo = sSpellStore.LookupEntry(spell);
- if(!spellinfo)
- {
- sLog.outErrorDb("Table `npc_trainer` for Trainer (Entry: %u ) has non existing spell %u, ignore", entry,spell);
- continue;
- }
+ sLog.outString();
+ sLog.outString( ">> Loaded %d Trainers", count );
+}
- if(!SpellMgr::IsSpellValid(spellinfo))
- {
- sLog.outErrorDb("Table `npc_trainer` for Trainer (Entry: %u) has broken learning spell %u, ignore", entry, spell);
- continue;
- }
+int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
+{
+ // find all items from the reference vendor
+ QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d'", item);
+ if( !result )
+ {
+ barGoLink bar( 1 );
- if(GetTalentSpellCost(spell))
- {
- if(talentIds.count(spell)==0)
- {
- sLog.outErrorDb("Table `npc_trainer` has talent as learning spell %u, ignore", spell);
- talentIds.insert(spell);
- }
- continue;
- }
+ bar.step();
+ return 0;
+ }
- TrainerSpellData& data = m_mCacheTrainerSpellMap[entry];
+ barGoLink bar( result->GetRowCount() );
- TrainerSpell& trainerSpell = data.spellList[spell];
- trainerSpell.spell = spell;
- trainerSpell.spellCost = fields[2].GetUInt32();
- trainerSpell.reqSkill = fields[3].GetUInt32();
- trainerSpell.reqSkillValue = fields[4].GetUInt32();
- trainerSpell.reqLevel = fields[5].GetUInt32();
+ uint32 count = 0;
+ do
+ {
+ bar.step();
+ Field* fields = result->Fetch();
- if(!trainerSpell.reqLevel)
- trainerSpell.reqLevel = spellinfo->spellLevel;
+ uint32 entry = fields[0].GetUInt32();
+ int32 item_id = fields[1].GetInt32();
- // calculate learned spell for profession case when stored cast-spell
- trainerSpell.learnedSpell[0] = spell;
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ // if item is a negative, its a reference
+ if ( item_id < 0 )
+ count += LoadReferenceVendor(vendor, -item_id, skip_vendors);
+ else
{
- if(spellinfo->Effect[i] != SPELL_EFFECT_LEARN_SPELL)
- continue;
- if (trainerSpell.learnedSpell[0] == spell)
- trainerSpell.learnedSpell[0] = 0;
- // player must be able to cast spell on himself
- if (spellinfo->EffectImplicitTargetA[i] != 0 && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ALLY
- && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ANY && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_CASTER)
- {
- sLog.outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
+ int32 maxcount = fields[2].GetInt32();
+ uint32 incrtime = fields[3].GetUInt32();
+ uint32 ExtendedCost = fields[4].GetUInt32();
+
+ if(!IsVendorItemValid(vendor,item_id,maxcount,incrtime,ExtendedCost,NULL,skip_vendors))
continue;
- }
- trainerSpell.learnedSpell[i] = spellinfo->EffectTriggerSpell[i];
- }
+ VendorItemData& vList = m_mCacheVendorItemMap[vendor];
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- {
- if (!trainerSpell.learnedSpell[i])
- continue;
- if(SpellMgr::IsProfessionSpell(trainerSpell.learnedSpell[i]))
- {
- data.trainerType = 2;
- break;
- }
+ vList.AddItem(item_id,maxcount,incrtime,ExtendedCost);
+ ++count;
}
- ++count;
-
} while (result->NextRow());
- sLog.outString();
- sLog.outString( ">> Loaded %d Trainers", count );
+ return count;
}
void ObjectMgr::LoadVendors()
@@ -8305,18 +8385,25 @@ void ObjectMgr::LoadVendors()
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
- uint32 item_id = fields[1].GetUInt32();
- int32 maxcount = fields[2].GetInt32();
- uint32 incrtime = fields[3].GetUInt32();
- uint32 ExtendedCost = fields[4].GetUInt32();
+ int32 item_id = fields[1].GetInt32();
- if(!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost,NULL,&skip_vendors))
- continue;
+ // if item is a negative, its a reference
+ if ( item_id < 0 )
+ count += LoadReferenceVendor(entry, -item_id, &skip_vendors);
+ else
+ {
+ int32 maxcount = fields[2].GetInt32();
+ uint32 incrtime = fields[3].GetUInt32();
+ uint32 ExtendedCost = fields[4].GetUInt32();
+
+ if(!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost,NULL,&skip_vendors))
+ continue;
- VendorItemData& vList = m_mCacheVendorItemMap[entry];
+ VendorItemData& vList = m_mCacheVendorItemMap[entry];
- vList.AddItem(item_id,maxcount,incrtime,ExtendedCost);
- ++count;
+ vList.AddItem(item_id,maxcount,incrtime,ExtendedCost);
+ ++count;
+ }
} while (result->NextRow());
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 1f061618ced..2e7de177fdb 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -429,6 +429,7 @@ class ObjectMgr
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
+ int LoadReferenceVendor(int32 vendor, int32 item_id, std::set<uint32> *skip_vendors);
void LoadGameobjectInfo();
void AddGameobjectInfo(GameObjectInfo *goinfo);
@@ -582,13 +583,12 @@ class ObjectMgr
return NULL;
}
- VehicleAccessoryList GetVehicleAccessoryList(uint32 uiEntry)
+ VehicleAccessoryList const* GetVehicleAccessoryList(uint32 uiEntry) const
{
- VehicleAccessoryList mVehList;
VehicleAccessoryMap::const_iterator itr = m_VehicleAccessoryMap.find(uiEntry);
if (itr != m_VehicleAccessoryMap.end())
- mVehList = itr->second;
- return mVehList;
+ return &itr->second;
+ return NULL;
}
void LoadGuilds();
@@ -691,6 +691,8 @@ class ObjectMgr
void LoadVendors();
void LoadTrainerSpell();
+ bool AddSpellToTrainer(int32 entry, int32 spell, Field *fields, std::set<uint32> *skip_trainers, std::set<uint32> *talentIds);
+ int LoadReferenceTrainer(int32 trainer, int32 spell, std::set<uint32> *skip_trainers, std::set<uint32> *talentIds);
void LoadGMTickets();
std::string GeneratePetName(uint32 entry);
diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp
index f25816ff121..6fcea316787 100644
--- a/src/game/Vehicle.cpp
+++ b/src/game/Vehicle.cpp
@@ -91,56 +91,12 @@ void Vehicle::Install()
void Vehicle::InstallAllAccessories()
{
- VehicleAccessoryList mVehicleList = objmgr.GetVehicleAccessoryList(me->GetEntry());
- if (mVehicleList.size())
- for (VehicleAccessoryList::iterator itr2 = mVehicleList.begin(); itr2 < mVehicleList.end(); ++itr2)
- InstallAccessory(itr2->uiAccessory, itr2->uiSeat, itr2->bMinion);
- /*switch(me->GetEntry())
- {
- //case 27850:InstallAccessory(27905,1);break;
- case 28782:InstallAccessory(28768,0,false);break; // Acherus Deathcharger
- case 28312:InstallAccessory(28319,7);break;
- case 32627:InstallAccessory(32629,7);break;
- case 32930:
- InstallAccessory(32933,0);
- InstallAccessory(32934,1);
- break;
- case 33109:InstallAccessory(33167,1);break;
- case 33060:InstallAccessory(33067,7);break;
- case 33113:
- InstallAccessory(33114,0);
- InstallAccessory(33114,1);
- InstallAccessory(33114,2);
- InstallAccessory(33114,3);
- InstallAccessory(33139,7);
- break;
- case 33114:
- InstallAccessory(33143,2); // Overload Control Device
- InstallAccessory(33142,1); // Leviathan Defense Turret
- break;
- case 33214:InstallAccessory(33218,1,false);break; // Mechanolift 304-A
- case 35637:InstallAccessory(34705,0,false);break;
- case 35633:InstallAccessory(34702,0,false);break;
- case 35768:InstallAccessory(34701,0,false);break;
- case 34658:InstallAccessory(34657,0,false);break;
- case 35636:InstallAccessory(34703,0,false);break;
- case 35638:InstallAccessory(35572,0,false);break;
- case 35635:InstallAccessory(35569,0,false);break;
- case 35640:InstallAccessory(35571,0,false);break;
- case 35641:InstallAccessory(35570,0,false);break;
- case 35634:InstallAccessory(35617,0,false);break;
- case 33298:InstallAccessory(35332,0);break; //Darnassian Nightsaber
- case 33416:InstallAccessory(35330,0);break; //Exodar Elekk
- case 33297:InstallAccessory(35328,0);break; //Stormwind Steed
- case 33414:InstallAccessory(35327,0);break; //Forsaken Warhorse
- case 33301:InstallAccessory(35331,0);break; //Gnomeregan Mechanostrider
- case 33408:InstallAccessory(35329,0);break; //Ironforge Ram
- case 33300:InstallAccessory(35325,0);break; //Thunder Bluff Kodo
- case 33409:InstallAccessory(35314,0);break; //Orgrimmar Wolf
- case 33418:InstallAccessory(35326,0);break; //Silvermoon Hawkstrider
- case 33299:InstallAccessory(35323,0);break; //Darkspear Raptor
- case 35491:InstallAccessory(35451,0,false);break; //Black Knight
- }*/
+ VehicleAccessoryList const* mVehicleList = objmgr.GetVehicleAccessoryList(me->GetEntry());
+ if (!mVehicleList)
+ return;
+
+ for (VehicleAccessoryList::const_iterator itr = mVehicleList->begin(); itr != mVehicleList->end(); ++itr)
+ InstallAccessory(itr->uiAccessory, itr->uiSeat, itr->bMinion);
}
void Vehicle::Uninstall()
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp
index e9256750d31..5ecc380019d 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp
@@ -52,6 +52,11 @@ bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo)
pInstance->SetData(TYPE_LYCEUM, DONE);
else
pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS);
+ // If used brazier open linked doors (North or South)
+ if(pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_N))
+ pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_N), true);
+ else if(pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_S))
+ pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_S), true);
}
return false;
}
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h
index c467e3873cf..edb340252b2 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h
@@ -32,6 +32,14 @@ enum eTypes
DATA_GO_CHALICE = 19,
DATA_GHOSTKILL = 20,
- DATA_EVENSTARTER = 21
+ DATA_EVENSTARTER = 21,
+
+ DATA_GOLEM_DOOR_N = 22,
+ DATA_GOLEM_DOOR_S = 23,
+
+ DATA_THRONE_DOOR = 24,
+
+ DATA_SF_BRAZIER_N = 25,
+ DATA_SF_BRAZIER_S = 26
};
#endif
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp
index 773eaf913cd..1854a7b2adc 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp
@@ -29,6 +29,11 @@ enum Spells
SPELL_WARSTOMP = 24375
};
+enum eEnums
+{
+ DATA_THRONE_DOOR = 24 // not id or guid of doors but number of enum in blackrock_depths.h
+};
+
struct boss_magmusAI : public ScriptedAI
{
boss_magmusAI(Creature *c) : ScriptedAI(c) {}
@@ -71,6 +76,12 @@ struct boss_magmusAI : public ScriptedAI
DoMeleeAttackIfReady();
}
+ // When he die open door to last chamber
+ void JustDied(Unit *who)
+ {
+ if(ScriptedInstance* pInstance = who->GetInstanceData())
+ pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true);
+ }
};
CreatureAI* GetAI_boss_magmus(Creature* pCreature)
{
diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp
index e04ed9e99c6..d376dea8b6e 100644
--- a/src/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp
+++ b/src/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp
@@ -47,6 +47,7 @@ enum eEnums
NPC_SEETHREL = 9038,
NPC_GLOOMREL = 9037,
NPC_DOOMREL = 9039,
+ NPC_MAGMUS = 9938,
GO_ARENA1 = 161525,
GO_ARENA2 = 161522,
@@ -62,9 +63,11 @@ enum eEnums
GO_TOMB_ENTER = 170576,
GO_TOMB_EXIT = 170577,
GO_LYCEUM = 170558,
- GO_GOLEM_ROOM_N = 170573,
- GO_GOLEM_ROOM_S = 170574,
- GO_THONE_ROOM = 170575,
+ GO_SF_N = 174745, // Shadowforge Brazier North
+ GO_SF_S = 174744, // Shadowforge Brazier South
+ GO_GOLEM_ROOM_N = 170573, // Magmus door North
+ GO_GOLEM_ROOM_S = 170574, // Magmus door Soutsh
+ GO_THRONE_ROOM = 170575, // Throne door
GO_SPECTRAL_CHALICE = 164869,
GO_CHEST_SEVEN = 169243
@@ -79,6 +82,7 @@ struct instance_blackrock_depths : public ScriptedInstance
uint64 EmperorGUID;
uint64 PhalanxGUID;
+ uint64 MagmusGUID;
uint64 GoArena1GUID;
uint64 GoArena2GUID;
@@ -94,9 +98,11 @@ struct instance_blackrock_depths : public ScriptedInstance
uint64 GoTombEnterGUID;
uint64 GoTombExitGUID;
uint64 GoLyceumGUID;
+ uint64 GoSFSGUID;
+ uint64 GoSFNGUID;
uint64 GoGolemNGUID;
uint64 GoGolemSGUID;
- uint64 GoThoneGUID;
+ uint64 GoThroneGUID;
uint64 GoChestGUID;
uint32 BarAleCount;
@@ -112,6 +118,7 @@ struct instance_blackrock_depths : public ScriptedInstance
EmperorGUID = 0;
PhalanxGUID = 0;
+ MagmusGUID = 0;
GoArena1GUID = 0;
GoArena2GUID = 0;
@@ -127,9 +134,11 @@ struct instance_blackrock_depths : public ScriptedInstance
GoTombEnterGUID = 0;
GoTombExitGUID = 0;
GoLyceumGUID = 0;
+ GoSFSGUID = 0;
+ GoSFNGUID = 0;
GoGolemNGUID = 0;
GoGolemSGUID = 0;
- GoThoneGUID = 0;
+ GoThroneGUID = 0;
GoChestGUID = 0;
BarAleCount = 0;
@@ -155,6 +164,11 @@ struct instance_blackrock_depths : public ScriptedInstance
case NPC_SEETHREL: TombBossGUIDs[4] = pCreature->GetGUID(); break;
case NPC_GLOOMREL: TombBossGUIDs[5] = pCreature->GetGUID(); break;
case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break;
+ case NPC_MAGMUS:
+ MagmusGUID = pCreature->GetGUID();
+ if(!pCreature->isAlive())
+ HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
+ break;
}
}
@@ -182,9 +196,11 @@ struct instance_blackrock_depths : public ScriptedInstance
HandleGameObject(0, false, pGo);
break;
case GO_LYCEUM: GoLyceumGUID = pGo->GetGUID(); break;
+ case GO_SF_S: GoSFSGUID = pGo->GetGUID(); break;
+ case GO_SF_N: GoSFNGUID = pGo->GetGUID(); break;
case GO_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break;
case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break;
- case GO_THONE_ROOM: GoThoneGUID = pGo->GetGUID(); break;
+ case GO_THRONE_ROOM: GoThroneGUID = pGo->GetGUID(); break;
case GO_CHEST_SEVEN: GoChestGUID = pGo->GetGUID(); break;
}
}
@@ -301,6 +317,16 @@ struct instance_blackrock_depths : public ScriptedInstance
return GoBarDoorGUID;
case DATA_EVENSTARTER:
return TombEventStarterGUID;
+ case DATA_SF_BRAZIER_N:
+ return GoSFNGUID;
+ case DATA_SF_BRAZIER_S:
+ return GoSFSGUID;
+ case DATA_THRONE_DOOR:
+ return GoThroneGUID;
+ case DATA_GOLEM_DOOR_N:
+ return GoGolemNGUID;
+ case DATA_GOLEM_DOOR_S:
+ return GoGolemSGUID;
}
return 0;
}
@@ -329,7 +355,7 @@ struct instance_blackrock_depths : public ScriptedInstance
m_auiEncounter[i] = NOT_STARTED;
if (GhostKillCount > 0 && GhostKillCount < 7)
GhostKillCount = 0;//reset tomb of seven event
- if (GhostKillCount > 7)
+ if (GhostKillCount >= 7)
GhostKillCount = 7;
OUT_LOAD_INST_DATA_COMPLETE;
@@ -401,6 +427,17 @@ struct instance_blackrock_depths : public ScriptedInstance
TombTimer = TIMER_TOMBOFTHESEVEN;
++TombEventCounter;
TombOfSevenEvent();
+ // Check Killed bosses
+ for (uint8 i = 0; i < 7; ++i)
+ {
+ if (Creature* boss = instance->GetCreature(TombBossGUIDs[i]))
+ {
+ if (!boss->isAlive())
+ {
+ GhostKillCount = i+1;
+ }
+ }
+ }
} else TombTimer -= diff;
}
if (GhostKillCount >= 7 && TombEventStarterGUID)
diff --git a/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp b/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp
index 1665f50a731..1f63bb3ef60 100644
--- a/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp
+++ b/src/scripts/northrend/gundrak/boss_drakkari_colossus.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2010 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->clearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT);
m_creature->SetReactState(REACT_PASSIVE);
- MightyBlowTimer = 10000;
+ MightyBlowTimer = 10*IN_MILISECONDS;
bHealth = false;
bHealth1 = false;
}
@@ -96,7 +96,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
if (!UpdateVictim())
return;
- if (!bHealth && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() >= 6)
+ if (!bHealth && HealthBelowPct(50) && !HealthBelowPct(6))
{
CreatureState(m_creature, false);
DoCast(m_creature,SPELL_FREEZE_ANIM);
@@ -104,7 +104,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
bHealth = true;
}
- if (!bHealth1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 5)
+ if (!bHealth1 && HealthBelowPct(5))
{
DoCast(m_creature,SPELL_EMERGE);
CreatureState(m_creature, false);
@@ -115,7 +115,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
if (MightyBlowTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW, true);
- MightyBlowTimer = 10000;
+ MightyBlowTimer = 10*IN_MILISECONDS;
} else MightyBlowTimer -= diff;
if (!m_creature->hasUnitState(UNIT_STAT_STUNNED))
@@ -130,7 +130,7 @@ struct boss_drakkari_colossusAI : public ScriptedAI
void JustSummoned(Creature* pSummon)
{
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 5)
+ if (HealthBelowPct(5))
pSummon->DealDamage(pSummon, pSummon->GetHealth() * 0.5 , NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
pSummon->AI()->AttackStart(m_creature->getVictim());
}
@@ -160,7 +160,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI
{
if (pColossus)
CAST_AI(boss_drakkari_colossusAI, pColossus->AI())->CreatureState(m_creature, true);
- uiSurgeTimer = 7000;
+ uiSurgeTimer = 7*IN_MILISECONDS;
bGoToColossus = false;
}
@@ -184,7 +184,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI
if(!UpdateVictim())
return;
- if(!bGoToColossus && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && pColossus->GetHealth()*100 / pColossus->GetMaxHealth() >= 6)
+ if(!bGoToColossus && HealthBelowPct(50) && !CAST_AI(boss_drakkari_colossusAI,pColossus->AI())->HealthBelowPct(6))
{
m_creature->InterruptNonMeleeSpells(true);
if (pColossus)
@@ -195,7 +195,7 @@ struct boss_drakkari_elementalAI : public ScriptedAI
if (uiSurgeTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SURGE);
- uiSurgeTimer = 7000;
+ uiSurgeTimer = 7*IN_MILISECONDS;
} else uiSurgeTimer -= diff;
DoMeleeAttackIfReady();
@@ -225,8 +225,8 @@ struct npc_living_mojoAI : public ScriptedAI
void Reset()
{
- uiMojoWaveTimer = 2000;
- uiMojoPuddleTimer = 7000;
+ uiMojoWaveTimer = 2*IN_MILISECONDS;
+ uiMojoPuddleTimer = 7*IN_MILISECONDS;
}
void EnterCombat(Unit* who)
@@ -266,13 +266,13 @@ struct npc_living_mojoAI : public ScriptedAI
if (uiMojoWaveTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MOJO_WAVE, H_SPELL_MOJO_WAVE));
- uiMojoWaveTimer = 15000;
+ uiMojoWaveTimer = 15*IN_MILISECONDS;
} else uiMojoWaveTimer -= diff;
if (uiMojoPuddleTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MOJO_PUDDLE, H_SPELL_MOJO_PUDDLE));
- uiMojoPuddleTimer = 18000;
+ uiMojoPuddleTimer = 18*IN_MILISECONDS;
} else uiMojoPuddleTimer -= diff;
DoMeleeAttackIfReady();
diff --git a/src/scripts/northrend/gundrak/boss_eck.cpp b/src/scripts/northrend/gundrak/boss_eck.cpp
index cac1bfd8f3e..383b93126c2 100644
--- a/src/scripts/northrend/gundrak/boss_eck.cpp
+++ b/src/scripts/northrend/gundrak/boss_eck.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2009-2010 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@
enum Spells
{
- SPELL_ECK_BERSERK = 55816, //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
- SPELL_ECK_BITE = 55813, //Eck bites down hard, inflicting 150% of his normal damage to an enemy.
- SPELL_ECK_SPIT = 55814, //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec.
- SPELL_ECK_SPRING_1 = 55815, //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back.
- SPELL_ECK_SPRING_2 = 55837 //Eck leaps at a distant target.
+ SPELL_ECK_BERSERK = 55816, //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%.
+ SPELL_ECK_BITE = 55813, //Eck bites down hard, inflicting 150% of his normal damage to an enemy.
+ SPELL_ECK_SPIT = 55814, //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec.
+ SPELL_ECK_SPRING_1 = 55815, //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back.
+ SPELL_ECK_SPRING_2 = 55837 //Eck leaps at a distant target.
};
static Position EckSpawnPoint = { 1643.877930, 936.278015, 107.204948, 0.668432 };
@@ -48,10 +48,10 @@ struct boss_eckAI : public ScriptedAI
void Reset()
{
- uiBerserkTimer = 60000 + rand()%30000; //60-90 secs according to wowwiki
- uiBiteTimer = 5000;
- uiSpitTimer = 10000;
- uiSpringTimer = 8000;
+ uiBerserkTimer = urand(60*IN_MILISECONDS,90*IN_MILISECONDS); //60-90 secs according to wowwiki
+ uiBiteTimer = 5*IN_MILISECONDS;
+ uiSpitTimer = 10*IN_MILISECONDS;
+ uiSpringTimer = 8*IN_MILISECONDS;
bBerserk = false;
@@ -74,13 +74,13 @@ struct boss_eckAI : public ScriptedAI
if (uiBiteTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ECK_BITE);
- uiBiteTimer = 8000 + rand()%4000;
+ uiBiteTimer = urand(8*IN_MILISECONDS,12*IN_MILISECONDS);
} else uiBiteTimer -= diff;
if (uiSpitTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ECK_SPIT);
- uiSpitTimer = 6000 + rand()%8000;
+ uiSpitTimer = urand(6*IN_MILISECONDS,14*IN_MILISECONDS);
} else uiSpitTimer -= diff;
if (uiSpringTimer <= diff)
@@ -89,7 +89,7 @@ struct boss_eckAI : public ScriptedAI
if(pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
{
DoCast(pTarget, RAND(SPELL_ECK_SPRING_1, SPELL_ECK_SPRING_2));
- uiSpringTimer = 5000 + rand()%10000;
+ uiSpringTimer = urand(5*IN_MILISECONDS,10*IN_MILISECONDS);
}
} else uiSpringTimer -= diff;
@@ -104,7 +104,7 @@ struct boss_eckAI : public ScriptedAI
else
{
uiBerserkTimer -= diff;
- if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
+ if (HealthBelowPct(20))
{
DoCast(m_creature, SPELL_ECK_BERSERK);
bBerserk = true;
diff --git a/src/scripts/northrend/gundrak/boss_gal_darah.cpp b/src/scripts/northrend/gundrak/boss_gal_darah.cpp
index eefd3b9c105..828769fcd76 100644
--- a/src/scripts/northrend/gundrak/boss_gal_darah.cpp
+++ b/src/scripts/northrend/gundrak/boss_gal_darah.cpp
@@ -1,14 +1,21 @@
-/* Script Data Start
-SDName: Boss gal_darah
-SDAuthor: LordVanMartin
-SD%Complete:
-SDComment:
-SDCategory:
-Script Data End */
-
-/*** SQL START ***
-update creature_template set scriptname = '' where entry = '';
-*** SQL END ***/
+/*
+* Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
#include "ScriptedPch.h"
#include "gundrak.h"
@@ -20,36 +27,41 @@ enum Spells
SPELL_IMPALING_CHARGE = 54956,
H_SPELL_IMPALING_CHARGE = 59827,
SPELL_STOMP = 55292,
- H_SPELL_STOMP = 59826,
+ H_SPELL_STOMP = 59829,
SPELL_PUNCTURE = 55276,
H_SPELL_PUNCTURE = 59826,
SPELL_STAMPEDE = 55218,
- SPELL_WHIRLING_SLASH = 55249,
- H_SPELL_WHIRLING_SLASH = 55825,
+ SPELL_WHIRLING_SLASH = 55250,
+ H_SPELL_WHIRLING_SLASH = 59824,
SPELL_ECK_RESIDUE = 55817
};
//Yells
enum Yells
{
- SAY_AGGRO = -1604000,
- SAY_SLAY_1 = -1604001,
- SAY_SLAY_2 = -1604002,
- SAY_SLAY_3 = -1604003,
- SAY_DEATH = -1604004,
- SAY_SUMMON_RHINO_1 = -1604005,
- SAY_SUMMON_RHINO_2 = -1604006,
- SAY_SUMMON_RHINO_3 = -1604007,
- SAY_TRANSFORM_1 = -1604008, //Phase change
- SAY_TRANSFORM_2 = -1604009
+ SAY_AGGRO = -1604000,
+ SAY_SLAY_1 = -1604001,
+ SAY_SLAY_2 = -1604002,
+ SAY_SLAY_3 = -1604003,
+ SAY_DEATH = -1604004,
+ SAY_SUMMON_RHINO_1 = -1604005,
+ SAY_SUMMON_RHINO_2 = -1604006,
+ SAY_SUMMON_RHINO_3 = -1604007,
+ SAY_TRANSFORM_1 = -1604008, //Phase change
+ SAY_TRANSFORM_2 = -1604009
};
enum Achievements
{
- ACHIEVEMENT_WHAT_THE_ECK = 1864,
- ACHIEVEMENT_SHARE_THE_LOVE = 2152
+ ACHIEV_WHAT_THE_ECK = 1864,
+ ACHIEV_SHARE_THE_LOVE = 2152
};
+enum Displays
+{
+ DISPLAY_RHINO = 26265,
+ DISPLAY_TROLL = 27061
+};
enum CombatPhase
{
@@ -70,28 +82,36 @@ struct boss_gal_darahAI : public ScriptedAI
uint32 uiEnrageTimer;
uint32 uiImpalingChargeTimer;
uint32 uiStompTimer;
+ uint32 uiTransformationTimer;
std::set<uint64> lImpaledPlayers;
CombatPhase Phase;
uint8 uiPhaseCounter;
+ bool bStartOfTransformation;
+
ScriptedInstance* pInstance;
void Reset()
{
- uiStampedeTimer = 10000;
- uiWhirlingSlashTimer = 20000;
- uiPunctureTimer = 10000;
- uiEnrageTimer = 15000;
- uiImpalingChargeTimer = 20000;
- uiStompTimer = 25000;
+ uiStampedeTimer = 10*IN_MILISECONDS;
+ uiWhirlingSlashTimer = 21*IN_MILISECONDS;
+ uiPunctureTimer = 10*IN_MILISECONDS;
+ uiEnrageTimer = 15*IN_MILISECONDS;
+ uiImpalingChargeTimer = 21*IN_MILISECONDS;
+ uiStompTimer = 25*IN_MILISECONDS;
+ uiTransformationTimer = 9*IN_MILISECONDS;
uiPhaseCounter = 0;
lImpaledPlayers.clear();
+ bStartOfTransformation = true;
+
Phase = TROLL;
+ m_creature->SetDisplayId(DISPLAY_TROLL);
+
if (pInstance)
pInstance->SetData(DATA_GAL_DARAH_EVENT, NOT_STARTED);
}
@@ -115,10 +135,28 @@ struct boss_gal_darahAI : public ScriptedAI
case TROLL:
if (uiPhaseCounter == 2)
{
- //FIX: implement transformation
- Phase = RHINO;
- uiPhaseCounter = 0;
- DoScriptText(SAY_TRANSFORM_1,m_creature);
+ if (uiTransformationTimer <= diff)
+ {
+ m_creature->SetDisplayId(DISPLAY_RHINO);
+ Phase = RHINO;
+ uiPhaseCounter = 0;
+ DoScriptText(SAY_TRANSFORM_1, m_creature);
+ uiTransformationTimer = 5*IN_MILISECONDS;
+ bStartOfTransformation = true;
+ m_creature->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ m_creature->SetReactState(REACT_AGGRESSIVE);
+ }
+ else
+ {
+ uiTransformationTimer -= diff;
+
+ if (bStartOfTransformation)
+ {
+ bStartOfTransformation = false;
+ m_creature->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ m_creature->SetReactState(REACT_PASSIVE);
+ }
+ }
}
else
{
@@ -126,13 +164,13 @@ struct boss_gal_darahAI : public ScriptedAI
{
DoCast(m_creature, SPELL_STAMPEDE);
DoScriptText(RAND(SAY_SUMMON_RHINO_1,SAY_SUMMON_RHINO_2,SAY_SUMMON_RHINO_3),m_creature);
- uiStampedeTimer = 15000;
+ uiStampedeTimer = 15*IN_MILISECONDS;
} else uiStampedeTimer -= diff;
if (uiWhirlingSlashTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_WHIRLING_SLASH, H_SPELL_WHIRLING_SLASH));
- uiWhirlingSlashTimer = 20000;
+ uiWhirlingSlashTimer = 21*IN_MILISECONDS;
++uiPhaseCounter;
} else uiWhirlingSlashTimer -= diff;
}
@@ -140,39 +178,57 @@ struct boss_gal_darahAI : public ScriptedAI
case RHINO:
if (uiPhaseCounter == 2)
{
- //FIX: implement transformation
- Phase = TROLL;
- uiPhaseCounter = 0;
- DoScriptText(SAY_TRANSFORM_2,m_creature);
+ if (uiTransformationTimer <= diff)
+ {
+ m_creature->SetDisplayId(DISPLAY_TROLL);
+ Phase = TROLL;
+ uiPhaseCounter = 0;
+ DoScriptText(SAY_TRANSFORM_2, m_creature);
+ uiTransformationTimer = 9*IN_MILISECONDS;
+ bStartOfTransformation = true;
+ m_creature->clearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ m_creature->SetReactState(REACT_AGGRESSIVE);
+ }
+ else
+ {
+ uiTransformationTimer -= diff;
+
+ if (bStartOfTransformation)
+ {
+ bStartOfTransformation = false;
+ m_creature->addUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT);
+ m_creature->SetReactState(REACT_PASSIVE);
+ }
+ }
}
else
{
if (uiPunctureTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_PUNCTURE, H_SPELL_PUNCTURE));
- uiPunctureTimer = 8000;
+ uiPunctureTimer = 8*IN_MILISECONDS;
} else uiPunctureTimer -= diff;
if (uiEnrageTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_ENRAGE, H_SPELL_ENRAGE));
- uiEnrageTimer = 20000;
+ uiEnrageTimer = 20*IN_MILISECONDS;
} else uiEnrageTimer -= diff;
if (uiStompTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_STOMP, H_SPELL_STOMP));
- uiStompTimer = 20000;
+ uiStompTimer = 20*IN_MILISECONDS;
} else uiStompTimer -= diff;
if (uiImpalingChargeTimer <= diff)
{
- if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
+ if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoCast(pTarget, DUNGEON_MODE(SPELL_IMPALING_CHARGE, H_SPELL_IMPALING_CHARGE));
lImpaledPlayers.insert(pTarget->GetGUID());
}
- uiImpalingChargeTimer = 30000;
+ uiImpalingChargeTimer = 31*IN_MILISECONDS;
++uiPhaseCounter;
} else uiImpalingChargeTimer -= diff;
}
@@ -186,27 +242,25 @@ struct boss_gal_darahAI : public ScriptedAI
{
DoScriptText(SAY_DEATH, m_creature);
- if (IsHeroic())
+ if (pInstance)
{
- AchievementEntry const *achievWhatTheEck = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WHAT_THE_ECK);
- if (achievWhatTheEck)
+ if (IsHeroic())
{
- Map* pMap = m_creature->GetMap();
- if (pMap && pMap->IsDungeon())
+ if (lImpaledPlayers.size() == 5)
+ pInstance->DoCompleteAchievement(ACHIEV_SHARE_THE_LOVE);
+
+ AchievementEntry const *achievWhatTheEck = GetAchievementStore()->LookupEntry(ACHIEV_WHAT_THE_ECK);
+ if (achievWhatTheEck)
{
- Map::PlayerList const &players = pMap->GetPlayers();
+ Map::PlayerList const &players = pInstance->instance->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (itr->getSource()->HasAura(SPELL_ECK_RESIDUE))
itr->getSource()->CompletedAchievement(achievWhatTheEck);
}
}
- }
-
- if (pInstance && IsHeroic() && lImpaledPlayers.size() == 5)
- pInstance->DoCompleteAchievement(ACHIEVEMENT_SHARE_THE_LOVE);
-
- if (pInstance)
+
pInstance->SetData(DATA_GAL_DARAH_EVENT, DONE);
+ }
}
void KilledUnit(Unit *victim)
diff --git a/src/scripts/northrend/gundrak/boss_moorabi.cpp b/src/scripts/northrend/gundrak/boss_moorabi.cpp
index e2843eb2ecb..f0f972fe078 100644
--- a/src/scripts/northrend/gundrak/boss_moorabi.cpp
+++ b/src/scripts/northrend/gundrak/boss_moorabi.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2009-2010 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ enum eSpells
SPELL_GROUND_TREMOR = 55142,
SPELL_NUMBING_SHOUT = 55106,
SPELL_DETERMINED_GORE = 55102,
- SPELL_DETERMINED_GORE_1 = 59444,
+ H_SPELL_DETERMINED_GORE = 59444,
SPELL_QUAKE = 55101,
SPELL_NUMBING_ROAR = 55100,
SPELL_MOJO_FRENZY = 55163,
@@ -34,19 +34,19 @@ enum eSpells
enum eArchivements
{
- ACHIEVEMENT_LESS_RABI = 2040
+ ACHIEV_LESS_RABI = 2040
};
enum eSays
{
- SAY_AGGRO = -1604010,
- //SAY_SLAY_1 = -1604011, // not in db
- SAY_SLAY_2 = -1604012,
- SAY_SLAY_3 = -1604013,
- SAY_DEATH = -1604014,
- SAY_TRANSFORM = -1604015,
- SAY_QUAKE = -1604016,
- EMOTE_TRANSFORM = -1604017
+ SAY_AGGRO = -1604010,
+ //SAY_SLAY_1 = -1604011, // not in db
+ SAY_SLAY_2 = -1604012,
+ SAY_SLAY_3 = -1604013,
+ SAY_DEATH = -1604014,
+ SAY_TRANSFORM = -1604015,
+ SAY_QUAKE = -1604016,
+ EMOTE_TRANSFORM = -1604017
};
struct boss_moorabiAI : public ScriptedAI
@@ -67,10 +67,10 @@ struct boss_moorabiAI : public ScriptedAI
void Reset()
{
- uiGroundTremorTimer = 18000;
- uiNumblingShoutTimer = 10000;
- uiDeterminedStabTimer = 20000;
- uiTransformationTImer = 12000;
+ uiGroundTremorTimer = 18*IN_MILISECONDS;
+ uiNumblingShoutTimer = 10*IN_MILISECONDS;
+ uiDeterminedStabTimer = 20*IN_MILISECONDS;
+ uiTransformationTImer = 12*IN_MILISECONDS;
bPhase = false;
if (pInstance)
@@ -105,7 +105,7 @@ struct boss_moorabiAI : public ScriptedAI
DoCast(m_creature->getVictim(), SPELL_QUAKE, true);
else
DoCast(m_creature->getVictim(), SPELL_GROUND_TREMOR, true);
- uiGroundTremorTimer = 10000;
+ uiGroundTremorTimer = 10*IN_MILISECONDS;
} else uiGroundTremorTimer -= uiDiff;
if (uiNumblingShoutTimer <= uiDiff)
@@ -114,16 +114,16 @@ struct boss_moorabiAI : public ScriptedAI
DoCast(m_creature->getVictim(), SPELL_NUMBING_ROAR, true);
else
DoCast(m_creature->getVictim(), SPELL_NUMBING_SHOUT, true);
- uiNumblingShoutTimer = 10000;
+ uiNumblingShoutTimer = 10*IN_MILISECONDS;
} else uiNumblingShoutTimer -=uiDiff;
if (uiDeterminedStabTimer <= uiDiff)
{
if (bPhase)
- DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_DETERMINED_GORE, SPELL_DETERMINED_GORE_1));
+ DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_DETERMINED_GORE, H_SPELL_DETERMINED_GORE));
else
DoCast(m_creature->getVictim(), SPELL_DETERMINED_STAB, true);
- uiDeterminedStabTimer = 8000;
+ uiDeterminedStabTimer = 8*IN_MILISECONDS;
} else uiDeterminedStabTimer -=uiDiff;
if (!bPhase && uiTransformationTImer <= uiDiff)
@@ -131,7 +131,7 @@ struct boss_moorabiAI : public ScriptedAI
DoScriptText(EMOTE_TRANSFORM, m_creature);
DoScriptText(SAY_TRANSFORM, m_creature);
DoCast(m_creature, SPELL_TRANSFORMATION, false);
- uiTransformationTImer = 10000;
+ uiTransformationTImer = 10*IN_MILISECONDS;
} else uiTransformationTImer -= uiDiff;
DoMeleeAttackIfReady();
@@ -146,7 +146,7 @@ struct boss_moorabiAI : public ScriptedAI
pInstance->SetData(DATA_MOORABI_EVENT, DONE);
if (IsHeroic() && !bPhase)
- pInstance->DoCompleteAchievement(ACHIEVEMENT_LESS_RABI);
+ pInstance->DoCompleteAchievement(ACHIEV_LESS_RABI);
}
}
diff --git a/src/scripts/northrend/gundrak/boss_slad_ran.cpp b/src/scripts/northrend/gundrak/boss_slad_ran.cpp
index 521eba5d1e7..143d1f095f6 100644
--- a/src/scripts/northrend/gundrak/boss_slad_ran.cpp
+++ b/src/scripts/northrend/gundrak/boss_slad_ran.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2009-2010 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,28 +33,28 @@ enum Spells
//Yell
enum Yells
{
- SAY_AGGRO = -1604017,
- SAY_SLAY_1 = -1604018,
- SAY_SLAY_2 = -1604019,
- SAY_SLAY_3 = -1604020,
- SAY_DEATH = -1604021,
- SAY_SUMMON_SNAKES = -1604022,
- SAY_SUMMON_CONSTRICTORS = -1604023
+ SAY_AGGRO = -1604017,
+ SAY_SLAY_1 = -1604018,
+ SAY_SLAY_2 = -1604019,
+ SAY_SLAY_3 = -1604020,
+ SAY_DEATH = -1604021,
+ SAY_SUMMON_SNAKES = -1604022,
+ SAY_SUMMON_CONSTRICTORS = -1604023
};
//Creatures
enum Creatures
{
- CREATURE_SNAKE = 29680,
- CREATURE_CONSTRICTORS = 29713
+ CREATURE_SNAKE = 29680,
+ CREATURE_CONSTRICTORS = 29713
};
//Creatures' spells
enum ConstrictorSpells
{
- SPELL_GRIP_OF_SLAD_RAN = 55093,
- SPELL_VENOMOUS_BITE = 54987,
- H_SPELL_VENOMOUS_BITE = 58996
+ SPELL_GRIP_OF_SLAD_RAN = 55093,
+ SPELL_VENOMOUS_BITE = 54987,
+ H_SPELL_VENOMOUS_BITE = 58996
};
static Position SpawnLoc[]=
@@ -86,10 +86,10 @@ struct boss_slad_ranAI : public ScriptedAI
void Reset()
{
- uiPoisonNovaTimer = 10000;
- uiPowerfullBiteTimer = 3000;
- uiVenomBoltTimer = 15000;
- uiSpawnTimer = 5000;
+ uiPoisonNovaTimer = 10*IN_MILISECONDS;
+ uiPowerfullBiteTimer = 3*IN_MILISECONDS;
+ uiVenomBoltTimer = 15*IN_MILISECONDS;
+ uiSpawnTimer = 5*IN_MILISECONDS;
uiPhase = 0;
lSummons.DespawnAll();
@@ -115,19 +115,19 @@ struct boss_slad_ranAI : public ScriptedAI
if (uiPoisonNovaTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_POISON_NOVA, H_SPELL_POISON_NOVA));
- uiPoisonNovaTimer = 15000;
+ uiPoisonNovaTimer = 15*IN_MILISECONDS;
} else uiPoisonNovaTimer -= diff;
if (uiPowerfullBiteTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_POWERFULL_BITE, H_SPELL_POWERFULL_BITE));
- uiPowerfullBiteTimer = 10000;
+ uiPowerfullBiteTimer = 10*IN_MILISECONDS;
} else uiPowerfullBiteTimer -= diff;
if (uiVenomBoltTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_VENOM_BOLT, H_SPELL_VENOM_BOLT));
- uiVenomBoltTimer = 10000;
+ uiVenomBoltTimer = 10*IN_MILISECONDS;
} else uiVenomBoltTimer -= diff;
if (uiPhase)
@@ -136,11 +136,11 @@ struct boss_slad_ranAI : public ScriptedAI
{
if (uiPhase == 1)
for (uint8 i = 0; i < DUNGEON_MODE(3, 5); ++i)
- m_creature->SummonCreature(CREATURE_SNAKE, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ m_creature->SummonCreature(CREATURE_SNAKE, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
if (uiPhase == 2)
for (uint8 i = 0; i < DUNGEON_MODE(3, 5); ++i)
- m_creature->SummonCreature(CREATURE_CONSTRICTORS, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
- uiSpawnTimer = 5000;
+ m_creature->SummonCreature(CREATURE_CONSTRICTORS, SpawnLoc[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILISECONDS);
+ uiSpawnTimer = 5*IN_MILISECONDS;
} else uiSpawnTimer -= diff;
}
@@ -187,7 +187,7 @@ struct mob_slad_ran_constrictorAI : public ScriptedAI
void Reset()
{
- uiGripOfSladRanTimer = 1000;
+ uiGripOfSladRanTimer = 1*IN_MILISECONDS;
}
void UpdateAI(const uint32 diff)
@@ -197,7 +197,7 @@ struct mob_slad_ran_constrictorAI : public ScriptedAI
if (uiGripOfSladRanTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GRIP_OF_SLAD_RAN);
- uiGripOfSladRanTimer = 5000;
+ uiGripOfSladRanTimer = 5*IN_MILISECONDS;
} else uiGripOfSladRanTimer -= diff;
}
@@ -214,7 +214,7 @@ struct mob_slad_ran_viperAI : public ScriptedAI
void Reset()
{
- uiVenomousBiteTimer = 2000;
+ uiVenomousBiteTimer = 2*IN_MILISECONDS;
}
void UpdateAI(const uint32 diff)
@@ -225,7 +225,7 @@ struct mob_slad_ran_viperAI : public ScriptedAI
if (uiVenomousBiteTimer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_VENOMOUS_BITE, H_SPELL_VENOMOUS_BITE));
- uiVenomousBiteTimer = 10000;
+ uiVenomousBiteTimer = 10*IN_MILISECONDS;
} else uiVenomousBiteTimer -= diff;
}
};
diff --git a/src/scripts/northrend/gundrak/gundrak.h b/src/scripts/northrend/gundrak/gundrak.h
index 17f0097bbf7..a443aa4e698 100644
--- a/src/scripts/northrend/gundrak/gundrak.h
+++ b/src/scripts/northrend/gundrak/gundrak.h
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2009-2010 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/scripts/northrend/gundrak/instance_gundrak.cpp b/src/scripts/northrend/gundrak/instance_gundrak.cpp
index 88043730ae5..e96495eee26 100644
--- a/src/scripts/northrend/gundrak/instance_gundrak.cpp
+++ b/src/scripts/northrend/gundrak/instance_gundrak.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2009-2010 TrinityCore <http://www.trinitycore.org/>
+* Copyright (C) 2009 - 2010 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by