* Add script for Razorfen Kraul, implements access to certain room after certain event. Script by ArticDevil, thank you.
* Rename the 'Azeroth' filter to 'Eastern Kingdoms' in the script vcproj files --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
-- Razorfen Kraul
|
||||||
|
UPDATE `instance_template` SET `script` = 'instance_razorfen_kraul' WHERE `map` = '47' LIMIT 1;
|
||||||
|
UPDATE `creature_template` SET `ScriptName` = 'npc_deaths_head_ward_keeper' WHERE `entry` = '4625' LIMIT 1;
|
||||||
@@ -536,6 +536,14 @@
|
|||||||
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
|
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\zone\razorfen_kraul\instance_razorfen_kraul.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\zone\razorfen_kraul\def_razorfen_kraul.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Redridge Mountains"
|
Name="Redridge Mountains"
|
||||||
|
|||||||
@@ -713,6 +713,14 @@
|
|||||||
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
|
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\zone\razorfen_kraul\instance_razorfen_kraul.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\zone\razorfen_kraul\def_razorfen_kraul.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Redridge Mountains"
|
Name="Redridge Mountains"
|
||||||
|
|||||||
@@ -706,6 +706,14 @@
|
|||||||
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
|
RelativePath="..\scripts\zone\razorfen_kraul\razorfen_kraul.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\zone\razorfen_kraul\instance_razorfen_kraul.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\scripts\zone\razorfen_kraul\def_razorfen_kraul.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Redridge Mountains"
|
Name="Redridge Mountains"
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DEF_RAZORFEN_KRAUL_H
|
||||||
|
#define DEF_RAZORFEN_KRAUL_H
|
||||||
|
|
||||||
|
#define TYPE_WARD_KEEPERS 1
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
/* 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
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ScriptData
|
||||||
|
SDName: Instance_Razorfen_Kraul
|
||||||
|
SD%Complete:
|
||||||
|
SDComment:
|
||||||
|
SDCategory: Razorfen Kraul
|
||||||
|
EndScriptData */
|
||||||
|
|
||||||
|
#include "precompiled.h"
|
||||||
|
#include "def_razorfen_kraul.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define WARD_KEEPERS_NR 2
|
||||||
|
|
||||||
|
struct TRINITY_DLL_DECL instance_razorfen_kraul : public ScriptedInstance
|
||||||
|
{
|
||||||
|
instance_razorfen_kraul(Map *map) : ScriptedInstance(map) {Initialize();};
|
||||||
|
|
||||||
|
uint64 DoorWardGUID;
|
||||||
|
uint32 WardCheck_Timer;
|
||||||
|
int WardKeeperAlive;
|
||||||
|
|
||||||
|
void Initialize()
|
||||||
|
{
|
||||||
|
WardKeeperAlive = 1;
|
||||||
|
WardCheck_Timer = 4000;
|
||||||
|
DoorWardGUID = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player* GetPlayerInMap()
|
||||||
|
{
|
||||||
|
Map::PlayerList const& players = instance->GetPlayers();
|
||||||
|
|
||||||
|
if (!players.isEmpty())
|
||||||
|
{
|
||||||
|
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||||
|
{
|
||||||
|
if (Player* plr = itr->getSource())
|
||||||
|
return plr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnObjectCreate(GameObject *go)
|
||||||
|
{
|
||||||
|
switch(go->GetEntry())
|
||||||
|
{
|
||||||
|
case 21099: DoorWardGUID = go->GetGUID(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleGameObject(uint64 guid, uint32 state)
|
||||||
|
{
|
||||||
|
Player *player = GetPlayerInMap();
|
||||||
|
|
||||||
|
if (!player || !guid)
|
||||||
|
{
|
||||||
|
debug_log("SD2: Instance Razorfen Kraul: HandleGameObject fail");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GameObject *go = GameObject::GetGameObject(*player,guid))
|
||||||
|
go->SetGoState(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update(uint32 diff)
|
||||||
|
{
|
||||||
|
if (WardCheck_Timer < diff)
|
||||||
|
{
|
||||||
|
HandleGameObject(DoorWardGUID, WardKeeperAlive);
|
||||||
|
WardKeeperAlive = 0;
|
||||||
|
WardCheck_Timer = 4000;
|
||||||
|
}else
|
||||||
|
WardCheck_Timer -= diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetData(uint32 type, uint32 data)
|
||||||
|
{
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case TYPE_WARD_KEEPERS:
|
||||||
|
if (data == NOT_STARTED)
|
||||||
|
WardKeeperAlive = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
InstanceData* GetInstanceData_instance_razorfen_kraul(Map* map)
|
||||||
|
{
|
||||||
|
return new instance_razorfen_kraul(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddSC_instance_razorfen_kraul()
|
||||||
|
{
|
||||||
|
Script *newscript;
|
||||||
|
newscript = new Script;
|
||||||
|
newscript->Name = "instance_razorfen_kraul";
|
||||||
|
newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul;
|
||||||
|
newscript->RegisterSelf();
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@ EndContentData */
|
|||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
#include "../../npc/npc_escortAI.h"
|
#include "../../npc/npc_escortAI.h"
|
||||||
|
#include "def_razorfen_kraul.h"
|
||||||
|
|
||||||
#define SAY_READY -1047000
|
#define SAY_READY -1047000
|
||||||
#define SAY_POINT -10470001
|
#define SAY_POINT -10470001
|
||||||
@@ -42,6 +43,7 @@ EndContentData */
|
|||||||
|
|
||||||
#define QUEST_WILLIX_THE_IMPORTER 1144
|
#define QUEST_WILLIX_THE_IMPORTER 1144
|
||||||
#define ENTRY_BOAR 4514
|
#define ENTRY_BOAR 4514
|
||||||
|
#define SPELL_QUILLBOAR_CHANNELING 7083
|
||||||
|
|
||||||
struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI
|
struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI
|
||||||
{
|
{
|
||||||
@@ -137,6 +139,50 @@ bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* que
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct TRINITY_DLL_DECL npc_deaths_head_ward_keeperAI : public ScriptedAI
|
||||||
|
{
|
||||||
|
npc_deaths_head_ward_keeperAI(Creature *c) : ScriptedAI(c)
|
||||||
|
{
|
||||||
|
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
ScriptedInstance *pInstance;
|
||||||
|
uint32 QuillboarChanneling_Timer;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
QuillboarChanneling_Timer = 1500;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Aggro(Unit *who)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateAI(const uint32 diff)
|
||||||
|
{
|
||||||
|
if (!m_creature->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (pInstance)
|
||||||
|
pInstance->SetData(TYPE_WARD_KEEPERS, NOT_STARTED);
|
||||||
|
|
||||||
|
if (QuillboarChanneling_Timer < diff)
|
||||||
|
{
|
||||||
|
if( m_creature->IsNonMeleeSpellCasted(false) )
|
||||||
|
m_creature->InterruptNonMeleeSpells(true);
|
||||||
|
DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING);
|
||||||
|
QuillboarChanneling_Timer = 1100;
|
||||||
|
}else QuillboarChanneling_Timer -= diff;
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature *_Creature)
|
||||||
|
{
|
||||||
|
return new npc_deaths_head_ward_keeperAI(_Creature);
|
||||||
|
}
|
||||||
|
|
||||||
CreatureAI* GetAI_npc_willix(Creature *_Creature)
|
CreatureAI* GetAI_npc_willix(Creature *_Creature)
|
||||||
{
|
{
|
||||||
npc_willixAI* thisAI = new npc_willixAI(_Creature);
|
npc_willixAI* thisAI = new npc_willixAI(_Creature);
|
||||||
@@ -201,5 +247,10 @@ void AddSC_razorfen_kraul()
|
|||||||
newscript->GetAI = &GetAI_npc_willix;
|
newscript->GetAI = &GetAI_npc_willix;
|
||||||
newscript->pQuestAccept = &QuestAccept_npc_willix;
|
newscript->pQuestAccept = &QuestAccept_npc_willix;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
|
newscript = new Script;
|
||||||
|
newscript->Name = "npc_deaths_head_ward_keeper";
|
||||||
|
newscript->GetAI = &GetAI_npc_deaths_head_ward_keeper;
|
||||||
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user