--HG--
branch : trunk
This commit is contained in:
Machiavelli
2009-06-19 00:25:35 +02:00
11 changed files with 306 additions and 61 deletions
+1
View File
@@ -999,6 +999,7 @@ INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc1`, `content
(-1543014, 'Die, weakling!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10282, 1, 0, 0, 'omor SAY_KILL_1'),
(-1543015, 'It is... not over.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10284, 1, 0, 0, 'omor SAY_DIE'),
(-1543016, 'I am victorious!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10283, 1, 0, 0, 'omor SAY_WIPE'),
(-1543017, 'You have faced many challenges, pity they were all in vain. Soon your people will kneel to my lord!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10292, 1, 0, 0, 'vazruden SAY_INTRO'),
(-1543018, 'Is there no one left to test me?', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10293, 1, 0, 0, 'vazruden SAY_WIPE'),
(-1543019, 'Your time is running out!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 10294, 1, 0, 0, 'vazruden SAY_AGGRO_1'),
+7
View File
@@ -13,6 +13,13 @@ CREATE TABLE script_waypoint (
PRIMARY KEY (entry, pointid)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints';
DELETE FROM script_waypoint WHERE entry=24358;
INSERT INTO script_waypoint VALUES
(24358, 0, 121.193970, 1645.619385, 42.021, 0, ''),
(24358, 1, 132.051468, 1642.176025, 42.021, 5000, 'SAY_AT_GONG'),
(24358, 2, 120.670631, 1636.346802, 42.415, 0, ''),
(24358, 3, 120.536003, 1611.654663, 43.473, 10000, 'SAY_OPEN_ENTRANCE'),
(24358, 4, 120.536003, 1611.654663, 43.473, 0, '');
DELETE FROM script_waypoint WHERE entry=16295;
INSERT INTO script_waypoint VALUES
+1
View File
@@ -83,6 +83,7 @@ UPDATE `item_template` SET `ScriptName`='item_only_for_flight' WHERE `entry` IN
UPDATE `item_template` SET `ScriptName`='item_inoculating_crystal' WHERE `entry`=22962;
/* NPC (usually creatures to be found in more than one specific zone) */
UPDATE `creature_template` SET `ScriptName`='npc_air_force_bots' WHERE `entry` IN (2614, 2615, 21974, 21993, 21996, 21997, 21999, 22001, 22002, 22003, 22063, 22065, 22066, 22068, 22069, 22070, 22071, 22078, 22079, 22080, 22086, 22087, 22088, 22090, 22124, 22125, 22126);
UPDATE `creature_template` SET `ScriptName`='npc_chicken_cluck' WHERE `entry`=620;
UPDATE `creature_template` SET `ScriptName`='npc_dancing_flames' WHERE `entry`=25305;
UPDATE `creature_template` SET `ScriptName`='npc_garments_of_quests' WHERE `entry` IN (12429,12423,12427,12430,12428);
+1
View File
@@ -0,0 +1 @@
UPDATE creature_template SET ScriptName='npc_air_force_bots' WHERE entry IN (2614, 2615, 21974, 21993, 21996, 21997, 21999, 22001, 22002, 22003, 22063, 22065, 22066, 22068, 22069, 22070, 22071, 22078, 22079, 22080, 22086, 22087, 22088, 22090, 22124, 22125, 22126);
@@ -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
@@ -1373,6 +1581,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;
@@ -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;
@@ -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;
}
@@ -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();
@@ -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;
@@ -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();
@@ -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 )