diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
index 0ac15f31f4..1908de699b 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
@@ -62,6 +62,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
//database should have `RegenHealth`=0 to prevent regen
uint32 hp = (m_creature->GetMaxHealth()*40)/100;
if (hp) m_creature->SetHealth(hp);
+ m_creature->ResetPlayerDamageReq();
}
void Aggro(Unit *who) { }
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
index 4b63b092c5..2718ff5b2a 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
+/* Copyright (C) 2006 - 2009 ScriptDev2
* 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
@@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
// Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later.
if(ExplosionCount < 3)
{
- for(uint8 i = 0; i < 4; i++)
+ for(uint8 i = 0; i < 3; ++i)
{
Unit* pUnit = NULL;
if(TargetGUID[i])
diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
index 266c84bd09..b64c5d7374 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2
+/* Copyright (C) 2006 - 2009 ScriptDev2
* 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
@@ -51,6 +51,8 @@ EndScriptData */
#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly."
+#define AKAMAID 23089
+
struct CouncilYells
{
int32 entry;
@@ -240,7 +242,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
+ m_creature->SetDisplayId(11686);
}
void Aggro(Unit *who) {}
@@ -297,6 +299,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
if(Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
+ m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0);
}
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
@@ -405,9 +408,12 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
damage /= 4;
for(uint8 i = 0; i < 4; ++i)
{
- if(Unit* pUnit = Unit::GetUnit(*m_creature, Council[i]))
+ if(Creature* pUnit = Unit::GetCreature(*m_creature, Council[i]))
if(pUnit != m_creature && damage < pUnit->GetHealth())
+ {
pUnit->SetHealth(pUnit->GetHealth() - damage);
+ pUnit->LowerPlayerDamageReq(damage);
+ }
}
}
@@ -593,7 +599,7 @@ struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_
{
DoCast(m_creature, SPELL_DAMPEN_MAGIC);
Cooldown = 1000;
- DampenMagicTimer = 110000; // almost 2 minutes
+ DampenMagicTimer = 67200; // almost 1,12 minutes
ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
}else DampenMagicTimer -= diff;
diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp
index d44cab9fd2..b549d8bfcc 100644
--- a/src/game/AggressorAI.cpp
+++ b/src/game/AggressorAI.cpp
@@ -93,7 +93,7 @@ void AggressorAI::EnterEvadeMode()
i_victimGuid = 0;
i_creature.CombatStop();
i_creature.SetLootRecipient(NULL);
- i_creature.ResetDamageByPlayers();
+ i_creature.ResetPlayerDamageReq();
}
void
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index fc79caf726..8c062282b9 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -147,7 +147,7 @@ m_deathTimer(0), m_respawnTime(0), m_respawnDelay(25), m_corpseDelay(60), m_resp
m_gossipOptionLoaded(false), m_emoteState(0), m_isPet(false), m_isTotem(false), m_reactState(REACT_AGGRESSIVE),
m_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0),
m_AlreadyCallAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false),
-m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL)
+m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTableGuid(0), m_formation(NULL), m_PlayerDamageReq(0)
{
m_valuesCount = UNIT_END;
@@ -159,7 +159,6 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl
m_GlobalCooldown = 0;
m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE;
DisableReputationGain = false;
- ResetDamageByPlayers();
}
Creature::~Creature()
@@ -1270,6 +1269,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
SetCreateHealth(health);
SetMaxHealth(health);
SetHealth(health);
+ ResetPlayerDamageReq();
// mana
uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);
@@ -1654,7 +1654,7 @@ void Creature::setDeathState(DeathState s)
// setActive(true);
SetHealth(GetMaxHealth());
SetLootRecipient(NULL);
- ResetDamageByPlayers();
+ ResetPlayerDamageReq();
Unit::setDeathState(ALIVE);
CreatureInfo const *cinfo = GetCreatureInfo();
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
diff --git a/src/game/Creature.h b/src/game/Creature.h
index b25893b5ba..2abd304138 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -637,10 +637,15 @@ class TRINITY_DLL_SPEC Creature : public Unit
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
- bool IsDamageEnoughForLootingAndReward() { return m_unDamageByPlayers >= (uint32)(GetMaxHealth() / 2); }
- void AddDamageByPlayers(uint32 unDamage) { m_unDamageByPlayers += unDamage; }
- void ResetDamageByPlayers() { m_unDamageByPlayers = 0; }
-
+ bool IsDamageEnoughForLootingAndReward() { return m_PlayerDamageReq == 0; }
+ void LowerPlayerDamageReq(uint32 unDamage)
+ {
+ if(m_PlayerDamageReq)
+ m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0;
+ }
+ void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; }
+ uint32 m_PlayerDamageReq;
+
protected:
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
@@ -655,7 +660,6 @@ class TRINITY_DLL_SPEC Creature : public Unit
uint32 m_lootMoney;
uint64 m_lootRecipient;
- uint32 m_unDamageByPlayers;
/// Timers
uint32 m_deathTimer; // (msecs)timer for death or corpse disappearance
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 3a7cb896e8..e5ed4cf894 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -100,7 +100,7 @@ void CreatureAI::EnterEvadeMode()
me->CombatStop();
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
- me->ResetDamageByPlayers();
+ me->ResetPlayerDamageReq();
if(me->isAlive())
me->GetMotionMaster()->MoveTargetedHome();
diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp
index f9fe0abfdc..15a99adef8 100644
--- a/src/game/ReactorAI.cpp
+++ b/src/game/ReactorAI.cpp
@@ -104,7 +104,7 @@ ReactorAI::EnterEvadeMode()
i_victimGuid = 0;
i_creature.CombatStop();
i_creature.SetLootRecipient(NULL);
- i_creature.ResetDamageByPlayers();
+ i_creature.ResetPlayerDamageReq();
if(!i_creature.GetCharmerOrOwner())
{
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 23cde7b2fc..b4878cbac4 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -806,7 +806,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
((Creature*)pVictim)->SetLootRecipient(this);
if(GetCharmerOrOwnerPlayerOrPlayerItself())
- ((Creature*)pVictim)->AddDamageByPlayers(health < damage ? health : damage);
+ ((Creature*)pVictim)->LowerPlayerDamageReq(health < damage ? health : damage);
}
if (health <= damage)