mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
*Updated Shirrak the Dead watcher script - by Iskander
*Fixed Yenniku script - by Elron *Corrected Brazier of Dancing flames - by Silver1ce --HG-- branch : trunk
This commit is contained in:
@@ -131,12 +131,79 @@ bool QuestComplete_npc_chicken_cluck(Player *player, Creature *_Creature, const
|
||||
## npc_dancing_flames
|
||||
######*/
|
||||
|
||||
bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *_Creature, uint32 emote )
|
||||
{
|
||||
if( emote == TEXTEMOTE_DANCE )
|
||||
_Creature->CastSpell(player,47057,false);
|
||||
#define SPELL_BRAZIER 45423
|
||||
#define SPELL_SEDUCTION 47057
|
||||
#define SPELL_FIERY_AURA 45427
|
||||
|
||||
return true;
|
||||
struct TRINITY_DLL_DECL npc_dancing_flamesAI : public ScriptedAI
|
||||
{
|
||||
npc_dancing_flamesAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
bool active;
|
||||
uint32 can_iteract;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
active = true;
|
||||
can_iteract = 3500;
|
||||
DoCast(m_creature,SPELL_BRAZIER,true);
|
||||
DoCast(m_creature,SPELL_FIERY_AURA,false);
|
||||
float x, y, z;
|
||||
m_creature->GetPosition(x,y,z);
|
||||
m_creature->Relocate(x,y,z + 0.94f);
|
||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
|
||||
WorldPacket data; //send update position to client
|
||||
m_creature->BuildHeartBeatMsg(&data);
|
||||
m_creature->SendMessageToSet(&data,true);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!active)
|
||||
{
|
||||
if(can_iteract <= diff){
|
||||
active = true;
|
||||
can_iteract = 3500;
|
||||
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_DANCE);
|
||||
}else can_iteract -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit* who){}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_dancing_flames(Creature *_Creature)
|
||||
{
|
||||
return new npc_dancing_flamesAI(_Creature);
|
||||
}
|
||||
|
||||
bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 emote )
|
||||
{
|
||||
if ( ((npc_dancing_flamesAI*)flame->AI())->active &&
|
||||
flame->IsWithinLOS(player->GetPositionX(),player->GetPositionY(),player->GetPositionZ()) && flame->IsWithinDistInMap(player,30.0f))
|
||||
{
|
||||
flame->SetInFront(player);
|
||||
((npc_dancing_flamesAI*)flame->AI())->active = false;
|
||||
|
||||
WorldPacket data;
|
||||
flame->BuildHeartBeatMsg(&data);
|
||||
flame->SendMessageToSet(&data,true);
|
||||
switch(emote)
|
||||
{
|
||||
case TEXTEMOTE_KISS: flame->HandleEmoteCommand(EMOTE_ONESHOT_SHY); break;
|
||||
case TEXTEMOTE_WAVE: flame->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
|
||||
case TEXTEMOTE_BOW: flame->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break;
|
||||
case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
|
||||
case TEXTEMOTE_DANCE:
|
||||
{
|
||||
if (!player->HasAura(SPELL_SEDUCTION,0))
|
||||
flame->CastSpell(player,SPELL_SEDUCTION,true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*######
|
||||
@@ -940,6 +1007,7 @@ void AddSC_npcs_special()
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_dancing_flames";
|
||||
newscript->GetAI = &GetAI_npc_dancing_flames;
|
||||
newscript->pReceiveEmote = &ReceiveEmote_npc_dancing_flames;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
|
||||
#define SPELL_INHABITMAGIC 32264
|
||||
#define SPELL_INHIBITMAGIC 32264
|
||||
#define SPELL_ATTRACTMAGIC 32265
|
||||
#define N_SPELL_CARNIVOROUSBITE 36383
|
||||
#define H_SPELL_CARNIVOROUSBITE 39382
|
||||
@@ -44,7 +44,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
Reset();
|
||||
}
|
||||
|
||||
uint32 Inhabitmagic_Timer;
|
||||
uint32 Inhibitmagic_Timer;
|
||||
uint32 Attractmagic_Timer;
|
||||
uint32 Carnivorousbite_Timer;
|
||||
uint32 FocusFire_Timer;
|
||||
@@ -53,7 +53,7 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Inhabitmagic_Timer = 3000;
|
||||
Inhibitmagic_Timer = 0;
|
||||
Attractmagic_Timer = 28000;
|
||||
Carnivorousbite_Timer = 10000;
|
||||
FocusFire_Timer = 17000;
|
||||
@@ -79,22 +79,38 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Inhibitmagic_Timer
|
||||
if (Inhibitmagic_Timer < diff)
|
||||
{
|
||||
float dist;
|
||||
Map *map = m_creature->GetMap();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* i_pl = i->getSource())
|
||||
if (i_pl->isAlive() && (dist = i_pl->GetDistance(m_creature)) < 45)
|
||||
{
|
||||
i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC);
|
||||
m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
if(dist < 35)
|
||||
m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
if(dist < 25)
|
||||
m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
if(dist < 15)
|
||||
m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl);
|
||||
}
|
||||
Inhibitmagic_Timer = 3000+(rand()%1000);
|
||||
}else Inhibitmagic_Timer -= diff;
|
||||
|
||||
//Return since we have no target
|
||||
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
|
||||
return;
|
||||
|
||||
//Inhabitmagic_Timer
|
||||
if (Inhabitmagic_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature,SPELL_INHABITMAGIC);
|
||||
Inhabitmagic_Timer = 2000+(rand()%2000);
|
||||
}else Inhabitmagic_Timer -= diff;
|
||||
|
||||
//Attractmagic_Timer
|
||||
if (Attractmagic_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature,SPELL_ATTRACTMAGIC);
|
||||
Attractmagic_Timer = 30000;
|
||||
Carnivorousbite_Timer = 1500;
|
||||
}else Attractmagic_Timer -= diff;
|
||||
|
||||
//Carnivorousbite_Timer
|
||||
@@ -108,20 +124,20 @@ struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
if (FocusFire_Timer < diff)
|
||||
{
|
||||
// Summon Focus Fire & Emote
|
||||
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1);
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive())
|
||||
{
|
||||
focusedTarget = target;
|
||||
m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500);
|
||||
|
||||
// Emote
|
||||
std::string *emote = new std::string("focuses his energy on ");
|
||||
std::string *emote = new std::string("focuses on ");
|
||||
emote->append(target->GetName());
|
||||
emote->append("!");
|
||||
DoTextEmote(emote->c_str(),NULL,true);
|
||||
delete emote;
|
||||
|
||||
FocusFire_Timer = 15000+(rand()%5000);
|
||||
}
|
||||
FocusFire_Timer = 15000+(rand()%5000);
|
||||
}else FocusFire_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -143,7 +159,7 @@ struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI
|
||||
|
||||
bool HeroicMode;
|
||||
uint32 FieryBlast_Timer;
|
||||
bool fiery1, fiery2, fiery3;
|
||||
bool fiery1, fiery2;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
|
||||
@@ -72,13 +72,28 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (bReset)
|
||||
if(Reset_Timer < diff)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
bReset = false;
|
||||
m_creature->setFaction(28); //troll, bloodscalp
|
||||
}
|
||||
else Reset_Timer -= diff;
|
||||
{
|
||||
if(Reset_Timer < diff)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
bReset = false;
|
||||
m_creature->setFaction(28); //troll, bloodscalp
|
||||
}
|
||||
else Reset_Timer -= diff;
|
||||
|
||||
if(m_creature->isInCombat() && m_creature->getVictim())
|
||||
{
|
||||
if(m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Unit *victim = m_creature->getVictim();
|
||||
if(((Player*)victim)->GetTeam() == HORDE)
|
||||
{
|
||||
m_creature->CombatStop();
|
||||
m_creature->DeleteThreatList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() )
|
||||
|
||||
Reference in New Issue
Block a user