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