Merge [SD2]
r1001 Correcting location where drake fly to for quest 10814 r1002 Reorganize and rename sql-files. - Skip r1003 Include data from sd2_db_version table in function used by .server info -command - Skip r1004 Updated How to install.txt - Skip r1005 Fixed typo in scriptdev2_script_full.sql - Skip --HG-- branch : trunk
This commit is contained in:
@@ -46,110 +46,115 @@ EndContentData */
|
|||||||
# mob_mature_netherwing_drake
|
# mob_mature_netherwing_drake
|
||||||
#####*/
|
#####*/
|
||||||
|
|
||||||
#define SPELL_PLACE_CARCASS 38439
|
enum
|
||||||
#define SPELL_JUST_EATEN 38502
|
{
|
||||||
#define SPELL_NETHER_BREATH 38467
|
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
|
struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
|
||||||
{
|
{
|
||||||
mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c)
|
mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { }
|
||||||
{
|
|
||||||
PlayerGUID = 0;
|
|
||||||
Reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 PlayerGUID;
|
uint64 uiPlayerGUID;
|
||||||
|
|
||||||
bool IsEating;
|
bool bCanEat;
|
||||||
bool Evade;
|
bool bIsEating;
|
||||||
|
|
||||||
uint32 ResetTimer;
|
|
||||||
uint32 CastTimer;
|
|
||||||
uint32 EatTimer;
|
uint32 EatTimer;
|
||||||
|
uint32 CastTimer;
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
IsEating = false;
|
uiPlayerGUID = 0;
|
||||||
Evade = false;
|
|
||||||
|
bCanEat = false;
|
||||||
|
bIsEating = false;
|
||||||
|
|
||||||
ResetTimer = 120000;
|
|
||||||
EatTimer = 5000;
|
EatTimer = 5000;
|
||||||
CastTimer = 5000;
|
CastTimer = 5000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* who) { }
|
void EnterCombat(Unit* who) { }
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit* who)
|
void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
|
||||||
{
|
{
|
||||||
if(m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
|
if (bCanEat || bIsEating)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ScriptedAI::MoveInLineOfSight(who);
|
if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN))
|
||||||
}
|
|
||||||
|
|
||||||
void SpellHit(Unit* caster, const SpellEntry* spell)
|
|
||||||
{
|
|
||||||
if(!caster)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN) && !PlayerGUID)
|
|
||||||
{
|
{
|
||||||
float PlayerX, PlayerY, PlayerZ;
|
uiPlayerGUID = pCaster->GetGUID();
|
||||||
caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize());
|
bCanEat = true;
|
||||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
|
||||||
m_creature->GetMotionMaster()->MovePoint(1, PlayerX, PlayerY, PlayerZ);
|
|
||||||
PlayerGUID = caster->GetGUID();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovementInform(uint32 type, uint32 id)
|
void MovementInform(uint32 type, uint32 id)
|
||||||
{
|
{
|
||||||
if(type != POINT_MOTION_TYPE)
|
if (type != POINT_MOTION_TYPE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(id == 1)
|
if (id == POINT_ID)
|
||||||
{
|
{
|
||||||
IsEating = true;
|
bIsEating = true;
|
||||||
EatTimer = 5000;
|
EatTimer = 7000;
|
||||||
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
|
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
|
||||||
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
if(IsEating)
|
if (bCanEat || bIsEating)
|
||||||
if(EatTimer < diff)
|
|
||||||
{
|
{
|
||||||
IsEating = false;
|
if (EatTimer < diff)
|
||||||
DoCast(m_creature, SPELL_JUST_EATEN);
|
|
||||||
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
|
||||||
DoScriptText(SAY_JUST_EATEN, m_creature);
|
|
||||||
if(PlayerGUID)
|
|
||||||
{
|
{
|
||||||
Player* plr = Unit::GetPlayer(PlayerGUID);
|
if (bCanEat && !bIsEating)
|
||||||
if(plr && plr->GetQuestStatus(10804) == QUEST_STATUS_INCOMPLETE)
|
|
||||||
{
|
{
|
||||||
plr->KilledMonster(22131, m_creature->GetGUID());
|
if (Unit* pUnit = Unit::GetUnit(*m_creature, uiPlayerGUID))
|
||||||
Evade = true;
|
{
|
||||||
PlayerGUID = 0;
|
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)
|
return;
|
||||||
if(ResetTimer < diff)
|
}
|
||||||
{
|
|
||||||
EnterEvadeMode();
|
|
||||||
return;
|
|
||||||
}else ResetTimer -= diff;
|
|
||||||
|
|
||||||
if(!UpdateVictim())
|
if(!UpdateVictim())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(CastTimer < diff)
|
if (CastTimer < diff)
|
||||||
{
|
{
|
||||||
DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH);
|
DoCast(m_creature->getVictim(), SPELL_NETHER_BREATH);
|
||||||
CastTimer = 5000;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*###
|
/*###
|
||||||
|
|||||||
Reference in New Issue
Block a user