More tabs2spaces
--HG-- branch : trunk
This commit is contained in:
@@ -22,19 +22,19 @@ typedef unsigned int uint32;
|
|||||||
class WMORoot
|
class WMORoot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootID;
|
int nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootID;
|
||||||
unsigned int col;
|
unsigned int col;
|
||||||
int bbcorn1[3];
|
int bbcorn1[3];
|
||||||
int bbcorn2[3];
|
int bbcorn2[3];
|
||||||
|
|
||||||
WMORoot(std::string &filename);
|
WMORoot(std::string &filename);
|
||||||
~WMORoot();
|
~WMORoot();
|
||||||
|
|
||||||
bool open();
|
bool open();
|
||||||
bool ConvertToVMAPRootWmo(FILE *output);
|
bool ConvertToVMAPRootWmo(FILE *output);
|
||||||
private:
|
private:
|
||||||
std::string filename;
|
std::string filename;
|
||||||
char outfilename;
|
char outfilename;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -42,66 +42,66 @@ class WMOGroup
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int offsize,flag,flag1,Xid,Xid2,Xid3,zero1,Xflag,nTexture,GroupID;
|
int offsize,flag,flag1,Xid,Xid2,Xid3,zero1,Xflag,nTexture,GroupID;
|
||||||
int mopy_size,moba_size,hlq_xverts,hlq_yverts;
|
int mopy_size,moba_size,hlq_xverts,hlq_yverts;
|
||||||
int MopyEx_size,IndexExTr_size,LiquEx_size;
|
int MopyEx_size,IndexExTr_size,LiquEx_size;
|
||||||
unsigned int nVertices; // number when loaded
|
unsigned int nVertices; // number when loaded
|
||||||
int nTriangles; // number when loaded
|
int nTriangles; // number when loaded
|
||||||
int bbcorn1[3];
|
int bbcorn1[3];
|
||||||
int bbcorn2[3];
|
int bbcorn2[3];
|
||||||
int * IndexExTr;
|
int * IndexExTr;
|
||||||
char* MOPY;
|
char* MOPY;
|
||||||
char* MopyEx;
|
char* MopyEx;
|
||||||
uint16* MOVI;
|
uint16* MOVI;
|
||||||
uint16* MoviEx;
|
uint16* MoviEx;
|
||||||
uint16* MoviExSort;
|
uint16* MoviExSort;
|
||||||
float* MOVT;
|
float* MOVT;
|
||||||
float* MovtEx;
|
float* MovtEx;
|
||||||
uint16* MovtExSort;
|
uint16* MovtExSort;
|
||||||
float* MONR;
|
float* MONR;
|
||||||
float* MonrEx;
|
float* MonrEx;
|
||||||
uint16* MOBA;
|
uint16* MOBA;
|
||||||
int* MobaEx;
|
int* MobaEx;
|
||||||
float* LiquEx;
|
float* LiquEx;
|
||||||
uint32 liquflags;
|
uint32 liquflags;
|
||||||
|
|
||||||
WMOGroup(std::string &filename);
|
WMOGroup(std::string &filename);
|
||||||
~WMOGroup();
|
~WMOGroup();
|
||||||
|
|
||||||
bool open();
|
bool open();
|
||||||
int ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData);
|
int ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string filename;
|
std::string filename;
|
||||||
char outfilename;
|
char outfilename;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WMOLiquidHeader
|
struct WMOLiquidHeader
|
||||||
{
|
{
|
||||||
int xverts, yverts, xtiles, ytiles;
|
int xverts, yverts, xtiles, ytiles;
|
||||||
float pos_x;
|
float pos_x;
|
||||||
float pos_y;
|
float pos_y;
|
||||||
float pos_z;
|
float pos_z;
|
||||||
short type;
|
short type;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WMOInstance
|
class WMOInstance
|
||||||
{
|
{
|
||||||
static std::set<int> ids;
|
static std::set<int> ids;
|
||||||
public:
|
public:
|
||||||
string MapName;
|
string MapName;
|
||||||
int currx;
|
int currx;
|
||||||
int curry;
|
int curry;
|
||||||
WMOGroup *wmo;
|
WMOGroup *wmo;
|
||||||
Vec3D pos;
|
Vec3D pos;
|
||||||
Vec3D pos2, pos3, rot;
|
Vec3D pos2, pos3, rot;
|
||||||
int indx,id, d2, d3;
|
int indx,id, d2, d3;
|
||||||
int doodadset;
|
int doodadset;
|
||||||
|
|
||||||
WMOInstance(MPQFile &f,const char* WmoInstName,const char*MapName, FILE *pDirfile);
|
WMOInstance(MPQFile &f,const char* WmoInstName,const char*MapName, FILE *pDirfile);
|
||||||
|
|
||||||
static void reset();
|
static void reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -32,133 +32,133 @@ EndContentData */
|
|||||||
## npc_professor_phizzlethorpe
|
## npc_professor_phizzlethorpe
|
||||||
######*/
|
######*/
|
||||||
|
|
||||||
#define SAY_PROGRESS_1 -1000235
|
#define SAY_PROGRESS_1 -1000235
|
||||||
#define SAY_PROGRESS_2 -1000236
|
#define SAY_PROGRESS_2 -1000236
|
||||||
#define SAY_PROGRESS_3 -1000237
|
#define SAY_PROGRESS_3 -1000237
|
||||||
#define EMOTE_PROGRESS_4 -1000238
|
#define EMOTE_PROGRESS_4 -1000238
|
||||||
#define SAY_AGGRO -1000239
|
#define SAY_AGGRO -1000239
|
||||||
#define SAY_PROGRESS_5 -1000240
|
#define SAY_PROGRESS_5 -1000240
|
||||||
#define SAY_PROGRESS_6 -1000241
|
#define SAY_PROGRESS_6 -1000241
|
||||||
#define SAY_PROGRESS_7 -1000242
|
#define SAY_PROGRESS_7 -1000242
|
||||||
#define EMOTE_PROGRESS_8 -1000243
|
#define EMOTE_PROGRESS_8 -1000243
|
||||||
#define SAY_PROGRESS_9 -1000244
|
#define SAY_PROGRESS_9 -1000244
|
||||||
|
|
||||||
#define QUEST_SUNKEN_TREASURE 665
|
#define QUEST_SUNKEN_TREASURE 665
|
||||||
#define MOB_VENGEFUL_SURGE 2776
|
#define MOB_VENGEFUL_SURGE 2776
|
||||||
|
|
||||||
struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
|
struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
|
||||||
{
|
{
|
||||||
npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();}
|
npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();}
|
||||||
|
|
||||||
bool Completed;
|
bool Completed;
|
||||||
|
|
||||||
void WaypointReached(uint32 i)
|
void WaypointReached(uint32 i)
|
||||||
{
|
{
|
||||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||||
|
|
||||||
switch(i)
|
switch(i)
|
||||||
{
|
{
|
||||||
case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break;
|
case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break;
|
||||||
case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break;
|
case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break;
|
||||||
case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break;
|
case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break;
|
||||||
case 9:
|
case 9:
|
||||||
{
|
{
|
||||||
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||||
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 10:DoScriptText(SAY_PROGRESS_5, m_creature, player);break;
|
case 10:DoScriptText(SAY_PROGRESS_5, m_creature, player);break;
|
||||||
case 11:DoScriptText(SAY_PROGRESS_6, m_creature, player);break;
|
case 11:DoScriptText(SAY_PROGRESS_6, m_creature, player);break;
|
||||||
case 19:DoScriptText(SAY_PROGRESS_7, m_creature, player); break;
|
case 19:DoScriptText(SAY_PROGRESS_7, m_creature, player); break;
|
||||||
case 20:
|
case 20:
|
||||||
DoScriptText(EMOTE_PROGRESS_8, m_creature);
|
DoScriptText(EMOTE_PROGRESS_8, m_creature);
|
||||||
DoScriptText(SAY_PROGRESS_9, m_creature, player);
|
DoScriptText(SAY_PROGRESS_9, m_creature, player);
|
||||||
Completed = true;
|
Completed = true;
|
||||||
if(player)
|
if(player)
|
||||||
((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
|
((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustSummoned(Creature *summoned)
|
void JustSummoned(Creature *summoned)
|
||||||
{
|
{
|
||||||
summoned->AI()->AttackStart(m_creature);
|
summoned->AI()->AttackStart(m_creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
Completed = true;
|
Completed = true;
|
||||||
m_creature->setFaction(35);
|
m_creature->setFaction(35);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit* who)
|
void Aggro(Unit* who)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_AGGRO, m_creature, NULL);
|
DoScriptText(SAY_AGGRO, m_creature, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* killer)
|
void JustDied(Unit* killer)
|
||||||
{
|
{
|
||||||
if (PlayerGUID && !Completed )
|
if (PlayerGUID && !Completed )
|
||||||
{
|
{
|
||||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||||
if (player)
|
if (player)
|
||||||
((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE);
|
((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
npc_escortAI::UpdateAI(diff);
|
npc_escortAI::UpdateAI(diff);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, Quest const* quest)
|
bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, Quest const* quest)
|
||||||
{
|
{
|
||||||
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
|
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_PROGRESS_1, creature, player);
|
DoScriptText(SAY_PROGRESS_1, creature, player);
|
||||||
((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID());
|
((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID());
|
||||||
creature->setFaction(113);
|
creature->setFaction(113);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature)
|
CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature)
|
||||||
{
|
{
|
||||||
npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature);
|
npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature);
|
||||||
|
|
||||||
professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08);
|
professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24);
|
professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24);
|
professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67);
|
professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000);
|
professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000);
|
professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56);
|
professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31);
|
professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000);
|
professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000);
|
professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000);
|
professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000);
|
professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31);
|
professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56);
|
professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42);
|
professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67);
|
professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24);
|
professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24);
|
professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08);
|
professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000);
|
professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000);
|
||||||
professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000);
|
professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000);
|
||||||
|
|
||||||
return (CreatureAI*)professor_phizzlethorpeAI;
|
return (CreatureAI*)professor_phizzlethorpeAI;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddSC_arathi_highlands()
|
void AddSC_arathi_highlands()
|
||||||
{
|
{
|
||||||
Script * newscript;
|
Script * newscript;
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "npc_professor_phizzlethorpe";
|
newscript->Name = "npc_professor_phizzlethorpe";
|
||||||
newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI;
|
newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI;
|
||||||
newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe;
|
newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,53 +353,53 @@ CreatureAI* GetAI_npc_time_rift(Creature *_Creature)
|
|||||||
|
|
||||||
bool GossipHello_npc_saat(Player *player, Creature *_Creature)
|
bool GossipHello_npc_saat(Player *player, Creature *_Creature)
|
||||||
{
|
{
|
||||||
if (_Creature->isQuestGiver())
|
if (_Creature->isQuestGiver())
|
||||||
player->PrepareQuestMenu(_Creature->GetGUID());
|
player->PrepareQuestMenu(_Creature->GetGUID());
|
||||||
|
|
||||||
if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1))
|
if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1))
|
||||||
{
|
{
|
||||||
player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
|
player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
|
||||||
player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1))
|
else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1))
|
||||||
{
|
{
|
||||||
player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
|
player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
|
||||||
player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID());
|
player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, uint32 action)
|
||||||
{
|
{
|
||||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||||
{
|
{
|
||||||
player->CLOSE_GOSSIP_MENU();
|
player->CLOSE_GOSSIP_MENU();
|
||||||
_Creature->CastSpell(player,SPELL_CHRONO_BEACON,false);
|
_Creature->CastSpell(player,SPELL_CHRONO_BEACON,false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddSC_dark_portal()
|
void AddSC_dark_portal()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "npc_medivh_bm";
|
newscript->Name = "npc_medivh_bm";
|
||||||
newscript->GetAI = &GetAI_npc_medivh_bm;
|
newscript->GetAI = &GetAI_npc_medivh_bm;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "npc_time_rift";
|
newscript->Name = "npc_time_rift";
|
||||||
newscript->GetAI = &GetAI_npc_time_rift;
|
newscript->GetAI = &GetAI_npc_time_rift;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "npc_saat";
|
newscript->Name = "npc_saat";
|
||||||
newscript->pGossipHello = &GossipHello_npc_saat;
|
newscript->pGossipHello = &GossipHello_npc_saat;
|
||||||
newscript->pGossipSelect = &GossipSelect_npc_saat;
|
newscript->pGossipSelect = &GossipSelect_npc_saat;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
+273
-273
@@ -36,347 +36,347 @@ inline uint32 RandRiftBoss() { return rand()%2 ? C_RKEEP : C_RLORD; }
|
|||||||
|
|
||||||
float PortalLocation[4][4]=
|
float PortalLocation[4][4]=
|
||||||
{
|
{
|
||||||
{-2041.06, 7042.08, 29.99, 1.30},
|
{-2041.06, 7042.08, 29.99, 1.30},
|
||||||
{-1968.18, 7042.11, 21.93, 2.12},
|
{-1968.18, 7042.11, 21.93, 2.12},
|
||||||
{-1885.82, 7107.36, 22.32, 3.07},
|
{-1885.82, 7107.36, 22.32, 3.07},
|
||||||
{-1928.11, 7175.95, 22.11, 3.44}
|
{-1928.11, 7175.95, 22.11, 3.44}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Wave
|
struct Wave
|
||||||
{
|
{
|
||||||
uint32 PortalBoss; //protector of current portal
|
uint32 PortalBoss; //protector of current portal
|
||||||
uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed
|
uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed
|
||||||
};
|
};
|
||||||
|
|
||||||
static Wave RiftWaves[]=
|
static Wave RiftWaves[]=
|
||||||
{
|
{
|
||||||
{RIFT_BOSS, 0},
|
{RIFT_BOSS, 0},
|
||||||
{C_DEJA, 0},
|
{C_DEJA, 0},
|
||||||
{RIFT_BOSS, 120000},
|
{RIFT_BOSS, 120000},
|
||||||
{C_TEMPO, 140000},
|
{C_TEMPO, 140000},
|
||||||
{RIFT_BOSS, 120000},
|
{RIFT_BOSS, 120000},
|
||||||
{C_AEONUS, 0}
|
{C_AEONUS, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance
|
||||||
{
|
{
|
||||||
instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();};
|
instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();};
|
||||||
|
|
||||||
uint32 Encounter[ENCOUNTERS];
|
uint32 Encounter[ENCOUNTERS];
|
||||||
|
|
||||||
uint32 mRiftPortalCount;
|
uint32 mRiftPortalCount;
|
||||||
uint32 mShieldPercent;
|
uint32 mShieldPercent;
|
||||||
uint8 mRiftWaveCount;
|
uint8 mRiftWaveCount;
|
||||||
uint8 mRiftWaveId;
|
uint8 mRiftWaveId;
|
||||||
|
|
||||||
uint32 NextPortal_Timer;
|
uint32 NextPortal_Timer;
|
||||||
|
|
||||||
uint64 MedivhGUID;
|
uint64 MedivhGUID;
|
||||||
uint8 CurrentRiftId;
|
uint8 CurrentRiftId;
|
||||||
|
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
MedivhGUID = 0;
|
MedivhGUID = 0;
|
||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||||
Encounter[i] = NOT_STARTED;
|
Encounter[i] = NOT_STARTED;
|
||||||
|
|
||||||
mRiftPortalCount = 0;
|
mRiftPortalCount = 0;
|
||||||
mShieldPercent = 100;
|
mShieldPercent = 100;
|
||||||
mRiftWaveCount = 0;
|
mRiftWaveCount = 0;
|
||||||
mRiftWaveId = 0;
|
mRiftWaveId = 0;
|
||||||
|
|
||||||
CurrentRiftId = 0;
|
CurrentRiftId = 0;
|
||||||
|
|
||||||
NextPortal_Timer = 0;
|
NextPortal_Timer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player* GetPlayerInMap()
|
Player* GetPlayerInMap()
|
||||||
{
|
{
|
||||||
Map::PlayerList const& players = instance->GetPlayers();
|
Map::PlayerList const& players = instance->GetPlayers();
|
||||||
|
|
||||||
if (!players.isEmpty())
|
if (!players.isEmpty())
|
||||||
{
|
{
|
||||||
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Player* plr = itr->getSource())
|
if (Player* plr = itr->getSource())
|
||||||
return plr;
|
return plr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
|
debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateBMWorldState(uint32 id, uint32 state)
|
void UpdateBMWorldState(uint32 id, uint32 state)
|
||||||
{
|
{
|
||||||
Map::PlayerList const& players = instance->GetPlayers();
|
Map::PlayerList const& players = instance->GetPlayers();
|
||||||
|
|
||||||
if (!players.isEmpty())
|
if (!players.isEmpty())
|
||||||
{
|
{
|
||||||
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Player* player = itr->getSource())
|
if (Player* player = itr->getSource())
|
||||||
player->SendUpdateWorldState(id,state);
|
player->SendUpdateWorldState(id,state);
|
||||||
}
|
}
|
||||||
}else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
|
}else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitWorldState(bool Enable = true)
|
void InitWorldState(bool Enable = true)
|
||||||
{
|
{
|
||||||
UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0);
|
UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0);
|
||||||
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100);
|
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100);
|
||||||
UpdateBMWorldState(WORLD_STATE_BM_RIFT,0);
|
UpdateBMWorldState(WORLD_STATE_BM_RIFT,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsEncounterInProgress()
|
bool IsEncounterInProgress()
|
||||||
{
|
{
|
||||||
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnPlayerEnter(Player *player)
|
void OnPlayerEnter(Player *player)
|
||||||
{
|
{
|
||||||
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
if (GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
player->SendUpdateWorldState(WORLD_STATE_BM,0);
|
player->SendUpdateWorldState(WORLD_STATE_BM,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
|
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
|
||||||
{
|
{
|
||||||
if (creature->GetEntry() == C_MEDIVH)
|
if (creature->GetEntry() == C_MEDIVH)
|
||||||
MedivhGUID = creature->GetGUID();
|
MedivhGUID = creature->GetGUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
//what other conditions to check?
|
//what other conditions to check?
|
||||||
bool CanProgressEvent()
|
bool CanProgressEvent()
|
||||||
{
|
{
|
||||||
if (!GetPlayerInMap())
|
if (!GetPlayerInMap())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 GetRiftWaveId()
|
uint8 GetRiftWaveId()
|
||||||
{
|
{
|
||||||
switch(mRiftPortalCount)
|
switch(mRiftPortalCount)
|
||||||
{
|
{
|
||||||
case 6:
|
case 6:
|
||||||
mRiftWaveId = 2;
|
mRiftWaveId = 2;
|
||||||
return 1;
|
return 1;
|
||||||
case 12:
|
case 12:
|
||||||
mRiftWaveId = 4;
|
mRiftWaveId = 4;
|
||||||
return 3;
|
return 3;
|
||||||
case 18:
|
case 18:
|
||||||
return 5;
|
return 5;
|
||||||
default:
|
default:
|
||||||
return mRiftWaveId;
|
return mRiftWaveId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetData(uint32 type, uint32 data)
|
void SetData(uint32 type, uint32 data)
|
||||||
{
|
{
|
||||||
Player *player = GetPlayerInMap();
|
Player *player = GetPlayerInMap();
|
||||||
|
|
||||||
if (!player)
|
if (!player)
|
||||||
{
|
{
|
||||||
debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
|
debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case TYPE_MEDIVH:
|
case TYPE_MEDIVH:
|
||||||
if (data == SPECIAL && Encounter[0] == IN_PROGRESS)
|
if (data == SPECIAL && Encounter[0] == IN_PROGRESS)
|
||||||
{
|
{
|
||||||
--mShieldPercent;
|
--mShieldPercent;
|
||||||
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent);
|
UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent);
|
||||||
|
|
||||||
if (!mShieldPercent)
|
if (!mShieldPercent)
|
||||||
{
|
{
|
||||||
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
||||||
{
|
{
|
||||||
if (medivh->isAlive())
|
if (medivh->isAlive())
|
||||||
{
|
{
|
||||||
medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
Encounter[0] = FAIL;
|
Encounter[0] = FAIL;
|
||||||
Encounter[1] = NOT_STARTED;
|
Encounter[1] = NOT_STARTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (data == IN_PROGRESS)
|
if (data == IN_PROGRESS)
|
||||||
{
|
{
|
||||||
debug_log("SD2: Instance Dark Portal: Starting event.");
|
debug_log("SD2: Instance Dark Portal: Starting event.");
|
||||||
InitWorldState();
|
InitWorldState();
|
||||||
Encounter[1] = IN_PROGRESS;
|
Encounter[1] = IN_PROGRESS;
|
||||||
NextPortal_Timer = 15000;
|
NextPortal_Timer = 15000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data == DONE)
|
if (data == DONE)
|
||||||
{
|
{
|
||||||
//this may be completed further out in the post-event
|
//this may be completed further out in the post-event
|
||||||
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
||||||
{
|
{
|
||||||
player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh);
|
player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh);
|
||||||
player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh);
|
player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Encounter[0] = data;
|
Encounter[0] = data;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TYPE_RIFT:
|
case TYPE_RIFT:
|
||||||
if (data == SPECIAL)
|
if (data == SPECIAL)
|
||||||
{
|
{
|
||||||
if (mRiftPortalCount < 7)
|
if (mRiftPortalCount < 7)
|
||||||
NextPortal_Timer = 5000;
|
NextPortal_Timer = 5000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Encounter[1] = data;
|
Encounter[1] = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 GetData(uint32 type)
|
uint32 GetData(uint32 type)
|
||||||
{
|
{
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case TYPE_MEDIVH:
|
case TYPE_MEDIVH:
|
||||||
return Encounter[0];
|
return Encounter[0];
|
||||||
case TYPE_RIFT:
|
case TYPE_RIFT:
|
||||||
return Encounter[1];
|
return Encounter[1];
|
||||||
case DATA_PORTAL_COUNT:
|
case DATA_PORTAL_COUNT:
|
||||||
return mRiftPortalCount;
|
return mRiftPortalCount;
|
||||||
case DATA_SHIELD:
|
case DATA_SHIELD:
|
||||||
return mShieldPercent;
|
return mShieldPercent;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 GetData64(uint32 data)
|
uint64 GetData64(uint32 data)
|
||||||
{
|
{
|
||||||
if (data == DATA_MEDIVH)
|
if (data == DATA_MEDIVH)
|
||||||
return MedivhGUID;
|
return MedivhGUID;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unit* SummonedPortalBoss(Unit* source)
|
Unit* SummonedPortalBoss(Unit* source)
|
||||||
{
|
{
|
||||||
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
|
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
|
||||||
if (entry == RIFT_BOSS)
|
if (entry == RIFT_BOSS)
|
||||||
entry = RandRiftBoss();
|
entry = RandRiftBoss();
|
||||||
|
|
||||||
float x,y,z;
|
float x,y,z;
|
||||||
source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z);
|
source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z);
|
||||||
//normalize Z-level if we can, if rift is not at ground level.
|
//normalize Z-level if we can, if rift is not at ground level.
|
||||||
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
|
z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y));
|
||||||
|
|
||||||
debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry);
|
debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry);
|
||||||
|
|
||||||
Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(),
|
Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(),
|
||||||
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||||
|
|
||||||
if (Summon)
|
if (Summon)
|
||||||
return Summon;
|
return Summon;
|
||||||
|
|
||||||
debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
|
debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun...");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoSpawnPortal()
|
void DoSpawnPortal()
|
||||||
{
|
{
|
||||||
Player *player = GetPlayerInMap();
|
Player *player = GetPlayerInMap();
|
||||||
if (!player)
|
if (!player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID))
|
||||||
{
|
{
|
||||||
for(uint8 i = 0; i < 4; i++)
|
for(uint8 i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
int tmp = rand()%4;
|
int tmp = rand()%4;
|
||||||
if (tmp != CurrentRiftId)
|
if (tmp != CurrentRiftId)
|
||||||
{
|
{
|
||||||
debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
|
debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId);
|
||||||
|
|
||||||
CurrentRiftId = tmp;
|
CurrentRiftId = tmp;
|
||||||
|
|
||||||
Unit *temp = medivh->SummonCreature(C_TIME_RIFT,
|
Unit *temp = medivh->SummonCreature(C_TIME_RIFT,
|
||||||
PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3],
|
PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3],
|
||||||
TEMPSUMMON_CORPSE_DESPAWN,0);
|
TEMPSUMMON_CORPSE_DESPAWN,0);
|
||||||
if (temp)
|
if (temp)
|
||||||
{
|
{
|
||||||
|
|
||||||
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||||
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||||
|
|
||||||
|
|
||||||
if (Unit* boss = SummonedPortalBoss(temp))
|
if (Unit* boss = SummonedPortalBoss(temp))
|
||||||
{
|
{
|
||||||
if (boss->GetEntry() == C_AEONUS)
|
if (boss->GetEntry() == C_AEONUS)
|
||||||
{
|
{
|
||||||
boss->AddThreat(medivh,0.0f);
|
boss->AddThreat(medivh,0.0f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boss->AddThreat(temp,0.0f);
|
boss->AddThreat(temp,0.0f);
|
||||||
temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false);
|
temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update(uint32 diff)
|
void Update(uint32 diff)
|
||||||
{
|
{
|
||||||
if (Encounter[1] != IN_PROGRESS)
|
if (Encounter[1] != IN_PROGRESS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//add delay timer?
|
//add delay timer?
|
||||||
if (!CanProgressEvent())
|
if (!CanProgressEvent())
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NextPortal_Timer)
|
if (NextPortal_Timer)
|
||||||
{
|
{
|
||||||
if (NextPortal_Timer < diff)
|
if (NextPortal_Timer < diff)
|
||||||
{
|
{
|
||||||
++mRiftPortalCount;
|
++mRiftPortalCount;
|
||||||
UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount);
|
UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount);
|
||||||
|
|
||||||
DoSpawnPortal();
|
DoSpawnPortal();
|
||||||
NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime;
|
NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime;
|
||||||
}else NextPortal_Timer -= diff;
|
}else NextPortal_Timer -= diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
InstanceData* GetInstanceData_instance_dark_portal(Map* map)
|
InstanceData* GetInstanceData_instance_dark_portal(Map* map)
|
||||||
{
|
{
|
||||||
return new instance_dark_portal(map);
|
return new instance_dark_portal(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddSC_instance_dark_portal()
|
void AddSC_instance_dark_portal()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "instance_dark_portal";
|
newscript->Name = "instance_dark_portal";
|
||||||
newscript->GetInstanceData = &GetInstanceData_instance_dark_portal;
|
newscript->GetInstanceData = &GetInstanceData_instance_dark_portal;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,5 +306,5 @@ void AddSC_boss_onyxia()
|
|||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name="boss_onyxia";
|
newscript->Name="boss_onyxia";
|
||||||
newscript->GetAI = &GetAI_boss_onyxiaAI;
|
newscript->GetAI = &GetAI_boss_onyxiaAI;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,158 +47,158 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI
|
|||||||
{
|
{
|
||||||
npc_willixAI(Creature *c) : npc_escortAI(c) {Reset();}
|
npc_willixAI(Creature *c) : npc_escortAI(c) {Reset();}
|
||||||
|
|
||||||
void WaypointReached(uint32 i)
|
void WaypointReached(uint32 i)
|
||||||
{
|
{
|
||||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||||
|
|
||||||
if (!player)
|
if (!player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 3:
|
case 3:
|
||||||
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
|
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
|
||||||
DoScriptText(SAY_POINT, m_creature, player);
|
DoScriptText(SAY_POINT, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
DoScriptText(SAY_BLUELEAF, m_creature, player);
|
DoScriptText(SAY_BLUELEAF, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
DoScriptText(SAY_DANGER, m_creature, player);
|
DoScriptText(SAY_DANGER, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
DoScriptText(SAY_BAD, m_creature, player);
|
DoScriptText(SAY_BAD, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
DoScriptText(SAY_THINK, m_creature, player);
|
DoScriptText(SAY_THINK, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
DoScriptText(SAY_SOON, m_creature, player);
|
DoScriptText(SAY_SOON, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 42:
|
case 42:
|
||||||
DoScriptText(SAY_FINALY, m_creature, player);
|
DoScriptText(SAY_FINALY, m_creature, player);
|
||||||
break;
|
break;
|
||||||
case 43:
|
case 43:
|
||||||
m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||||
break;
|
break;
|
||||||
case 45:
|
case 45:
|
||||||
DoScriptText(SAY_WIN, m_creature, player);
|
DoScriptText(SAY_WIN, m_creature, player);
|
||||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||||
((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
|
((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
|
||||||
break;
|
break;
|
||||||
case 46:
|
case 46:
|
||||||
DoScriptText(SAY_END, m_creature, player);
|
DoScriptText(SAY_END, m_creature, player);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset() {}
|
void Reset() {}
|
||||||
|
|
||||||
void Aggro(Unit* who)
|
void Aggro(Unit* who)
|
||||||
{
|
{
|
||||||
DoScriptText(SAY_AGGRO1, m_creature, NULL);
|
DoScriptText(SAY_AGGRO1, m_creature, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustSummoned(Creature* summoned)
|
void JustSummoned(Creature* summoned)
|
||||||
{
|
{
|
||||||
summoned->AI()->AttackStart(m_creature);
|
summoned->AI()->AttackStart(m_creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustDied(Unit* killer)
|
void JustDied(Unit* killer)
|
||||||
{
|
{
|
||||||
if (PlayerGUID)
|
if (PlayerGUID)
|
||||||
{
|
{
|
||||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||||
((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
|
((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
npc_escortAI::UpdateAI(diff);
|
npc_escortAI::UpdateAI(diff);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* quest)
|
bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* quest)
|
||||||
{
|
{
|
||||||
if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER)
|
if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER)
|
||||||
{
|
{
|
||||||
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
|
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
|
||||||
DoScriptText(SAY_READY, creature, player);
|
DoScriptText(SAY_READY, creature, player);
|
||||||
creature->setFaction(113);
|
creature->setFaction(113);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000);
|
thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000);
|
||||||
thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45);
|
thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45);
|
||||||
thisAI->AddWaypoint(2, 2187, 1843.49, 59.33);
|
thisAI->AddWaypoint(2, 2187, 1843.49, 59.33);
|
||||||
thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000);
|
thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000);
|
||||||
thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000);
|
thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000);
|
||||||
thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32);
|
thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32);
|
||||||
thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85);
|
thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85);
|
||||||
thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13);
|
thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13);
|
||||||
thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000);
|
thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000);
|
||||||
thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000);
|
thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000);
|
||||||
thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27);
|
thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27);
|
||||||
thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85);
|
thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85);
|
||||||
thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71);
|
thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71);
|
||||||
thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000);
|
thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000);
|
||||||
thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000);
|
thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000);
|
||||||
thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74);
|
thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74);
|
||||||
thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41);
|
thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41);
|
||||||
thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27);
|
thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27);
|
||||||
thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92);
|
thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92);
|
||||||
thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42);
|
thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42);
|
||||||
thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70);
|
thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70);
|
||||||
thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24);
|
thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24);
|
||||||
thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21);
|
thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21);
|
||||||
thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24);
|
thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24);
|
||||||
thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24);
|
thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24);
|
||||||
thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000);
|
thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000);
|
||||||
thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26);
|
thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26);
|
||||||
thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89);
|
thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89);
|
||||||
thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40);
|
thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40);
|
||||||
thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35);
|
thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35);
|
||||||
thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65);
|
thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65);
|
||||||
thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70);
|
thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70);
|
||||||
thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79);
|
thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79);
|
||||||
thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8);
|
thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8);
|
||||||
thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93);
|
thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93);
|
||||||
thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44);
|
thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44);
|
||||||
thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11);
|
thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11);
|
||||||
thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57);
|
thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57);
|
||||||
thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62);
|
thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62);
|
||||||
thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22);
|
thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22);
|
||||||
thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39);
|
thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39);
|
||||||
thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000);
|
thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000);
|
||||||
thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000);
|
thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000);
|
||||||
thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000);
|
thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000);
|
||||||
thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18);
|
thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18);
|
||||||
thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000);
|
thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000);
|
||||||
thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000);
|
thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000);
|
||||||
|
|
||||||
return (CreatureAI*)thisAI;
|
return (CreatureAI*)thisAI;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddSC_razorfen_kraul()
|
void AddSC_razorfen_kraul()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
|
|
||||||
newscript = new Script;
|
newscript = new Script;
|
||||||
newscript->Name = "npc_willix";
|
newscript->Name = "npc_willix";
|
||||||
newscript->GetAI = &GetAI_npc_willix;
|
newscript->GetAI = &GetAI_npc_willix;
|
||||||
newscript->pQuestAccept = &QuestAccept_npc_willix;
|
newscript->pQuestAccept = &QuestAccept_npc_willix;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
#define DATA_WHITEMANE 3
|
#define DATA_WHITEMANE 3
|
||||||
#define DATA_DOOR_WHITEMANE 4
|
#define DATA_DOOR_WHITEMANE 4
|
||||||
|
|
||||||
#define DATA_HORSEMAN_EVENT 5
|
#define DATA_HORSEMAN_EVENT 5
|
||||||
#define GAMEOBJECT_PUMPKIN_SHRINE 6
|
#define GAMEOBJECT_PUMPKIN_SHRINE 6
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+12
-12
@@ -7566,35 +7566,35 @@ CreatureInfo const *GetCreatureInfo(uint32 id)
|
|||||||
void ObjectMgr::LoadTransportEvents()
|
void ObjectMgr::LoadTransportEvents()
|
||||||
{
|
{
|
||||||
|
|
||||||
QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events");
|
QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events");
|
||||||
|
|
||||||
if( !result )
|
if( !result )
|
||||||
{
|
{
|
||||||
barGoLink bar1( 1 );
|
barGoLink bar1( 1 );
|
||||||
bar1.step();
|
bar1.step();
|
||||||
sLog.outString( "\n>> Transport events table is empty \n" );
|
sLog.outString( "\n>> Transport events table is empty \n" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
barGoLink bar1( result->GetRowCount() );
|
barGoLink bar1( result->GetRowCount() );
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bar1.step();
|
bar1.step();
|
||||||
|
|
||||||
Field *fields = result->Fetch();
|
Field *fields = result->Fetch();
|
||||||
|
|
||||||
//Load event values
|
//Load event values
|
||||||
uint32 entry = fields[0].GetUInt32();
|
uint32 entry = fields[0].GetUInt32();
|
||||||
uint32 waypoint_id = fields[1].GetUInt32();
|
uint32 waypoint_id = fields[1].GetUInt32();
|
||||||
uint32 event_id = fields[2].GetUInt32();
|
uint32 event_id = fields[2].GetUInt32();
|
||||||
|
|
||||||
uint32 event_count = (entry*100)+waypoint_id;
|
uint32 event_count = (entry*100)+waypoint_id;
|
||||||
TransportEventMap[event_count] = event_id;
|
TransportEventMap[event_count] = event_id;
|
||||||
}
|
}
|
||||||
while(result->NextRow());
|
while(result->NextRow());
|
||||||
|
|
||||||
sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() );
|
sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() );
|
||||||
|
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user