merge.
--HG-- branch : trunk
This commit is contained in:
@@ -62,7 +62,10 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
boss_moroesAI(Creature *c) : ScriptedAI(c)
|
boss_moroesAI(Creature *c) : ScriptedAI(c)
|
||||||
{
|
{
|
||||||
FirstTime = true;
|
for(int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
AddId[i] = 0;
|
||||||
|
}
|
||||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +80,6 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
uint32 CheckAdds_Timer;
|
uint32 CheckAdds_Timer;
|
||||||
uint32 AddId[4];
|
uint32 AddId[4];
|
||||||
|
|
||||||
bool FirstTime;
|
|
||||||
bool InVanish;
|
bool InVanish;
|
||||||
bool Enrage;
|
bool Enrage;
|
||||||
|
|
||||||
@@ -91,12 +93,10 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
|
|
||||||
Enrage = false;
|
Enrage = false;
|
||||||
InVanish = false;
|
InVanish = false;
|
||||||
|
if(m_creature->GetHealth() > 0)
|
||||||
|
{
|
||||||
SpawnAdds();
|
SpawnAdds();
|
||||||
|
}
|
||||||
m_creature->setFaction(16);
|
|
||||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
|
||||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
|
||||||
|
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED);
|
pInstance->SetData(DATA_MOROES_EVENT, NOT_STARTED);
|
||||||
@@ -106,6 +106,8 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
pInstance->SetData(DATA_MOROES_EVENT, IN_PROGRESS);
|
pInstance->SetData(DATA_MOROES_EVENT, IN_PROGRESS);
|
||||||
|
|
||||||
|
DoZoneInCombat();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aggro(Unit* who)
|
void Aggro(Unit* who)
|
||||||
@@ -153,27 +155,15 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 CheckAdd(uint64 guid)
|
|
||||||
{
|
|
||||||
Unit* pUnit = Unit::GetUnit((*m_creature), guid);
|
|
||||||
if (pUnit)
|
|
||||||
{
|
|
||||||
if (!pUnit->isAlive())
|
|
||||||
return 1; // Exists but is dead
|
|
||||||
else
|
|
||||||
return 2; // Exists and is alive
|
|
||||||
}
|
|
||||||
return 0; // Does not exist
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpawnAdds()
|
void SpawnAdds()
|
||||||
{
|
{
|
||||||
Creature *pCreature = NULL;
|
DeSpawnAdds();
|
||||||
|
if(isAddlistEmpty())
|
||||||
if (FirstTime)
|
|
||||||
{
|
{
|
||||||
|
Creature *pCreature = NULL;
|
||||||
std::vector<uint32> AddList;
|
std::vector<uint32> AddList;
|
||||||
|
|
||||||
|
|
||||||
for(uint8 i = 0; i < 6; ++i)
|
for(uint8 i = 0; i < 6; ++i)
|
||||||
AddList.push_back(Adds[i]);
|
AddList.push_back(Adds[i]);
|
||||||
|
|
||||||
@@ -193,48 +183,44 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
}else
|
||||||
FirstTime = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for(uint8 i = 0; i < 4; ++i)
|
for(int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
switch(CheckAdd(AddGUID[i]))
|
Creature *pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
|
||||||
if (pCreature)
|
if (pCreature)
|
||||||
|
{
|
||||||
AddGUID[i] = pCreature->GetGUID();
|
AddGUID[i] = pCreature->GetGUID();
|
||||||
break;
|
}
|
||||||
case 1:
|
}
|
||||||
pCreature = (Unit::GetCreature((*m_creature), AddGUID[i]));
|
}
|
||||||
if (pCreature)
|
}
|
||||||
|
|
||||||
|
bool isAddlistEmpty()
|
||||||
{
|
{
|
||||||
pCreature->Respawn();
|
for(int i = 0; i < 4; i++)
|
||||||
pCreature->AI()->EnterEvadeMode();
|
{
|
||||||
}
|
if(AddId[i] == 0)
|
||||||
break;
|
return true;
|
||||||
case 2:
|
|
||||||
pCreature = (Unit::GetCreature((*m_creature), AddGUID[i]));
|
|
||||||
if (!pCreature->IsInEvadeMode())
|
|
||||||
pCreature->AI()->EnterEvadeMode();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeSpawnAdds()
|
void DeSpawnAdds()
|
||||||
{
|
{
|
||||||
for(uint8 i = 0; i < 4 ; ++i)
|
for(uint8 i = 0; i < 4 ; ++i)
|
||||||
{
|
{
|
||||||
Unit* Temp = NULL;
|
Creature* Temp = NULL;
|
||||||
if (AddGUID[i])
|
if (AddGUID[i])
|
||||||
{
|
{
|
||||||
Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
|
Temp = Creature::GetCreature((*m_creature),AddGUID[i]);
|
||||||
if (Temp && Temp->isAlive())
|
if (Temp && Temp->isAlive())
|
||||||
|
{
|
||||||
|
(*Temp).GetMotionMaster()->Clear(true);
|
||||||
Temp->DealDamage(Temp, Temp->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
Temp->DealDamage(Temp, Temp->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||||
|
Temp->RemoveCorpse();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -243,13 +229,13 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
for(uint8 i = 0; i < 4; ++i)
|
for(uint8 i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
Unit* Temp = NULL;
|
Creature* Temp = NULL;
|
||||||
if (AddGUID[i])
|
if (AddGUID[i])
|
||||||
{
|
{
|
||||||
Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
|
Temp = Creature::GetCreature((*m_creature),AddGUID[i]);
|
||||||
if (Temp && Temp->isAlive())
|
if (Temp && Temp->isAlive())
|
||||||
{
|
{
|
||||||
((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
|
Temp->AI()->AttackStart(m_creature->getVictim());
|
||||||
DoZoneInCombat(Temp);
|
DoZoneInCombat(Temp);
|
||||||
}else
|
}else
|
||||||
EnterEvadeMode();
|
EnterEvadeMode();
|
||||||
@@ -295,15 +281,28 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
//Cast Vanish, then Garrote random victim
|
//Cast Vanish, then Garrote random victim
|
||||||
if (Vanish_Timer < diff)
|
if (Vanish_Timer < diff)
|
||||||
{
|
{
|
||||||
m_creature->setFaction(35);
|
|
||||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
|
||||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
|
||||||
DoCast(m_creature, SPELL_VANISH);
|
DoCast(m_creature, SPELL_VANISH);
|
||||||
InVanish = true;
|
InVanish = true;
|
||||||
Vanish_Timer = 30000;
|
Vanish_Timer = 30000;
|
||||||
Wait_Timer = 5000;
|
Wait_Timer = 5000;
|
||||||
}else Vanish_Timer -= diff;
|
}else Vanish_Timer -= diff;
|
||||||
|
|
||||||
|
if (Gouge_Timer < diff)
|
||||||
|
{
|
||||||
|
DoCast(m_creature->getVictim(), SPELL_GOUGE);
|
||||||
|
Gouge_Timer = 40000;
|
||||||
|
}else Gouge_Timer -= diff;
|
||||||
|
|
||||||
|
if (Blind_Timer < diff)
|
||||||
|
{
|
||||||
|
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 5, true);
|
||||||
|
if (target && m_creature->IsWithinMeleeRange(target))
|
||||||
|
DoCast(target, SPELL_BLIND);
|
||||||
|
|
||||||
|
Blind_Timer = 40000;
|
||||||
|
}else Blind_Timer -= diff;
|
||||||
|
}
|
||||||
|
|
||||||
if (InVanish)
|
if (InVanish)
|
||||||
{
|
{
|
||||||
if (Wait_Timer < diff)
|
if (Wait_Timer < diff)
|
||||||
@@ -317,46 +316,10 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
|||||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||||
target->CastSpell(target, SPELL_GARROTE,true);
|
target->CastSpell(target, SPELL_GARROTE,true);
|
||||||
|
|
||||||
m_creature->setFaction(16);
|
|
||||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
|
||||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
|
||||||
m_creature->AI()->AttackStart(m_creature->getVictim());
|
|
||||||
InVanish = false;
|
InVanish = false;
|
||||||
}else Wait_Timer -= diff;
|
}else Wait_Timer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Gouge highest aggro, and attack second highest
|
|
||||||
if (Gouge_Timer < diff)
|
|
||||||
{
|
|
||||||
DoCast(m_creature->getVictim(), SPELL_GOUGE);
|
|
||||||
Gouge_Timer = 40000;
|
|
||||||
}else Gouge_Timer -= diff;
|
|
||||||
|
|
||||||
if (Blind_Timer < diff)
|
|
||||||
{
|
|
||||||
Unit* target = NULL;
|
|
||||||
std::list<HostilReference*> t_list = m_creature->getThreatManager().getThreatList();
|
|
||||||
|
|
||||||
if (t_list.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
std::vector<Unit*> target_list;
|
|
||||||
for (std::list<HostilReference*>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
|
||||||
{
|
|
||||||
target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
|
|
||||||
if (target && target->GetDistance2d(m_creature) < 5)
|
|
||||||
target_list.push_back(target);
|
|
||||||
}
|
|
||||||
if (target_list.size())
|
|
||||||
target = *(target_list.begin()+rand()%target_list.size());
|
|
||||||
|
|
||||||
if (target)
|
|
||||||
DoCast(target, SPELL_BLIND);
|
|
||||||
|
|
||||||
Blind_Timer = 40000;
|
|
||||||
}else Blind_Timer -= diff;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!InVanish)
|
if (!InVanish)
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ void WorldSession::HandleGroupInviteOpcode( WorldPacket & recv_data )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restrict invite to GMs
|
||||||
|
if (!sWorld.getConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster())
|
||||||
|
{
|
||||||
|
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_CANT_FIND_TARGET);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// can't group with
|
// can't group with
|
||||||
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
if(!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include "Pet.h"
|
#include "Pet.h"
|
||||||
#include "SocialMgr.h"
|
#include "SocialMgr.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
|
void WorldSession::HandleRepopRequestOpcode( WorldPacket & /*recv_data*/ )
|
||||||
{
|
{
|
||||||
@@ -555,12 +556,13 @@ void WorldSession::HandleAddFriendOpcode( WorldPacket & recv_data )
|
|||||||
sLog.outDebug( "WORLD: %s asked to add friend : '%s'",
|
sLog.outDebug( "WORLD: %s asked to add friend : '%s'",
|
||||||
GetPlayer()->GetName(), friendName.c_str() );
|
GetPlayer()->GetName(), friendName.c_str() );
|
||||||
|
|
||||||
CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddFriendOpcodeCallBack, GetAccountId(), friendNote, "SELECT guid, race FROM characters WHERE name = '%s'", friendName.c_str());
|
CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddFriendOpcodeCallBack, GetAccountId(), friendNote, "SELECT guid, race, account FROM characters WHERE name = '%s'", friendName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 accountId, std::string friendNote)
|
void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 accountId, std::string friendNote)
|
||||||
{
|
{
|
||||||
uint64 friendGuid;
|
uint64 friendGuid;
|
||||||
|
uint64 friendAcctid;
|
||||||
uint32 team;
|
uint32 team;
|
||||||
FriendsResult friendResult;
|
FriendsResult friendResult;
|
||||||
|
|
||||||
@@ -576,9 +578,11 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||||||
{
|
{
|
||||||
friendGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
friendGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||||
team = Player::TeamForRace((*result)[1].GetUInt8());
|
team = Player::TeamForRace((*result)[1].GetUInt8());
|
||||||
|
friendAcctid = (*result)[2].GetUInt32();
|
||||||
|
|
||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
|
if ( session->GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || accmgr.GetSecurity(friendAcctid) < SEC_MODERATOR)
|
||||||
if(friendGuid)
|
if(friendGuid)
|
||||||
{
|
{
|
||||||
if(friendGuid==session->GetPlayer()->GetGUID())
|
if(friendGuid==session->GetPlayer()->GetGUID())
|
||||||
@@ -599,9 +603,8 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
|||||||
friendResult = FRIEND_LIST_FULL;
|
friendResult = FRIEND_LIST_FULL;
|
||||||
sLog.outDebug( "WORLD: %s's friend list is full.", session->GetPlayer()->GetName());
|
sLog.outDebug( "WORLD: %s's friend list is full.", session->GetPlayer()->GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
session->GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote);
|
|
||||||
}
|
}
|
||||||
|
session->GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -769,6 +769,8 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList",false);
|
m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList",false);
|
||||||
m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
|
m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
|
||||||
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
|
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
|
||||||
|
m_configs[CONFIG_ALLOW_GM_GROUP] = sConfig.GetBoolDefault("GM.AllowInvite", false);
|
||||||
|
m_configs[CONFIG_ALLOW_GM_FRIEND] = sConfig.GetBoolDefault("GM.AllowFriend", false);
|
||||||
if(m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
|
if(m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
|
||||||
{
|
{
|
||||||
sLog.outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
|
sLog.outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ enum WorldConfigs
|
|||||||
CONFIG_GM_IN_WHO_LIST,
|
CONFIG_GM_IN_WHO_LIST,
|
||||||
CONFIG_GM_LOG_TRADE,
|
CONFIG_GM_LOG_TRADE,
|
||||||
CONFIG_START_GM_LEVEL,
|
CONFIG_START_GM_LEVEL,
|
||||||
|
CONFIG_ALLOW_GM_GROUP,
|
||||||
|
CONFIG_ALLOW_GM_FRIEND,
|
||||||
CONFIG_GROUP_VISIBILITY,
|
CONFIG_GROUP_VISIBILITY,
|
||||||
CONFIG_MAIL_DELIVERY_DELAY,
|
CONFIG_MAIL_DELIVERY_DELAY,
|
||||||
CONFIG_UPTIME_UPDATE,
|
CONFIG_UPTIME_UPDATE,
|
||||||
|
|||||||
@@ -884,6 +884,15 @@ Channel.SilentlyGMJoin = 0
|
|||||||
# GM starting level (1-255)
|
# GM starting level (1-255)
|
||||||
# Default: 1
|
# Default: 1
|
||||||
#
|
#
|
||||||
|
# GM.AllowInvite
|
||||||
|
# Is GM accepting invites from players by default or not
|
||||||
|
# Default: 0 (false)
|
||||||
|
# 1 (true)
|
||||||
|
#
|
||||||
|
# GM.AllowFriend
|
||||||
|
# Are players allowed to add GMs to their friend list
|
||||||
|
# Default: 0 (false)
|
||||||
|
# 1 (true)
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
|
|
||||||
GM.LoginState = 2
|
GM.LoginState = 2
|
||||||
@@ -894,6 +903,8 @@ GM.InGMList = 0
|
|||||||
GM.InWhoList = 0
|
GM.InWhoList = 0
|
||||||
GM.LogTrade = 1
|
GM.LogTrade = 1
|
||||||
GM.StartLevel = 70
|
GM.StartLevel = 70
|
||||||
|
GM.AllowInvite = 0
|
||||||
|
GM.AllowFriend = 0
|
||||||
|
|
||||||
###################################################################################################################
|
###################################################################################################################
|
||||||
# VISIBILITY AND RADIUSES
|
# VISIBILITY AND RADIUSES
|
||||||
|
|||||||
Reference in New Issue
Block a user