2009-06-15 03:31:11 +02:00
|
|
|
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*/
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
/* ScriptData
|
|
|
|
|
SDName: Desolace
|
|
|
|
|
SD%Complete: 100
|
|
|
|
|
SDComment: Quest support: 5561
|
|
|
|
|
SDCategory: Desolace
|
|
|
|
|
EndScriptData */
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
/* ContentData
|
|
|
|
|
npc_aged_dying_ancient_kodo
|
|
|
|
|
EndContentData */
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-01-19 11:36:05 +01:00
|
|
|
#include "ScriptedPch.h"
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-10-17 07:42:48 -07:00
|
|
|
enum eDyingKodo
|
2009-06-15 03:31:11 +02:00
|
|
|
{
|
2009-09-10 13:00:39 +02:00
|
|
|
// signed for 9999
|
2009-06-15 03:31:11 +02:00
|
|
|
SAY_SMEED_HOME_1 = -1000428,
|
|
|
|
|
SAY_SMEED_HOME_2 = -1000429,
|
|
|
|
|
SAY_SMEED_HOME_3 = -1000430,
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
QUEST_KODO = 5561,
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
NPC_SMEED = 11596,
|
|
|
|
|
NPC_AGED_KODO = 4700,
|
|
|
|
|
NPC_DYING_KODO = 4701,
|
|
|
|
|
NPC_ANCIENT_KODO = 4702,
|
|
|
|
|
NPC_TAMED_KODO = 11627,
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
SPELL_KODO_KOMBO_ITEM = 18153,
|
|
|
|
|
SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks
|
|
|
|
|
SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377,
|
|
|
|
|
SPELL_KODO_KOMBO_GOSSIP = 18362
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
struct TRINITY_DLL_DECL npc_aged_dying_ancient_kodoAI : public ScriptedAI
|
|
|
|
|
{
|
|
|
|
|
npc_aged_dying_ancient_kodoAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
uint32 m_uiDespawnTimer;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
void Reset()
|
|
|
|
|
{
|
|
|
|
|
m_uiDespawnTimer = 0;
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
void MoveInLineOfSight(Unit* pWho)
|
|
|
|
|
{
|
|
|
|
|
if (pWho->GetEntry() == NPC_SMEED)
|
|
|
|
|
{
|
|
|
|
|
if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
|
|
|
|
|
return;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
if (m_creature->IsWithinDistInMap(pWho, 10.0f))
|
|
|
|
|
{
|
2009-10-17 06:26:32 -07:00
|
|
|
DoScriptText(RAND(SAY_SMEED_HOME_1,SAY_SMEED_HOME_2,SAY_SMEED_HOME_3), pWho);
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
//spell have no implemented effect (dummy), so useful to notify spellHit
|
2009-11-11 13:47:21 -08:00
|
|
|
DoCast(m_creature, SPELL_KODO_KOMBO_GOSSIP, true);
|
2009-06-15 03:31:11 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
|
|
|
|
|
{
|
|
|
|
|
if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
|
|
|
|
|
{
|
|
|
|
|
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
|
|
|
|
m_uiDespawnTimer = 60000;
|
|
|
|
|
}
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
void UpdateAI(const uint32 diff)
|
|
|
|
|
{
|
|
|
|
|
//timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat.
|
|
|
|
|
if (m_uiDespawnTimer && m_uiDespawnTimer <= diff)
|
|
|
|
|
{
|
|
|
|
|
if (!m_creature->getVictim() && m_creature->isAlive())
|
|
|
|
|
{
|
|
|
|
|
Reset();
|
|
|
|
|
m_creature->setDeathState(JUST_DIED);
|
|
|
|
|
m_creature->Respawn();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else m_uiDespawnTimer -= diff;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
if (!UpdateVictim())
|
|
|
|
|
return;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
DoMeleeAttackIfReady();
|
|
|
|
|
}
|
|
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
CreatureAI* GetAI_npc_aged_dying_ancient_kodo(Creature* pCreature)
|
|
|
|
|
{
|
|
|
|
|
return new npc_aged_dying_ancient_kodoAI(pCreature);
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
bool EffectDummyCreature_npc_aged_dying_ancient_kodo(Unit *pCaster, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget)
|
|
|
|
|
{
|
|
|
|
|
//always check spellid and effectindex
|
|
|
|
|
if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
//no effect if player/creature already have aura from spells
|
|
|
|
|
if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || pCreatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
|
|
|
|
|
return true;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
if (pCreatureTarget->GetEntry() == NPC_AGED_KODO ||
|
|
|
|
|
pCreatureTarget->GetEntry() == NPC_DYING_KODO ||
|
|
|
|
|
pCreatureTarget->GetEntry() == NPC_ANCIENT_KODO)
|
|
|
|
|
{
|
|
|
|
|
pCaster->CastSpell(pCaster,SPELL_KODO_KOMBO_PLAYER_BUFF,true);
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
pCreatureTarget->UpdateEntry(NPC_TAMED_KODO);
|
|
|
|
|
pCreatureTarget->CastSpell(pCreatureTarget,SPELL_KODO_KOMBO_DESPAWN_BUFF,false);
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
|
|
|
|
|
pCreatureTarget->GetMotionMaster()->MoveIdle();
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-07-22 17:10:30 +02:00
|
|
|
pCreatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, pCreatureTarget->GetFollowAngle());
|
2009-06-15 03:31:11 +02:00
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
//always return true when we are handling this spell and effect
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
bool GossipHello_npc_aged_dying_ancient_kodo(Player* pPlayer, Creature* pCreature)
|
|
|
|
|
{
|
|
|
|
|
if (pPlayer->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && pCreature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
|
|
|
|
|
{
|
|
|
|
|
//the expected quest objective
|
|
|
|
|
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
pPlayer->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);
|
|
|
|
|
pCreature->GetMotionMaster()->MoveIdle();
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-12-20 13:35:08 +02:00
|
|
|
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
|
2009-06-15 03:31:11 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-10-19 17:46:33 +02:00
|
|
|
/*######
|
|
|
|
|
## go_iruxos. Quest 5381
|
|
|
|
|
######*/
|
|
|
|
|
|
2009-10-27 19:10:39 -07:00
|
|
|
bool GOHello_go_iruxos(Player *pPlayer, GameObject* pGO)
|
2009-10-19 17:46:33 +02:00
|
|
|
{
|
2009-10-27 19:10:39 -07:00
|
|
|
if (pPlayer->GetQuestStatus(5381) == QUEST_STATUS_INCOMPLETE)
|
|
|
|
|
pPlayer->SummonCreature(11876, pPlayer->GetInnPosX(),pPlayer->GetInnPosY(),pPlayer->GetInnPosZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
|
2009-10-19 17:46:33 +02:00
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
void AddSC_desolace()
|
|
|
|
|
{
|
|
|
|
|
Script *newscript;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-06-15 03:31:11 +02:00
|
|
|
newscript = new Script;
|
|
|
|
|
newscript->Name = "npc_aged_dying_ancient_kodo";
|
2009-08-13 02:48:34 +02:00
|
|
|
newscript->GetAI = &GetAI_npc_aged_dying_ancient_kodo;
|
2009-06-15 03:31:11 +02:00
|
|
|
newscript->pEffectDummyCreature = &EffectDummyCreature_npc_aged_dying_ancient_kodo;
|
|
|
|
|
newscript->pGossipHello = &GossipHello_npc_aged_dying_ancient_kodo;
|
|
|
|
|
newscript->RegisterSelf();
|
2009-10-19 17:46:33 +02:00
|
|
|
|
|
|
|
|
newscript = new Script;
|
|
|
|
|
newscript->Name = "go_iruxos";
|
|
|
|
|
newscript->pGOHello = &GOHello_go_iruxos;
|
|
|
|
|
newscript->RegisterSelf();
|
2009-06-15 03:31:11 +02:00
|
|
|
}
|