Код:
/* Copyright (C) 2006 - 2011 ScriptDev2 <http://www.scriptdev2.com/>
* 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
*/
/* ScriptData
SDName: Icecrown_Quests
SD%Complete: 10
SDComment: Quest support:
SDCategory: Icecrown Citadel Quests[Raid]
EndScriptData */
/* ContentData
npc_quest_raid_sylvana_icc
npc_quest_raid_uther_38608
npc_quest_raid_jaina_38606
npc_quest_raid_darion_mogrine_38610
EndContentData */
#include "precompiled.h"
#include "icecrown_citadel.h"
/*#####
# pc_quest_raid_sylvana_icc
#####*/
//[17376]Lady Sylvanas Windrunner says: So, it is done.
//[17377]Lady Sylvanas Windrunner says: I had not dared to trust my senses - too many times has the Lich King made me to be a fool.
//[17378]Lady Sylvanas Windrunner says: Finally, he has been made to pay for the atrocities he imposed upon my people.
//[17379]Lady Sylvanas Windrunner says: May Azeroth never fail to remember the terrible price we paid for our weakness... for our pride.
//[17380]Lady Sylvanas Windrunner says: But what now, hero? What of those freed from his grasp, but still shackled to their mortal coils?
//[17381]Lady Sylvanas Windrunner says: Leave me.
//[17382]Lady Sylvanas Windrunner says: I have much to ponder.
enum
{
QUEST_FROM_VENGEANCE = 24918, //Sylvanas' Vengeance http://www.wowhead.com/quest=24918
SAY_QUEST_DIALOGE_1 = -1580108, //17376
SAY_QUEST_DIALOGE_2 = -1580109, //17377
SAY_QUEST_DIALOGE_3 = -1580110, //17378
SAY_QUEST_DIALOGE_4 = -1580111, //17379
SAY_QUEST_DIALOGE_5 = -1580112, //17380
SAY_QUEST_DIALOGE_6 = -1580113, //17381
SAY_QUEST_DIALOGE_7 = -1580114 //17382
};
struct MANGOS_DLL_DECL npc_quest_raid_sylvana_iccAI : public ScriptedAI
{
npc_quest_raid_sylvana_iccAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
uint32 m_uiDialogeTimer;
uint32 m_uiDialogeEvent;
void Reset()
{
m_uiDialogeTimer = 0;
m_uiDialogeEvent = 0;
}
void SylvanaEvent()
{
switch (m_uiDialogeEvent)
{
case 0:
DoScriptText(SAY_QUEST_DIALOGE_1, m_creature);
m_uiDialogeTimer = 2500;
++m_uiDialogeEvent;
break;
case 1:
DoScriptText(SAY_QUEST_DIALOGE_2, m_creature);
m_uiDialogeTimer = 12500;
++m_uiDialogeEvent;
break;
case 2:
DoScriptText(SAY_QUEST_DIALOGE_3, m_creature);
m_uiDialogeTimer = 11000;
++m_uiDialogeEvent;
break;
case 3:
DoScriptText(SAY_QUEST_DIALOGE_4, m_creature);
m_uiDialogeTimer = 13000;
++m_uiDialogeEvent;
break;
case 4:
DoScriptText(SAY_QUEST_DIALOGE_5, m_creature);
m_uiDialogeTimer = 13500;
++m_uiDialogeEvent;
break;
case 5:
DoScriptText(SAY_QUEST_DIALOGE_6, m_creature);
m_uiDialogeTimer = 2500;
++m_uiDialogeEvent;
break;
case 6:
DoScriptText(SAY_QUEST_DIALOGE_7, m_creature);
Reset();
break;
default:
Reset();
break;
}
}
void UpdateAI(const uint32 uiDiff)
{
if (m_uiDialogeTimer)
{
if (m_uiDialogeTimer <= uiDiff)
SylvanaEvent();
else
m_uiDialogeTimer -= uiDiff;
}
}
};
CreatureAI* GetAI_npc_quest_raid_sylvana_icc(Creature* pCreature)
{
return new npc_quest_raid_sylvana_iccAI(pCreature);
}
bool QuestRewarded_npc_quest_raid_sylvana_icc(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_FROM_VENGEANCE)
{
if (npc_quest_raid_sylvana_iccAI* pSylvanaAI = dynamic_cast<npc_quest_raid_sylvana_iccAI*>(pCreature->AI()))
{
if (!pSylvanaAI->m_uiDialogeTimer)
pSylvanaAI->m_uiDialogeTimer = 500;
}
}
return true;
}
void AddSC_icecrown_quests()
{
Script *pNewScript;
pNewScript = new Script;
pNewScript->Name = "npc_quest_raid_sylvana_icc";
pNewScript->GetAI = &GetAI_npc_quest_raid_sylvana_icc;
pNewScript->pQuestRewardedNPC = &QuestRewarded_npc_quest_raid_sylvana_icc;
pNewScript->RegisterSelf();
};
Сделал по стандарту, убрал кое что лишнее. Поправил не возможность повторного проигрывания эвента.
П.С. отключите у себя табуляцию и соблюдайте стиль написания отступайте 4 пробела.