aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-24 16:25:13 -0600
committermegamage <none@none>2008-12-24 16:25:13 -0600
commit84a21f8f4b56ab732af37c9187cf68fc464b018f (patch)
tree50c257d066eb004ea34b4032b65fc65e9c011eca /src
parent4481ad517f9107992a4c0043f44e254c67a822fd (diff)
parentc6e74cb9134f3501a59cb0f8440a12749bda0f7e (diff)
Merge.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h1
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp13
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp211
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp22
-rw-r--r--src/game/SpellMgr.cpp14
5 files changed, 247 insertions, 14 deletions
diff --git a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
index df39785f555..78c1c488637 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
+++ b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
@@ -30,6 +30,7 @@
#define DATA_GAMEOBJECT_NETHER_DOOR 23
#define DATA_GAMEOBJECT_GAME_DOOR 24
#define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25
+#define DATA_IMAGE_OF_MEDIVH 26
// Opera Performances
#define EVENT_OZ 1
diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
index 0ca3835d976..5af12a4fb0b 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
@@ -61,6 +61,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
uint64 GamesmansExitDoor; // Door after Chess
uint64 NetherspaceDoor; // Door at Malchezaar
+ uint64 ImageGUID;
+
void Initialize()
{
for (uint8 i = 0; i < ENCOUNTERS; ++i)
@@ -82,6 +84,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
GamesmansDoor = 0;
GamesmansExitDoor = 0;
NetherspaceDoor = 0;
+
+ ImageGUID = 0;
}
bool IsEncounterInProgress() const
@@ -111,6 +115,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case DATA_NIGHTBANE_EVENT: return Encounters[11];
case DATA_OPERA_PERFORMANCE: return OperaEvent;
case DATA_OPERA_OZ_DEATHCOUNT: return OzDeathCount;
+ case DATA_IMAGE_OF_MEDIVH: return ImageGUID;
}
return 0;
@@ -174,6 +179,14 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
SaveToDB();
}
+ void SetData64(uint32 identifier, uint64 data)
+ {
+ switch(identifier)
+ {
+ case DATA_IMAGE_OF_MEDIVH: ImageGUID = data;
+ }
+ }
+
void OnObjectCreate(GameObject* go)
{
switch(go->GetEntry())
diff --git a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
index adda6eefa98..bb44dd55cc0 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp
@@ -17,13 +17,14 @@
/* ScriptData
SDName: Karazhan
SD%Complete: 100
-SDComment: Support for Barnes (Opera controller) and Berthold (Doorman).
+SDComment: Support for Barnes (Opera controller) and Berthold (Doorman), Support for Quest 9645.
SDCategory: Karazhan
EndScriptData */
/* ContentData
npc_barnes
npc_berthold
+npc_image_of_medivh
EndContentData */
#include "precompiled.h"
@@ -432,6 +433,209 @@ bool GossipSelect_npc_berthold(Player* player, Creature* _Creature, uint32 sende
return true;
}
+/*###
+# npc_image_of_medivh
+####*/
+
+#define SAY_DIALOG_MEDIVH_1 "You've got my attention, dragon. You'll find I'm not as easily scared as the villagers below."
+#define SAY_DIALOG_ARCANAGOS_2 "Your dabbling in the arcane has gone too far, Medivh. You've attracted the attention of powers beyond your understanding. You must leave Karazhan at once!"
+#define SAY_DIALOG_MEDIVH_3 "You dare challenge me at my own dwelling? Your arrogance is astounding, even for a dragon!"
+#define SAY_DIALOG_ARCANAGOS_4 "A dark power seeks to use you, Medivh! If you stay, dire days will follow. You must hurry, we don't have much time!"
+#define SAY_DIALOG_MEDIVH_5 "I do not know what you speak of, dragon... but I will not be bullied by this display of insolence. I'll leave Karazhan when it suits me!"
+#define SAY_DIALOG_ARCANAGOS_6 "You leave me no alternative. I will stop you by force if you won't listen to reason!"
+#define EMOTE_DIALOG_MEDIVH_7 "begins to cast a spell of great power, weaving his own essence into the magic."
+#define SAY_DIALOG_ARCANAGOS_8 "What have you done, wizard? This cannot be! I'm burning from... within!"
+#define SAY_DIALOG_MEDIVH_9 "He should not have angered me. I must go... recover my strength now..."
+
+#define MOB_ARCANAGOS 17652
+#define SPELL_FIRE_BALL 30967
+#define SPELL_UBER_FIREBALL 30971
+#define SPELL_CONFLAGRATION_BLAST 30977
+#define SPELL_MANA_SHIELD 31635
+
+static float MedivPos[4] = {-11161.49,-1902.24,91.48,1.94};
+static float ArcanagosPos[4] = {-11169.75,-1881.48,95.39,4.83};
+
+struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
+{
+ npc_image_of_medivhAI(Creature* c) : ScriptedAI(c)
+ {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Reset();
+ }
+
+ ScriptedInstance *pInstance;
+
+ uint64 ArcanagosGUID;
+
+ uint32 YellTimer;
+ uint32 Step;
+ uint32 FireMedivhTimer;
+ uint32 FireArcanagosTimer;
+
+ bool EventStarted;
+
+ void Reset()
+ {
+ ArcanagosGUID = 0;
+
+ if(pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
+ {
+ pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, m_creature->GetGUID());
+ (*m_creature).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
+ Step = 0;
+ }else
+ {
+ m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }
+ }
+ void Aggro(Unit* who){}
+
+ void MovementInform(uint32 type, uint32 id)
+ {
+ if(type != POINT_MOTION_TYPE)
+ return;
+ if(id == 1)
+ {
+ StartEvent();
+ m_creature->SetOrientation(MedivPos[3]);
+ m_creature->SetOrientation(MedivPos[3]);
+ }
+ }
+
+ void StartEvent()
+ {
+ Step = 1;
+ EventStarted = true;
+ Creature* Arcanagos = m_creature->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
+ ArcanagosGUID = Arcanagos->GetGUID();
+ Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ (*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]);
+ Arcanagos->SetOrientation(ArcanagosPos[3]);
+ m_creature->SetOrientation(MedivPos[3]);
+ YellTimer = 10000;
+ }
+
+
+ uint32 NextStep(uint32 Step)
+ {
+ Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
+ Map *map = m_creature->GetMap();
+ switch(Step)
+ {
+ case 0: return 9999999;
+ case 1:
+ m_creature->Yell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
+ return 10000;
+ case 2:
+ if(arca)
+ ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
+ return 20000;
+ case 3:
+ m_creature->Yell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
+ return 10000;
+ case 4:
+ if(arca)
+ ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
+ return 20000;
+ case 5:
+ m_creature->Yell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
+ return 20000;
+ case 6:
+ if(arca)
+ ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
+ return 10000;
+ case 7:
+ FireArcanagosTimer = 500;
+ return 5000;
+ case 8:
+ FireMedivhTimer = 500;
+ DoCast(m_creature, SPELL_MANA_SHIELD);
+ return 10000;
+ case 9:
+ m_creature->TextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
+ return 10000;
+ case 10:
+ if(arca)
+ m_creature->CastSpell(arca, SPELL_CONFLAGRATION_BLAST, false);
+ return 1000;
+ case 11:
+ if(arca)
+ ((Creature*)arca)->Yell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
+ return 5000;
+ case 12:
+ arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47);
+ arca->setActive(true);
+ arca->InterruptNonMeleeSpells(true);
+ arca->SetSpeed(MOVE_FLIGHT, 2.0f);
+ return 10000;
+ case 13:
+ m_creature->Yell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
+ return 10000;
+ case 14:
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->ClearInCombat();
+
+ if(map->IsDungeon())
+ {
+ InstanceMap::PlayerList const &PlayerList = ((InstanceMap*)map)->GetPlayers();
+ for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
+ {
+ if(i->getSource()->isAlive())
+ {
+ if(i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE)
+ i->getSource()->CompleteQuest(9645);
+ }
+ }
+ }
+ return 50000;
+ case 15:
+ arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return 5000;
+ default : return 9999999;
+ }
+
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+
+ if(YellTimer < diff)
+ {
+ if(EventStarted)
+ {
+ YellTimer = NextStep(Step++);
+ }
+ }else YellTimer -= diff;
+
+ if(Step >= 7 && Step <= 12 )
+ {
+ Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
+
+ if(FireArcanagosTimer < diff)
+ {
+ if(arca)
+ arca->CastSpell(m_creature, SPELL_FIRE_BALL, false);
+ FireArcanagosTimer = 6000;
+ }else FireArcanagosTimer -= diff;
+
+ if(FireMedivhTimer < diff)
+ {
+ if(arca)
+ DoCast(arca, SPELL_FIRE_BALL);
+ FireMedivhTimer = 5000;
+ }else FireMedivhTimer -= diff;
+
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_image_of_medivh(Creature *_Creature)
+{
+ return new npc_image_of_medivhAI(_Creature);
+}
+
void AddSC_karazhan()
{
Script* newscript;
@@ -448,4 +652,9 @@ void AddSC_karazhan()
newscript->pGossipHello = &GossipHello_npc_berthold;
newscript->pGossipSelect = &GossipSelect_npc_berthold;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_image_of_medivh";
+ newscript->GetAI = &GetAI_npc_image_of_medivh;
+ newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
index b804502033b..44e68f0dfbf 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp
@@ -435,20 +435,30 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
DoYell(YELL_SURGE, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE);
- Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1);
+ Unit *target = NULL;
+ std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
+ std::vector<Unit *> target_list;
+ for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
+ {
+ target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ //50 yard radius maximum
+ if(target && target->GetDistance2d(m_creature) < 50)
+ target_list.push_back(target);
+ target = NULL;
+ }
+ if(target_list.size())
+ target = *(target_list.begin()+rand()%target_list.size());
+
if(!target)
target = m_creature->getVictim();
TankGUID = m_creature->getVictim()->GetGUID();
ChargeTargetGUID = target->GetGUID();
-
- if(target && m_creature->IsWithinDistInMap(target, 50.0f))
- {
+
float x, y, z;
target->GetContactPoint(m_creature, x, y, z);
m_creature->SetSpeed(MOVE_RUN, 5.0f);
m_creature->GetMotionMaster()->Clear();
- m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
- }
+ m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
Surge_Timer = 15000 + rand()%5000;
return;
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 1e9ae3531dd..41faea5b8fb 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1332,14 +1332,14 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool
// return true;
//use data of highest rank spell(needed for spells which ranks have different effects)
- SpellEntry const *spellInfo1=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_1));
- SpellEntry const *spellInfo2=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_2));
+ spellInfo_1=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_1));
+ spellInfo_2=sSpellStore.LookupEntry(GetLastSpellInChain(spellId_2));
//if spells have exactly the same effect they cannot stack
for(uint32 i = 0; i < 3; ++i)
- if(spellInfo1->Effect[i] != spellInfo2->Effect[i]
- || spellInfo1->EffectApplyAuraName[i] != spellInfo2->EffectApplyAuraName[i]
- || spellInfo1->EffectMiscValue[i] != spellInfo2->EffectMiscValue[i]) // paladin resist aura
+ if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i]
+ || spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]
+ || spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i]) // paladin resist aura
return false; // need itemtype check? need an example to add that check
return true;
@@ -1430,8 +1430,8 @@ void SpellMgr::LoadSpellRequired()
bar.step();
sLog.outString();
- sLog.outString( ">> Loaded 0 spell chain records" );
- sLog.outErrorDb("`spell_chains` table is empty!");
+ sLog.outString( ">> Loaded 0 spell required records" );
+ sLog.outErrorDb("`spell_required` table is empty!");
return;
}
uint32 rows = 0;