aboutsummaryrefslogtreecommitdiff
path: root/src/bindings/scripts
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-06-15 23:59:27 +0200
committerMachiavelli <none@none>2009-06-15 23:59:27 +0200
commitef28e35c893f78f6c5a5bd069dc815b33d4ba8c6 (patch)
treef4a93967c000a5a84d1668705a7d48011c9a0ef5 /src/bindings/scripts
parent6ad7da569c51d6c62b707f6c436efb4275daf1b9 (diff)
parent9edc94f0922eba48148fec85bf02773c80537978 (diff)
*Merge
--HG-- branch : trunk
Diffstat (limited to 'src/bindings/scripts')
-rw-r--r--src/bindings/scripts/CMakeLists.txt1
-rw-r--r--src/bindings/scripts/ScriptMgr.cpp4
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj6
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj6
-rw-r--r--src/bindings/scripts/scripts/guard/guard_ai.cpp24
-rw-r--r--src/bindings/scripts/scripts/guard/guard_ai.h17
-rw-r--r--src/bindings/scripts/scripts/guard/guards.cpp34
-rw-r--r--src/bindings/scripts/scripts/npc/npcs_special.cpp14
-rw-r--r--src/bindings/scripts/scripts/zone/azshara/azshara.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp79
-rw-r--r--src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/desolace/desolace.cpp174
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp5
-rw-r--r--src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp41
-rw-r--r--src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp4
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp127
-rw-r--r--src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp63
-rw-r--r--src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp136
21 files changed, 466 insertions, 287 deletions
diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt
index 4e2d4aa4de0..2dbf2545d3b 100644
--- a/src/bindings/scripts/CMakeLists.txt
+++ b/src/bindings/scripts/CMakeLists.txt
@@ -149,6 +149,7 @@ SET(trinityscript_LIB_SRCS
scripts/zone/darkshore/darkshore.cpp
scripts/zone/deadmines/def_deadmines.h
scripts/zone/deadmines/deadmines.cpp
+ scripts/zone/desolace/desolace.cpp
scripts/zone/dragonblight/dragonblight.cpp
scripts/zone/dun_morogh/dun_morogh.cpp
scripts/zone/dustwallow_marsh/dustwallow_marsh.cpp
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp
index 24e0c488825..fadadda7246 100644
--- a/src/bindings/scripts/ScriptMgr.cpp
+++ b/src/bindings/scripts/ScriptMgr.cpp
@@ -255,6 +255,8 @@ extern void AddSC_instance_deadmines();
//Deadwind pass
//Desolace
+extern void AddSC_desolace();
+
//Dire Maul
extern void AddSC_dragonblight();
@@ -1149,6 +1151,8 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
//Deadwind pass
//Desolace
+ AddSC_desolace();
+
//Dire Maul
AddSC_dragonblight();
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index b3eb1437c02..5885b5de607 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -718,8 +718,10 @@
>
</Filter>
<Filter
- Name="Desolace"
- >
+ Name="Desolace">
+ <File
+ RelativePath="..\scripts\zone\desolace\desolace.cpp">
+ </File>
</Filter>
<Filter
Name="Dire Maul"
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 95f44bd2275..97d0da3ceea 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -717,8 +717,10 @@
>
</Filter>
<Filter
- Name="Desolace"
- >
+ Name="Desolace">
+ <File
+ RelativePath="..\scripts\zone\desolace\desolace.cpp">
+ </File>
</Filter>
<Filter
Name="Dire Maul"
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.cpp b/src/bindings/scripts/scripts/guard/guard_ai.cpp
index 3d7c3f5ba4c..41f3ad4fefc 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.cpp
+++ b/src/bindings/scripts/scripts/guard/guard_ai.cpp
@@ -170,3 +170,27 @@ void guardAI::UpdateAI(const uint32 diff)
}
}
+void guardAI::DoReplyToTextEmote(uint32 em)
+{
+ switch(em)
+ {
+ case TEXTEMOTE_KISS: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
+ case TEXTEMOTE_WAVE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
+ case TEXTEMOTE_SALUTE: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
+ case TEXTEMOTE_SHY: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
+ case TEXTEMOTE_RUDE:
+ case TEXTEMOTE_CHICKEN: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
+ }
+}
+
+void guardAI_orgrimmar::ReceiveEmote(Player *player, uint32 text_emote)
+{
+ if (player->GetTeam()==HORDE)
+ DoReplyToTextEmote(text_emote);
+}
+
+void guardAI_stormwind::ReceiveEmote(Player *player, uint32 text_emote)
+{
+ if (player->GetTeam() == ALLIANCE)
+ DoReplyToTextEmote(text_emote);
+}
diff --git a/src/bindings/scripts/scripts/guard/guard_ai.h b/src/bindings/scripts/scripts/guard/guard_ai.h
index 71ded211f6f..85baa30fb9d 100644
--- a/src/bindings/scripts/scripts/guard/guard_ai.h
+++ b/src/bindings/scripts/scripts/guard/guard_ai.h
@@ -21,6 +21,23 @@ struct TRINITY_DLL_DECL guardAI : public ScriptedAI
void JustDied(Unit *Killer);
void UpdateAI(const uint32 diff);
+
+ //common used for guards in main cities
+ void DoReplyToTextEmote(uint32 em);
+};
+
+struct TRINITY_DLL_DECL guardAI_orgrimmar : public guardAI
+{
+ guardAI_orgrimmar(Creature *c) : guardAI(c) {}
+
+ void ReceiveEmote(Player *player, uint32 text_emote);
+};
+
+struct TRINITY_DLL_DECL guardAI_stormwind : public guardAI
+{
+ guardAI_stormwind(Creature *c) : guardAI(c) {}
+
+ void ReceiveEmote(Player *player, uint32 text_emote);
};
#endif
diff --git a/src/bindings/scripts/scripts/guard/guards.cpp b/src/bindings/scripts/scripts/guard/guards.cpp
index fb27c64135d..4f160223aae 100644
--- a/src/bindings/scripts/scripts/guard/guards.cpp
+++ b/src/bindings/scripts/scripts/guard/guards.cpp
@@ -79,20 +79,6 @@ EndContentData */
#define GOSSIP_TEXT_INN_SILVERMOON_1 "Silvermoon City Inn"
#define GOSSIP_TEXT_INN_SILVERMOON_2 "Wayfarer's Rest tavern"
-//common used for guards in main cities
-void DoReplyToTextEmote(Creature *_Creature,uint32 em)
-{
- switch(em)
- {
- case TEXTEMOTE_KISS: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
- case TEXTEMOTE_WAVE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
- case TEXTEMOTE_SALUTE: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break;
- case TEXTEMOTE_SHY: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break;
- case TEXTEMOTE_RUDE:
- case TEXTEMOTE_CHICKEN: _Creature->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break;
- }
-}
-
/*******************************************************
* guard_azuremyst start
*******************************************************/
@@ -2220,20 +2206,13 @@ bool GossipSelect_guard_orgrimmar(Player *player, Creature *_Creature, uint32 se
return true;
}
-bool ReceiveEmote_guard_orgrimmar(Player *player, Creature *_Creature, uint32 emote)
-{
- if( player->GetTeam() == HORDE )
- DoReplyToTextEmote(_Creature,emote);
- return true;
-}
-
/*******************************************************
* guard_orgrimmar end
*******************************************************/
CreatureAI* GetAI_guard_orgrimmar(Creature *_Creature)
{
- return new guardAI (_Creature);
+ return new guardAI_orgrimmar (_Creature);
}
/*******************************************************
@@ -3384,20 +3363,13 @@ bool GossipSelect_guard_stormwind(Player *player, Creature *_Creature, uint32 se
return true;
}
-bool ReceiveEmote_guard_stormwind(Player *player, Creature *_Creature, uint32 emote)
-{
- if( player->GetTeam() == ALLIANCE )
- DoReplyToTextEmote(_Creature,emote);
- return true;
-}
-
/*******************************************************
* guard_stormwind end
*******************************************************/
CreatureAI* GetAI_guard_stormwind(Creature *_Creature)
{
- return new guardAI (_Creature);
+ return new guardAI_stormwind (_Creature);
}
/*******************************************************
@@ -4010,7 +3982,6 @@ void AddSC_guards()
newscript->Name="guard_orgrimmar";
newscript->pGossipHello = &GossipHello_guard_orgrimmar;
newscript->pGossipSelect = &GossipSelect_guard_orgrimmar;
- //newscript->pReceiveEmote = &ReceiveEmote_guard_orgrimmar;
newscript->GetAI = &GetAI_guard_orgrimmar;
newscript->RegisterSelf();
@@ -4046,7 +4017,6 @@ void AddSC_guards()
newscript->Name="guard_stormwind";
newscript->pGossipHello = &GossipHello_guard_stormwind;
newscript->pGossipSelect = &GossipSelect_guard_stormwind;
- //newscript->pReceiveEmote = &ReceiveEmote_guard_stormwind;
newscript->GetAI = &GetAI_guard_stormwind;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp
index 3c0429ee4f3..c6a545faed1 100644
--- a/src/bindings/scripts/scripts/npc/npcs_special.cpp
+++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp
@@ -98,14 +98,18 @@ struct TRINITY_DLL_DECL npc_chicken_cluckAI : public ScriptedAI
DoScriptText(EMOTE_A_HELLO, m_creature);
}
}
- } else DoScriptText(EMOTE_H_HELLO,m_creature);
+ }
+ else
+ DoScriptText(EMOTE_H_HELLO,m_creature);
}
if( emote == TEXTEMOTE_CHEER && player->GetTeam() == ALLIANCE )
- if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
{
- m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- m_creature->setFaction(FACTION_FRIENDLY);
- DoScriptText(EMOTE_CLUCK_TEXT2, m_creature);
+ if( player->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE )
+ {
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ m_creature->setFaction(FACTION_FRIENDLY);
+ DoScriptText(EMOTE_CLUCK_TEXT2, m_creature);
+ }
}
}
};
diff --git a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
index 5223b6d93c3..6d191db16b2 100644
--- a/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
+++ b/src/bindings/scripts/scripts/zone/azshara/azshara.cpp
@@ -310,7 +310,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI
Player* player = Unit::GetPlayer(PlayerGUID);
SendText(MSG_ESCAPE_NOTICE, player);
DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE);
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING);
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
m_creature->SetSpeed(MOVE_RUN, 0.85f, true);
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
@@ -441,7 +441,7 @@ struct TRINITY_DLL_DECL mob_depth_chargeAI : public ScriptedAI
void Reset()
{
- m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING);
+ m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
we_must_die = false;
must_die_timer = 1000;
diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
index 320a1610827..ae2ac22ae71 100644
--- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
+++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp
@@ -565,56 +565,71 @@ CreatureAI* GetAI_npc_geezleAI(Creature *_Creature)
enum
{
- INOCULATION_CHANNEL = 29528,
- INOCULATED_OWLKIN = 16534
+ SPELL_INOCULATE_OWLKIN = 29528,
+ ENTRY_OWLKIN = 16518,
+ ENTRY_OWLKIN_INOC = 16534
};
-struct TRINITY_DLL_DECL mob_nestlewood_owlkinAI : public ScriptedAI
+struct TRINITY_DLL_DECL npc_nestlewood_owlkinAI : public ScriptedAI
{
- mob_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {}
+ npc_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {}
- uint32 ChannelTimer;
- bool Channeled;
- bool Hitted;
+ uint32 DespawnTimer;
void Reset()
{
- ChannelTimer = 0;
- Channeled = false;
- Hitted = false;
+ DespawnTimer = 0;
+ m_creature->SetVisibility(VISIBILITY_ON);
}
- void EnterCombat(Unit *who){}
+ void Aggro(Unit *who) {}
- void SpellHit(Unit* caster, const SpellEntry* spell)
+ void UpdateAI(const uint32 diff)
{
- if(!caster)
- return;
-
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == INOCULATION_CHANNEL)
+ //timer gets adjusted by the triggered aura effect
+ if (DespawnTimer)
{
- ChannelTimer = 3000;
- Hitted = true;
+ if (DespawnTimer <= diff)
+ {
+ //once we are able to, despawn us
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->SetHealth(0);
+ m_creature->CombatStop();
+ m_creature->DeleteThreatList();
+ m_creature->RemoveCorpse();
+ }else DespawnTimer -= diff;
}
- }
- void UpdateAI(const uint32 diff)
- {
- if(ChannelTimer < diff && !Channeled && Hitted)
- {
- m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- m_creature->RemoveCorpse();
- m_creature->SummonCreature(INOCULATED_OWLKIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
- Channeled = true;
- }else ChannelTimer -= diff;
+ if (!UpdateVictim())
+ return;
DoMeleeAttackIfReady();
}
};
-CreatureAI* GetAI_mob_nestlewood_owlkinAI(Creature *_Creature)
+CreatureAI* GetAI_npc_nestlewood_owlkinAI(Creature* pCreature)
+{
+ return new npc_nestlewood_owlkinAI (pCreature);
+}
+
+bool EffectDummyCreature_npc_nestlewood_owlkin(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget)
{
- return new mob_nestlewood_owlkinAI (_Creature);
+ //always check spellid and effectindex
+ if (spellId == SPELL_INOCULATE_OWLKIN && effIndex == 0)
+ {
+ if (pCreatureTarget->GetEntry() != ENTRY_OWLKIN)
+ return true;
+
+ pCreatureTarget->UpdateEntry(ENTRY_OWLKIN_INOC);
+
+ //set despawn timer, since we want to remove creature after a short time
+ ((npc_nestlewood_owlkinAI*)pCreatureTarget->AI())->DespawnTimer = 15000;
+
+ //always return true when we are handling this spell and effect
+ return true;
+ }
+ return false;
}
void AddSC_azuremyst_isle()
@@ -650,8 +665,8 @@ void AddSC_azuremyst_isle()
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name="mob_nestlewood_owlkin";
- newscript->GetAI = &GetAI_mob_nestlewood_owlkinAI;
+ newscript->Name="npc_nestlewood_owlkin";
+ newscript->GetAI = &GetAI_npc_nestlewood_owlkinAI;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
index f8b92d4f077..30a9db9f29c 100644
--- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
+++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
@@ -167,8 +167,8 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
{
if (m_creature->getFaction() == FACTION_FRIENDLY_F)
return;
- else
- DoFriend();
+
+ DoFriend();
}
}
}
diff --git a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
index 432633e90fe..be0c9c0d57c 100644
--- a/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
+++ b/src/bindings/scripts/scripts/zone/blasted_lands/blasted_lands.cpp
@@ -50,7 +50,7 @@ bool GossipHello_npc_deathly_usher(Player *player, Creature *_Creature)
bool GossipSelect_npc_deathly_usher(Player *player, Creature *_Creature, uint32 sender, uint32 action)
{
- if(action = GOSSIP_ACTION_INFO_DEF)
+ if(action == GOSSIP_ACTION_INFO_DEF)
{
player->CLOSE_GOSSIP_MENU();
_Creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true);
diff --git a/src/bindings/scripts/scripts/zone/desolace/desolace.cpp b/src/bindings/scripts/scripts/zone/desolace/desolace.cpp
new file mode 100644
index 00000000000..e1366d51727
--- /dev/null
+++ b/src/bindings/scripts/scripts/zone/desolace/desolace.cpp
@@ -0,0 +1,174 @@
+/* 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: Desolace
+SD%Complete: 100
+SDComment: Quest support: 5561
+SDCategory: Desolace
+EndScriptData */
+
+/* ContentData
+npc_aged_dying_ancient_kodo
+EndContentData */
+
+#include "precompiled.h"
+
+enum
+{
+ SAY_SMEED_HOME_1 = -1000428,
+ SAY_SMEED_HOME_2 = -1000429,
+ SAY_SMEED_HOME_3 = -1000430,
+
+ QUEST_KODO = 5561,
+
+ NPC_SMEED = 11596,
+ NPC_AGED_KODO = 4700,
+ NPC_DYING_KODO = 4701,
+ NPC_ANCIENT_KODO = 4702,
+ NPC_TAMED_KODO = 11627,
+
+ SPELL_KODO_KOMBO_ITEM = 18153,
+ SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks
+ SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377,
+ SPELL_KODO_KOMBO_GOSSIP = 18362
+
+};
+
+struct TRINITY_DLL_DECL npc_aged_dying_ancient_kodoAI : public ScriptedAI
+{
+ npc_aged_dying_ancient_kodoAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
+
+ uint32 m_uiDespawnTimer;
+
+ void Reset()
+ {
+ m_uiDespawnTimer = 0;
+ }
+
+ void MoveInLineOfSight(Unit* pWho)
+ {
+ if (pWho->GetEntry() == NPC_SMEED)
+ {
+ if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
+ return;
+
+ if (m_creature->IsWithinDistInMap(pWho, 10.0f))
+ {
+ switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SMEED_HOME_1, pWho); break;
+ case 1: DoScriptText(SAY_SMEED_HOME_2, pWho); break;
+ case 2: DoScriptText(SAY_SMEED_HOME_3, pWho); break;
+ }
+
+ //spell have no implemented effect (dummy), so useful to notify spellHit
+ m_creature->CastSpell(m_creature,SPELL_KODO_KOMBO_GOSSIP,true);
+ }
+ }
+ }
+
+ void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
+ {
+ if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
+ {
+ m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ m_uiDespawnTimer = 60000;
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat.
+ if (m_uiDespawnTimer && m_uiDespawnTimer <= diff)
+ {
+ if (!m_creature->getVictim() && m_creature->isAlive())
+ {
+ Reset();
+ m_creature->setDeathState(JUST_DIED);
+ m_creature->Respawn();
+ return;
+ }
+ } else m_uiDespawnTimer -= diff;
+
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_npc_aged_dying_ancient_kodo(Creature* pCreature)
+{
+ return new npc_aged_dying_ancient_kodoAI(pCreature);
+}
+
+bool EffectDummyCreature_npc_aged_dying_ancient_kodo(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget)
+{
+ //always check spellid and effectindex
+ if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0)
+ {
+ //no effect if player/creature already have aura from spells
+ if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || pCreatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
+ return true;
+
+ if (pCreatureTarget->GetEntry() == NPC_AGED_KODO ||
+ pCreatureTarget->GetEntry() == NPC_DYING_KODO ||
+ pCreatureTarget->GetEntry() == NPC_ANCIENT_KODO)
+ {
+ pCaster->CastSpell(pCaster,SPELL_KODO_KOMBO_PLAYER_BUFF,true);
+
+ pCreatureTarget->UpdateEntry(NPC_TAMED_KODO);
+ pCreatureTarget->CastSpell(pCreatureTarget,SPELL_KODO_KOMBO_DESPAWN_BUFF,false);
+
+ if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ pCreatureTarget->GetMotionMaster()->MoveIdle();
+
+ pCreatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
+ }
+
+ //always return true when we are handling this spell and effect
+ return true;
+ }
+ return false;
+}
+
+bool GossipHello_npc_aged_dying_ancient_kodo(Player* pPlayer, Creature* pCreature)
+{
+ if (pPlayer->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && pCreature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
+ {
+ //the expected quest objective
+ pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
+
+ pPlayer->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
+ pCreature->GetMotionMaster()->MoveIdle();
+ }
+
+ pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID());
+ return true;
+}
+
+void AddSC_desolace()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_aged_dying_ancient_kodo";
+ newscript->GetAI = GetAI_npc_aged_dying_ancient_kodo;
+ newscript->pEffectDummyCreature = &EffectDummyCreature_npc_aged_dying_ancient_kodo;
+ newscript->pGossipHello = &GossipHello_npc_aged_dying_ancient_kodo;
+ newscript->RegisterSelf();
+}
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
index 68e15fd0282..482a7169ad3 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
@@ -17,6 +17,7 @@
*/
#include "precompiled.h"
+#include "Vehicle.h"
#define GCD_CAST 1
@@ -560,13 +561,13 @@ struct TRINITY_DLL_DECL npc_ros_dark_riderAI : public ScriptedAI
return;
// this should be before next one otherwise he may enter vehicle again
- if(!me->m_Vehicle && who->GetEntry() == 28782 && CAST_CRE(who)->isVehicle() && !who->GetCharmerGUID())
+ if(!me->m_Vehicle && who->GetEntry() == 28782 && CAST_CRE(who)->isVehicle() && CAST_VEH(who)->HasEmptySeat(0))
me->EnterVehicle((Vehicle*)who);
ScriptedAI::MoveInLineOfSight(who);
}
- void CombatStart(Unit *who)
+ void EnterCombat(Unit *who)
{
me->ExitVehicle();
}
diff --git a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
index 51b22fd934a..d358fbc2a86 100644
--- a/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
+++ b/src/bindings/scripts/scripts/zone/isle_of_queldanas/isle_of_queldanas.cpp
@@ -62,8 +62,10 @@ struct TRINITY_DLL_DECL npc_converted_sentryAI : public ScriptedAI
if( Timer <= diff )
{
uint32 i = urand(1,2);
- if( i=1 ) DoScriptText(SAY_CONVERTED_1, m_creature);
- else DoScriptText(SAY_CONVERTED_2, m_creature);
+ if( i==1 )
+ DoScriptText(SAY_CONVERTED_1, m_creature);
+ else
+ DoScriptText(SAY_CONVERTED_2, m_creature);
DoCast(m_creature, SPELL_CONVERT_CREDIT);
if(m_creature->isPet())
diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
index 5a9d17db745..74e7b953ad8 100644
--- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
+++ b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
@@ -69,7 +69,10 @@ bool GossipSelect_npc_neeru_fireblade(Player *player, Creature *_Creature, uint3
## npc_shenthul
######*/
-#define QUEST_2460 2460
+enum
+{
+ QUEST_SHATTERED_SALUTE = 2460
+};
struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
{
@@ -95,21 +98,27 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if( CanEmote )
- if( Reset_Timer < diff )
{
- if( Unit* temp = Unit::GetUnit((*m_creature),playerGUID) )
- if( temp->GetTypeId() == TYPEID_PLAYER )
- CAST_PLR(temp)->FailQuest(QUEST_2460);
- Reset();
- } else Reset_Timer -= diff;
+ if (Reset_Timer < diff)
+ {
+ if (Player* pPlayer = (Player*)Unit::GetUnit((*m_creature),playerGUID))
+ {
+ if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
+ pPlayer->FailQuest(QUEST_SHATTERED_SALUTE);
+ }
+ Reset();
+ } else Reset_Timer -= diff;
+ }
if( CanTalk && !CanEmote )
- if( Salute_Timer < diff )
{
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- CanEmote = true;
- Reset_Timer = 60000;
- } else Salute_Timer -= diff;
+ if (Salute_Timer < diff)
+ {
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
+ CanEmote = true;
+ Reset_Timer = 60000;
+ } else Salute_Timer -= diff;
+ }
if (!UpdateVictim())
return;
@@ -119,12 +128,14 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
void ReciveEmote_npc_shenthul(Player *player, uint32 emote)
{
- if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_2460) == QUEST_STATUS_INCOMPLETE )
+ if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE )
+ {
if(CanEmote)
{
- player->AreaExploredOrEventHappens(QUEST_2460);
+ player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
Reset();
}
+ }
}
};
@@ -135,7 +146,7 @@ CreatureAI* GetAI_npc_shenthul(Creature *_Creature)
bool QuestAccept_npc_shenthul(Player* player, Creature* creature, Quest const* quest)
{
- if( quest->GetQuestId() == QUEST_2460 )
+ if( quest->GetQuestId() == QUEST_SHATTERED_SALUTE )
{
CAST_AI(npc_shenthulAI, creature->AI())->CanTalk = true;
CAST_AI(npc_shenthulAI, creature->AI())->playerGUID = player->GetGUID();
diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp
index 0cf5119f0d8..f0a80248c19 100644
--- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp
+++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp
@@ -400,7 +400,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING2);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_HOVER);
m_creature->SetSpeed(MOVE_WALK,5.0f,true);
wp_reached = false;
count = 0;
@@ -432,7 +432,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING2);break;
+ m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER);break;
case 20: {
Phase = 1;
IsFlying = false;
diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
index d87c25c14a7..2aae2d51e4e 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
@@ -46,110 +46,115 @@ EndContentData */
# mob_mature_netherwing_drake
#####*/
-#define SPELL_PLACE_CARCASS 38439
-#define SPELL_JUST_EATEN 38502
-#define SPELL_NETHER_BREATH 38467
+enum
+{
+ SAY_JUST_EATEN = -1000222,
+
+ SPELL_PLACE_CARCASS = 38439,
+ SPELL_JUST_EATEN = 38502,
+ SPELL_NETHER_BREATH = 38467,
+ POINT_ID = 1,
+
+ QUEST_KINDNESS = 10804,
+ NPC_EVENT_PINGER = 22131
+};
-#define SAY_JUST_EATEN -1000222
struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
{
- mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
- {
- PlayerGUID = 0;
- Reset();
- }
+ mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { }
- uint64 PlayerGUID;
+ uint64 uiPlayerGUID;
- bool IsEating;
- bool Evade;
+ bool bCanEat;
+ bool bIsEating;
- uint32 ResetTimer;
- uint32 CastTimer;
uint32 EatTimer;
+ uint32 CastTimer;
void Reset()
{
- IsEating = false;
- Evade = false;
+ uiPlayerGUID = 0;
+
+ bCanEat = false;
+ bIsEating = false;
- ResetTimer = 120000;
EatTimer = 5000;
CastTimer = 5000;
}
void EnterCombat(Unit* who) { }
- void MoveInLineOfSight(Unit* who)
+ void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
{
- if(m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
- return;
-
- ScriptedAI::MoveInLineOfSight(who);
- }
-
- void SpellHit(Unit* caster, const SpellEntry* spell)
- {
- if(!caster)
+ if (bCanEat || bIsEating)
return;
- if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN) && !PlayerGUID)
+ if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN))
{
- float PlayerX, PlayerY, PlayerZ;
- caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize());
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
- m_creature->GetMotionMaster()->MovePoint(1, PlayerX, PlayerY, PlayerZ);
- PlayerGUID = caster->GetGUID();
+ uiPlayerGUID = pCaster->GetGUID();
+ bCanEat = true;
}
}
void MovementInform(uint32 type, uint32 id)
{
- if(type != POINT_MOTION_TYPE)
+ if (type != POINT_MOTION_TYPE)
return;
- if(id == 1)
+ if (id == POINT_ID)
{
- IsEating = true;
- EatTimer = 5000;
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
+ bIsEating = true;
+ EatTimer = 7000;
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
}
}
void UpdateAI(const uint32 diff)
{
- if(IsEating)
- if(EatTimer < diff)
+ if (bCanEat || bIsEating)
{
- IsEating = false;
- DoCast(m_creature, SPELL_JUST_EATEN);
- m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
- DoScriptText(SAY_JUST_EATEN, m_creature);
- if(PlayerGUID)
+ if (EatTimer < diff)
{
- Player* plr = Unit::GetPlayer(PlayerGUID);
- if(plr && plr->GetQuestStatus(10804) == QUEST_STATUS_INCOMPLETE)
+ if (bCanEat && !bIsEating)
{
- plr->KilledMonster(22131, m_creature->GetGUID());
- Evade = true;
- PlayerGUID = 0;
+ if (Unit* pUnit = Unit::GetUnit(*m_creature, uiPlayerGUID))
+ {
+ if (GameObject* pGo = pUnit->GetGameObject(SPELL_PLACE_CARCASS))
+ {
+ if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
+ m_creature->GetMotionMaster()->MovementExpired();
+
+ m_creature->GetMotionMaster()->MoveIdle();
+ m_creature->StopMoving();
+
+ m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
+ }
+ }
+ bCanEat = false;
+ }
+ else if (bIsEating)
+ {
+ DoCast(m_creature, SPELL_JUST_EATEN);
+ DoScriptText(SAY_JUST_EATEN, m_creature);
+
+ if (Player* pPlr = (Player*)Unit::GetUnit((*m_creature), uiPlayerGUID))
+ pPlr->KilledMonster(NPC_EVENT_PINGER, m_creature->GetGUID());
+
+ Reset();
+ m_creature->GetMotionMaster()->Clear();
}
}
- }else EatTimer -= diff;
+ else
+ EatTimer -= diff;
- if(Evade)
- if(ResetTimer < diff)
- {
- EnterEvadeMode();
- return;
- }else ResetTimer -= diff;
+ return;
+ }
if(!UpdateVictim())
return;
- if(CastTimer < diff)
+ if (CastTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH);
CastTimer = 5000;
@@ -159,9 +164,9 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
}
};
-CreatureAI* GetAI_mob_mature_netherwing_drake(Creature *_creature)
+CreatureAI* GetAI_mob_mature_netherwing_drake(Creature* pCreature)
{
- return new mob_mature_netherwing_drakeAI(_creature);
+ return new mob_mature_netherwing_drakeAI(pCreature);
}
/*###
diff --git a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
index 5cd9b01b7c3..3182a56926c 100644
--- a/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
+++ b/src/bindings/scripts/scripts/zone/stormwind/stormwind_city.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Stormwind_City
SD%Complete: 100
-SDComment: Quest support: 1640, 1447, 4185, 11223. Receive emote General Marcus
+SDComment: Quest support: 1640, 1447, 4185, 11223
SDCategory: Stormwind City
EndScriptData */
@@ -25,7 +25,6 @@ EndScriptData */
npc_archmage_malin
npc_bartleby
npc_dashel_stonefist
-npc_general_marcus_jonathan
npc_lady_katrana_prestor
EndContentData */
@@ -123,27 +122,33 @@ CreatureAI* GetAI_npc_bartleby(Creature *_creature)
## npc_dashel_stonefist
######*/
+enum
+{
+ QUEST_MISSING_DIPLO_PT8 = 1447,
+ FACTION_HOSTILE = 168
+};
+
struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
{
- npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) {}
+ npc_dashel_stonefistAI(Creature *c) : ScriptedAI(c) { uiNormFaction = c->getFaction(); }
+
+ uint32 uiNormFaction;
void Reset()
{
- m_creature->setFaction(11);
+ m_creature->setFaction(uiNormFaction);
}
void DamageTaken(Unit *done_by, uint32 & damage)
{
- if((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
+ if ((damage > m_creature->GetHealth()) || (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 15)
{
//Take 0 damage
damage = 0;
if (done_by->GetTypeId() == TYPEID_PLAYER)
- {
- CAST_PLR(done_by)->AttackStop();
- CAST_PLR(done_by)->AreaExploredOrEventHappens(1447);
- }
+ CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8);
+
//m_creature->CombatStop();
EnterEvadeMode();
}
@@ -152,42 +157,19 @@ struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
void EnterCombat(Unit *who) {}
};
-bool QuestAccept_npc_dashel_stonefist(Player *player, Creature *_Creature, Quest const *_Quest)
+bool QuestAccept_npc_dashel_stonefist(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
- if(_Quest->GetQuestId() == 1447)
+ if(pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT8)
{
- _Creature->setFaction(168);
- CAST_AI(npc_dashel_stonefistAI, _Creature->AI())->AttackStart(player);
+ pCreature->setFaction(FACTION_HOSTILE);
+ CAST_AI(npc_dashel_stonefistAI, pCreature->AI())->AttackStart(pPlayer);
}
return true;
}
-CreatureAI* GetAI_npc_dashel_stonefist(Creature *_creature)
+CreatureAI* GetAI_npc_dashel_stonefist(Creature* pCreature)
{
- return new npc_dashel_stonefistAI(_creature);
-}
-
-/*######
-## npc_general_marcus_jonathan
-######*/
-
-#define SAY_GREETING -1000005
-
-bool ReceiveEmote_npc_general_marcus_jonathan(Player *player, Creature *_Creature, uint32 emote)
-{
- if(player->GetTeam() == ALLIANCE)
- {
- if (emote == TEXTEMOTE_SALUTE)
- {
- _Creature->SetOrientation(_Creature->GetAngle(player));
- _Creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
- }
- if (emote == TEXTEMOTE_WAVE)
- {
- DoScriptText(SAY_GREETING, _Creature, player);
- }
- }
- return true;
+ return new npc_dashel_stonefistAI(pCreature);
}
/*######
@@ -259,11 +241,6 @@ void AddSC_stormwind_city()
newscript->RegisterSelf();
newscript = new Script;
- newscript->Name = "npc_general_marcus_jonathan";
- //newscript->pReceiveEmote = &ReceiveEmote_npc_general_marcus_jonathan;
- newscript->RegisterSelf();
-
- newscript = new Script;
newscript->Name="npc_lady_katrana_prestor";
newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor;
newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor;
diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
index e3c66109dfc..035df9082c8 100644
--- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
+++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp
@@ -295,7 +295,7 @@ struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI
void Reset()
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_FLYING2);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_HOVER);
m_creature->SetSpeed(MOVE_SWIM , 0.1f);
m_creature->SetSpeed(MOVE_RUN , 0.1f);
m_creature->SetSpeed(MOVE_WALK , 0.1f);
diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
index a4f2f32b250..a3f84aa0dc2 100644
--- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
+++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Zangarmarsh
SD%Complete: 100
-SDComment: Quest support: 9785, 9803, 10009, 9752. Mark Of ... buffs.
+SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs.
SDCategory: Zangarmarsh
EndScriptData */
@@ -255,71 +255,67 @@ bool GossipSelect_npc_mortog_steamhead(Player *player, Creature *_Creature, uint
## npc_kayra_longmane
######*/
-#define SAY_PROGRESS_1 -1000360
-#define SAY_PROGRESS_2 -1000361
-#define SAY_PROGRESS_3 -1000362
-#define SAY_PROGRESS_4 -1000363
-#define SAY_PROGRESS_5 -1000364
-#define SAY_PROGRESS_6 -1000365
-
-#define QUEST_EFU 9752
-#define MOB_AMBUSH 18042
+enum
+{
+ SAY_START = -1000360,
+ SAY_AMBUSH1 = -1000361,
+ SAY_PROGRESS = -1000362,
+ SAY_AMBUSH2 = -1000363,
+ SAY_NEAR_END = -1000364,
+ SAY_END = -1000365,
+
+ QUEST_ESCAPE_FROM = 9752,
+ NPC_SLAVEBINDER = 18042
+};
struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
{
npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {}
- bool Completed;
-
- void Reset()
- {
- Completed = false;
- m_creature->setFaction(1660);
- }
+ void Reset() { }
void EnterCombat(Unit* who){}
- void JustSummoned(Creature *summoned)
- {
- summoned->AI()->AttackStart(m_creature);
- summoned->setFaction(14);
- }
-
void WaypointReached(uint32 i)
{
- Player* player = Unit::GetPlayer(PlayerGUID);
+ Unit* pUnit = Unit::GetUnit(*m_creature, PlayerGUID);
+
+ if (!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER)
+ return;
switch(i)
{
- case 0: DoScriptText(SAY_PROGRESS_1, m_creature, player); break;
- case 5: DoScriptText(SAY_PROGRESS_2, m_creature, player);
- m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
- m_creature->SummonCreature(MOB_AMBUSH, -922.24, 5357.98, 17.93, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
- break;
- case 6: DoScriptText(SAY_PROGRESS_3, m_creature, player);
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- break;
- case 18: DoScriptText(SAY_PROGRESS_4, m_creature, player);
- m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
- m_creature->SummonCreature(MOB_AMBUSH, -671.86, 5379.81, 22.12, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
- break;
- case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- DoScriptText(SAY_PROGRESS_5, m_creature, player); break;
- case 26: DoScriptText(SAY_PROGRESS_6, m_creature, player);
- Completed = true;
- if(player)
- player->GroupEventHappens(QUEST_EFU, m_creature);
- break;
+ case 4:
+ DoScriptText(SAY_AMBUSH1, m_creature, pUnit);
+ DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ break;
+ case 5:
+ DoScriptText(SAY_PROGRESS, m_creature, pUnit);
+ SetRun();
+ break;
+ case 16:
+ DoScriptText(SAY_AMBUSH2, m_creature, pUnit);
+ DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
+ break;
+ case 17:
+ SetRun(false);
+ DoScriptText(SAY_NEAR_END, m_creature, pUnit);
+ break;
+ case 26:
+ DoScriptText(SAY_END, m_creature, pUnit);
+ ((Player*)pUnit)->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature);
+ break;
}
}
void JustDied(Unit* killer)
{
- if (PlayerGUID && !Completed)
+ if (Unit* pUnit = Unit::GetUnit(*m_creature, PlayerGUID))
{
- Player* player = Unit::GetPlayer(PlayerGUID);
- if (player && !Completed)
- player->FailQuest(QUEST_EFU);
+ if (((Player*)pUnit)->GetQuestStatus(QUEST_ESCAPE_FROM) == QUEST_STATUS_INCOMPLETE)
+ ((Player*)pUnit)->FailQuest(QUEST_ESCAPE_FROM);
}
}
@@ -329,49 +325,23 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
}
};
-bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest const* quest)
+bool QuestAccept_npc_kayra_longmane(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
{
- if (quest->GetQuestId() == QUEST_EFU)
+ if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM)
{
- CAST_AI(npc_escortAI, (creature->AI()))->Start(true, true, false, player->GetGUID());
- creature->setFaction(113);
+ DoScriptText(SAY_START, pCreature, pPlayer);
+ ((npc_escortAI*)(pCreature->AI()))->Start(false, true, false, pPlayer->GetGUID());
}
return true;
}
-CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* _Creature)
+CreatureAI* GetAI_npc_kayra_longmaneAI(Creature* pCreature)
{
- npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(_Creature);
-
- thisAI->AddWaypoint(0, -931.88, 5283.56, 23.98);//SAY_PROGRESS_1
- thisAI->AddWaypoint(1, -930.52, 5287.57, 23.82);
- thisAI->AddWaypoint(2, -924.98, 5297.94, 17.78);
- thisAI->AddWaypoint(3, -928.83, 5316.07, 18.18);
- thisAI->AddWaypoint(4, -930.07, 5323.10, 18.63);
- thisAI->AddWaypoint(5, -926.58, 5331.24, 18.74, 6000);//SAY_PROGRESS_2
- thisAI->AddWaypoint(6, -926.58, 5331.24, 18.74, 3000);//SAY_PROGRESS_3 Run to the hills!
- thisAI->AddWaypoint(7, -931.24, 5358.89, 18.14);
- thisAI->AddWaypoint(8, -934.43, 5370.20, 22.41);
- thisAI->AddWaypoint(9, -943.01, 5400.55, 22.74);
- thisAI->AddWaypoint(10, -929.62, 5417.98, 23.07);
- thisAI->AddWaypoint(11, -901.92, 5420.38, 24.19);
- thisAI->AddWaypoint(12, -859.03, 5415.36, 23.64);
- thisAI->AddWaypoint(13, -808.94, 5401.93, 23.11);
- thisAI->AddWaypoint(14, -772.74, 5390.53, 22.97);
- thisAI->AddWaypoint(15, -749.71, 5385.39, 22.75);
- thisAI->AddWaypoint(16, -721.23, 5380.38, 22.47);
- thisAI->AddWaypoint(17, -687.96, 5379.08, 22.16);
- thisAI->AddWaypoint(18, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_4 Summon Ambush
- thisAI->AddWaypoint(19, -680.87, 5378.95, 21.99, 6000);//SAY_PROGRESS_5
- thisAI->AddWaypoint(20, -636.14, 5385.25, 22.20);
- thisAI->AddWaypoint(21, -602.94, 5411.36, 21.48);
- thisAI->AddWaypoint(22, -566.86, 5421.87, 21.25);
- thisAI->AddWaypoint(23, -547.27, 5427.87, 21.10);
- thisAI->AddWaypoint(24, -520.59, 5444.83, 21.15);
- thisAI->AddWaypoint(25, -488.45, 5447.83, 22.38);
- thisAI->AddWaypoint(26, -449.65, 5463.78, 21.77, 11000);//SAY_PROGRESS_6
-
- return thisAI;
+ npc_kayra_longmaneAI* thisAI = new npc_kayra_longmaneAI(pCreature);
+
+ thisAI->FillPointMovementListForCreature();
+
+ return (CreatureAI*)thisAI;
}
/*######
## AddSC