* Merged ScriptDev2 897
* TODO: - fix mob_eventai.cpp line 613 DisplayID_A - merge boss_kaelthas.cpp with sd2 - fix azuremyst.cpp line 108 Spell->SpellFamilyFlags2 --HG-- branch : trunk
This commit is contained in:
@@ -222,7 +222,6 @@ SET(trinityscript_LIB_SRCS
|
||||
scripts/zone/naxxramas/boss_gothik.cpp
|
||||
scripts/zone/naxxramas/boss_grobbulus.cpp
|
||||
scripts/zone/naxxramas/boss_heigan.cpp
|
||||
scripts/zone/naxxramas/boss_highlord_mograine.cpp
|
||||
scripts/zone/naxxramas/boss_kelthuzad.cpp
|
||||
scripts/zone/naxxramas/boss_four_horsemen.cpp
|
||||
scripts/zone/naxxramas/boss_loatheb.cpp
|
||||
|
||||
@@ -255,7 +255,6 @@ scripts/zone/naxxramas/boss_gluth.cpp \
|
||||
scripts/zone/naxxramas/boss_gothik.cpp \
|
||||
scripts/zone/naxxramas/boss_grobbulus.cpp \
|
||||
scripts/zone/naxxramas/boss_heigan.cpp \
|
||||
scripts/zone/naxxramas/boss_highlord_mograine.cpp \
|
||||
scripts/zone/naxxramas/boss_kelthuzad.cpp \
|
||||
scripts/zone/naxxramas/boss_four_horsemen.cpp \
|
||||
scripts/zone/naxxramas/boss_loatheb.cpp \
|
||||
|
||||
@@ -395,7 +395,6 @@ extern void AddSC_boss_anubrekhan();
|
||||
extern void AddSC_boss_maexxna();
|
||||
extern void AddSC_boss_patchwerk();
|
||||
extern void AddSC_boss_razuvious();
|
||||
extern void AddSC_boss_highlord_mograine();
|
||||
extern void AddSC_boss_kelthuzad();
|
||||
extern void AddSC_boss_loatheb();
|
||||
extern void AddSC_boss_noth();
|
||||
@@ -937,6 +936,10 @@ void LoadDatabase()
|
||||
temp.event_param3 = fields[8].GetUInt32();
|
||||
temp.event_param4 = fields[9].GetUInt32();
|
||||
|
||||
//Creature does not exist in database
|
||||
if (!GetCreatureTemplateStore(temp.creature_id))
|
||||
error_db_log("TSCR: Event %u has script for non-existing creature.", i);
|
||||
|
||||
//Report any errors in event
|
||||
if (temp.event_type >= EVENT_T_END)
|
||||
error_db_log("TSCR: Event %u has incorrect event type. Maybe DB requires updated version of SD2.", i);
|
||||
@@ -1031,7 +1034,7 @@ void LoadDatabase()
|
||||
case EVENT_T_AGGRO:
|
||||
case EVENT_T_DEATH:
|
||||
case EVENT_T_EVADE:
|
||||
case EVENT_T_SPAWNED:
|
||||
case EVENT_T_REACHED_HOME:
|
||||
{
|
||||
if (temp.event_flags & EFLAG_REPEATABLE)
|
||||
{
|
||||
@@ -1077,7 +1080,29 @@ void LoadDatabase()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SET_FACTION:
|
||||
if (temp.action[j].param1 !=0 && !GetFactionStore()->LookupEntry(temp.action[j].param1))
|
||||
{
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant FactionId %u.", i, j+1, temp.action[j].param1);
|
||||
temp.action[j].param1 = 0;
|
||||
}
|
||||
break;
|
||||
case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
|
||||
if (temp.action[j].param1 !=0 || temp.action[j].param2 !=0)
|
||||
{
|
||||
if (temp.action[j].param1 && !GetCreatureTemplateStore(temp.action[j].param1))
|
||||
{
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, temp.action[j].param1);
|
||||
temp.action[j].param1 = 0;
|
||||
}
|
||||
|
||||
if (temp.action[j].param2 && !GetCreatureDisplayStore()->LookupEntry(temp.action[j].param2))
|
||||
{
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant ModelId %u.", i, j+1, temp.action[j].param2);
|
||||
temp.action[j].param2 = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SOUND:
|
||||
if (!GetSoundEntriesStore()->LookupEntry(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant SoundID %u.", i, j+1, temp.action[j].param1);
|
||||
@@ -1096,14 +1121,23 @@ void LoadDatabase()
|
||||
|
||||
case ACTION_T_CAST:
|
||||
{
|
||||
if (!GetSpellStore()->LookupEntry(temp.action[j].param1))
|
||||
const SpellEntry *spell = GetSpellStore()->LookupEntry(temp.action[j].param1);
|
||||
if (!spell)
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param1);
|
||||
else
|
||||
{
|
||||
if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE)
|
||||
{
|
||||
//output as debug for now, also because there's no general rule all spells have RecoveryTime
|
||||
if (temp.event_param3 < spell->RecoveryTime)
|
||||
debug_log("TSCR: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,temp.action[j].param1, spell->RecoveryTime, temp.event_param3);
|
||||
}
|
||||
}
|
||||
|
||||
if (temp.action[j].param2 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTION_T_REMOVEAURASFROMSPELL:
|
||||
{
|
||||
if (!GetSpellStore()->LookupEntry(temp.action[j].param2))
|
||||
@@ -1113,9 +1147,36 @@ void LoadDatabase()
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_QUEST_EVENT:
|
||||
{
|
||||
if (Quest const* qid = GetQuestTemplateStore(temp.action[j].param1))
|
||||
{
|
||||
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
error_db_log("TSCR: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1);
|
||||
}
|
||||
else
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
|
||||
|
||||
if (temp.action[j].param2 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_QUEST_EVENT_ALL:
|
||||
{
|
||||
if (Quest const* qid = GetQuestTemplateStore(temp.action[j].param1))
|
||||
{
|
||||
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
|
||||
error_db_log("TSCR: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, temp.action[j].param1);
|
||||
}
|
||||
else
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_CASTCREATUREGO:
|
||||
{
|
||||
if (!GetCreatureTemplateStore(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
|
||||
|
||||
if (!GetSpellStore()->LookupEntry(temp.action[j].param2))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
|
||||
|
||||
@@ -1123,10 +1184,22 @@ void LoadDatabase()
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_CASTCREATUREGO_ALL:
|
||||
{
|
||||
if (!GetQuestTemplateStore(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant Quest entry %u.", i, j+1, temp.action[j].param1);
|
||||
|
||||
if (!GetSpellStore()->LookupEntry(temp.action[j].param2))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
|
||||
}
|
||||
break;
|
||||
|
||||
//2nd param target
|
||||
case ACTION_T_SUMMON_ID:
|
||||
{
|
||||
if (!GetCreatureTemplateStore(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
|
||||
|
||||
if (EventAI_Summon_Map.find(temp.action[j].param3) == EventAI_Summon_Map.end())
|
||||
error_db_log("TSCR: Event %u Action %u summons missing EventAI_Summon %u", i, j+1, temp.action[j].param3);
|
||||
|
||||
@@ -1134,13 +1207,27 @@ void LoadDatabase()
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_KILLED_MONSTER:
|
||||
{
|
||||
if (!GetCreatureTemplateStore(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
|
||||
|
||||
if (temp.action[j].param2 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SUMMON:
|
||||
{
|
||||
if (!GetCreatureTemplateStore(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
|
||||
|
||||
if (temp.action[j].param2 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_THREAT_SINGLE_PCT:
|
||||
case ACTION_T_QUEST_EVENT:
|
||||
case ACTION_T_SET_UNIT_FLAG:
|
||||
case ACTION_T_REMOVE_UNIT_FLAG:
|
||||
case ACTION_T_SET_INST_DATA64:
|
||||
if (temp.action[j].param2 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
break;
|
||||
@@ -1163,18 +1250,30 @@ void LoadDatabase()
|
||||
error_db_log("TSCR: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
|
||||
break;
|
||||
|
||||
case ACTION_T_KILLED_MONSTER:
|
||||
if (temp.event_type != EVENT_T_DEATH)
|
||||
outstring_log("SD2 WARNING: Event %u Action %u calling ACTION_T_KILLED_MONSTER outside of EVENT_T_DEATH", i, j+1);
|
||||
break;
|
||||
|
||||
case ACTION_T_SET_INST_DATA:
|
||||
if (temp.action[j].param2 > SPECIAL)
|
||||
error_db_log("TSCR2: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
|
||||
break;
|
||||
{
|
||||
if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC))
|
||||
error_db_log("TSCR: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1);
|
||||
|
||||
case ACTION_T_YELL:
|
||||
case ACTION_T_TEXTEMOTE:
|
||||
if (temp.action[j].param2 > SPECIAL)
|
||||
error_db_log("TSCR: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SET_INST_DATA64:
|
||||
{
|
||||
if (!(temp.event_flags & EFLAG_NORMAL) && !(temp.event_flags & EFLAG_HEROIC))
|
||||
error_db_log("TSCR: Event %u Action %u. Cannot set instance data without event flags (normal/heroic).", i, j+1);
|
||||
|
||||
if (temp.action[j].param2 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_UPDATE_TEMPLATE:
|
||||
{
|
||||
if (!GetCreatureTemplateStore(temp.action[j].param1))
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant creature entry %u.", i, j+1, temp.action[j].param1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_RANDOM_SAY:
|
||||
case ACTION_T_RANDOM_YELL:
|
||||
case ACTION_T_RANDOM_TEXTEMOTE:
|
||||
@@ -1222,7 +1321,7 @@ void ScriptsFree()
|
||||
delete []SpellSummary;
|
||||
|
||||
// Free resources before library unload
|
||||
for(int i=0;i<num_sc_scripts;i++)
|
||||
for(int i=0;i<MAX_SCRIPTS;i++)
|
||||
delete m_scripts[i];
|
||||
|
||||
num_sc_scripts = 0;
|
||||
@@ -1614,8 +1713,7 @@ void ScriptsInit()
|
||||
AddSC_boss_maexxna();
|
||||
AddSC_boss_patchwerk();
|
||||
AddSC_boss_razuvious();
|
||||
AddSC_boss_highlord_mograine();
|
||||
AddSC_boss_kelthuzad();
|
||||
AddSC_boss_kelthuzad();
|
||||
AddSC_boss_loatheb();
|
||||
AddSC_boss_noth();
|
||||
AddSC_boss_gluth();
|
||||
@@ -1934,8 +2032,12 @@ void Script::RegisterSelf()
|
||||
{
|
||||
m_scripts[id] = this;
|
||||
++num_sc_scripts;
|
||||
} else
|
||||
debug_log("SD2: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
debug_log("TSCR: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str());
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
//********************************
|
||||
|
||||
@@ -848,10 +848,6 @@
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp"
|
||||
>
|
||||
|
||||
@@ -1029,10 +1029,6 @@
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp"
|
||||
>
|
||||
|
||||
@@ -1150,10 +1150,6 @@
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_heigan.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_highlord_mograine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\naxxramas\boss_kelthuzad.cpp"
|
||||
>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -108,9 +108,9 @@ void ScriptedAI::AttackStart(Unit* who)
|
||||
void ScriptedAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Check if we have a current target
|
||||
if (m_creature->isAlive() && UpdateVictim())
|
||||
if (UpdateVictim())
|
||||
{
|
||||
if (m_creature->isAttackReady() )
|
||||
if (m_creature->isAttackReady())
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
@@ -169,11 +169,10 @@ void ScriptedAI::DoStartNoMovement(Unit* victim)
|
||||
m_creature->StopMoving();
|
||||
}
|
||||
|
||||
|
||||
void ScriptedAI::DoMeleeAttackIfReady()
|
||||
{
|
||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||
if (m_creature->isAttackReady() && !m_creature->hasUnitState(UNIT_STAT_CASTING))
|
||||
//Make sure our attack is ready before checking distance
|
||||
if (m_creature->isAttackReady())
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
|
||||
@@ -23,6 +23,7 @@ EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "mob_event_ai.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
#define EVENT_UPDATE_TIME 500
|
||||
#define SPELL_RUN_AWAY 8225
|
||||
@@ -454,6 +455,10 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVENT_T_REACHED_HOME:
|
||||
{
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (EAI_ErrorLevel > 0)
|
||||
error_db_log("SD2: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", m_creature->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type);
|
||||
@@ -541,7 +546,8 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
}else if ( param2 && urand(0,1) )
|
||||
{
|
||||
temp = param2;
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
temp = param1;
|
||||
}
|
||||
@@ -577,6 +583,45 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SET_FACTION:
|
||||
{
|
||||
if (param1)
|
||||
m_creature->setFaction(param1);
|
||||
else
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(m_creature->GetEntry()))
|
||||
{
|
||||
//if no id provided, assume reset and then use default
|
||||
if (m_creature->getFaction() != ci->faction_A)
|
||||
m_creature->setFaction(ci->faction_A);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
|
||||
{
|
||||
if (param1 || param2)
|
||||
{
|
||||
//set model based on entry from creature_template
|
||||
if (param1)
|
||||
{
|
||||
if (CreatureInfo const* ci = GetCreatureTemplateStore(param1))
|
||||
{
|
||||
//use default display
|
||||
//TODO FIX DisplayID_A in core
|
||||
/*
|
||||
if (ci->DisplayID_A)
|
||||
m_creature->SetDisplayId(ci->DisplayID_A);*/
|
||||
}
|
||||
}
|
||||
//if no param1, then use value from param2 (modelId)
|
||||
else
|
||||
m_creature->SetDisplayId(param2);
|
||||
}
|
||||
else
|
||||
m_creature->DeMorph();
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SOUND:
|
||||
DoPlaySoundToSet(m_creature, param1);
|
||||
break;
|
||||
@@ -639,14 +684,18 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
//Melee current victim if flag not set
|
||||
if (!(param3 & CAST_NO_MELEE_IF_OOM))
|
||||
{
|
||||
AttackDistance = 0;
|
||||
AttackAngle = 0;
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
{
|
||||
AttackDistance = 0;
|
||||
AttackAngle = 0;
|
||||
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
}
|
||||
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
//Interrupt any previous spell
|
||||
if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
|
||||
@@ -754,10 +803,10 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
{
|
||||
CombatMovementEnabled = param1;
|
||||
|
||||
//Allow movement (create new targeted movement gen if none exist already)
|
||||
//Allow movement (create new targeted movement gen only if idle)
|
||||
if (CombatMovementEnabled)
|
||||
{
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE)
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
|
||||
{
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
@@ -839,9 +888,12 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
if (CombatMovementEnabled)
|
||||
{
|
||||
//Drop current movement gen
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
{
|
||||
//Drop current movement gen
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1007,7 +1059,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
EventUpdateTime = EVENT_UPDATE_TIME;
|
||||
EventDiff = 0;
|
||||
|
||||
//Handle Evade events and reset all events to enabled
|
||||
//Reset all events to enabled
|
||||
for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
|
||||
{
|
||||
switch ((*i).Event.event_type)
|
||||
@@ -1036,22 +1088,39 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
//when creature reach home after EnterEvadeMode
|
||||
void JustReachedHome()
|
||||
{
|
||||
m_creature->LoadCreaturesAddon();
|
||||
|
||||
for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
|
||||
{
|
||||
if ((*i).Event.event_type == EVENT_T_REACHED_HOME)
|
||||
ProcessEvent(*i);
|
||||
}
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop();
|
||||
|
||||
IsFleeing = false;
|
||||
if (m_creature->isAlive())
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
m_creature->SetLootRecipient(NULL);
|
||||
|
||||
InCombat = false;
|
||||
|
||||
//Handle Evade events
|
||||
for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
|
||||
{
|
||||
switch ((*i).Event.event_type)
|
||||
{
|
||||
//Evade
|
||||
case EVENT_T_EVADE:
|
||||
ProcessEvent(*i);
|
||||
break;
|
||||
}
|
||||
if ((*i).Event.event_type == EVENT_T_EVADE)
|
||||
ProcessEvent(*i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1254,27 +1323,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
{
|
||||
EventDiff += diff;
|
||||
|
||||
//Check for range based events
|
||||
//if (m_creature->GetDistance(m_creature->getVictim()) >
|
||||
if (Combat)
|
||||
{
|
||||
for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
|
||||
{
|
||||
switch ((*i).Event.event_type)
|
||||
{
|
||||
case EVENT_T_RANGE:
|
||||
// in some cases this is called twice and victim may not exist in the second time
|
||||
if(m_creature->getVictim())
|
||||
{
|
||||
float dist = m_creature->GetDistance(m_creature->getVictim());
|
||||
if (dist > (*i).Event.event_param1 && dist < (*i).Event.event_param2)
|
||||
ProcessEvent(*i);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for time based events
|
||||
for (std::list<EventHolder>::iterator i = EventList.begin(); i != EventList.end(); ++i)
|
||||
{
|
||||
@@ -1293,9 +1341,9 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
else (*i).Time = 0;
|
||||
}
|
||||
|
||||
//Events that are updated every EVENT_UPDATE_TIME
|
||||
switch ((*i).Event.event_type)
|
||||
{
|
||||
//Events that are updated every EVENT_UPDATE_TIME
|
||||
case EVENT_T_TIMER_OOC:
|
||||
ProcessEvent(*i);
|
||||
break;
|
||||
@@ -1305,9 +1353,19 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
case EVENT_T_TARGET_HP:
|
||||
case EVENT_T_TARGET_CASTING:
|
||||
case EVENT_T_FRIENDLY_HP:
|
||||
if( Combat )
|
||||
if (Combat)
|
||||
ProcessEvent(*i);
|
||||
break;
|
||||
case EVENT_T_RANGE:
|
||||
if (Combat)
|
||||
{
|
||||
if (m_creature->IsWithinDistInMap(m_creature->getVictim(),(float)(*i).Event.event_param2))
|
||||
{
|
||||
if (m_creature->GetDistance(m_creature->getVictim()) >= (float)(*i).Event.event_param1)
|
||||
ProcessEvent(*i);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,52 +29,52 @@ enum Event_Types
|
||||
EVENT_T_SUMMONED_UNIT = 17, //CreatureId, RepeatMin, RepeatMax
|
||||
EVENT_T_TARGET_MANA = 18, //ManaMax%, ManaMin%, RepeatMin, RepeatMax
|
||||
EVENT_T_QUEST_ACCEPT = 19, //QuestID
|
||||
EVENT_T_QUEST_COMPLETE = 20, //
|
||||
EVENT_T_REACHED_HOME = 21, //NONE
|
||||
|
||||
EVENT_T_END,
|
||||
};
|
||||
|
||||
enum Action_Types
|
||||
{
|
||||
ACTION_T_NONE = 0, //No action
|
||||
ACTION_T_TEXT = 1, //-TextId1, optionally -TextId2, optionally -TextId3(if -TextId2 exist). If more than just -TextId1 is defined, randomize. Negative values.
|
||||
ACTION_T_YELL = 2, //UNUSED
|
||||
ACTION_T_TEXTEMOTE = 3, //UNUSED
|
||||
ACTION_T_SOUND = 4, //SoundId
|
||||
ACTION_T_EMOTE = 5, //EmoteId
|
||||
ACTION_T_RANDOM_SAY = 6, //UNUSED
|
||||
ACTION_T_RANDOM_YELL = 7, //UNUSED
|
||||
ACTION_T_RANDOM_TEXTEMOTE = 8, //UNUSED
|
||||
ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
|
||||
ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
|
||||
ACTION_T_CAST = 11, //SpellId, Target, CastFlags
|
||||
ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
|
||||
ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
|
||||
ACTION_T_THREAT_ALL_PCT = 14, //Threat%
|
||||
ACTION_T_QUEST_EVENT = 15, //QuestID, Target
|
||||
ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
|
||||
ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
|
||||
ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
|
||||
ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
|
||||
ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
|
||||
ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
|
||||
ACTION_T_SET_PHASE = 22, //Phase
|
||||
ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
|
||||
ACTION_T_EVADE = 24, //No Params
|
||||
ACTION_T_FLEE = 25, //No Params
|
||||
ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
|
||||
ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
|
||||
ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
|
||||
ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
|
||||
ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
|
||||
ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
|
||||
ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
|
||||
ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
|
||||
ACTION_T_SET_INST_DATA = 34, //Field, Data
|
||||
ACTION_T_SET_INST_DATA64 = 35, //Field, Target
|
||||
ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
|
||||
ACTION_T_DIE = 37, //No Params
|
||||
ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
|
||||
ACTION_T_NONE = 0, //No action
|
||||
ACTION_T_TEXT = 1, //-TextId1, optionally -TextId2, optionally -TextId3(if -TextId2 exist). If more than just -TextId1 is defined, randomize. Negative values.
|
||||
ACTION_T_SET_FACTION = 2, //FactionId (or 0 for default)
|
||||
ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3, //Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph)
|
||||
ACTION_T_SOUND = 4, //SoundId
|
||||
ACTION_T_EMOTE = 5, //EmoteId
|
||||
ACTION_T_RANDOM_SAY = 6, //UNUSED
|
||||
ACTION_T_RANDOM_YELL = 7, //UNUSED
|
||||
ACTION_T_RANDOM_TEXTEMOTE = 8, //UNUSED
|
||||
ACTION_T_RANDOM_SOUND = 9, //SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field)
|
||||
ACTION_T_RANDOM_EMOTE = 10, //EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field)
|
||||
ACTION_T_CAST = 11, //SpellId, Target, CastFlags
|
||||
ACTION_T_SUMMON = 12, //CreatureID, Target, Duration in ms
|
||||
ACTION_T_THREAT_SINGLE_PCT = 13, //Threat%, Target
|
||||
ACTION_T_THREAT_ALL_PCT = 14, //Threat%
|
||||
ACTION_T_QUEST_EVENT = 15, //QuestID, Target
|
||||
ACTION_T_CASTCREATUREGO = 16, //QuestID, SpellId, Target
|
||||
ACTION_T_SET_UNIT_FIELD = 17, //Field_Number, Value, Target
|
||||
ACTION_T_SET_UNIT_FLAG = 18, //Flags (may be more than one field OR'd together), Target
|
||||
ACTION_T_REMOVE_UNIT_FLAG = 19, //Flags (may be more than one field OR'd together), Target
|
||||
ACTION_T_AUTO_ATTACK = 20, //AllowAttackState (0 = stop attack, anything else means continue attacking)
|
||||
ACTION_T_COMBAT_MOVEMENT = 21, //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
|
||||
ACTION_T_SET_PHASE = 22, //Phase
|
||||
ACTION_T_INC_PHASE = 23, //Value (may be negative to decrement phase, should not be 0)
|
||||
ACTION_T_EVADE = 24, //No Params
|
||||
ACTION_T_FLEE = 25, //No Params
|
||||
ACTION_T_QUEST_EVENT_ALL = 26, //QuestID
|
||||
ACTION_T_CASTCREATUREGO_ALL = 27, //QuestId, SpellId
|
||||
ACTION_T_REMOVEAURASFROMSPELL = 28, //Target, Spellid
|
||||
ACTION_T_RANGED_MOVEMENT = 29, //Distance, Angle
|
||||
ACTION_T_RANDOM_PHASE = 30, //PhaseId1, PhaseId2, PhaseId3
|
||||
ACTION_T_RANDOM_PHASE_RANGE = 31, //PhaseMin, PhaseMax
|
||||
ACTION_T_SUMMON_ID = 32, //CreatureId, Target, SpawnId
|
||||
ACTION_T_KILLED_MONSTER = 33, //CreatureId, Target
|
||||
ACTION_T_SET_INST_DATA = 34, //Field, Data
|
||||
ACTION_T_SET_INST_DATA64 = 35, //Field, Target
|
||||
ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
|
||||
ACTION_T_DIE = 37, //No Params
|
||||
ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
|
||||
|
||||
ACTION_T_SET_ACTIVE = 101, //Apply
|
||||
ACTION_T_SET_AGGRESSIVE = 102, //Apply
|
||||
|
||||
@@ -27,34 +27,25 @@ EndScriptData */
|
||||
SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
//Clear all data
|
||||
Aggro_Text[0] = NULL;
|
||||
Aggro_Text[1] = NULL;
|
||||
Aggro_Text[2] = NULL;
|
||||
Aggro_Say[0] = false;
|
||||
Aggro_Say[1] = false;
|
||||
Aggro_Say[2] = false;
|
||||
Aggro_TextId[0] = 0;
|
||||
Aggro_TextId[1] = 0;
|
||||
Aggro_TextId[2] = 0;
|
||||
Aggro_Sound[0] = 0;
|
||||
Aggro_Sound[1] = 0;
|
||||
Aggro_Sound[2] = 0;
|
||||
|
||||
Death_Text[0] = NULL;
|
||||
Death_Text[1] = NULL;
|
||||
Death_Text[2] = NULL;
|
||||
Death_Say[0] = false;
|
||||
Death_Say[1] = false;
|
||||
Death_Say[2] = false;
|
||||
Death_TextId[0] = 0;
|
||||
Death_TextId[1] = 0;
|
||||
Death_TextId[2] = 0;
|
||||
Death_Sound[0] = 0;
|
||||
Death_Sound[1] = 0;
|
||||
Death_Sound[2] = 0;
|
||||
Death_Spell = 0;
|
||||
Death_Target_Type = 0;
|
||||
|
||||
Kill_Text[0] = NULL;
|
||||
Kill_Text[1] = NULL;
|
||||
Kill_Text[2] = NULL;
|
||||
Kill_Say[0] = false;
|
||||
Kill_Say[1] = false;
|
||||
Kill_Say[2] = false;
|
||||
Kill_TextId[0] = 0;
|
||||
Kill_TextId[1] = 0;
|
||||
Kill_TextId[2] = 0;
|
||||
Kill_Sound[0] = 0;
|
||||
Kill_Sound[1] = 0;
|
||||
Kill_Sound[2] = 0;
|
||||
@@ -106,11 +97,9 @@ void SimpleAI::Aggro(Unit *who)
|
||||
|
||||
uint32 random_text = rand()%3;
|
||||
|
||||
//Random yell
|
||||
if (Aggro_Text[random_text])
|
||||
if (Aggro_Say[random_text])
|
||||
DoSay(Aggro_Text[random_text], LANG_UNIVERSAL, who);
|
||||
else DoYell(Aggro_Text[random_text], LANG_UNIVERSAL, who);
|
||||
//Random text
|
||||
if (Aggro_TextId[random_text])
|
||||
DoScriptText(Aggro_TextId[random_text], m_creature, who);
|
||||
|
||||
//Random sound
|
||||
if (Aggro_Sound[random_text])
|
||||
@@ -122,10 +111,8 @@ void SimpleAI::KilledUnit(Unit *victim)
|
||||
uint32 random_text = rand()%3;
|
||||
|
||||
//Random yell
|
||||
if (Kill_Text[random_text])
|
||||
if (Kill_Say[random_text])
|
||||
DoSay(Kill_Text[random_text], LANG_UNIVERSAL, victim);
|
||||
else DoYell(Kill_Text[random_text], LANG_UNIVERSAL, victim);
|
||||
if (Kill_TextId[random_text])
|
||||
DoScriptText(Kill_TextId[random_text], m_creature, victim);
|
||||
|
||||
//Random sound
|
||||
if (Kill_Sound[random_text])
|
||||
@@ -172,10 +159,8 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
|
||||
uint32 random_text = rand()%3;
|
||||
|
||||
//Random yell
|
||||
if (Death_Text[random_text])
|
||||
if (Death_Say[random_text])
|
||||
DoSay(Death_Text[random_text], LANG_UNIVERSAL, killer);
|
||||
else DoYell(Death_Text[random_text], LANG_UNIVERSAL, killer);
|
||||
if (Death_TextId[random_text])
|
||||
DoScriptText(Death_TextId[random_text], m_creature, killer);
|
||||
|
||||
//Random sound
|
||||
if (Death_Sound[random_text])
|
||||
@@ -269,10 +254,8 @@ void SimpleAI::UpdateAI(const uint32 diff)
|
||||
uint32 random_text = rand()%3;
|
||||
|
||||
//Random yell
|
||||
if (Spell[i].Text[random_text])
|
||||
if (Spell[i].Say[random_text])
|
||||
DoSay(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
|
||||
else DoYell(Spell[i].Text[random_text], LANG_UNIVERSAL, target);
|
||||
if (Spell[i].TextId[random_text])
|
||||
DoScriptText(Spell[i].TextId[random_text], m_creature, target);
|
||||
|
||||
//Random sound
|
||||
if (Spell[i].Text_Sound[random_text])
|
||||
|
||||
@@ -35,18 +35,15 @@ struct TRINITY_DLL_DECL SimpleAI : public ScriptedAI
|
||||
|
||||
public:
|
||||
|
||||
char* Aggro_Text[3];
|
||||
bool Aggro_Say[3];
|
||||
int32 Aggro_TextId[3];
|
||||
uint32 Aggro_Sound[3];
|
||||
|
||||
char* Death_Text[3];
|
||||
bool Death_Say[3];
|
||||
int32 Death_TextId[3];
|
||||
uint32 Death_Sound[3];
|
||||
uint32 Death_Spell;
|
||||
uint32 Death_Target_Type;
|
||||
|
||||
char* Kill_Text[3];
|
||||
bool Kill_Say[3];
|
||||
int32 Kill_TextId[3];
|
||||
uint32 Kill_Sound[3];
|
||||
uint32 Kill_Spell;
|
||||
uint32 Kill_Target_Type;
|
||||
@@ -62,8 +59,7 @@ public:
|
||||
bool Enabled; //Spell enabled or disabled (default: false)
|
||||
|
||||
//3 texts to many?
|
||||
char* Text[3];
|
||||
bool Say[3];
|
||||
int32 TextId[3];
|
||||
uint32 Text_Sound[3];
|
||||
}Spell[10];
|
||||
|
||||
|
||||
@@ -215,71 +215,42 @@ bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 em
|
||||
#define SAY_DOC2 -1000202
|
||||
#define SAY_DOC3 -1000203
|
||||
|
||||
#define DOCTOR_ALLIANCE 12939
|
||||
#define DOCTOR_HORDE 12920
|
||||
#define ALLIANCE_COORDS 7
|
||||
#define HORDE_COORDS 6
|
||||
|
||||
struct Location
|
||||
{
|
||||
float x, y, z, o;
|
||||
};
|
||||
|
||||
#define DOCTOR_ALLIANCE 12939
|
||||
|
||||
static Location AllianceCoords[]=
|
||||
{
|
||||
{ // Top-far-right bunk as seen from entrance
|
||||
-3757.38, -4533.05, 14.16, 3.62
|
||||
},
|
||||
{ // Top-far-left bunk
|
||||
-3754.36, -4539.13, 14.16, 5.13
|
||||
},
|
||||
{ // Far-right bunk
|
||||
-3749.54, -4540.25, 14.28, 3.34
|
||||
},
|
||||
{ // Right bunk near entrance
|
||||
-3742.10, -4536.85, 14.28, 3.64
|
||||
},
|
||||
{ // Far-left bunk
|
||||
-3755.89, -4529.07, 14.05, 0.57
|
||||
},
|
||||
{ // Mid-left bunk
|
||||
-3749.51, -4527.08, 14.07, 5.26
|
||||
},
|
||||
{ // Left bunk near entrance
|
||||
-3746.37, -4525.35, 14.16, 5.22
|
||||
},
|
||||
{-3757.38, -4533.05, 14.16, 3.62}, // Top-far-right bunk as seen from entrance
|
||||
{-3754.36, -4539.13, 14.16, 5.13}, // Top-far-left bunk
|
||||
{-3749.54, -4540.25, 14.28, 3.34}, // Far-right bunk
|
||||
{-3742.10, -4536.85, 14.28, 3.64}, // Right bunk near entrance
|
||||
{-3755.89, -4529.07, 14.05, 0.57}, // Far-left bunk
|
||||
{-3749.51, -4527.08, 14.07, 5.26}, // Mid-left bunk
|
||||
{-3746.37, -4525.35, 14.16, 5.22}, // Left bunk near entrance
|
||||
};
|
||||
|
||||
#define ALLIANCE_COORDS 7
|
||||
|
||||
//alliance run to where
|
||||
#define A_RUNTOX -3742.96
|
||||
#define A_RUNTOY -4531.52
|
||||
#define A_RUNTOZ 11.91
|
||||
|
||||
#define DOCTOR_HORDE 12920
|
||||
|
||||
static Location HordeCoords[]=
|
||||
{
|
||||
{ // Left, Behind
|
||||
-1013.75, -3492.59, 62.62, 4.34
|
||||
},
|
||||
{ // Right, Behind
|
||||
-1017.72, -3490.92, 62.62, 4.34
|
||||
},
|
||||
{ // Left, Mid
|
||||
-1015.77, -3497.15, 62.82, 4.34
|
||||
},
|
||||
{ // Right, Mid
|
||||
-1019.51, -3495.49, 62.82, 4.34
|
||||
},
|
||||
{ // Left, front
|
||||
-1017.25, -3500.85, 62.98, 4.34
|
||||
},
|
||||
{ // Right, Front
|
||||
-1020.95, -3499.21, 62.98, 4.34
|
||||
}
|
||||
{-1013.75, -3492.59, 62.62, 4.34}, // Left, Behind
|
||||
{-1017.72, -3490.92, 62.62, 4.34}, // Right, Behind
|
||||
{-1015.77, -3497.15, 62.82, 4.34}, // Left, Mid
|
||||
{-1019.51, -3495.49, 62.82, 4.34}, // Right, Mid
|
||||
{-1017.25, -3500.85, 62.98, 4.34}, // Left, front
|
||||
{-1020.95, -3499.21, 62.98, 4.34} // Right, Front
|
||||
};
|
||||
|
||||
#define HORDE_COORDS 6
|
||||
|
||||
//horde run to where
|
||||
#define H_RUNTOX -1016.44
|
||||
#define H_RUNTOY -3508.48
|
||||
@@ -305,6 +276,8 @@ const uint32 HordeSoldierId[3] =
|
||||
|
||||
struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
|
||||
{
|
||||
npc_doctorAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint64 Playerguid;
|
||||
|
||||
uint32 SummonPatient_Timer;
|
||||
@@ -317,9 +290,17 @@ struct TRINITY_DLL_DECL npc_doctorAI : public ScriptedAI
|
||||
std::list<uint64> Patients;
|
||||
std::vector<Location*> Coordinates;
|
||||
|
||||
npc_doctorAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
void Reset()
|
||||
{
|
||||
Playerguid = 0;
|
||||
|
||||
void Reset(){}
|
||||
SummonPatient_Timer = 10000;
|
||||
SummonPatientCount = 0;
|
||||
PatientDiedCount = 0;
|
||||
PatientSavedCount = 0;
|
||||
|
||||
Event = false;
|
||||
}
|
||||
|
||||
void BeginEvent(Player* player);
|
||||
void PatientDied(Location* Point);
|
||||
@@ -338,19 +319,20 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
npc_injured_patientAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint64 Doctorguid;
|
||||
|
||||
Location* Coord;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Doctorguid = 0;
|
||||
|
||||
Coord = NULL;
|
||||
//no select
|
||||
|
||||
//no select
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
//no regen health
|
||||
|
||||
//no regen health
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
//to make them lay with face down
|
||||
|
||||
//to make them lay with face down
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
|
||||
|
||||
uint32 mobId = m_creature->GetEntry();
|
||||
@@ -378,20 +360,22 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
{
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
|
||||
{
|
||||
if( (((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
|
||||
if((((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
|
||||
{
|
||||
if(Doctorguid)
|
||||
if (Doctorguid)
|
||||
{
|
||||
Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
|
||||
if(Doctor)
|
||||
if (Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid)))
|
||||
((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
|
||||
}
|
||||
}
|
||||
//make not selectable
|
||||
|
||||
//make not selectable
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
//regen health
|
||||
|
||||
//regen health
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
//stand up
|
||||
|
||||
//stand up
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
|
||||
|
||||
switch(rand()%3)
|
||||
@@ -403,6 +387,7 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
|
||||
uint32 mobId = m_creature->GetEntry();
|
||||
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
|
||||
switch (mobId)
|
||||
{
|
||||
case 12923:
|
||||
@@ -422,8 +407,9 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//lower HP on every world tick makes it a useful counter, not officlone though
|
||||
if (m_creature->isAlive() && m_creature->GetHealth() > 6)
|
||||
{ //lower HP on every world tick makes it a useful counter, not officlone though
|
||||
{
|
||||
m_creature->SetHealth(uint32(m_creature->GetHealth()-5) );
|
||||
}
|
||||
|
||||
@@ -434,10 +420,9 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, 32);
|
||||
|
||||
if(Doctorguid)
|
||||
if (Doctorguid)
|
||||
{
|
||||
Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid));
|
||||
if(Doctor)
|
||||
if (Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid)))
|
||||
((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
|
||||
}
|
||||
}
|
||||
@@ -468,7 +453,6 @@ void npc_doctorAI::BeginEvent(Player* player)
|
||||
for(uint8 i = 0; i < ALLIANCE_COORDS; ++i)
|
||||
Coordinates.push_back(&AllianceCoords[i]);
|
||||
break;
|
||||
|
||||
case DOCTOR_HORDE:
|
||||
for(uint8 i = 0; i < HORDE_COORDS; ++i)
|
||||
Coordinates.push_back(&HordeCoords[i]);
|
||||
@@ -476,7 +460,6 @@ void npc_doctorAI::BeginEvent(Player* player)
|
||||
}
|
||||
|
||||
Event = true;
|
||||
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
@@ -495,6 +478,7 @@ void npc_doctorAI::PatientDied(Location* Point)
|
||||
|
||||
Event = false;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Reset();
|
||||
}
|
||||
|
||||
Coordinates.push_back(Point);
|
||||
@@ -503,31 +487,31 @@ void npc_doctorAI::PatientDied(Location* Point)
|
||||
|
||||
void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Point)
|
||||
{
|
||||
if(player && Playerguid == player->GetGUID())
|
||||
if (player && Playerguid == player->GetGUID())
|
||||
{
|
||||
if((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
|
||||
if ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
|
||||
{
|
||||
PatientSavedCount++;
|
||||
if(PatientSavedCount == 15)
|
||||
if (PatientSavedCount == 15)
|
||||
{
|
||||
if(!Patients.empty())
|
||||
if (!Patients.empty())
|
||||
{
|
||||
std::list<uint64>::iterator itr;
|
||||
for(itr = Patients.begin(); itr != Patients.end(); ++itr)
|
||||
{
|
||||
Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr));
|
||||
if( Patient )
|
||||
if (Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr)))
|
||||
Patient->setDeathState(JUST_DIED);
|
||||
}
|
||||
}
|
||||
|
||||
if(player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
|
||||
if (player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(6624);
|
||||
else if(player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
|
||||
else if (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(6622);
|
||||
|
||||
Event = false;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Reset();
|
||||
}
|
||||
|
||||
Coordinates.push_back(Point);
|
||||
@@ -537,53 +521,61 @@ void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Poi
|
||||
|
||||
void npc_doctorAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(Event && SummonPatientCount >= 20)
|
||||
if (Event && SummonPatientCount >= 20)
|
||||
{
|
||||
Event = false;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Reset();
|
||||
}
|
||||
|
||||
if(Event)
|
||||
if(SummonPatient_Timer < diff)
|
||||
if (Event)
|
||||
{
|
||||
Creature* Patient = NULL;
|
||||
Location* Point = NULL;
|
||||
|
||||
if(Coordinates.empty())
|
||||
return;
|
||||
|
||||
std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
|
||||
uint32 patientEntry = 0;
|
||||
|
||||
switch(m_creature->GetEntry())
|
||||
if (SummonPatient_Timer < diff)
|
||||
{
|
||||
case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
|
||||
case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
|
||||
default:
|
||||
error_log("SD2: Invalid entry for Triage doctor. Please check your database");
|
||||
Creature* Patient = NULL;
|
||||
Location* Point = NULL;
|
||||
|
||||
if (Coordinates.empty())
|
||||
return;
|
||||
}
|
||||
|
||||
Point = *itr;
|
||||
std::vector<Location*>::iterator itr = Coordinates.begin()+rand()%Coordinates.size();
|
||||
uint32 patientEntry = 0;
|
||||
|
||||
Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
switch(m_creature->GetEntry())
|
||||
{
|
||||
case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break;
|
||||
case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break;
|
||||
default:
|
||||
error_log("SD2: Invalid entry for Triage doctor. Please check your database");
|
||||
return;
|
||||
}
|
||||
|
||||
if(Patient)
|
||||
{
|
||||
Patients.push_back(Patient->GetGUID());
|
||||
((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
|
||||
if(Point)
|
||||
((npc_injured_patientAI*)Patient->AI())->Coord = Point;
|
||||
Coordinates.erase(itr);
|
||||
}
|
||||
SummonPatient_Timer = 10000;
|
||||
SummonPatientCount++;
|
||||
}else SummonPatient_Timer -= diff;
|
||||
Point = *itr;
|
||||
|
||||
Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
|
||||
if (Patient)
|
||||
{
|
||||
//303, this flag appear to be required for client side item->spell to work (TARGET_SINGLE_FRIEND)
|
||||
Patient->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
|
||||
Patients.push_back(Patient->GetGUID());
|
||||
((npc_injured_patientAI*)Patient->AI())->Doctorguid = m_creature->GetGUID();
|
||||
|
||||
if (Point)
|
||||
((npc_injured_patientAI*)Patient->AI())->Coord = Point;
|
||||
|
||||
Coordinates.erase(itr);
|
||||
}
|
||||
SummonPatient_Timer = 10000;
|
||||
SummonPatientCount++;
|
||||
}else SummonPatient_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
bool QuestAccept_npc_doctor(Player *player, Creature *creature, Quest const *quest )
|
||||
{
|
||||
if((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
|
||||
if ((quest->GetQuestId() == 6624) || (quest->GetQuestId() == 6622))
|
||||
((npc_doctorAI*)creature->AI())->BeginEvent(player);
|
||||
|
||||
return true;
|
||||
@@ -599,7 +591,6 @@ CreatureAI* GetAI_npc_doctor(Creature *_Creature)
|
||||
######*/
|
||||
|
||||
#define SPELL_DEATHTOUCH 5
|
||||
#define SAY_AGGRO "This area is closed!"
|
||||
|
||||
struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
|
||||
{
|
||||
@@ -612,7 +603,6 @@ struct TRINITY_DLL_DECL npc_guardianAI : public ScriptedAI
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoYell(SAY_AGGRO,LANG_UNIVERSAL,NULL);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -73,13 +73,14 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
|
||||
Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (m_creature->IsWithinDistInMap(target, 34))
|
||||
//Not do anything without aura, spell can be resisted!
|
||||
if (target->HasAura(SPELL_SONIC_BOOM_CAST,1) && m_creature->IsWithinDistInMap(target, 34.0f))
|
||||
{
|
||||
target->SetHealth(target->GetMaxHealth() - target->GetMaxHealth() * 0.8);
|
||||
//This will be wrong calculation. Also, comments suggest it must deal damage
|
||||
target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aggro(Unit *who) { }
|
||||
|
||||
@@ -39,155 +39,141 @@ EndContentData */
|
||||
## npc_draenei_survivor
|
||||
######*/
|
||||
|
||||
#define HEAL1 -1000248
|
||||
#define HEAL2 -1000249
|
||||
#define HEAL3 -1000250
|
||||
#define HEAL4 -1000251
|
||||
#define SAY_HEAL1 -1000248
|
||||
#define SAY_HEAL2 -1000249
|
||||
#define SAY_HEAL3 -1000250
|
||||
#define SAY_HEAL4 -1000251
|
||||
|
||||
#define HELP1 -1000252
|
||||
#define HELP2 -1000253
|
||||
#define HELP3 -1000254
|
||||
#define HELP4 -1000255
|
||||
#define SAY_HELP1 -1000252
|
||||
#define SAY_HELP2 -1000253
|
||||
#define SAY_HELP3 -1000254
|
||||
#define SAY_HELP4 -1000255
|
||||
|
||||
#define SPELL_IRRIDATION 35046
|
||||
#define SPELL_STUNNED 28630
|
||||
|
||||
struct TRINITY_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
|
||||
{
|
||||
npc_draenei_survivorAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 UnSpawnTimer;
|
||||
uint32 ResetlifeTimer;
|
||||
uint32 SayingTimer;
|
||||
uint32 HealSayTimer;
|
||||
bool UnSpawn;
|
||||
bool say;
|
||||
bool HealSay;
|
||||
bool isRun;
|
||||
bool isMove;
|
||||
uint64 pCaster;
|
||||
|
||||
uint32 SayThanksTimer;
|
||||
uint32 RunAwayTimer;
|
||||
uint32 SayHelpTimer;
|
||||
|
||||
bool CanSayHelp;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
UnSpawnTimer = 2500;
|
||||
ResetlifeTimer= 60000;
|
||||
SayingTimer = 5000;
|
||||
HealSayTimer = 6000;
|
||||
say = false;
|
||||
isRun = false;
|
||||
isMove = false;
|
||||
UnSpawn = false;
|
||||
HealSay = false;
|
||||
pCaster = 0;
|
||||
|
||||
SayThanksTimer = 0;
|
||||
RunAwayTimer = 0;
|
||||
SayHelpTimer = 10000;
|
||||
|
||||
CanSayHelp = true;
|
||||
|
||||
m_creature->CastSpell(m_creature, SPELL_IRRIDATION, true);
|
||||
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
//cast red shining
|
||||
m_creature->CastSpell(m_creature, 29152, false, NULL);
|
||||
//set creature health
|
||||
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who) {}
|
||||
|
||||
void MoveInLineOfSight(Unit *who) //MoveInLineOfSight is called if creature could see you, updated all 100 ms
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if(who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 15) && say && !isRun)
|
||||
if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f))
|
||||
{
|
||||
switch (rand()%4) //Random switch between 4 texts
|
||||
//Random switch between 4 texts
|
||||
switch (rand()%4)
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(HELP1, m_creature);
|
||||
SayingTimer = 15000;
|
||||
say = false;
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(HELP2, m_creature);
|
||||
SayingTimer = 15000;
|
||||
say = false;
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(HELP3, m_creature);
|
||||
SayingTimer = 15000;
|
||||
say = false;
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(HELP4, m_creature);
|
||||
SayingTimer = 15000;
|
||||
say = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isRun = false;
|
||||
case 0: DoScriptText(SAY_HELP1, m_creature, who); break;
|
||||
case 1: DoScriptText(SAY_HELP2, m_creature, who); break;
|
||||
case 2: DoScriptText(SAY_HELP3, m_creature, who); break;
|
||||
case 3: DoScriptText(SAY_HELP4, m_creature, who); break;
|
||||
}
|
||||
|
||||
SayHelpTimer = 20000;
|
||||
CanSayHelp = false;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff) //Is also called each ms for Creature AI Updates...
|
||||
void SpellHit(Unit *Caster, const SpellEntry *Spell)
|
||||
{
|
||||
if (m_creature->GetHealth() > 50)
|
||||
// error: âconst struct SpellEntryâ has no member named âSpellFamilyFlags2â
|
||||
/*if (Spell->SpellFamilyFlags2 & 0x080000000)
|
||||
{
|
||||
if(ResetlifeTimer < diff)
|
||||
{
|
||||
ResetlifeTimer = 60000;
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
//set creature health
|
||||
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
|
||||
// ley down
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,3);
|
||||
}
|
||||
else ResetlifeTimer -= diff;
|
||||
}
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
if(HealSay)
|
||||
{
|
||||
if (HealSayTimer < diff)
|
||||
{
|
||||
UnSpawn = true;
|
||||
isRun = true;
|
||||
isMove = true;
|
||||
}else HealSayTimer -= diff;
|
||||
}
|
||||
m_creature->CastSpell(m_creature, SPELL_STUNNED, true);
|
||||
|
||||
if(UnSpawn)
|
||||
pCaster = Caster->GetGUID();
|
||||
|
||||
SayThanksTimer = 5000;
|
||||
}*/
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (SayThanksTimer)
|
||||
{
|
||||
if(isMove)
|
||||
if (SayThanksTimer <= diff)
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION);
|
||||
|
||||
if (Player *pPlayer = (Player*)Unit::GetUnit(*m_creature,pCaster))
|
||||
{
|
||||
if (pPlayer->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
switch (rand()%4)
|
||||
{
|
||||
case 0: DoScriptText(SAY_HEAL1, m_creature, pPlayer); break;
|
||||
case 1: DoScriptText(SAY_HEAL2, m_creature, pPlayer); break;
|
||||
case 2: DoScriptText(SAY_HEAL3, m_creature, pPlayer); break;
|
||||
case 3: DoScriptText(SAY_HEAL4, m_creature, pPlayer); break;
|
||||
}
|
||||
|
||||
pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
|
||||
}
|
||||
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
|
||||
isMove = false;
|
||||
}
|
||||
|
||||
if (UnSpawnTimer < diff)
|
||||
{
|
||||
m_creature->StopMoving();
|
||||
EnterEvadeMode();
|
||||
//set creature health
|
||||
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
|
||||
RunAwayTimer = 10000;
|
||||
SayThanksTimer = 0;
|
||||
}else SayThanksTimer -= diff;
|
||||
|
||||
}else UnSpawnTimer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
if(SayingTimer < diff)
|
||||
if (RunAwayTimer)
|
||||
{
|
||||
say = true;
|
||||
}else SayingTimer -= diff;
|
||||
}
|
||||
|
||||
void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)//Called if you cast a spell and do some things if Specified spell is true!
|
||||
{
|
||||
if (Hitter && Spellkind->Id == 28880)
|
||||
{
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
|
||||
m_creature->HandleEmoteCommand(ANIM_RISE);
|
||||
switch (rand()%4) //This switch doesn't work at all, creature say nothing!
|
||||
if (RunAwayTimer <= diff)
|
||||
{
|
||||
case 0: DoScriptText(HEAL1, m_creature, Hitter); break;
|
||||
case 1: DoScriptText(HEAL2, m_creature, Hitter); break;
|
||||
case 2: DoScriptText(HEAL3, m_creature, Hitter); break;
|
||||
case 3: DoScriptText(HEAL4, m_creature, Hitter); break;
|
||||
}
|
||||
HealSay = true;
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
m_creature->SetHealth(0);
|
||||
m_creature->CombatStop();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->RemoveCorpse();
|
||||
}else RunAwayTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (SayHelpTimer < diff)
|
||||
{
|
||||
CanSayHelp = true;
|
||||
SayHelpTimer = 20000;
|
||||
}else SayHelpTimer -= diff;
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_npc_draenei_survivor(Creature *_Creature)
|
||||
@@ -288,8 +274,8 @@ struct TRINITY_DLL_DECL npc_injured_draeneiAI : public ScriptedAI
|
||||
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
|
||||
switch (rand()%2)
|
||||
{
|
||||
case 0: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1); break;
|
||||
case 1: m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3); break;
|
||||
case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break;
|
||||
case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,7 +308,7 @@ CreatureAI* GetAI_npc_injured_draenei(Creature *_Creature)
|
||||
#define SAY_END2 -1000115
|
||||
#define EMOTE_HUG -1000116
|
||||
|
||||
#define QUEST_A_CRY_FOR_HELP 9528
|
||||
#define QUEST_A_CRY_FOR_SAY_HELP 9528
|
||||
|
||||
struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
|
||||
{
|
||||
@@ -351,7 +337,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
|
||||
DoScriptText(EMOTE_HUG, m_creature, player);
|
||||
DoScriptText(SAY_END2, m_creature, player);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_HELP,m_creature);
|
||||
((Player*)player)->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -373,7 +359,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_A_CRY_FOR_HELP);
|
||||
((Player*)player)->FailQuest(QUEST_A_CRY_FOR_SAY_HELP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +371,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
|
||||
|
||||
bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP)
|
||||
if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP)
|
||||
{
|
||||
creature->setFaction(113);
|
||||
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
|
||||
|
||||
+450
-492
@@ -1,492 +1,450 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Blades_Edge_Mountains
|
||||
SD%Complete: 90
|
||||
SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
|
||||
SDCategory: Blade's Edge Mountains
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
mobs_bladespire_ogre
|
||||
mobs_nether_drake
|
||||
npc_daranelle
|
||||
npc_overseer_nuaar
|
||||
npc_saikkal_the_elder
|
||||
npc_skyguard_handler_irena
|
||||
go_legion_obelisk
|
||||
EndContentData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
//Support for quest: You're Fired! (10821)
|
||||
bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
|
||||
|
||||
#define LEGION_OBELISK_ONE 185193
|
||||
#define LEGION_OBELISK_TWO 185195
|
||||
#define LEGION_OBELISK_THREE 185196
|
||||
#define LEGION_OBELISK_FOUR 185197
|
||||
#define LEGION_OBELISK_FIVE 185198
|
||||
|
||||
/*######
|
||||
## mobs_bladespire_ogre
|
||||
######*/
|
||||
|
||||
//TODO: add support for quest 10512 + creature abilities
|
||||
struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
|
||||
{
|
||||
mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
|
||||
{
|
||||
return new mobs_bladespire_ogreAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## mobs_nether_drake
|
||||
######*/
|
||||
|
||||
#define SAY_NIHIL_1 -1000396
|
||||
#define SAY_NIHIL_2 -1000397
|
||||
#define SAY_NIHIL_3 -1000398
|
||||
#define SAY_NIHIL_4 -1000399
|
||||
#define SAY_NIHIL_INTERRUPT -1000400
|
||||
|
||||
#define ENTRY_WHELP 20021
|
||||
#define ENTRY_PROTO 21821
|
||||
#define ENTRY_ADOLE 21817
|
||||
#define ENTRY_MATUR 21820
|
||||
#define ENTRY_NIHIL 21823
|
||||
|
||||
#define SPELL_T_PHASE_MODULATOR 37573
|
||||
|
||||
#define SPELL_ARCANE_BLAST 38881
|
||||
#define SPELL_MANA_BURN 38884
|
||||
#define SPELL_INTANGIBLE_PRESENCE 36513
|
||||
|
||||
struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
|
||||
{
|
||||
mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
bool IsNihil;
|
||||
uint32 NihilSpeech_Timer;
|
||||
uint32 NihilSpeech_Phase;
|
||||
|
||||
uint32 ArcaneBlast_Timer;
|
||||
uint32 ManaBurn_Timer;
|
||||
uint32 IntangiblePresence_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
NihilSpeech_Timer = 2000;
|
||||
IsNihil = false;
|
||||
if( m_creature->GetEntry() == ENTRY_NIHIL )
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
IsNihil = true;
|
||||
}
|
||||
NihilSpeech_Phase = 1;
|
||||
|
||||
ArcaneBlast_Timer = 7500;
|
||||
ManaBurn_Timer = 10000;
|
||||
IntangiblePresence_Timer = 15000;
|
||||
}
|
||||
|
||||
void Aggro(Unit* who) { }
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
{
|
||||
if( spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
uint32 cEntry = 0;
|
||||
|
||||
switch( m_creature->GetEntry() )
|
||||
{
|
||||
case ENTRY_WHELP:
|
||||
switch(rand()%4)
|
||||
{
|
||||
case 0: cEntry = ENTRY_PROTO; break;
|
||||
case 1: cEntry = ENTRY_ADOLE; break;
|
||||
case 2: cEntry = ENTRY_MATUR; break;
|
||||
case 3: cEntry = ENTRY_NIHIL; break;
|
||||
}
|
||||
break;
|
||||
case ENTRY_PROTO:
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: cEntry = ENTRY_ADOLE; break;
|
||||
case 1: cEntry = ENTRY_MATUR; break;
|
||||
case 2: cEntry = ENTRY_NIHIL; break;
|
||||
}
|
||||
break;
|
||||
case ENTRY_ADOLE:
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: cEntry = ENTRY_PROTO; break;
|
||||
case 1: cEntry = ENTRY_MATUR; break;
|
||||
case 2: cEntry = ENTRY_NIHIL; break;
|
||||
}
|
||||
break;
|
||||
case ENTRY_MATUR:
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: cEntry = ENTRY_PROTO; break;
|
||||
case 1: cEntry = ENTRY_ADOLE; break;
|
||||
case 2: cEntry = ENTRY_NIHIL; break;
|
||||
}
|
||||
break;
|
||||
case ENTRY_NIHIL:
|
||||
if( NihilSpeech_Phase )
|
||||
{
|
||||
DoScriptText(SAY_NIHIL_INTERRUPT, m_creature);
|
||||
IsNihil = false;
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: cEntry = ENTRY_PROTO; break;
|
||||
case 1: cEntry = ENTRY_ADOLE; break;
|
||||
case 2: cEntry = ENTRY_MATUR; break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if( cEntry )
|
||||
{
|
||||
m_creature->UpdateEntry(cEntry);
|
||||
|
||||
if( cEntry == ENTRY_NIHIL )
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop();
|
||||
InCombat = false;
|
||||
Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if( IsNihil )
|
||||
{
|
||||
if( NihilSpeech_Phase )
|
||||
{
|
||||
if(NihilSpeech_Timer <= diff)
|
||||
{
|
||||
switch( NihilSpeech_Phase )
|
||||
{
|
||||
case 1:
|
||||
DoScriptText(SAY_NIHIL_1, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_NIHIL_2, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_NIHIL_3, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_NIHIL_4, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 5:
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
// + MOVEMENTFLAG_LEVITATING
|
||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
//then take off to random location. creature is initially summoned, so don't bother do anything else.
|
||||
m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+100, m_creature->GetPositionY(), m_creature->GetPositionZ()+100);
|
||||
NihilSpeech_Phase = 0;
|
||||
break;
|
||||
}
|
||||
NihilSpeech_Timer = 5000;
|
||||
}else NihilSpeech_Timer -=diff;
|
||||
}
|
||||
return; //anything below here is not interesting for Nihil, so skip it
|
||||
}
|
||||
|
||||
if( !UpdateVictim() )
|
||||
return;
|
||||
|
||||
if( IntangiblePresence_Timer <= diff )
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
|
||||
IntangiblePresence_Timer = 15000+rand()%15000;
|
||||
}else IntangiblePresence_Timer -= diff;
|
||||
|
||||
if( ManaBurn_Timer <= diff )
|
||||
{
|
||||
Unit* target = m_creature->getVictim();
|
||||
if( target && target->getPowerType() == POWER_MANA )
|
||||
DoCast(target,SPELL_MANA_BURN);
|
||||
ManaBurn_Timer = 8000+rand()%8000;
|
||||
}else ManaBurn_Timer -= diff;
|
||||
|
||||
if( ArcaneBlast_Timer <= diff )
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
|
||||
ArcaneBlast_Timer = 2500+rand()%5000;
|
||||
}else ArcaneBlast_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
|
||||
{
|
||||
return new mobs_nether_drakeAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_daranelle
|
||||
######*/
|
||||
|
||||
#define SAY_DARANELLE -1000401
|
||||
|
||||
struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
|
||||
{
|
||||
npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if(who->HasAura(36904,0))
|
||||
{
|
||||
DoScriptText(SAY_DARANELLE, m_creature, who);
|
||||
//TODO: Move the below to updateAI and run if this statement == true
|
||||
((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
|
||||
((Player*)who)->RemoveAurasDueToSpell(36904);
|
||||
}
|
||||
}
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
|
||||
{
|
||||
return new npc_daranelleAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_overseer_nuaar
|
||||
######*/
|
||||
|
||||
#define GOSSIP_HON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition."
|
||||
|
||||
bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
|
||||
{
|
||||
if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM( 0, GOSSIP_HON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->SEND_GOSSIP_MENU(10533, _Creature->GetGUID());
|
||||
player->AreaExploredOrEventHappens(10682);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_saikkal_the_elder
|
||||
######*/
|
||||
|
||||
#define GOSSIP_HSTE "Yes... yes, it's me."
|
||||
#define GOSSIP_SSTE "Yes elder. Tell me more of the book."
|
||||
|
||||
bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
|
||||
{
|
||||
if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM( 0, GOSSIP_HSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
player->ADD_GOSSIP_ITEM( 0, GOSSIP_SSTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(10796, _Creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_skyguard_handler_irena
|
||||
######*/
|
||||
|
||||
#define GOSSIP_SKYGUARD "Fly me to Skettis please"
|
||||
|
||||
bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature )
|
||||
{
|
||||
if (_Creature->isQuestGiver())
|
||||
player->PrepareQuestMenu( _Creature->GetGUID() );
|
||||
|
||||
if (player->GetReputationRank(1031) >= REP_HONORED)
|
||||
player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action )
|
||||
{
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
std::vector<uint32> nodes;
|
||||
|
||||
nodes.resize(2);
|
||||
nodes[0] = 172; //from ogri'la
|
||||
nodes[1] = 171; //end at skettis
|
||||
player->ActivateTaxiPathTo(nodes); //TaxiPath 706
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## go_legion_obelisk
|
||||
######*/
|
||||
|
||||
bool GOHello_go_legion_obelisk(Player *player, GameObject* _GO)
|
||||
{
|
||||
if ( player->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
switch( _GO->GetEntry() )
|
||||
{
|
||||
case LEGION_OBELISK_ONE:
|
||||
obelisk_one = true;
|
||||
break;
|
||||
case LEGION_OBELISK_TWO:
|
||||
obelisk_two = true;
|
||||
break;
|
||||
case LEGION_OBELISK_THREE:
|
||||
obelisk_three = true;
|
||||
break;
|
||||
case LEGION_OBELISK_FOUR:
|
||||
obelisk_four = true;
|
||||
break;
|
||||
case LEGION_OBELISK_FIVE:
|
||||
obelisk_five = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true )
|
||||
{
|
||||
_GO->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
|
||||
//reset global var
|
||||
obelisk_one = false;
|
||||
obelisk_two = false;
|
||||
obelisk_three = false;
|
||||
obelisk_four = false;
|
||||
obelisk_five = false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## AddSC
|
||||
######*/
|
||||
|
||||
void AddSC_blades_edge_mountains()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mobs_bladespire_ogre";
|
||||
newscript->GetAI = &GetAI_mobs_bladespire_ogre;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mobs_nether_drake";
|
||||
newscript->GetAI = &GetAI_mobs_nether_drake;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_daranelle";
|
||||
newscript->GetAI = &GetAI_npc_daranelle;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_overseer_nuaar";
|
||||
newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_saikkal_the_elder";
|
||||
newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="go_legion_obelisk";
|
||||
newscript->pGOHello = &GOHello_go_legion_obelisk;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_skyguard_handler_irena";
|
||||
newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Blades_Edge_Mountains
|
||||
SD%Complete: 90
|
||||
SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
|
||||
SDCategory: Blade's Edge Mountains
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
mobs_bladespire_ogre
|
||||
mobs_nether_drake
|
||||
npc_daranelle
|
||||
npc_overseer_nuaar
|
||||
npc_saikkal_the_elder
|
||||
npc_skyguard_handler_irena
|
||||
go_legion_obelisk
|
||||
EndContentData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
//Support for quest: You're Fired! (10821)
|
||||
bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
|
||||
|
||||
#define LEGION_OBELISK_ONE 185193
|
||||
#define LEGION_OBELISK_TWO 185195
|
||||
#define LEGION_OBELISK_THREE 185196
|
||||
#define LEGION_OBELISK_FOUR 185197
|
||||
#define LEGION_OBELISK_FIVE 185198
|
||||
|
||||
/*######
|
||||
## mobs_bladespire_ogre
|
||||
######*/
|
||||
|
||||
//TODO: add support for quest 10512 + creature abilities
|
||||
struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
|
||||
{
|
||||
mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
|
||||
{
|
||||
return new mobs_bladespire_ogreAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## mobs_nether_drake
|
||||
######*/
|
||||
|
||||
#define SAY_NIHIL_1 -1000396
|
||||
#define SAY_NIHIL_2 -1000397
|
||||
#define SAY_NIHIL_3 -1000398
|
||||
#define SAY_NIHIL_4 -1000399
|
||||
#define SAY_NIHIL_INTERRUPT -1000400
|
||||
|
||||
#define ENTRY_WHELP 20021
|
||||
#define ENTRY_PROTO 21821
|
||||
#define ENTRY_ADOLE 21817
|
||||
#define ENTRY_MATUR 21820
|
||||
#define ENTRY_NIHIL 21823
|
||||
|
||||
#define SPELL_T_PHASE_MODULATOR 37573
|
||||
|
||||
#define SPELL_ARCANE_BLAST 38881
|
||||
#define SPELL_MANA_BURN 38884
|
||||
#define SPELL_INTANGIBLE_PRESENCE 36513
|
||||
|
||||
struct TRINITY_DLL_DECL mobs_nether_drakeAI : public ScriptedAI
|
||||
{
|
||||
mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
bool IsNihil;
|
||||
uint32 NihilSpeech_Timer;
|
||||
uint32 NihilSpeech_Phase;
|
||||
|
||||
uint32 ArcaneBlast_Timer;
|
||||
uint32 ManaBurn_Timer;
|
||||
uint32 IntangiblePresence_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
IsNihil = false;
|
||||
NihilSpeech_Timer = 3000;
|
||||
NihilSpeech_Phase = 0;
|
||||
|
||||
ArcaneBlast_Timer = 7500;
|
||||
ManaBurn_Timer = 10000;
|
||||
IntangiblePresence_Timer = 15000;
|
||||
}
|
||||
|
||||
void Aggro(Unit* who) { }
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
//in case creature was not summoned (not expected)
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
m_creature->RemoveCorpse();
|
||||
m_creature->SetHealth(0);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
{
|
||||
if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL};
|
||||
int cid = rand()%(4-1);
|
||||
|
||||
if (entry_list[cid] == m_creature->GetEntry())
|
||||
++cid;
|
||||
|
||||
//we are nihil, so say before transform
|
||||
if (m_creature->GetEntry() == ENTRY_NIHIL)
|
||||
{
|
||||
DoScriptText(SAY_NIHIL_INTERRUPT, m_creature);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
IsNihil = false;
|
||||
}
|
||||
|
||||
if (m_creature->UpdateEntry(entry_list[cid]))
|
||||
{
|
||||
if (entry_list[cid] == ENTRY_NIHIL)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
IsNihil = true;
|
||||
}else
|
||||
AttackStart(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (IsNihil)
|
||||
{
|
||||
if (NihilSpeech_Timer <= diff)
|
||||
{
|
||||
switch(NihilSpeech_Phase)
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_NIHIL_1, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_NIHIL_2, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_NIHIL_3, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_NIHIL_4, m_creature);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
case 4:
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
//take off to location above
|
||||
m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+50.0f, m_creature->GetPositionY(), m_creature->GetPositionZ()+50.0f);
|
||||
++NihilSpeech_Phase;
|
||||
break;
|
||||
}
|
||||
NihilSpeech_Timer = 5000;
|
||||
}else NihilSpeech_Timer -=diff;
|
||||
|
||||
//anything below here is not interesting for Nihil, so skip it
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
if (IntangiblePresence_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE);
|
||||
IntangiblePresence_Timer = 15000+rand()%15000;
|
||||
}else IntangiblePresence_Timer -= diff;
|
||||
|
||||
if (ManaBurn_Timer <= diff)
|
||||
{
|
||||
Unit* target = m_creature->getVictim();
|
||||
if (target && target->getPowerType() == POWER_MANA)
|
||||
DoCast(target,SPELL_MANA_BURN);
|
||||
ManaBurn_Timer = 8000+rand()%8000;
|
||||
}else ManaBurn_Timer -= diff;
|
||||
|
||||
if (ArcaneBlast_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_ARCANE_BLAST);
|
||||
ArcaneBlast_Timer = 2500+rand()%5000;
|
||||
}else ArcaneBlast_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mobs_nether_drake(Creature *_Creature)
|
||||
{
|
||||
return new mobs_nether_drakeAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_daranelle
|
||||
######*/
|
||||
|
||||
#define SAY_SPELL_INFLUENCE -1000174
|
||||
|
||||
struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
|
||||
{
|
||||
npc_daranelleAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void Aggro(Unit* who) { }
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (who->HasAura(36904,0) && m_creature->IsWithinDistInMap(who, 10.0f))
|
||||
{
|
||||
DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
|
||||
//TODO: Move the below to updateAI and run if this statement == true
|
||||
((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
|
||||
((Player*)who)->RemoveAurasDueToSpell(36904);
|
||||
}
|
||||
}
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_daranelle(Creature *_Creature)
|
||||
{
|
||||
return new npc_daranelleAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_overseer_nuaar
|
||||
######*/
|
||||
|
||||
bool GossipHello_npc_overseer_nuaar(Player *player, Creature *_Creature)
|
||||
{
|
||||
if (player->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM( 0, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(10532, _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_overseer_nuaar(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->SEND_GOSSIP_MENU(10533, _Creature->GetGUID());
|
||||
player->AreaExploredOrEventHappens(10682);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_saikkal_the_elder
|
||||
######*/
|
||||
|
||||
bool GossipHello_npc_saikkal_the_elder(Player *player, Creature *_Creature)
|
||||
{
|
||||
if (player->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM( 0, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(10794, _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_saikkal_the_elder(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
player->ADD_GOSSIP_ITEM( 0, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
player->SEND_GOSSIP_MENU(10795, _Creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
player->TalkedToCreature(_Creature->GetEntry(), _Creature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(10796, _Creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_skyguard_handler_irena
|
||||
######*/
|
||||
|
||||
#define GOSSIP_SKYGUARD "Fly me to Skettis please"
|
||||
|
||||
bool GossipHello_npc_skyguard_handler_irena(Player *player, Creature *_Creature )
|
||||
{
|
||||
if (_Creature->isQuestGiver())
|
||||
player->PrepareQuestMenu( _Creature->GetGUID() );
|
||||
|
||||
if (player->GetReputationRank(1031) >= REP_HONORED)
|
||||
player->ADD_GOSSIP_ITEM( 2, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_skyguard_handler_irena(Player *player, Creature *_Creature, uint32 sender, uint32 action )
|
||||
{
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player,41278,true); //TaxiPath 706
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## go_legion_obelisk
|
||||
######*/
|
||||
|
||||
bool GOHello_go_legion_obelisk(Player *player, GameObject* _GO)
|
||||
{
|
||||
if ( player->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
switch( _GO->GetEntry() )
|
||||
{
|
||||
case LEGION_OBELISK_ONE:
|
||||
obelisk_one = true;
|
||||
break;
|
||||
case LEGION_OBELISK_TWO:
|
||||
obelisk_two = true;
|
||||
break;
|
||||
case LEGION_OBELISK_THREE:
|
||||
obelisk_three = true;
|
||||
break;
|
||||
case LEGION_OBELISK_FOUR:
|
||||
obelisk_four = true;
|
||||
break;
|
||||
case LEGION_OBELISK_FIVE:
|
||||
obelisk_five = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true )
|
||||
{
|
||||
_GO->SummonCreature(19963,2943.40f,4778.20f,284.49f,0.94f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
|
||||
//reset global var
|
||||
obelisk_one = false;
|
||||
obelisk_two = false;
|
||||
obelisk_three = false;
|
||||
obelisk_four = false;
|
||||
obelisk_five = false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
## AddSC
|
||||
######*/
|
||||
|
||||
void AddSC_blades_edge_mountains()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mobs_bladespire_ogre";
|
||||
newscript->GetAI = &GetAI_mobs_bladespire_ogre;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mobs_nether_drake";
|
||||
newscript->GetAI = &GetAI_mobs_nether_drake;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_daranelle";
|
||||
newscript->GetAI = &GetAI_npc_daranelle;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_overseer_nuaar";
|
||||
newscript->pGossipHello = &GossipHello_npc_overseer_nuaar;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_saikkal_the_elder";
|
||||
newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="go_legion_obelisk";
|
||||
newscript->pGOHello = &GOHello_go_legion_obelisk;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_skyguard_handler_irena";
|
||||
newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
|
||||
|
||||
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
|
||||
{
|
||||
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
||||
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_INTRO, m_creature);
|
||||
@@ -182,7 +182,6 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_WEAK25, m_creature);
|
||||
Life25 = false;
|
||||
Check_Timer = 0;
|
||||
}
|
||||
else if (Life50 && pct <= 50)
|
||||
{
|
||||
@@ -204,11 +203,16 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
if (pInstance->GetData(TYPE_MEDIVH) == DONE)
|
||||
if (pInstance->GetData(TYPE_RIFT) == DONE)
|
||||
{
|
||||
DoScriptText(SAY_WIN, m_creature);
|
||||
Check_Timer = 0;
|
||||
|
||||
if (m_creature->HasAura(SPELL_CHANNEL,0))
|
||||
m_creature->RemoveAura(SPELL_CHANNEL,0);
|
||||
|
||||
//TODO: start the post-event here
|
||||
pInstance->SetData(TYPE_MEDIVH,DONE);
|
||||
}
|
||||
}else Check_Timer -= diff;
|
||||
}
|
||||
@@ -336,7 +340,8 @@ struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI
|
||||
debug_log("SD2: npc_time_rift: not casting anylonger, i need to die.");
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
|
||||
pInstance->SetData(TYPE_RIFT,SPECIAL);
|
||||
if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS)
|
||||
pInstance->SetData(TYPE_RIFT,SPECIAL);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+8
-7
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
}
|
||||
}
|
||||
|
||||
debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
|
||||
debug_log("TSCR: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
if (Player* player = itr->getSource())
|
||||
player->SendUpdateWorldState(id,state);
|
||||
}
|
||||
}else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
|
||||
}else debug_log("TSCR: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
|
||||
}
|
||||
|
||||
void InitWorldState(bool Enable = true)
|
||||
@@ -187,7 +187,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
|
||||
if (!player)
|
||||
{
|
||||
debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
|
||||
debug_log("TSCR: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
{
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
debug_log("SD2: Instance Dark Portal: Starting event.");
|
||||
debug_log("TSCR: Instance Dark Portal: Starting event.");
|
||||
InitWorldState();
|
||||
Encounter[1] = IN_PROGRESS;
|
||||
NextPortal_Timer = 15000;
|
||||
@@ -227,6 +227,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
//this may be completed further out in the post-event
|
||||
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
||||
{
|
||||
debug_log("TSCR: Instance Dark Portal: Event completed.");
|
||||
player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh);
|
||||
player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh);
|
||||
}
|
||||
@@ -282,7 +283,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
//normalize Z-level if we can, if rift is not at ground level.
|
||||
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
|
||||
|
||||
debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry);
|
||||
debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
|
||||
|
||||
Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(),
|
||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||
@@ -290,7 +291,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
if (Summon)
|
||||
return Summon;
|
||||
|
||||
debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
|
||||
debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -306,7 +307,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||
|
||||
if (tmp >= CurrentRiftId)
|
||||
tmp++;
|
||||
debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
|
||||
debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
|
||||
|
||||
CurrentRiftId = tmp;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
|
||||
{
|
||||
lifeTimer = 120000;
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
spellHit = false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
|
||||
if (m_creature->IsStandState())
|
||||
{
|
||||
if(lifeTimer < diff)
|
||||
m_creature->AI()->EnterEvadeMode();
|
||||
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI
|
||||
if(Spellkind->Id == 8593 && !spellHit)
|
||||
{
|
||||
DoCast(m_creature,32343);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||
//m_creature->RemoveAllAuras();
|
||||
DoScriptText(SAY_HEAL, m_creature);
|
||||
|
||||
@@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
|
||||
{
|
||||
lifeTimer = 120000;
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
|
||||
spellHit = false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
|
||||
if (m_creature->IsStandState())
|
||||
{
|
||||
if(lifeTimer < diff)
|
||||
m_creature->AI()->EnterEvadeMode();
|
||||
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI
|
||||
if(Spellkind->Id == 8593 && !spellHit)
|
||||
{
|
||||
DoCast(m_creature,32343);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||
//m_creature->RemoveAllAuras();
|
||||
DoScriptText(SAY_HEAL, m_creature);
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
/* ScriptData
|
||||
SDName: Eversong_Woods
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 8346, 8483, 8488, 8490
|
||||
SDComment: Quest support: 8483, 8488, 8490
|
||||
SDCategory: Eversong Woods
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
mobs_mana_tapped
|
||||
npc_prospector_anvilward
|
||||
npc_apprentice_mirveda
|
||||
npc_infused_crystal
|
||||
@@ -31,31 +30,6 @@ EndContentData */
|
||||
#include "precompiled.h"
|
||||
#include "../../npc/npc_escortAI.h"
|
||||
|
||||
/*######
|
||||
## mobs_mana_tapped
|
||||
######*/
|
||||
|
||||
struct TRINITY_DLL_DECL mobs_mana_tappedAI : public ScriptedAI
|
||||
{
|
||||
mobs_mana_tappedAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void Aggro(Unit *who) { }
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry *spell)
|
||||
{
|
||||
if( caster->GetTypeId() == TYPEID_PLAYER)
|
||||
if( ((Player*)caster)->GetQuestStatus(8346) == QUEST_STATUS_INCOMPLETE && !((Player*)caster)->GetReqKillOrCastCurrentCount(8346, m_creature->GetEntry()) && spell->Id == 28734)
|
||||
((Player*)caster)->CastedCreatureOrGO(15468, m_creature->GetGUID(), spell->Id);
|
||||
return;
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_mobs_mana_tapped(Creature *_Creature)
|
||||
{
|
||||
return new mobs_mana_tappedAI (_Creature);
|
||||
}
|
||||
|
||||
/*######
|
||||
## npc_prospector_anvilward
|
||||
######*/
|
||||
@@ -753,11 +727,6 @@ void AddSC_eversong_woods()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mobs_mana_tapped";
|
||||
newscript->GetAI = &GetAI_mobs_mana_tapped;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name= "npc_prospector_anvilward";
|
||||
newscript->GetAI = &GetAI_npc_prospector_anvilward;
|
||||
|
||||
+121
-95
@@ -1,95 +1,121 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Broggok
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Hellfire Citadel, Blood Furnace
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#define SAY_AGGRO -1542008
|
||||
|
||||
#define SPELL_SLIME_SPRAY 30913
|
||||
#define SPELL_POISON_CLOUD 30916
|
||||
#define SPELL_POISON_BOLT 30917
|
||||
|
||||
#define SPELL_POISON 30914
|
||||
|
||||
struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
|
||||
{
|
||||
boss_broggokAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 AcidSpray_Timer;
|
||||
uint32 PoisonSpawn_Timer;
|
||||
uint32 PoisonBolt_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
AcidSpray_Timer = 10000;
|
||||
PoisonSpawn_Timer = 5000;
|
||||
PoisonBolt_Timer = 7000;
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if(AcidSpray_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY);
|
||||
AcidSpray_Timer = 4000+rand()%8000;
|
||||
}else AcidSpray_Timer -=diff;
|
||||
|
||||
if(PoisonBolt_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_POISON_BOLT);
|
||||
PoisonBolt_Timer = 4000+rand()%8000;
|
||||
}else PoisonBolt_Timer -=diff;
|
||||
|
||||
if(PoisonSpawn_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature,SPELL_POISON_CLOUD);
|
||||
PoisonSpawn_Timer = 20000;
|
||||
}else PoisonSpawn_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_broggokAI(Creature *_Creature)
|
||||
{
|
||||
return new boss_broggokAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_broggok()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_broggok";
|
||||
newscript->GetAI = &GetAI_boss_broggokAI;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Broggok
|
||||
SD%Complete: 70
|
||||
SDComment: pre-event not made
|
||||
SDCategory: Hellfire Citadel, Blood Furnace
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#define SAY_AGGRO -1542008
|
||||
|
||||
#define SPELL_SLIME_SPRAY 30913
|
||||
#define SPELL_POISON_CLOUD 30916
|
||||
#define SPELL_POISON_BOLT 30917
|
||||
|
||||
#define SPELL_POISON 30914
|
||||
|
||||
struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
|
||||
{
|
||||
boss_broggokAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 AcidSpray_Timer;
|
||||
uint32 PoisonSpawn_Timer;
|
||||
uint32 PoisonBolt_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
AcidSpray_Timer = 10000;
|
||||
PoisonSpawn_Timer = 5000;
|
||||
PoisonBolt_Timer = 7000;
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
summoned->setFaction(16);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID());
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
if (AcidSpray_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY);
|
||||
AcidSpray_Timer = 4000+rand()%8000;
|
||||
}else AcidSpray_Timer -=diff;
|
||||
|
||||
if (PoisonBolt_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_POISON_BOLT);
|
||||
PoisonBolt_Timer = 4000+rand()%8000;
|
||||
}else PoisonBolt_Timer -=diff;
|
||||
|
||||
if (PoisonSpawn_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature,SPELL_POISON_CLOUD);
|
||||
PoisonSpawn_Timer = 20000;
|
||||
}else PoisonSpawn_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI
|
||||
{
|
||||
mob_broggok_poisoncloudAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset() { }
|
||||
void MoveInLineOfSight(Unit *who) { }
|
||||
void AttackStart(Unit *who) { }
|
||||
void Aggro(Unit* who) { }
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_broggok(Creature *_Creature)
|
||||
{
|
||||
return new boss_broggokAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_broggok_poisoncloud(Creature *_Creature)
|
||||
{
|
||||
return new mob_broggok_poisoncloudAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_broggok()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_broggok";
|
||||
newscript->GetAI = &GetAI_boss_broggok;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_broggok_poisoncloud";
|
||||
newscript->GetAI = &GetAI_mob_broggok_poisoncloud;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
+8
-33
@@ -215,9 +215,13 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
summoned->setFaction(14);
|
||||
summoned->setFaction(16);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
//triggered spell of consumption does not properly show it's SpellVisual, wrong spellid?
|
||||
summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true);
|
||||
summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID());
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
@@ -381,39 +385,10 @@ struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI
|
||||
{
|
||||
mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
bool Start;
|
||||
uint32 Stop_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Start = false;
|
||||
Stop_Timer = 30000;
|
||||
}
|
||||
|
||||
void Reset() { }
|
||||
void MoveInLineOfSight(Unit *who) { }
|
||||
void AttackStart(Unit* who) { }
|
||||
void Aggro(Unit* who) { }
|
||||
|
||||
void MoveInLineOfSight(Unit *who) { return; }
|
||||
|
||||
void AttackStart(Unit* who) { return; }
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!Start)
|
||||
{
|
||||
//triggered spell of consumption does not properly show it's SpellVisual, hack it a bit
|
||||
m_creature->CastSpell(m_creature,SPELL_TEMPORARY_VISUAL,true);
|
||||
m_creature->CastSpell(m_creature,SPELL_CONSUMPTION,false);
|
||||
Start = true;
|
||||
}
|
||||
|
||||
if (Stop_Timer < diff)
|
||||
{
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
m_creature->SetHealth(0);
|
||||
m_creature->CombatStop();
|
||||
m_creature->DeleteThreatList();
|
||||
}else Stop_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature *_Creature)
|
||||
|
||||
@@ -1,172 +1,201 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Curator
|
||||
SD%Complete: 100
|
||||
SDComment: Evocation may cause client crash (Core related)
|
||||
SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#define SAY_AGGRO -1532057
|
||||
#define SAY_SUMMON1 -1532058
|
||||
#define SAY_SUMMON2 -1532059
|
||||
#define SAY_EVOCATE -1532060
|
||||
#define SAY_ENRAGE -1532061
|
||||
#define SAY_KILL1 -1532062
|
||||
#define SAY_KILL2 -1532063
|
||||
#define SAY_DEATH -1532064
|
||||
|
||||
//Flare spell info
|
||||
#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage
|
||||
#define SPELL_ASTRAL_FLARE_NE 30236
|
||||
#define SPELL_ASTRAL_FLARE_NW 30239
|
||||
#define SPELL_ASTRAL_FLARE_SE 30240
|
||||
#define SPELL_ASTRAL_FLARE_SW 30241
|
||||
|
||||
//Curator spell info
|
||||
#define SPELL_HATEFUL_BOLT 30383
|
||||
#define SPELL_EVOCATION 30254
|
||||
#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
|
||||
#define SPELL_BERSERK 26662
|
||||
|
||||
struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
|
||||
{
|
||||
boss_curatorAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 AddTimer;
|
||||
uint32 HatefulBoltTimer;
|
||||
uint32 BerserkTimer;
|
||||
|
||||
bool Enraged;
|
||||
bool Evocating;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
AddTimer = 10000;
|
||||
HatefulBoltTimer = 15000; //This time may be wrong
|
||||
BerserkTimer = 720000; //12 minutes
|
||||
Enraged = false;
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_KILL1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_KILL2, m_creature); break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
if (Evocating && !m_creature->HasAura(SPELL_EVOCATION, 0))
|
||||
Evocating = false;
|
||||
|
||||
if (m_creature->GetPower(POWER_MANA) <= 1000 && !Evocating)
|
||||
{
|
||||
DoScriptText(SAY_EVOCATE, m_creature);
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
DoCast(m_creature, SPELL_EVOCATION);
|
||||
Evocating = true;
|
||||
}
|
||||
|
||||
if (!Enraged && !Evocating)
|
||||
{
|
||||
if (AddTimer < diff)
|
||||
{
|
||||
//Summon Astral Flare
|
||||
Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (AstralFlare && target)
|
||||
{
|
||||
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
|
||||
AstralFlare->AI()->AttackStart(target);
|
||||
AstralFlare->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
AstralFlare->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
|
||||
}
|
||||
|
||||
//Reduce Mana by 10%
|
||||
int32 mana = (int32)(0.1f*(m_creature->GetMaxPower(POWER_MANA)));
|
||||
m_creature->ModifyPower(POWER_MANA, -mana);
|
||||
switch(rand()%4)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SUMMON1, m_creature);break;
|
||||
case 1: DoScriptText(SAY_SUMMON2, m_creature);break;
|
||||
}
|
||||
AddTimer = 10000;
|
||||
}else AddTimer -= diff;
|
||||
|
||||
if (HatefulBoltTimer < diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
|
||||
DoCast(target, SPELL_HATEFUL_BOLT);
|
||||
|
||||
if (!Enraged) { HatefulBoltTimer = 15000; }
|
||||
if (Enraged) { HatefulBoltTimer = 7000; }
|
||||
}else HatefulBoltTimer -= diff;
|
||||
|
||||
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 16)
|
||||
{
|
||||
Enraged = true;
|
||||
DoCast(m_creature, SPELL_ENRAGE);
|
||||
DoScriptText(SAY_ENRAGE, m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
if (BerserkTimer < diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_BERSERK);
|
||||
DoScriptText(SAY_ENRAGE, m_creature);
|
||||
}else BerserkTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_curator(Creature *_Creature)
|
||||
{
|
||||
return new boss_curatorAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_curator()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_curator";
|
||||
newscript->GetAI = &GetAI_boss_curator;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Curator
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Karazhan
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#define SAY_AGGRO -1532057
|
||||
#define SAY_SUMMON1 -1532058
|
||||
#define SAY_SUMMON2 -1532059
|
||||
#define SAY_EVOCATE -1532060
|
||||
#define SAY_ENRAGE -1532061
|
||||
#define SAY_KILL1 -1532062
|
||||
#define SAY_KILL2 -1532063
|
||||
#define SAY_DEATH -1532064
|
||||
|
||||
//Flare spell info
|
||||
#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage
|
||||
|
||||
//Curator spell info
|
||||
#define SPELL_HATEFUL_BOLT 30383
|
||||
#define SPELL_EVOCATION 30254
|
||||
#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage.
|
||||
#define SPELL_BERSERK 26662
|
||||
|
||||
struct TRINITY_DLL_DECL boss_curatorAI : public ScriptedAI
|
||||
{
|
||||
boss_curatorAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 AddTimer;
|
||||
uint32 HatefulBoltTimer;
|
||||
uint32 BerserkTimer;
|
||||
|
||||
bool Enraged;
|
||||
bool Evocating;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
AddTimer = 10000;
|
||||
HatefulBoltTimer = 15000; //This time may be wrong
|
||||
BerserkTimer = 720000; //12 minutes
|
||||
Enraged = false;
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_KILL1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_KILL2, m_creature); break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
//always decrease BerserkTimer
|
||||
if (BerserkTimer < diff)
|
||||
{
|
||||
//if evocate, then break evocate
|
||||
if (Evocating)
|
||||
{
|
||||
if (m_creature->HasAura(SPELL_EVOCATION))
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION);
|
||||
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
//may not be correct SAY (generic hard enrage)
|
||||
DoScriptText(SAY_ENRAGE, m_creature);
|
||||
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
DoCast(m_creature, SPELL_BERSERK);
|
||||
|
||||
//don't know if he's supposed to do summon/evocate after hard enrage (probably not)
|
||||
Enraged = true;
|
||||
}else BerserkTimer -= diff;
|
||||
|
||||
if (Evocating)
|
||||
{
|
||||
//not supposed to do anything while evocate
|
||||
if (m_creature->HasAura(SPELL_EVOCATION))
|
||||
return;
|
||||
else
|
||||
Evocating = false;
|
||||
}
|
||||
|
||||
if (!Enraged)
|
||||
{
|
||||
if (AddTimer < diff)
|
||||
{
|
||||
//Summon Astral Flare
|
||||
Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (AstralFlare && target)
|
||||
{
|
||||
AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
|
||||
AstralFlare->AI()->AttackStart(target);
|
||||
AstralFlare->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
AstralFlare->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
|
||||
}
|
||||
|
||||
//Reduce Mana by 10% of max health
|
||||
if (int32 mana = m_creature->GetMaxPower(POWER_MANA))
|
||||
{
|
||||
mana /= 10;
|
||||
m_creature->ModifyPower(POWER_MANA, -mana);
|
||||
|
||||
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
|
||||
if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10)
|
||||
{
|
||||
DoScriptText(SAY_EVOCATE, m_creature);
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
DoCast(m_creature, SPELL_EVOCATION);
|
||||
Evocating = true;
|
||||
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(rand()%4)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SUMMON1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SUMMON2, m_creature); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AddTimer = 10000;
|
||||
}else AddTimer -= diff;
|
||||
|
||||
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15)
|
||||
{
|
||||
Enraged = true;
|
||||
DoCast(m_creature, SPELL_ENRAGE);
|
||||
DoScriptText(SAY_ENRAGE, m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
if (HatefulBoltTimer < diff)
|
||||
{
|
||||
if (Enraged)
|
||||
HatefulBoltTimer = 7000;
|
||||
else
|
||||
HatefulBoltTimer = 15000;
|
||||
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1))
|
||||
DoCast(target, SPELL_HATEFUL_BOLT);
|
||||
|
||||
}else HatefulBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_curator(Creature *_Creature)
|
||||
{
|
||||
return new boss_curatorAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_curator()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_curator";
|
||||
newscript->GetAI = &GetAI_boss_curator;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -274,8 +274,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
|
||||
m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true);
|
||||
m_creature->CastSpell(m_creature, SPELL_CONJURE, false);
|
||||
m_creature->CastSpell(m_creature, SPELL_DRINK, false);
|
||||
//Sitting down
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 1);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
DrinkInturruptTimer = 10000;
|
||||
}
|
||||
}
|
||||
@@ -285,7 +284,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
|
||||
{
|
||||
Drinking = false;
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_DRINK);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
|
||||
m_creature->CastSpell(m_creature, SPELL_POTION, false);
|
||||
}
|
||||
@@ -296,7 +295,7 @@ struct TRINITY_DLL_DECL boss_aranAI : public ScriptedAI
|
||||
DrinkInturruptTimer -= diff;
|
||||
else
|
||||
{
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->CastSpell(m_creature, SPELL_POTION, true);
|
||||
m_creature->CastSpell(m_creature, SPELL_AOE_PYROBLAST, false);
|
||||
DrinkInturrupted = true;
|
||||
|
||||
@@ -118,7 +118,6 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI
|
||||
|
||||
bool SummonedTito;
|
||||
bool TitoDied;
|
||||
bool InCombat;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -130,7 +129,6 @@ struct TRINITY_DLL_DECL boss_dorotheeAI : public ScriptedAI
|
||||
|
||||
SummonedTito = false;
|
||||
TitoDied = false;
|
||||
InCombat = false;
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
@@ -209,13 +207,11 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
|
||||
}
|
||||
|
||||
uint64 DorotheeGUID;
|
||||
|
||||
uint32 YipTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DorotheeGUID = 0;
|
||||
|
||||
YipTimer = 10000;
|
||||
}
|
||||
|
||||
@@ -306,8 +302,15 @@ struct TRINITY_DLL_DECL boss_strawmanAI : public ScriptedAI
|
||||
|
||||
void SpellHit(Unit* caster, const SpellEntry *Spell)
|
||||
{
|
||||
if((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
|
||||
if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10)))
|
||||
{
|
||||
/*
|
||||
if (not direct damage(aoe,dot))
|
||||
return;
|
||||
*/
|
||||
|
||||
DoCast(m_creature, SPELL_BURNING_STRAW, true);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
@@ -577,9 +580,11 @@ struct TRINITY_DLL_DECL boss_croneAI : public ScriptedAI
|
||||
if(pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_OPERA_EVENT, DONE);
|
||||
GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
|
||||
if(Door)
|
||||
Door->UseDoorOrButton();
|
||||
|
||||
if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
|
||||
lDoor->SetGoState(0);
|
||||
if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
|
||||
rDoor->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,9 +777,11 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
|
||||
if(pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_OPERA_EVENT, DONE);
|
||||
GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
|
||||
if(Door)
|
||||
Door->UseDoorOrButton();
|
||||
|
||||
if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
|
||||
lDoor->SetGoState(0);
|
||||
if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
|
||||
rDoor->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -807,8 +814,8 @@ struct TRINITY_DLL_DECL boss_bigbadwolfAI : public ScriptedAI
|
||||
else
|
||||
{
|
||||
IsChasing = false;
|
||||
Unit* target = Unit::GetUnit((*m_creature), HoodGUID);
|
||||
if(target)
|
||||
|
||||
if (Unit* target = Unit::GetUnit((*m_creature), HoodGUID))
|
||||
{
|
||||
HoodGUID = 0;
|
||||
if(DoGetThreat(target))
|
||||
@@ -880,9 +887,9 @@ CreatureAI* GetAI_boss_bigbadwolf(Creature* _Creature)
|
||||
#define SPELL_RES_VISUAL 24171
|
||||
|
||||
/*** Misc. Information ****/
|
||||
#define CREATURE_ROMULO 17533
|
||||
#define ROMULO_X -10900
|
||||
#define ROMULO_Y -1758
|
||||
#define CREATURE_ROMULO 17533
|
||||
#define ROMULO_X -10900
|
||||
#define ROMULO_Y -1758
|
||||
|
||||
enum RAJPhase
|
||||
{
|
||||
@@ -893,33 +900,28 @@ enum RAJPhase
|
||||
|
||||
void PretendToDie(Creature* _Creature)
|
||||
{
|
||||
_Creature->InterruptNonMeleeSpells(false);
|
||||
_Creature->InterruptNonMeleeSpells(true);
|
||||
_Creature->RemoveAllAuras();
|
||||
_Creature->SetHealth(0);
|
||||
_Creature->StopMoving();
|
||||
_Creature->ClearComboPointHolders();
|
||||
_Creature->RemoveAllAurasOnDeath();
|
||||
_Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
|
||||
_Creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
|
||||
_Creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
_Creature->ClearAllReactives();
|
||||
_Creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
|
||||
_Creature->GetMotionMaster()->Clear();
|
||||
_Creature->GetMotionMaster()->MovementExpired(false);
|
||||
_Creature->GetMotionMaster()->MoveIdle();
|
||||
_Creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD);
|
||||
_Creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
};
|
||||
|
||||
void Resurrect(Creature* target)
|
||||
{
|
||||
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
target->SetHealth(target->GetMaxHealth());
|
||||
target->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
target->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
target->CastSpell(target, SPELL_RES_VISUAL, true);
|
||||
if(target->getVictim())
|
||||
{
|
||||
target->SetUInt64Value(UNIT_FIELD_TARGET, target->getVictim()->GetGUID());
|
||||
target->GetMotionMaster()->MoveChase(target->getVictim());
|
||||
target->AI()->AttackStart(target->getVictim());
|
||||
}
|
||||
else
|
||||
target->GetMotionMaster()->Initialize();
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
|
||||
@@ -934,18 +936,21 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 EntryYellTimer;
|
||||
uint32 AggroYellTimer;
|
||||
|
||||
uint64 RomuloGUID;
|
||||
|
||||
uint32 Phase;
|
||||
|
||||
uint32 EntryYellTimer;
|
||||
uint32 AggroYellTimer;
|
||||
uint32 BlindingPassionTimer;
|
||||
uint32 DevotionTimer;
|
||||
uint32 EternalAffectionTimer;
|
||||
uint32 PowerfulAttractionTimer;
|
||||
uint32 SummonRomuloTimer;
|
||||
uint32 ResurrectTimer;
|
||||
uint32 DrinkPoisonTimer;
|
||||
uint32 ResurrectSelfTimer;
|
||||
|
||||
bool IsFakingDeath;
|
||||
bool SummonedRomulo;
|
||||
@@ -961,15 +966,18 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
|
||||
Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
|
||||
RomuloGUID = 0;
|
||||
}
|
||||
|
||||
RomuloGUID = 0;
|
||||
Phase = PHASE_JULIANNE;
|
||||
|
||||
BlindingPassionTimer = 30000;
|
||||
DevotionTimer = 15000;
|
||||
EternalAffectionTimer = 25000;
|
||||
PowerfulAttractionTimer = 5000;
|
||||
SummonRomuloTimer = 10000;
|
||||
DrinkPoisonTimer = 0;
|
||||
ResurrectSelfTimer = 0;
|
||||
|
||||
if(IsFakingDeath)
|
||||
Resurrect(m_creature);
|
||||
@@ -997,6 +1005,15 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* caster, const SpellEntry *Spell)
|
||||
{
|
||||
if (Spell->Id == SPELL_DRINK_POISON)
|
||||
{
|
||||
DoScriptText(SAY_JULIANNE_DEATH01, m_creature);
|
||||
DrinkPoisonTimer = 2500;
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage);
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
@@ -1006,9 +1023,11 @@ struct TRINITY_DLL_DECL boss_julianneAI : public ScriptedAI
|
||||
if(pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_OPERA_EVENT, DONE);
|
||||
GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT));
|
||||
if(Door)
|
||||
Door->UseDoorOrButton();
|
||||
|
||||
if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
|
||||
lDoor->SetGoState(0);
|
||||
if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
|
||||
rDoor->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1024,13 +1043,15 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
|
||||
{
|
||||
boss_romuloAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
EntryYellTimer = 8000;
|
||||
AggroYellTimer = 15000;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint64 JulianneGUID;
|
||||
|
||||
uint32 Phase;
|
||||
|
||||
uint32 EntryYellTimer;
|
||||
@@ -1041,22 +1062,19 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
|
||||
uint32 PoisonThrustTimer;
|
||||
uint32 ResurrectTimer;
|
||||
|
||||
bool JulianneDead;
|
||||
bool IsFakingDeath;
|
||||
bool JulianneDead;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
JulianneGUID = 0;
|
||||
|
||||
Phase = PHASE_ROMULO;
|
||||
|
||||
BackwardLungeTimer = 15000;
|
||||
DaringTimer = 20000;
|
||||
DeadlySwatheTimer = 25000;
|
||||
PoisonThrustTimer = 10000;
|
||||
|
||||
if(IsFakingDeath)
|
||||
Resurrect(m_creature);
|
||||
ResurrectTimer = 10000;
|
||||
|
||||
IsFakingDeath = false;
|
||||
JulianneDead = false;
|
||||
@@ -1089,6 +1107,16 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_ROMULO_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_OPERA_EVENT, DONE);
|
||||
|
||||
if (GameObject* lDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORLEFT)))
|
||||
lDoor->SetGoState(0);
|
||||
if (GameObject* rDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GAMEOBJECT_STAGEDOORRIGHT)))
|
||||
rDoor->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
@@ -1101,137 +1129,169 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
|
||||
|
||||
void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
|
||||
{
|
||||
if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == RomuloGUID)
|
||||
if (damage < m_creature->GetHealth())
|
||||
return;
|
||||
|
||||
//anything below only used if incoming damage will kill
|
||||
|
||||
if(Phase == PHASE_JULIANNE)
|
||||
{
|
||||
DoScriptText(SAY_JULIANNE_DEATH01, m_creature);
|
||||
damage = 0;
|
||||
|
||||
//this means already drinking, so return
|
||||
if (IsFakingDeath)
|
||||
return;
|
||||
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
DoCast(m_creature, SPELL_DRINK_POISON);
|
||||
PretendToDie(m_creature);
|
||||
Phase = PHASE_ROMULO;
|
||||
damage = 0;
|
||||
|
||||
IsFakingDeath = true;
|
||||
SummonRomuloTimer = 10000;
|
||||
//IS THIS USEFULL? Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
|
||||
return;
|
||||
}
|
||||
|
||||
if(!IsFakingDeath)
|
||||
if (Phase == PHASE_ROMULO)
|
||||
{
|
||||
Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
|
||||
if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
|
||||
error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?");
|
||||
damage = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Phase == PHASE_BOTH)
|
||||
{
|
||||
//if this is true then we have to kill romulo too
|
||||
if (RomuloDead)
|
||||
{
|
||||
((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000;
|
||||
((boss_romuloAI*)Romulo->AI())->JulianneDead = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if(Romulo)
|
||||
if (Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID)))
|
||||
{
|
||||
Romulo->DealDamage(Romulo, Romulo->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Romulo->GetMotionMaster()->Clear();
|
||||
Romulo->setDeathState(JUST_DIED);
|
||||
Romulo->CombatStop();
|
||||
Romulo->DeleteThreatList();
|
||||
Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
|
||||
JustDied(done_by);
|
||||
return;
|
||||
}
|
||||
|
||||
IsFakingDeath = true;
|
||||
PretendToDie(m_creature);
|
||||
damage = 0;
|
||||
//if not already returned, then romulo is alive and we can pretend die
|
||||
if (Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID)))
|
||||
{
|
||||
PretendToDie(m_creature);
|
||||
IsFakingDeath = true;
|
||||
((boss_romuloAI*)Romulo->AI())->ResurrectTimer = 10000;
|
||||
((boss_romuloAI*)Romulo->AI())->JulianneDead = true;
|
||||
damage = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
damage = 0;
|
||||
error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen.");
|
||||
}
|
||||
|
||||
void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
|
||||
{
|
||||
if(damage < m_creature->GetHealth() || done_by == m_creature || done_by->GetGUID() == JulianneGUID)
|
||||
if (damage < m_creature->GetHealth())
|
||||
return;
|
||||
|
||||
if(!IsFakingDeath)
|
||||
{
|
||||
IsFakingDeath = true;
|
||||
PretendToDie(m_creature);
|
||||
//anything below only used if incoming damage will kill
|
||||
|
||||
if(Phase == PHASE_BOTH)
|
||||
if (Phase == PHASE_ROMULO)
|
||||
{
|
||||
DoScriptText(SAY_ROMULO_DEATH, m_creature);
|
||||
PretendToDie(m_creature);
|
||||
IsFakingDeath = true;
|
||||
Phase = PHASE_BOTH;
|
||||
|
||||
if (Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID)))
|
||||
{
|
||||
Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
|
||||
if(Julianne && Julianne->isAlive() && !((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
|
||||
{
|
||||
((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000;
|
||||
((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if(Julianne)
|
||||
{
|
||||
Julianne->DealDamage(Julianne, Julianne->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
JustDied(done_by);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
|
||||
if(Julianne)
|
||||
{
|
||||
Resurrect(Julianne);
|
||||
m_creature->SetHealth(m_creature->GetMaxHealth());
|
||||
((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 4000;
|
||||
((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
|
||||
((boss_julianneAI*)Julianne->AI())->Phase = PHASE_BOTH;
|
||||
((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
|
||||
}
|
||||
Phase = PHASE_BOTH;
|
||||
((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
|
||||
((boss_julianneAI*)Julianne->AI())->ResurrectSelfTimer = 10000;
|
||||
}
|
||||
|
||||
damage = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if(IsFakingDeath) damage = 0;
|
||||
if (Phase == PHASE_BOTH)
|
||||
{
|
||||
if (JulianneDead)
|
||||
{
|
||||
if (Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID)))
|
||||
{
|
||||
Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Julianne->GetMotionMaster()->Clear();
|
||||
Julianne->setDeathState(JUST_DIED);
|
||||
Julianne->CombatStop();
|
||||
Julianne->DeleteThreatList();
|
||||
Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID)))
|
||||
{
|
||||
PretendToDie(m_creature);
|
||||
IsFakingDeath = true;
|
||||
((boss_julianneAI*)Julianne->AI())->ResurrectTimer = 10000;
|
||||
((boss_julianneAI*)Julianne->AI())->RomuloDead = true;
|
||||
damage = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen.");
|
||||
}
|
||||
|
||||
void boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(EntryYellTimer)
|
||||
{
|
||||
if(EntryYellTimer < diff)
|
||||
if (EntryYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_JULIANNE_ENTER, m_creature);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
EntryYellTimer = 0;
|
||||
}else EntryYellTimer -= diff;
|
||||
}
|
||||
|
||||
if(AggroYellTimer)
|
||||
{
|
||||
if(AggroYellTimer < diff)
|
||||
if (AggroYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_JULIANNE_AGGRO, m_creature);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->setFaction(16);
|
||||
AggroYellTimer = 0;
|
||||
}else AggroYellTimer -= diff;
|
||||
}
|
||||
|
||||
if(Phase == PHASE_ROMULO && !SummonedRomulo)
|
||||
if (DrinkPoisonTimer)
|
||||
{
|
||||
//will do this 2secs after spell hit. this is time to display visual as expected
|
||||
if (DrinkPoisonTimer <= diff)
|
||||
{
|
||||
PretendToDie(m_creature);
|
||||
Phase = PHASE_ROMULO;
|
||||
SummonRomuloTimer = 10000;
|
||||
DrinkPoisonTimer = 0;
|
||||
}else DrinkPoisonTimer -= diff;
|
||||
}
|
||||
|
||||
if (Phase == PHASE_ROMULO && !SummonedRomulo)
|
||||
{
|
||||
if(SummonRomuloTimer < diff)
|
||||
{
|
||||
Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
Creature* Romulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
if(Romulo)
|
||||
{
|
||||
RomuloGUID = Romulo->GetGUID();
|
||||
((boss_romuloAI*)Romulo->AI())->JulianneGUID = m_creature->GetGUID();
|
||||
((boss_romuloAI*)Romulo->AI())->Phase = PHASE_ROMULO;
|
||||
Romulo->setFaction(16);
|
||||
|
||||
if(m_creature->getVictim())
|
||||
{
|
||||
Romulo->AI()->AttackStart(m_creature->getVictim());
|
||||
Romulo->AddThreat(m_creature->getVictim(), 50.0f);
|
||||
Romulo->AddThreat(m_creature->getVictim(), 0.0f);
|
||||
}
|
||||
DoZoneInCombat(Romulo);
|
||||
}
|
||||
@@ -1239,7 +1299,23 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
}else SummonRomuloTimer -= diff;
|
||||
}
|
||||
|
||||
if(!UpdateVictim() ||IsFakingDeath)
|
||||
if (ResurrectSelfTimer)
|
||||
{
|
||||
if (ResurrectSelfTimer <= diff)
|
||||
{
|
||||
Resurrect(m_creature);
|
||||
Phase = PHASE_BOTH;
|
||||
IsFakingDeath = false;
|
||||
|
||||
if (m_creature->getVictim())
|
||||
AttackStart(m_creature->getVictim());
|
||||
|
||||
ResurrectSelfTimer = 0;
|
||||
ResurrectTimer = 1000;
|
||||
}else ResurrectSelfTimer -= diff;
|
||||
}
|
||||
|
||||
if(!UpdateVictim() || IsFakingDeath)
|
||||
return;
|
||||
|
||||
if(RomuloDead)
|
||||
@@ -1252,9 +1328,9 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
|
||||
Resurrect(Romulo);
|
||||
((boss_romuloAI*)Romulo->AI())->IsFakingDeath = false;
|
||||
RomuloDead = false;
|
||||
ResurrectTimer = 10000;
|
||||
}
|
||||
RomuloDead = false;
|
||||
}else ResurrectTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1281,10 +1357,8 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
if(rand()%2 == 1 && SummonedRomulo)
|
||||
{
|
||||
Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
|
||||
if(Romulo && Romulo->isAlive() && !((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
|
||||
if (Romulo && Romulo->isAlive() && !RomuloDead)
|
||||
DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
|
||||
else
|
||||
return;
|
||||
}else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
|
||||
|
||||
EternalAffectionTimer = 45000 + rand()%15000;
|
||||
@@ -1308,9 +1382,9 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
|
||||
DoScriptText(SAY_ROMULO_RESURRECT, m_creature);
|
||||
Resurrect(Julianne);
|
||||
((boss_julianneAI*)Julianne->AI())->IsFakingDeath = false;
|
||||
JulianneDead = false;
|
||||
ResurrectTimer = 10000;
|
||||
}
|
||||
JulianneDead = false;
|
||||
}else ResurrectTimer -= diff;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ EndContentData */
|
||||
#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?"
|
||||
#define RAJ_GOSSIP1 "I've never been more ready."
|
||||
|
||||
#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ"
|
||||
#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD"
|
||||
#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ"
|
||||
|
||||
struct Dialogue
|
||||
{
|
||||
int32 textid;
|
||||
@@ -182,6 +186,7 @@ struct TRINITY_DLL_DECL npc_barnesAI : public npc_escortAI
|
||||
}
|
||||
IsBeingEscorted = false;
|
||||
PerformanceReady = true;
|
||||
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -378,6 +383,13 @@ bool GossipHello_npc_barnes(Player* player, Creature* _Creature)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
if (player->isGameMaster())
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
player->ADD_GOSSIP_ITEM(5, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
}
|
||||
|
||||
if(!((npc_barnesAI*)_Creature->AI())->RaidWiped)
|
||||
player->SEND_GOSSIP_MENU(8970, _Creature->GetGUID());
|
||||
else
|
||||
@@ -395,11 +407,25 @@ bool GossipSelect_npc_barnes(Player *player, Creature *_Creature, uint32 sender,
|
||||
player->ADD_GOSSIP_ITEM(0, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
player->SEND_GOSSIP_MENU(8971, _Creature->GetGUID());
|
||||
break;
|
||||
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
((npc_barnesAI*)_Creature->AI())->StartEvent();
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
((npc_barnesAI*)_Creature->AI())->Event = EVENT_OZ;
|
||||
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",player->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
((npc_barnesAI*)_Creature->AI())->Event = EVENT_HOOD;
|
||||
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",player->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
((npc_barnesAI*)_Creature->AI())->Event = EVENT_RAJ;
|
||||
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",player->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,238 +1,227 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Vexallus
|
||||
SD%Complete: 90
|
||||
SDComment: Heroic and Normal support. Needs further testing.
|
||||
SDCategory: Magister's Terrace
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_magisters_terrace.h"
|
||||
|
||||
#define SAY_AGGRO -1585007
|
||||
#define SAY_ENERGY -1585008
|
||||
#define SAY_OVERLOAD -1585009
|
||||
#define SAY_KILL -1585010
|
||||
#define EMOTE_DISCHARGE_ENERGY -1585011
|
||||
//is this text for real?
|
||||
#define SAY_DEATH "What...happen...ed."
|
||||
|
||||
//Pure energy spell info
|
||||
#define SPELL_ENERGY_BOLT 44342
|
||||
#define SPELL_ENERGY_FEEDBACK 44335
|
||||
|
||||
//Vexallus spell info
|
||||
#define SPELL_CHAIN_LIGHTNING 44318
|
||||
#define SPELL_SUMMON_PURE_ENERGY 44322 //not-working, this script summon this creatures without this spell
|
||||
#define SPELL_OVERLOAD 44353
|
||||
#define SPELL_ARCANE_SHOCK 44319
|
||||
#define ASTRAL_FLARE_VISUAL 30237
|
||||
|
||||
//Creatures
|
||||
#define CREATURE_PURE_ENERGY 24745
|
||||
|
||||
struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
|
||||
{
|
||||
boss_vexallusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
Heroic = c->GetMap()->IsHeroic();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 ArcaneShockTimer;
|
||||
uint32 OverloadTimer;
|
||||
uint32 SpawnAddInterval;
|
||||
uint32 AlreadySpawnedAmount;
|
||||
bool Enraged;
|
||||
bool Heroic;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ChainLightningTimer = 10000;
|
||||
ArcaneShockTimer = 8000;
|
||||
OverloadTimer = 2200;
|
||||
SpawnAddInterval = 15;
|
||||
AlreadySpawnedAmount = 0;
|
||||
|
||||
Enraged = false;
|
||||
|
||||
if(pInstance)
|
||||
{
|
||||
if (m_creature->isDead())
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
else pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
DoYell(SAY_DEATH, LANG_UNIVERSAL, NULL);
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
|
||||
GameObject* Door = NULL;
|
||||
Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR));
|
||||
if(Door)
|
||||
Door->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)
|
||||
{
|
||||
Enraged = true;
|
||||
}
|
||||
|
||||
if(!Enraged)
|
||||
{
|
||||
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1))))
|
||||
{
|
||||
DoScriptText(SAY_ENERGY, m_creature);
|
||||
DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature);
|
||||
Creature* PureEnergyCreature = NULL;
|
||||
PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, 10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (PureEnergyCreature && target)
|
||||
PureEnergyCreature->AI()->AttackStart(target);
|
||||
|
||||
if(Heroic) // *Heroic mode only - he summons two instead of one.
|
||||
{
|
||||
PureEnergyCreature = DoSpawnCreature(CREATURE_PURE_ENERGY, -10, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (PureEnergyCreature && target)
|
||||
PureEnergyCreature->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
++AlreadySpawnedAmount;
|
||||
};
|
||||
|
||||
if(ChainLightningTimer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CHAIN_LIGHTNING);
|
||||
ChainLightningTimer = 10000;
|
||||
}else ChainLightningTimer -= diff;
|
||||
|
||||
if(ArcaneShockTimer < diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
DoCast(target, SPELL_ARCANE_SHOCK);
|
||||
ArcaneShockTimer = 8000;
|
||||
}else ArcaneShockTimer -= diff;
|
||||
}else
|
||||
{
|
||||
if(OverloadTimer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_OVERLOAD);
|
||||
OverloadTimer = 2200;
|
||||
}else OverloadTimer -= diff;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_vexallus(Creature *_Creature)
|
||||
{
|
||||
return new boss_vexallusAI (_Creature);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
|
||||
{
|
||||
mob_pure_energyAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 EnergyBoltTimer;
|
||||
uint32 VisualTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
EnergyBoltTimer = 1000;
|
||||
VisualTimer = 1000;
|
||||
m_creature->SetSpeed(MOVE_RUN, 0.5f);
|
||||
m_creature->SetSpeed(MOVE_WALK, 0.5f);
|
||||
}
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
{
|
||||
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, m_creature->GetGUID());
|
||||
}
|
||||
|
||||
void Aggro(Unit *who){}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
if(EnergyBoltTimer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_ENERGY_BOLT);
|
||||
EnergyBoltTimer = 1700;
|
||||
}else EnergyBoltTimer -= diff;
|
||||
if(VisualTimer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), ASTRAL_FLARE_VISUAL, true);
|
||||
VisualTimer = 1000;
|
||||
}else VisualTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_pure_energy(Creature *_Creature)
|
||||
{
|
||||
return new mob_pure_energyAI (_Creature);
|
||||
};
|
||||
|
||||
void AddSC_boss_vexallus()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_vexallus";
|
||||
newscript->GetAI = &GetAI_boss_vexallus;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_pure_energy";
|
||||
newscript->GetAI = &GetAI_mob_pure_energy;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Vexallus
|
||||
SD%Complete: 90
|
||||
SDComment: Heroic and Normal support. Needs further testing.
|
||||
SDCategory: Magister's Terrace
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_magisters_terrace.h"
|
||||
|
||||
#define SAY_AGGRO -1585007
|
||||
#define SAY_ENERGY -1585008
|
||||
#define SAY_OVERLOAD -1585009
|
||||
#define SAY_KILL -1585010
|
||||
#define EMOTE_DISCHARGE_ENERGY -1585011
|
||||
|
||||
//is this text for real?
|
||||
//#define SAY_DEATH "What...happen...ed."
|
||||
|
||||
//Pure energy spell info
|
||||
#define SPELL_ENERGY_BOLT 46156
|
||||
#define SPELL_ENERGY_FEEDBACK 44335
|
||||
|
||||
//Vexallus spell info
|
||||
#define SPELL_CHAIN_LIGHTNING 44318
|
||||
#define SPELL_OVERLOAD 44353
|
||||
#define SPELL_ARCANE_SHOCK 44319
|
||||
|
||||
#define SPELL_SUMMON_PURE_ENERGY 44322 //mod scale -10
|
||||
#define H_SPELL_SUMMON_PURE_ENERGY1 46154 //mod scale -5
|
||||
#define H_SPELL_SUMMON_PURE_ENERGY2 46159 //mod scale -5
|
||||
|
||||
//Creatures
|
||||
#define CREATURE_PURE_ENERGY 24745
|
||||
|
||||
struct TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI
|
||||
{
|
||||
boss_vexallusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Heroic = c->GetMap()->IsHeroic();
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
bool Heroic;
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 ArcaneShockTimer;
|
||||
uint32 OverloadTimer;
|
||||
uint32 SpawnAddInterval;
|
||||
uint32 AlreadySpawnedAmount;
|
||||
bool Enraged;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ChainLightningTimer = 10000;
|
||||
ArcaneShockTimer = 8000;
|
||||
OverloadTimer = 2200;
|
||||
SpawnAddInterval = 15;
|
||||
AlreadySpawnedAmount = 0;
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit *victim)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
|
||||
if (GameObject* Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_VEXALLUS_DOOR)))
|
||||
Door->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
{
|
||||
if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
summoned->GetMotionMaster()->MoveFollow(temp,0,0);
|
||||
|
||||
//spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
|
||||
summoned->SetOwnerGUID(m_creature->GetGUID());
|
||||
summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,m_creature->GetGUID());
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 10)
|
||||
{
|
||||
Enraged = true;
|
||||
}
|
||||
|
||||
if (!Enraged)
|
||||
{
|
||||
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(SpawnAddInterval*(AlreadySpawnedAmount+1))))
|
||||
{
|
||||
DoScriptText(SAY_ENERGY, m_creature);
|
||||
DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature);
|
||||
|
||||
if (Heroic)
|
||||
{
|
||||
m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false);
|
||||
m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY2,false);
|
||||
}
|
||||
else
|
||||
m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false);
|
||||
|
||||
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos
|
||||
DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
if (Heroic)
|
||||
DoSpawnCreature(CREATURE_PURE_ENERGY, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
|
||||
++AlreadySpawnedAmount;
|
||||
}
|
||||
|
||||
if (ChainLightningTimer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CHAIN_LIGHTNING);
|
||||
|
||||
ChainLightningTimer = 10000;
|
||||
}else ChainLightningTimer -= diff;
|
||||
|
||||
if (ArcaneShockTimer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ARCANE_SHOCK);
|
||||
|
||||
ArcaneShockTimer = 8000;
|
||||
}else ArcaneShockTimer -= diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (OverloadTimer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_OVERLOAD);
|
||||
|
||||
OverloadTimer = 2200;
|
||||
}else OverloadTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_vexallus(Creature *_Creature)
|
||||
{
|
||||
return new boss_vexallusAI (_Creature);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI
|
||||
{
|
||||
mob_pure_energyAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void JustDied(Unit* slayer)
|
||||
{
|
||||
if (Unit *temp = m_creature->GetOwner())
|
||||
{
|
||||
if (temp && temp->isAlive())
|
||||
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit *who) { }
|
||||
void MoveInLineOfSight(Unit *who) { }
|
||||
void AttackStart(Unit *who) { }
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_pure_energy(Creature *_Creature)
|
||||
{
|
||||
return new mob_pure_energyAI (_Creature);
|
||||
};
|
||||
|
||||
void AddSC_boss_vexallus()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_vexallus";
|
||||
newscript->GetAI = &GetAI_boss_vexallus;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_pure_energy";
|
||||
newscript->GetAI = &GetAI_mob_pure_energy;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop();
|
||||
m_creature->setFaction(1080); //friendly
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_SIT);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
DoScriptText(LUMP_DEFEAT, m_creature);
|
||||
|
||||
bReset = true;
|
||||
@@ -139,7 +139,7 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
|
||||
m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0);
|
||||
|
||||
if (!m_creature->IsStandState())
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
switch(rand()%2)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI
|
||||
void Reset()
|
||||
{
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who) {}
|
||||
|
||||
@@ -41,8 +41,10 @@ EndScriptData */
|
||||
#define SPELL_SHADOW_MARK 27825
|
||||
|
||||
//Unrelenting Rider
|
||||
#define SPELL_UNHOLY_AURA 28340
|
||||
#define SPELL_SHADOWBOLT 19729 //Search thru targets and find those who have the SHADOW_MARK to cast this on
|
||||
#define SPELL_UNHOLY_AURA 55606
|
||||
#define H_SPELL_UNHOLY_AURA 55608
|
||||
#define SPELL_SHADOWBOLT_VOLLEY 27831 //Search thru targets and find those who have the SHADOW_MARK to cast this on
|
||||
#define H_SPELL_SHADOWBOLT_VOLLEY 55638
|
||||
|
||||
//Spectral Trainee
|
||||
#define SPELL_ARCANE_EXPLOSION 27989
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Highlord_Mograine
|
||||
SD%Complete: 100
|
||||
SDComment: SCRIPT OBSOLETE
|
||||
SDCategory: Naxxramas
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
//All horsemen
|
||||
#define SPELL_SHIELDWALL 29061
|
||||
#define SPELL_BESERK 26662
|
||||
|
||||
// highlord mograine
|
||||
#define SPELL_MARK_OF_MOGRAINE 28834
|
||||
#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim()
|
||||
|
||||
#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust."
|
||||
#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough."
|
||||
#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested."
|
||||
#define SAY_AGGRO1 "You seek death?"
|
||||
#define SAY_AGGRO2 "None shall pass!"
|
||||
#define SAY_AGGRO3 "Be still!"
|
||||
#define SAY_SLAY1 "You will find no peace in death."
|
||||
#define SAY_SLAY2 "The master's will is done."
|
||||
#define SAY_SPECIAL "Bow to the might of the Highlord!"
|
||||
#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..."
|
||||
|
||||
#define SOUND_TAUNT1 8842
|
||||
#define SOUND_TAUNT2 8843
|
||||
#define SOUND_TAUNT3 8844
|
||||
#define SOUND_AGGRO1 8835
|
||||
#define SOUND_AGGRO2 8836
|
||||
#define SOUND_AGGRO3 8837
|
||||
#define SOUND_SLAY1 8839
|
||||
#define SOUND_SLAY2 8840
|
||||
#define SOUND_SPECIAL 8841
|
||||
#define SOUND_DEATH 8838
|
||||
|
||||
#define SPIRIT_OF_MOGRAINE 16775
|
||||
|
||||
struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
|
||||
{
|
||||
boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
uint32 Mark_Timer;
|
||||
uint32 RighteousFire_Timer;
|
||||
bool ShieldWall1;
|
||||
bool ShieldWall2;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec.
|
||||
RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks
|
||||
ShieldWall1 = true;
|
||||
ShieldWall2 = true;
|
||||
}
|
||||
|
||||
void InitialYell()
|
||||
{
|
||||
if(!InCombat)
|
||||
{
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0:
|
||||
DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature,SOUND_AGGRO1);
|
||||
break;
|
||||
case 1:
|
||||
DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature,SOUND_AGGRO2);
|
||||
break;
|
||||
case 2:
|
||||
DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature,SOUND_AGGRO3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit()
|
||||
{
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0:
|
||||
DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature,SOUND_SLAY1);
|
||||
break;
|
||||
case 1:
|
||||
DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature,SOUND_SLAY2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature, SOUND_DEATH);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
InitialYell();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Mark of Mograine
|
||||
if(Mark_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE);
|
||||
Mark_Timer = 12000;
|
||||
}else Mark_Timer -= diff;
|
||||
|
||||
// Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds
|
||||
if(ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50)
|
||||
{
|
||||
if(ShieldWall1)
|
||||
{
|
||||
DoCast(m_creature,SPELL_SHIELDWALL);
|
||||
ShieldWall1 = false;
|
||||
}
|
||||
}
|
||||
if(ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
|
||||
{
|
||||
if(ShieldWall2)
|
||||
{
|
||||
DoCast(m_creature,SPELL_SHIELDWALL);
|
||||
ShieldWall2 = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Righteous Fire
|
||||
if(RighteousFire_Timer < diff)
|
||||
{
|
||||
if(rand()%4 == 1) // 1/4
|
||||
{
|
||||
DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE);
|
||||
}
|
||||
RighteousFire_Timer = 2000;
|
||||
}else RighteousFire_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_highlord_mograine(Creature *_Creature)
|
||||
{
|
||||
return new boss_highlord_mograineAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_highlord_mograine()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_highlord_mograine";
|
||||
newscript->GetAI = &GetAI_boss_highlord_mograine;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -16,12 +16,13 @@
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Darkmaster_Gandling
|
||||
SD%Complete: 99
|
||||
SD%Complete: 75
|
||||
SDComment: Doors missing in instance script.
|
||||
SDCategory: Scholomance
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_scholomance.h"
|
||||
|
||||
#define SPELL_ARCANEMISSILES 22272
|
||||
#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either.
|
||||
@@ -49,12 +50,19 @@ EndScriptData */
|
||||
|
||||
struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
|
||||
{
|
||||
boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = (ScriptedInstance*)m_creature->GetInstanceData();
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 ArcaneMissiles_Timer;
|
||||
uint32 ShadowShield_Timer;
|
||||
uint32 Curse_Timer;
|
||||
uint32 Teleport_Timer;
|
||||
|
||||
Creature *Summoned;
|
||||
|
||||
void Reset()
|
||||
@@ -69,6 +77,12 @@ struct TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI
|
||||
{
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_GANDLING, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
|
||||
|
||||
if(pInstance->GetData(DATA_CANSPAWNGANDLING))
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_illuciabarovAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
|
||||
|
||||
if(pInstance->GetData(DATA_CANSPAWNGANDLING))
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
|
||||
|
||||
if(pInstance->GetData(DATA_CANSPAWNGANDLING))
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
|
||||
|
||||
if(pInstance->GetData(DATA_CANSPAWNGANDLING))
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_lorekeeperpolkeltAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
|
||||
|
||||
if(pInstance->GetData(DATA_CANSPAWNGANDLING))
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL boss_theravenianAI : public ScriptedAI
|
||||
{
|
||||
pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
|
||||
|
||||
if(pInstance->GetData(DATA_CANSPAWNGANDLING))
|
||||
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
|
||||
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
#ifndef DEF_SCHOLOMANCE_H
|
||||
#define DEF_SCHOLOMANCE_H
|
||||
|
||||
#define DATA_CANSPAWNGANDLING 1
|
||||
#define TYPE_GANDLING 1
|
||||
#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2
|
||||
#define DATA_INSTRUCTORMALICIA_DEATH 3
|
||||
#define DATA_LADYILLUCIABAROV_DEATH 4
|
||||
#define DATA_LORDALEXEIBAROV_DEATH 5
|
||||
#define DATA_LOREKEEPERPOLKELT_DEATH 6
|
||||
#define DATA_THERAVENIAN_DEATH 7
|
||||
#define TYPE_KIRTONOS 8
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,36 +24,65 @@ EndScriptData */
|
||||
#include "precompiled.h"
|
||||
#include "def_scholomance.h"
|
||||
|
||||
#define GO_GATE_KIRTONOS 175570
|
||||
#define GO_GATE_GANDLING 177374
|
||||
#define GO_GATE_MALICIA 177375
|
||||
#define GO_GATE_THEOLEN 177377
|
||||
#define GO_GATE_POLKELT 177376
|
||||
#define GO_GATE_RAVENIAN 177372
|
||||
#define GO_GATE_BAROV 177373
|
||||
#define GO_GATE_ILLUCIA 177371
|
||||
|
||||
#define ENCOUNTERS 2
|
||||
|
||||
struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
|
||||
{
|
||||
instance_scholomance(Map *map) : ScriptedInstance(map) {Initialize();};
|
||||
|
||||
//Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov.
|
||||
bool IsBossDied[6];
|
||||
uint32 Encounter[ENCOUNTERS];
|
||||
|
||||
uint64 GateKirtonosGUID;
|
||||
uint64 GateGandlingGUID;
|
||||
uint64 GateMiliciaGUID;
|
||||
uint64 GateTheolenGUID;
|
||||
uint64 GatePolkeltGUID;
|
||||
uint64 GateRavenianGUID;
|
||||
uint64 GateBarovGUID;
|
||||
uint64 GateIlluciaGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
IsBossDied[0] = false;
|
||||
IsBossDied[1] = false;
|
||||
IsBossDied[2] = false;
|
||||
IsBossDied[3] = false;
|
||||
IsBossDied[4] = false;
|
||||
IsBossDied[5] = false;
|
||||
GateKirtonosGUID = 0;
|
||||
GateGandlingGUID = 0;
|
||||
GateMiliciaGUID = 0;
|
||||
GateTheolenGUID = 0;
|
||||
GatePolkeltGUID = 0;
|
||||
GateRavenianGUID = 0;
|
||||
GateBarovGUID = 0;
|
||||
GateIlluciaGUID = 0;
|
||||
|
||||
for(uint8 i = 0; i < 6; i++)
|
||||
IsBossDied[i] = false;
|
||||
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
Encounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
void OnObjectCreate(GameObject *go)
|
||||
{
|
||||
//not active in scholomance
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
if(type == DATA_CANSPAWNGANDLING)
|
||||
if(IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break;
|
||||
case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break;
|
||||
case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break;
|
||||
case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break;
|
||||
case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break;
|
||||
case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break;
|
||||
case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break;
|
||||
case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
@@ -63,28 +92,43 @@ struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance
|
||||
case DATA_LORDALEXEIBAROV_DEATH:
|
||||
IsBossDied[0] = true;
|
||||
break;
|
||||
|
||||
case DATA_DOCTORTHEOLENKRASTINOV_DEATH:
|
||||
IsBossDied[1] = true;
|
||||
break;
|
||||
|
||||
case DATA_THERAVENIAN_DEATH:
|
||||
IsBossDied[2] = true;
|
||||
break;
|
||||
|
||||
case DATA_LOREKEEPERPOLKELT_DEATH:
|
||||
IsBossDied[3] = true;
|
||||
break;
|
||||
|
||||
case DATA_INSTRUCTORMALICIA_DEATH:
|
||||
IsBossDied[4] = true;
|
||||
break;
|
||||
|
||||
case DATA_LADYILLUCIABAROV_DEATH:
|
||||
IsBossDied[5] = true;
|
||||
break;
|
||||
case TYPE_GANDLING:
|
||||
Encounter[0] = data;
|
||||
break;
|
||||
case TYPE_KIRTONOS:
|
||||
Encounter[1] = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
if (type == TYPE_GANDLING)
|
||||
{
|
||||
if (IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5])
|
||||
{
|
||||
Encounter[0] = IN_PROGRESS;
|
||||
return IN_PROGRESS;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_scholomance(Map* map)
|
||||
|
||||
@@ -56,8 +56,8 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
|
||||
{
|
||||
mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
Reset();
|
||||
PlayerGUID = 0;
|
||||
Reset();
|
||||
}
|
||||
|
||||
uint64 PlayerGUID;
|
||||
@@ -179,9 +179,9 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
|
||||
{
|
||||
mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
Reset();
|
||||
PlayerGUID = 0;
|
||||
Tapped = false;
|
||||
Reset();
|
||||
}
|
||||
|
||||
uint64 PlayerGUID;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
|
||||
void Reset()
|
||||
{
|
||||
lifeTimer = 120000;
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down
|
||||
spellHit = false;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->GetUInt32Value(UNIT_FIELD_BYTES_1))
|
||||
if (m_creature->IsStandState())
|
||||
{
|
||||
if(lifeTimer < diff)
|
||||
m_creature->AI()->EnterEvadeMode();
|
||||
@@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
|
||||
{
|
||||
((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
|
||||
DoCast(m_creature,SPELL_REVIVE_SELF);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||
//m_creature->RemoveAllAuras();
|
||||
DoScriptText(SAY_HEAL, m_creature);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
|
||||
CanDoQuest = false;
|
||||
UnkorUnfriendly_Timer = 0;
|
||||
Pulverize_Timer = 3000;
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->setFaction(FACTION_HOSTILE);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_SUBMIT, m_creature);
|
||||
m_creature->setFaction(FACTION_FRIENDLY);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_SIT);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop();
|
||||
|
||||
@@ -38,7 +38,11 @@ EndContentData */
|
||||
|
||||
struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
|
||||
{
|
||||
npc_defias_traitorAI(Creature *c) : npc_escortAI(c) {Reset();}
|
||||
npc_defias_traitorAI(Creature *c) : npc_escortAI(c)
|
||||
{
|
||||
IsWalking = false;
|
||||
Reset();
|
||||
}
|
||||
|
||||
bool IsWalking;
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
|
||||
{
|
||||
//Resurrect LorKhan
|
||||
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
|
||||
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pLorKhan->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pLorKhan->setFaction(14);
|
||||
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
|
||||
@@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
|
||||
{
|
||||
//Resurrect Zath
|
||||
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
|
||||
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pZath->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pZath->setFaction(14);
|
||||
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
|
||||
@@ -154,7 +154,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
|
||||
if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
m_creature->AttackStop();
|
||||
|
||||
if(pInstance)
|
||||
@@ -170,7 +170,7 @@ struct TRINITY_DLL_DECL boss_thekalAI : public ScriptedAI
|
||||
{
|
||||
DoCast(m_creature,SPELL_TIGER_FORM);
|
||||
m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0));
|
||||
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
|
||||
@@ -331,7 +331,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
|
||||
{
|
||||
//Resurrect Thekal
|
||||
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
|
||||
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pThekal->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pThekal->setFaction(14);
|
||||
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
|
||||
@@ -341,7 +341,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
|
||||
{
|
||||
//Resurrect Zath
|
||||
Unit *pZath = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ZATH));
|
||||
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pZath->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pZath->setFaction(14);
|
||||
pZath->SetHealth(int(pZath->GetMaxHealth()*1.0));
|
||||
@@ -354,7 +354,7 @@ struct TRINITY_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI
|
||||
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
m_creature->setFaction(35);
|
||||
m_creature->AttackStop();
|
||||
|
||||
@@ -402,7 +402,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_ZATH_ALIVE, 0);
|
||||
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
|
||||
{
|
||||
//Resurrect LorKhan
|
||||
Unit *pLorKhan = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LORKHAN));
|
||||
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pLorKhan->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pLorKhan->setFaction(14);
|
||||
pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0));
|
||||
@@ -473,7 +473,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
|
||||
{
|
||||
//Resurrect Thekal
|
||||
Unit *pThekal = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THEKAL));
|
||||
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pThekal->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pThekal->setFaction(14);
|
||||
pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0));
|
||||
@@ -486,7 +486,7 @@ struct TRINITY_DLL_DECL mob_zealot_zathAI : public ScriptedAI
|
||||
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05)
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 3);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
m_creature->setFaction(35);
|
||||
m_creature->AttackStop();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user