* Added LowerPlayerDamageReq function from TC2
* Akama is summoned after the illidari council has been deafeated. (remove your akama spawn from creature db) * Dampen Magic timer * Merging mother from TC2 --HG-- branch : trunk
This commit is contained in:
@@ -62,6 +62,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
|
|||||||
//database should have `RegenHealth`=0 to prevent regen
|
//database should have `RegenHealth`=0 to prevent regen
|
||||||
uint32 hp = (m_creature->GetMaxHealth()*40)/100;
|
uint32 hp = (m_creature->GetMaxHealth()*40)/100;
|
||||||
if (hp) m_creature->SetHealth(hp);
|
if (hp) m_creature->SetHealth(hp);
|
||||||
|
m_creature->ResetPlayerDamageReq();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit *who) { }
|
void Aggro(Unit *who) { }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* 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.
|
// 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)
|
if(ExplosionCount < 3)
|
||||||
{
|
{
|
||||||
for(uint8 i = 0; i < 4; i++)
|
for(uint8 i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
Unit* pUnit = NULL;
|
Unit* pUnit = NULL;
|
||||||
if(TargetGUID[i])
|
if(TargetGUID[i])
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* 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 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
|
struct CouncilYells
|
||||||
{
|
{
|
||||||
int32 entry;
|
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->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
m_creature->SetFlag(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) {}
|
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))))
|
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);
|
VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
|
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);
|
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
return;
|
return;
|
||||||
@@ -405,9 +408,12 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
|
|||||||
damage /= 4;
|
damage /= 4;
|
||||||
for(uint8 i = 0; i < 4; ++i)
|
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())
|
if(pUnit != m_creature && damage < pUnit->GetHealth())
|
||||||
|
{
|
||||||
pUnit->SetHealth(pUnit->GetHealth() - damage);
|
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);
|
DoCast(m_creature, SPELL_DAMPEN_MAGIC);
|
||||||
Cooldown = 1000;
|
Cooldown = 1000;
|
||||||
DampenMagicTimer = 110000; // almost 2 minutes
|
DampenMagicTimer = 67200; // almost 1,12 minutes
|
||||||
ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
|
ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen.
|
||||||
}else DampenMagicTimer -= diff;
|
}else DampenMagicTimer -= diff;
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ void AggressorAI::EnterEvadeMode()
|
|||||||
i_victimGuid = 0;
|
i_victimGuid = 0;
|
||||||
i_creature.CombatStop();
|
i_creature.CombatStop();
|
||||||
i_creature.SetLootRecipient(NULL);
|
i_creature.SetLootRecipient(NULL);
|
||||||
i_creature.ResetDamageByPlayers();
|
i_creature.ResetPlayerDamageReq();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -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_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_regenTimer(2000), m_defaultMovementType(IDLE_MOTION_TYPE), m_equipmentId(0),
|
||||||
m_AlreadyCallAssistance(false), m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false),
|
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;
|
m_valuesCount = UNIT_END;
|
||||||
|
|
||||||
@@ -159,7 +159,6 @@ m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),m_creatureInfo(NULL), m_DBTabl
|
|||||||
m_GlobalCooldown = 0;
|
m_GlobalCooldown = 0;
|
||||||
m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE;
|
m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE;
|
||||||
DisableReputationGain = false;
|
DisableReputationGain = false;
|
||||||
ResetDamageByPlayers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Creature::~Creature()
|
Creature::~Creature()
|
||||||
@@ -1270,6 +1269,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
|
|||||||
SetCreateHealth(health);
|
SetCreateHealth(health);
|
||||||
SetMaxHealth(health);
|
SetMaxHealth(health);
|
||||||
SetHealth(health);
|
SetHealth(health);
|
||||||
|
ResetPlayerDamageReq();
|
||||||
|
|
||||||
// mana
|
// mana
|
||||||
uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);
|
uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);
|
||||||
@@ -1654,7 +1654,7 @@ void Creature::setDeathState(DeathState s)
|
|||||||
// setActive(true);
|
// setActive(true);
|
||||||
SetHealth(GetMaxHealth());
|
SetHealth(GetMaxHealth());
|
||||||
SetLootRecipient(NULL);
|
SetLootRecipient(NULL);
|
||||||
ResetDamageByPlayers();
|
ResetPlayerDamageReq();
|
||||||
Unit::setDeathState(ALIVE);
|
Unit::setDeathState(ALIVE);
|
||||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||||
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||||
|
|||||||
+9
-5
@@ -637,10 +637,15 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
|||||||
|
|
||||||
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
|
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
|
||||||
bool IsReputationGainDisabled() { return DisableReputationGain; }
|
bool IsReputationGainDisabled() { return DisableReputationGain; }
|
||||||
bool IsDamageEnoughForLootingAndReward() { return m_unDamageByPlayers >= (uint32)(GetMaxHealth() / 2); }
|
bool IsDamageEnoughForLootingAndReward() { return m_PlayerDamageReq == 0; }
|
||||||
void AddDamageByPlayers(uint32 unDamage) { m_unDamageByPlayers += unDamage; }
|
void LowerPlayerDamageReq(uint32 unDamage)
|
||||||
void ResetDamageByPlayers() { m_unDamageByPlayers = 0; }
|
{
|
||||||
|
if(m_PlayerDamageReq)
|
||||||
|
m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0;
|
||||||
|
}
|
||||||
|
void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; }
|
||||||
|
uint32 m_PlayerDamageReq;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
||||||
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, 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;
|
uint32 m_lootMoney;
|
||||||
uint64 m_lootRecipient;
|
uint64 m_lootRecipient;
|
||||||
uint32 m_unDamageByPlayers;
|
|
||||||
|
|
||||||
/// Timers
|
/// Timers
|
||||||
uint32 m_deathTimer; // (msecs)timer for death or corpse disappearance
|
uint32 m_deathTimer; // (msecs)timer for death or corpse disappearance
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ void CreatureAI::EnterEvadeMode()
|
|||||||
me->CombatStop();
|
me->CombatStop();
|
||||||
me->LoadCreaturesAddon();
|
me->LoadCreaturesAddon();
|
||||||
me->SetLootRecipient(NULL);
|
me->SetLootRecipient(NULL);
|
||||||
me->ResetDamageByPlayers();
|
me->ResetPlayerDamageReq();
|
||||||
|
|
||||||
if(me->isAlive())
|
if(me->isAlive())
|
||||||
me->GetMotionMaster()->MoveTargetedHome();
|
me->GetMotionMaster()->MoveTargetedHome();
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ ReactorAI::EnterEvadeMode()
|
|||||||
i_victimGuid = 0;
|
i_victimGuid = 0;
|
||||||
i_creature.CombatStop();
|
i_creature.CombatStop();
|
||||||
i_creature.SetLootRecipient(NULL);
|
i_creature.SetLootRecipient(NULL);
|
||||||
i_creature.ResetDamageByPlayers();
|
i_creature.ResetPlayerDamageReq();
|
||||||
|
|
||||||
if(!i_creature.GetCharmerOrOwner())
|
if(!i_creature.GetCharmerOrOwner())
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -806,7 +806,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||||||
((Creature*)pVictim)->SetLootRecipient(this);
|
((Creature*)pVictim)->SetLootRecipient(this);
|
||||||
|
|
||||||
if(GetCharmerOrOwnerPlayerOrPlayerItself())
|
if(GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||||
((Creature*)pVictim)->AddDamageByPlayers(health < damage ? health : damage);
|
((Creature*)pVictim)->LowerPlayerDamageReq(health < damage ? health : damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (health <= damage)
|
if (health <= damage)
|
||||||
|
|||||||
Reference in New Issue
Block a user