Core/Misc: 3.3.5a fixes

This commit is contained in:
Aokromes
2015-08-09 10:50:16 +02:00
parent deac934b80
commit 1b57196b4e
6 changed files with 3 additions and 121 deletions

View File

@@ -110,7 +110,6 @@ set(scripts_STAT_SRCS
Kalimdor/zone_winterspring.cpp
Kalimdor/zone_thousand_needles.cpp
Kalimdor/zone_ashenvale.cpp
Kalimdor/zone_teldrassil.cpp
Kalimdor/OnyxiasLair/boss_onyxia.cpp
Kalimdor/OnyxiasLair/onyxias_lair.h
Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp

View File

@@ -1,115 +0,0 @@
/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
* 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, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Teldrassil
SD%Complete: 100
SDComment: Quest support: 938
SDCategory: Teldrassil
EndScriptData */
/* ContentData
npc_mist
EndContentData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedFollowerAI.h"
#include "Player.h"
/*####
# npc_mist
####*/
enum Mist
{
SAY_AT_HOME = 0,
EMOTE_AT_HOME = 1,
QUEST_MIST = 938,
NPC_ARYNIA = 3519,
FACTION_DARNASSUS = 79
};
class npc_mist : public CreatureScript
{
public:
npc_mist() : CreatureScript("npc_mist") { }
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
{
if (quest->GetQuestId() == QUEST_MIST)
if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI()))
pMistAI->StartFollow(player, FACTION_DARNASSUS, quest);
return true;
}
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_mistAI(creature);
}
struct npc_mistAI : public FollowerAI
{
npc_mistAI(Creature* creature) : FollowerAI(creature) { }
void Reset() override { }
void MoveInLineOfSight(Unit* who) override
{
FollowerAI::MoveInLineOfSight(who);
if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_ARYNIA)
{
if (me->IsWithinDistInMap(who, 10.0f))
{
Talk(SAY_AT_HOME, who);
DoComplete();
}
}
}
void DoComplete()
{
Talk(EMOTE_AT_HOME);
Player* player = GetLeaderForFollower();
if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE)
player->GroupEventHappens(QUEST_MIST, me);
//The follow is over (and for later development, run off to the woods before really end)
SetFollowComplete();
}
//call not needed here, no known abilities
/*void UpdateFollowerAI(const uint32 Diff) override
{
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}*/
};
};
void AddSC_teldrassil()
{
new npc_mist();
}