mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-14 22:19:25 +01:00
Merge [SD2]
r1142 Fix: Kael'thas advisors gain double health in phase 3 and dropp them on reset
Fix: Void Reaver will now ignore pets and totems when casting arcane orb
r1143 Remove old workaround for summon kael(TK) weapons and use spells instead. Apply code style to parts of code.
r1144 Added lost sql from revision 1119 and 1121 - skip
r1145 Correcting details for npc related to quest 590
--HG--
branch : trunk
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -79,6 +79,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
DoZoneInCombat();
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_VOIDREAVEREVENT, DONE);
|
||||
@@ -119,13 +120,20 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI
|
||||
for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
|
||||
//18 yard radius minimum
|
||||
// exclude pets & totems
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
continue;
|
||||
|
||||
//18 yard radius minimum
|
||||
if(target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && !target->IsWithinDist(m_creature, 18, false))
|
||||
target_list.push_back(target);
|
||||
target = NULL;
|
||||
}
|
||||
|
||||
if(target_list.size())
|
||||
target = *(target_list.begin()+rand()%target_list.size());
|
||||
else
|
||||
target = m_creature->getVictim();
|
||||
|
||||
if (target)
|
||||
m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, target);
|
||||
|
||||
@@ -33,31 +33,94 @@ EndContentData */
|
||||
## npc_calvin_montague
|
||||
######*/
|
||||
|
||||
#define QUEST_590 590
|
||||
#define FACTION_FRIENDLY 68
|
||||
#define FACTION_HOSTILE 16
|
||||
enum
|
||||
{
|
||||
SAY_COMPLETE = -1000431,
|
||||
SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct)
|
||||
QUEST_590 = 590,
|
||||
FACTION_HOSTILE = 168
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI
|
||||
{
|
||||
npc_calvin_montagueAI(Creature* c) : ScriptedAI(c) {}
|
||||
npc_calvin_montagueAI(Creature* pCreature) : ScriptedAI(pCreature) { }
|
||||
|
||||
uint32 m_uiPhase;
|
||||
uint32 m_uiPhaseTimer;
|
||||
uint64 m_uiPlayerGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->setFaction(FACTION_FRIENDLY);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
m_uiPhase = 0;
|
||||
m_uiPhaseTimer = 5000;
|
||||
m_uiPlayerGUID = 0;
|
||||
|
||||
me->RestoreFaction();
|
||||
|
||||
if (!m_creature->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2))
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) { }
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
void AttackedBy(Unit* pAttacker)
|
||||
{
|
||||
if( Killer->GetTypeId() == TYPEID_PLAYER )
|
||||
if( CAST_PLR(Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(Killer)->AreaExploredOrEventHappens(QUEST_590);
|
||||
if (m_creature->getVictim() || m_creature->IsFriendlyTo(pAttacker))
|
||||
return;
|
||||
|
||||
AttackStart(pAttacker);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
|
||||
{
|
||||
if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15))
|
||||
{
|
||||
uiDamage = 0;
|
||||
|
||||
me->RestoreFaction();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
m_creature->CombatStop(true);
|
||||
|
||||
m_uiPhase = 1;
|
||||
|
||||
if (pDoneBy->GetTypeId() == TYPEID_PLAYER)
|
||||
m_uiPlayerGUID = pDoneBy->GetGUID();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (m_uiPhase)
|
||||
{
|
||||
if (m_uiPhaseTimer < uiDiff)
|
||||
m_uiPhaseTimer = 7500;
|
||||
else
|
||||
{
|
||||
m_uiPhaseTimer -= uiDiff;
|
||||
return;
|
||||
}
|
||||
|
||||
switch(m_uiPhase)
|
||||
{
|
||||
case 1:
|
||||
DoScriptText(SAY_COMPLETE, m_creature);
|
||||
++m_uiPhase;
|
||||
break;
|
||||
case 2:
|
||||
if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID))
|
||||
CAST_PLR(pUnit)->AreaExploredOrEventHappens(QUEST_590);
|
||||
|
||||
m_creature->CastSpell(m_creature,SPELL_DRINK,true);
|
||||
++m_uiPhase;
|
||||
break;
|
||||
case 3:
|
||||
EnterEvadeMode();
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -69,13 +132,13 @@ CreatureAI* GetAI_npc_calvin_montague(Creature *_Creature)
|
||||
return new npc_calvin_montagueAI (_Creature);
|
||||
}
|
||||
|
||||
bool QuestAccept_npc_calvin_montague(Player* player, Creature* creature, Quest const* quest)
|
||||
bool QuestAccept_npc_calvin_montague(Player* pPlayer, Creature* pCreature, Quest const* quest)
|
||||
{
|
||||
if( quest->GetQuestId() == QUEST_590 )
|
||||
{
|
||||
creature->setFaction(FACTION_HOSTILE);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
CAST_AI(npc_calvin_montagueAI, creature->AI())->AttackStart(player);
|
||||
pCreature->setFaction(FACTION_HOSTILE);
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
CAST_AI(npc_calvin_montagueAI, pCreature->AI())->AttackStart(pPlayer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user