aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKudlaty <none@none>2009-06-19 00:22:19 +0200
committerKudlaty <none@none>2009-06-19 00:22:19 +0200
commit2ac0089d165a86c54858b11b1b775416ddc555f7 (patch)
treef6e20a20312136b267802e6f887214e23cbc04cb /src
parentfd73be2f1e2aa134f3b26277281411de691db04a (diff)
Merge [SD2]
r1056 Added some texts for future use + added one additional waypoint for npc 24358 r1057 Add spell and correct gossip text for npc 24358. Move open door code to instance script r1058 Simplify scripts using manual call ActivateTaxiPathTo(). Added ScriptName for npc 22112, also cleanup code. r1059 Remove redundant call to activateTaxiPathTo(), taxi already implemented for related spell. Some code cleanup r1060 Update scripts with SD2 code style for a few commonly used pointers passed in functions (Player* pPlayer, Creature* pCreature, etc) Remove some useless whitespace - Skip r1061 Trim trailing whitespace in source files. - Skip r1062 Added script to control misc alarm/rooftop bots, summoning guards when hostile players comes in range and trigger AttackStart based on aura. r1063 Fixed missing call to AI constructor for npc 18585. Code cleanup. r1064 Correcting a few wrong gossip icons. Code cleanup. r1065 Fixed two more lost calls to ai constructors. Add one missing scriptname to *full.sql added in rev 982 --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/npc/npcs_special.cpp213
-rw-r--r--src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp47
-rw-r--r--src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp12
-rw-r--r--src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp23
-rw-r--r--src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp33
-rw-r--r--src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp25
-rw-r--r--src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp4
7 files changed, 296 insertions, 61 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp
index f195d54b882..55ba138bc09 100644
--- a/src/bindings/scripts/scripts/npc/npcs_special.cpp
+++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp
@@ -23,6 +23,7 @@ EndScriptData
*/
/* ContentData
+npc_air_force_bots 80% support for misc (invisible) guard bots in areas where player allowed to fly. Summon guards after a preset time if tagged by spell
npc_chicken_cluck 100% support for quest 3861 (Cluck!)
npc_dancing_flames 100% midsummer event NPC
npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2
@@ -38,6 +39,213 @@ EndContentData */
#include "precompiled.h"
#include "../npc/npc_escortAI.h"
+#include "ObjectMgr.h"
+
+/*########
+# npc_air_force_bots
+#########*/
+
+enum SpawnType
+{
+ SPAWNTYPE_TRIPWIRE_ROOFTOP, // no warning, summon creature at smaller range
+ SPAWNTYPE_ALARMBOT, // cast guards mark and summon npc - if player shows up with that buff duration < 5 seconds attack
+};
+
+struct SpawnAssociation
+{
+ uint32 m_uiThisCreatureEntry;
+ uint32 m_uiSpawnedCreatureEntry;
+ SpawnType m_SpawnType;
+};
+
+enum
+{
+ SPELL_GUARDS_MARK = 38067,
+ AURA_DURATION_TIME_LEFT = 5000
+};
+
+const float RANGE_TRIPWIRE = 15.0f;
+const float RANGE_GUARDS_MARK = 50.0f;
+
+SpawnAssociation m_aSpawnAssociations[] =
+{
+ {2614, 15241, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Alliance)
+ {2615, 15242, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Horde)
+ {21974, 21976, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Area 52)
+ {21993, 15242, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Horde - Bat Rider)
+ {21996, 15241, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Alliance - Gryphon)
+ {21997, 21976, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Goblin - Area 52 - Zeppelin)
+ {21999, 15241, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Alliance)
+ {22001, 15242, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Horde)
+ {22002, 15242, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Ground (Horde)
+ {22003, 15241, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Ground (Alliance)
+ {22063, 21976, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Goblin - Area 52)
+ {22065, 22064, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Ethereal - Stormspire)
+ {22066, 22067, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Scryer - Dragonhawk)
+ {22068, 22064, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Ethereal - Stormspire)
+ {22069, 22064, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Stormspire)
+ {22070, 22067, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Scryer)
+ {22071, 22067, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Scryer)
+ {22078, 22077, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Aldor)
+ {22079, 22077, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Aldor - Gryphon)
+ {22080, 22077, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Aldor)
+ {22086, 22085, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Sporeggar)
+ {22087, 22085, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Sporeggar - Spore Bat)
+ {22088, 22085, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Sporeggar)
+ {22090, 22089, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Toshley's Station - Flying Machine)
+ {22124, 22122, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Cenarion)
+ {22125, 22122, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Cenarion - Stormcrow)
+ {22126, 22122, SPAWNTYPE_ALARMBOT} //Air Force Trip Wire - Rooftop (Cenarion Expedition)
+};
+
+struct TRINITY_DLL_DECL npc_air_force_botsAI : public ScriptedAI
+{
+ npc_air_force_botsAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ m_pSpawnAssoc = NULL;
+ m_uiSpawnedGUID = 0;
+
+ // find the correct spawnhandling
+ static uint32 uiEntryCount = sizeof(m_aSpawnAssociations)/sizeof(SpawnAssociation);
+
+ for (uint8 i=0; i<uiEntryCount; ++i)
+ {
+ if (m_aSpawnAssociations[i].m_uiThisCreatureEntry == pCreature->GetEntry())
+ {
+ m_pSpawnAssoc = &m_aSpawnAssociations[i];
+ break;
+ }
+ }
+
+ if (!m_pSpawnAssoc)
+ error_db_log("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry());
+ else
+ {
+ CreatureInfo const* spawnedTemplate = GetCreatureTemplateStore(m_pSpawnAssoc->m_uiSpawnedCreatureEntry);
+
+ if (!spawnedTemplate)
+ {
+ m_pSpawnAssoc = NULL;
+ error_db_log("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", m_pSpawnAssoc->m_uiSpawnedCreatureEntry);
+ return;
+ }
+ }
+ }
+
+ SpawnAssociation* m_pSpawnAssoc;
+ uint64 m_uiSpawnedGUID;
+
+ void Reset() { }
+
+ Creature* SummonGuard()
+ {
+ Creature* pSummoned = m_creature->SummonCreature(m_pSpawnAssoc->m_uiSpawnedCreatureEntry, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000);
+
+ if (pSummoned)
+ m_uiSpawnedGUID = pSummoned->GetGUID();
+ else
+ {
+ error_db_log("TCSR: npc_air_force_bots: wasn't able to spawn creature %u", m_pSpawnAssoc->m_uiSpawnedCreatureEntry);
+ m_pSpawnAssoc = NULL;
+ }
+
+ return pSummoned;
+ }
+
+ Creature* GetSummonedGuard()
+ {
+ Creature* pCreature = (Creature*)Unit::GetUnit(*m_creature, m_uiSpawnedGUID);
+
+ if (pCreature && pCreature->isAlive())
+ return pCreature;
+
+ return NULL;
+ }
+
+ void MoveInLineOfSight(Unit* pWho)
+ {
+ if (!m_pSpawnAssoc)
+ return;
+
+ if (pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho))
+ {
+ Player* pPlayerTarget = pWho->GetTypeId() == TYPEID_PLAYER ? (Player*)pWho : NULL;
+
+ // airforce guards only spawn for players
+ if (!pPlayerTarget)
+ return;
+
+ Creature* pLastSpawnedGuard = m_uiSpawnedGUID == 0 ? NULL : GetSummonedGuard();
+
+ // prevent calling Unit::GetUnit at next MoveInLineOfSight call - speedup
+ if (!pLastSpawnedGuard)
+ m_uiSpawnedGUID = 0;
+
+ switch(m_pSpawnAssoc->m_SpawnType)
+ {
+ case SPAWNTYPE_ALARMBOT:
+ {
+ if (!pWho->IsWithinDistInMap(m_creature, RANGE_GUARDS_MARK))
+ return;
+
+ Aura* pMarkAura = pWho->GetAura(SPELL_GUARDS_MARK, 0);
+ if (pMarkAura)
+ {
+ // the target wasn't able to move out of our range within 25 seconds
+ if (!pLastSpawnedGuard)
+ {
+ pLastSpawnedGuard = SummonGuard();
+
+ if (!pLastSpawnedGuard)
+ return;
+ }
+
+ if (pMarkAura->GetAuraDuration() < AURA_DURATION_TIME_LEFT)
+ {
+ if (!pLastSpawnedGuard->getVictim())
+ pLastSpawnedGuard->AI()->AttackStart(pWho);
+ }
+ }
+ else
+ {
+ if (!pLastSpawnedGuard)
+ pLastSpawnedGuard = SummonGuard();
+
+ if (!pLastSpawnedGuard)
+ return;
+
+ pLastSpawnedGuard->CastSpell(pWho, SPELL_GUARDS_MARK, true);
+ }
+ break;
+ }
+ case SPAWNTYPE_TRIPWIRE_ROOFTOP:
+ {
+ if (!pWho->IsWithinDistInMap(m_creature, RANGE_TRIPWIRE))
+ return;
+
+ if (!pLastSpawnedGuard)
+ pLastSpawnedGuard = SummonGuard();
+
+ if (!pLastSpawnedGuard)
+ return;
+
+ // ROOFTOP only triggers if the player is on the ground
+ if (!pPlayerTarget->IsFlying())
+ {
+ if (!pLastSpawnedGuard->getVictim())
+ pLastSpawnedGuard->AI()->AttackStart(pWho);
+ }
+ break;
+ }
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_air_force_bots(Creature* pCreature)
+{
+ return new npc_air_force_botsAI(pCreature);
+}
/*########
# npc_chicken_cluck
@@ -1374,6 +1582,11 @@ void AddSC_npcs_special()
Script *newscript;
newscript = new Script;
+ newscript->Name = "npc_air_force_bots";
+ newscript->GetAI = &GetAI_npc_air_force_bots;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name="npc_chicken_cluck";
newscript->GetAI = &GetAI_npc_chicken_cluck;
newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck;
diff --git a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
index 26af428c2e7..596c6ce3fb1 100644
--- a/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
+++ b/src/bindings/scripts/scripts/zone/moonglade/moonglade.cpp
@@ -36,8 +36,16 @@ EndContentData */
## npc_bunthen_plainswind
######*/
-#define GOSSIP_BP1 "Do you know where I can find Half Pendant of Aquatic Endurance?"
-#define GOSSIP_BP2 "I'd like to fly to Thunder Bluff."
+enum
+{
+ QUEST_SEA_LION_HORDE = 30,
+ QUEST_SEA_LION_ALLY = 272,
+ TAXI_PATH_ID_ALLY = 315,
+ TAXI_PATH_ID_HORDE = 316
+};
+
+#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff."
+#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?"
bool GossipHello_npc_bunthen_plainswind(Player *player, Creature *_Creature)
{
@@ -45,17 +53,17 @@ bool GossipHello_npc_bunthen_plainswind(Player *player, Creature *_Creature)
player->SEND_GOSSIP_MENU(4916,_Creature->GetGUID());
else if(player->GetTeam() != HORDE)
{
- if(player->GetQuestStatus(272) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ if(player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(4917,_Creature->GetGUID());
}
else if(player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- if(player->GetQuestStatus(30) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_BP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ if(player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->SEND_GOSSIP_MENU(4918,_Creature->GetGUID());
}
@@ -67,14 +75,10 @@ bool GossipSelect_npc_bunthen_plainswind(Player *player, Creature *_Creature, ui
switch(action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
- {
player->CLOSE_GOSSIP_MENU();
if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE)
- {
- player->ActivateTaxiPathTo(316);
- }
+ player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE);
break;
- }
case GOSSIP_ACTION_INFO_DEF + 2:
player->SEND_GOSSIP_MENU(5373,_Creature->GetGUID());
break;
@@ -139,25 +143,26 @@ bool GossipSelect_npc_great_bear_spirit(Player *player, Creature *_Creature, uin
## npc_silva_filnaveth
######*/
-#define GOSSIP_SF1 "Do you know where I can find Half Pendant of Aquatic Agility?"
-#define GOSSIP_SF2 "I'd like to fly to Rut'theran Village."
+#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village."
+#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?"
+
bool GossipHello_npc_silva_filnaveth(Player *player, Creature *_Creature)
{
if(player->getClass() != CLASS_DRUID)
player->SEND_GOSSIP_MENU(4913,_Creature->GetGUID());
else if(player->GetTeam() != ALLIANCE)
{
- if(player->GetQuestStatus(30) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_SF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ if(player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
player->SEND_GOSSIP_MENU(4915,_Creature->GetGUID());
}
else if(player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
{
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_SF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- if(player->GetQuestStatus(272) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM( 0, GOSSIP_SF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ if(player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE)
+ player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
player->SEND_GOSSIP_MENU(4914,_Creature->GetGUID());
}
@@ -169,12 +174,10 @@ bool GossipSelect_npc_silva_filnaveth(Player *player, Creature *_Creature, uint3
switch(action)
{
case GOSSIP_ACTION_INFO_DEF + 1:
- {
player->CLOSE_GOSSIP_MENU();
if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE)
- player->ActivateTaxiPathTo(315);
+ player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY);
break;
- }
case GOSSIP_ACTION_INFO_DEF + 2:
player->SEND_GOSSIP_MENU(5374,_Creature->GetGUID());
break;
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 aa7c55330a2..0ae27fd009d 100644
--- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
+++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp
@@ -628,21 +628,13 @@ enum
{
QUEST_ALLY_OF_NETHER = 10870,
- TAXI_NODE_START = 161, // From Karynaku
- TAXI_NODE_END = 162 // To Mordenai
+ TAXI_PATH_ID = 649
};
bool QuestAccept_npc_karynaku(Player* player, Creature* creature, Quest const* quest)
{
if(quest->GetQuestId() == QUEST_ALLY_OF_NETHER)
- {
- std::vector<uint32> nodes;
-
- nodes.resize(2);
- nodes[0] = TAXI_NODE_START;
- nodes[1] = TAXI_NODE_END;
- player->ActivateTaxiPathTo(nodes); //player->ActivateTaxiPathTo(649);
- }
+ player->ActivateTaxiPathTo(TAXI_PATH_ID); //player->ActivateTaxiPathTo(649);
return true;
}
diff --git a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
index 236ef85f85c..d74d3934c6c 100644
--- a/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
+++ b/src/bindings/scripts/scripts/zone/shattrath/shattrath_city.cpp
@@ -41,21 +41,28 @@ EndContentData */
#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!"
-#define FACTION_HOSTILE_RD 45
-#define FACTION_FRIENDLY_RD 35
-
-#define SPELL_UPPERCUT 10966
+enum
+{
+ SPELL_UPPERCUT = 10966,
+ QUEST_CRACK_SKULLS = 10009,
+ FACTION_HOSTILE_RD = 45
+};
struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI
{
- npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) {}
+ npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c)
+ {
+ m_uiNormFaction = c->getFaction();
+ }
+ uint32 m_uiNormFaction;
uint32 Uppercut_Timer;
void Reset()
{
Uppercut_Timer = 5000;
- m_creature->setFaction(FACTION_FRIENDLY_RD);
+ if (m_creature->getFaction() != m_uiNormFaction)
+ m_creature->setFaction(m_uiNormFaction);
}
void EnterCombat(Unit *who) {}
@@ -74,6 +81,7 @@ struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_npc_raliq_the_drunk(Creature *_Creature)
{
return new npc_raliq_the_drunkAI (_Creature);
@@ -81,7 +89,7 @@ CreatureAI* GetAI_npc_raliq_the_drunk(Creature *_Creature)
bool GossipHello_npc_raliq_the_drunk(Player *player, Creature *_Creature )
{
- if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
+ if( player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE )
player->ADD_GOSSIP_ITEM(1, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9440, _Creature->GetGUID());
@@ -634,6 +642,7 @@ void AddSC_shattrath_city()
newscript = new Script;
newscript->Name="npc_raliq_the_drunk";
+ newscript->GetAI = &GetAI_npc_raliq_the_drunk;
newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk;
newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
index e35c45b2cf0..8e45c6c6a7c 100644
--- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
+++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp
@@ -243,19 +243,26 @@ CreatureAI* GetAI_mob_netherweb_victim(Creature *_Creature)
#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
#define GOSSIP_FLOON2 "Hand over the money or die...again!"
-#define SAY_FLOON_ATTACK -1000352
+enum
+{
+ SAY_FLOON_ATTACK = -1000352,
-#define FACTION_HOSTILE_FL 1738
-#define FACTION_FRIENDLY_FL 35
+ SPELL_SILENCE = 6726,
+ SPELL_FROSTBOLT = 9672,
+ SPELL_FROST_NOVA = 11831,
-#define SPELL_SILENCE 6726
-#define SPELL_FROSTBOLT 9672
-#define SPELL_FROST_NOVA 11831
+ FACTION_HOSTILE_FL = 1738,
+ QUEST_CRACK_SKULLS = 10009
+};
struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI
{
- npc_floonAI(Creature* c) : ScriptedAI(c) {}
+ npc_floonAI(Creature* c) : ScriptedAI(c)
+ {
+ m_uiNormFaction = c->getFaction();
+ }
+ uint32 m_uiNormFaction;
uint32 Silence_Timer;
uint32 Frostbolt_Timer;
uint32 FrostNova_Timer;
@@ -265,7 +272,8 @@ struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI
Silence_Timer = 2000;
Frostbolt_Timer = 4000;
FrostNova_Timer = 9000;
- m_creature->setFaction(FACTION_FRIENDLY_FL);
+ if (m_creature->getFaction() != m_uiNormFaction)
+ m_creature->setFaction(m_uiNormFaction);
}
void EnterCombat(Unit *who) {}
@@ -296,6 +304,7 @@ struct TRINITY_DLL_DECL npc_floonAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_npc_floon(Creature *_Creature)
{
return new npc_floonAI (_Creature);
@@ -303,8 +312,8 @@ CreatureAI* GetAI_npc_floon(Creature *_Creature)
bool GossipHello_npc_floon(Player *player, Creature *_Creature )
{
- if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ if( player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(9442, _Creature->GetGUID());
return true;
@@ -314,7 +323,7 @@ bool GossipSelect_npc_floon(Player *player, Creature *_Creature, uint32 sender,
{
if( action == GOSSIP_ACTION_INFO_DEF )
{
- player->ADD_GOSSIP_ITEM(1, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9443, _Creature->GetGUID());
}
if( action == GOSSIP_ACTION_INFO_DEF+1 )
@@ -538,9 +547,9 @@ void AddSC_terokkar_forest()
newscript = new Script;
newscript->Name="npc_floon";
+ newscript->GetAI = &GetAI_npc_floon;
newscript->pGossipHello = &GossipHello_npc_floon;
newscript->pGossipSelect = &GossipSelect_npc_floon;
- newscript->GetAI = &GetAI_npc_floon;
newscript->RegisterSelf();
newscript = new Script;
diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
index e6d6ecf8f0a..d5d2a47138e 100644
--- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
+++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp
@@ -120,21 +120,28 @@ bool GossipSelect_npcs_ashyen_and_keleth(Player *player, Creature *_Creature, ui
#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!"
-#define FACTION_HOSTILE_CO 45
-#define FACTION_FRIENDLY_CO 35
-
-#define SPELL_LIGHTNING_BOLT 9532
+enum
+{
+ SPELL_LIGHTNING_BOLT = 9532,
+ QUEST_CRACK_SKULLS = 10009,
+ FACTION_HOSTILE_CO = 45
+};
struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI
{
- npc_cooshcooshAI(Creature* c) : ScriptedAI(c) {}
+ npc_cooshcooshAI(Creature* c) : ScriptedAI(c)
+ {
+ m_uiNormFaction = c->getFaction();
+ }
+ uint32 m_uiNormFaction;
uint32 LightningBolt_Timer;
void Reset()
{
LightningBolt_Timer = 2000;
- m_creature->setFaction(FACTION_FRIENDLY_CO);
+ if (m_creature->getFaction() != m_uiNormFaction)
+ m_creature->setFaction(m_uiNormFaction);
}
void EnterCombat(Unit *who) {}
@@ -153,6 +160,7 @@ struct TRINITY_DLL_DECL npc_cooshcooshAI : public ScriptedAI
DoMeleeAttackIfReady();
}
};
+
CreatureAI* GetAI_npc_cooshcoosh(Creature *_Creature)
{
return new npc_cooshcooshAI (_Creature);
@@ -160,8 +168,8 @@ CreatureAI* GetAI_npc_cooshcoosh(Creature *_Creature)
bool GossipHello_npc_cooshcoosh(Player *player, Creature *_Creature )
{
- if( player->GetQuestStatus(10009) == QUEST_STATUS_INCOMPLETE )
- player->ADD_GOSSIP_ITEM(1, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ if( player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE )
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(9441, _Creature->GetGUID());
return true;
@@ -359,6 +367,7 @@ void AddSC_zangarmarsh()
newscript = new Script;
newscript->Name="npc_cooshcoosh";
+ newscript->GetAI = &GetAI_npc_cooshcoosh;
newscript->pGossipHello = &GossipHello_npc_cooshcoosh;
newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh;
newscript->RegisterSelf();
diff --git a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
index c06cd917b0e..9c0f2a92e81 100644
--- a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
+++ b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp
@@ -104,7 +104,7 @@ bool GossipHello_npc_sergeant_bly(Player *player, Creature *_Creature )
{
/*if( pInstance->GetData(0) == DONE )
{*/
- player->ADD_GOSSIP_ITEM(1, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(1517, _Creature->GetGUID());
/*}
else if( pInstance->GetData(0) == IN_PROGRESS )
@@ -182,7 +182,7 @@ bool GossipHello_npc_weegli_blastfuse(Player *player, Creature *_Creature )
//event not implemented yet, this is only placeholder for future developement
/*if( pInstance->GetData(0) == DONE )
{
- player->ADD_GOSSIP_ITEM(1, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(0, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(1514, _Creature->GetGUID());//if event can proceed to end
}
else if( pInstance->GetData(0) == IN_PROGRESS )