Violet Hold: Support for Sinclari and guards event (blizzlike), at the start of Violet Hold event.

--HG--
branch : trunk
This commit is contained in:
maanuel
2009-12-10 22:13:50 -03:00
parent 550f9899fd
commit 80a3197388
3 changed files with 130 additions and 3 deletions

View File

@@ -1983,6 +1983,9 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`
(29305,-1604015,'Get ready for somethin''... much... BIGGAH! ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,'SAY_TRANSFORM boss_moorabi'),
(29305,-1604016,'Da ground gonna swallow you up',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,'SAY_QUAKE boss_moorabi'),
(29305,-1604017,'%s begins to transform!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,3,0,0,'EMOTE_TRANSFORM boss_moorabi'),
-- -1 608 000 VIOLET HOLD
(30658,-1608000,'Prision guards, we are leaving! These adventurers are taking over! Go go go',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''),
-- -1 615 000 OBSIDIAN SANCTUM
(30451,-1615000,'I fear nothing! Least of all you!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14111,1,0,0,'shadron SAY_SHADRON_AGGRO'),

View File

@@ -0,0 +1,4 @@
DELETE FROM `script_texts` WHERE `entry`=-1608000;
INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`,`sound`,`type`,`language`,`emote`,`comment`) VALUES
(30658,-1608000,'Prision guards, we are leaving! These adventurers are taking over! Go go go',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,'');

View File

@@ -16,7 +16,127 @@ enum PortalCreatures
CREATURE_AZURE_STALKER = 32191
};
enum eSinclari
{
NPC_VIOLET_HOLD_GUARD = 30659,
SAY_SINCLARI_1 = -1608000,
};
const Position DoorPosition = { 1828.300049, 797.309021, 46.135502, 1.48353};
const Position MovePosition = { 1806.955566, 803.851807, 44.363323};
struct TRINITY_DLL_DECL npc_sinclariAI : public ScriptedAI
{
npc_sinclariAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* pInstance;
uint8 uiPhase;
uint32 uiTimer;
std::list<Creature*> GuardList;
void Reset()
{
uiPhase = 0;
uiTimer = 0;
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->SetReactState(REACT_AGGRESSIVE);
m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
if (!GuardList.empty())
for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
{
if (Creature* pGuard = *itr)
{
pGuard->SetVisibility(VISIBILITY_ON);
pGuard->SetReactState(REACT_AGGRESSIVE);
}
}
}
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE)
return;
if (pInstance)
pInstance->SetData(DATA_WAVE_COUNT,1);
//She should not be despawned, she will be used by the instance to summon some npcs
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetReactState(REACT_PASSIVE);
}
void UpdateAI(const uint32 uiDiff)
{
ScriptedAI::UpdateAI(uiDiff);
if (uiPhase)
{
if (uiTimer <= uiDiff)
{
switch(uiPhase)
{
case 1:
DoScriptText(SAY_SINCLARI_1, m_creature);
uiTimer = 4000;
uiPhase = 2;
break;
case 2:
m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
if (!GuardList.empty())
for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
{
if (Creature* pGuard = *itr)
{
pGuard->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pGuard->GetMotionMaster()->MovePoint(0, MovePosition);
}
}
uiTimer = 6000;
uiPhase = 3;
break;
case 3:
m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
if (!GuardList.empty())
for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
{
if (Creature* pGuard = *itr)
{
pGuard->SetVisibility(VISIBILITY_OFF);
pGuard->SetReactState(REACT_PASSIVE);
}
}
uiTimer = 2000;
uiPhase = 4;
break;
case 4:
m_creature->GetMotionMaster()->MovePoint(0, MovePosition);
uiTimer = 0;
uiPhase = 0;
break;
}
}
else uiTimer -= uiDiff;
}
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_sinclari(Creature* pCreature)
{
return new npc_sinclariAI(pCreature);
}
bool GossipHello_npc_sinclari(Player* pPlayer, Creature* pCreature)
{
@@ -31,9 +151,8 @@ bool GossipSelect_npc_sinclari(Player* pPlayer, Creature* pCreature, uint32 uiSe
{
if (pPlayer)
pPlayer->CLOSE_GOSSIP_MENU();
ScriptedInstance* pInstance = pCreature->GetInstanceData();
if (pInstance)
pInstance->SetData(DATA_WAVE_COUNT,1);
CAST_AI(npc_sinclariAI, (pCreature->AI()))->uiPhase = 1;
return true;
}
@@ -98,6 +217,7 @@ void AddSC_violet_hold()
newscript = new Script;
newscript->Name = "npc_sinclari_vh";
newscript->GetAI = &GetAI_npc_sinclari;
newscript->pGossipHello = &GossipHello_npc_sinclari;
newscript->pGossipSelect = &GossipSelect_npc_sinclari;
newscript->RegisterSelf();