Fix Script Naxxramas/Gothik with help of scarymovie87

Fixes issue #80.

- Implement support for "merging" life and dead side after ~2 minutes, if group is not splitted
- Implement support for opening central gate at 30% boss health
- Implement Gothik teleport between side when above 30% boss health
- Fix dead-side mobs spawn in 25-Man difficulty
- Fix waves setup.
- Fix some timers (this may still need some tuning).
- Fix sporadic combat reset when Gothic teleport to ground.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-01-17 10:58:11 +01:00
parent 782fa95f1f
commit c4eb172d04
4 changed files with 275 additions and 102 deletions
+14
View File
@@ -537,3 +537,17 @@ bool ThreatManager::isNeedUpdateToClient(uint32 time)
return false;
}
// Reset all aggro without modifying the threadlist.
void ThreatManager::resetAllAggro()
{
std::list<HostilReference*> &threatlist = getThreatList();
if (threatlist.empty())
return;
for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
(*itr)->setThreat(0);
}
setDirty(true);
}
+22
View File
@@ -215,6 +215,28 @@ class TRINITY_DLL_SPEC ThreatManager
void setDirty(bool bDirty) { iThreatContainer.setDirty(bDirty); }
// Reset all aggro without modifying the threadlist.
void resetAllAggro();
// Reset all aggro of unit in threadlist satisfying the predicate.
template<class PREDICATE> void resetAggro(PREDICATE predicate)
{
std::list<HostilReference*> &threatlist = getThreatList();
if (threatlist.empty())
return;
for (std::list<HostilReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
{
HostilReference* ref = (*itr);
if (predicate(ref->getTarget()))
{
ref->setThreat(0);
setDirty(true);
}
}
}
// methods to access the lists from the outside to do some dirty manipulation (scriping and such)
// I hope they are used as little as possible.
std::list<HostilReference*>& getThreatList() { return iThreatContainer.getThreatList(); }