aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp1
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.cpp12
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp36
-rwxr-xr-xsrc/server/game/Chat/Commands/Level0.cpp11
-rwxr-xr-xsrc/server/game/Chat/Commands/TicketCommands.cpp61
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp1
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp21
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp13
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp4
-rwxr-xr-xsrc/server/game/Groups/Group.cpp1
-rwxr-xr-xsrc/server/game/Maps/Map.cpp40
-rwxr-xr-xsrc/server/game/Maps/Map.h2
-rwxr-xr-xsrc/server/game/Miscellaneous/Language.h4
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp3
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/CharacterHandler.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/ItemHandler.cpp2
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/NPCHandler.cpp5
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp12
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp17
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp98
-rw-r--r--src/server/game/Spells/SpellInfo.cpp15
-rwxr-xr-xsrc/server/game/World/World.h3
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp2
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp208
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp4
-rw-r--r--src/server/scripts/Outland/nagrand.cpp2
-rw-r--r--src/server/scripts/World/go_scripts.cpp28
-rw-r--r--src/server/scripts/World/npcs_special.cpp179
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp2
-rwxr-xr-xsrc/server/worldserver/RemoteAccess/RASocket.cpp2
-rw-r--r--src/server/worldserver/worldserver.conf.dist3
32 files changed, 491 insertions, 305 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 06c1570ccd9..c5f04d4ff5f 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -543,7 +543,6 @@ bool npc_escortAI::GetWaypointPosition(uint32 pointId, float& x, float& y, float
if (waypoints.empty())
return false;
- ScriptPointVector::const_iterator itrEnd = waypoints.end();
for (ScriptPointVector::const_iterator itr = waypoints.begin(); itr != waypoints.end(); ++itr)
{
if (itr->uiPointId == pointId)
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 1968de70f46..244c05ec0ad 100755
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -310,18 +310,22 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
bool changeowner = (m_ownerGUID == bad->GetGUID());
WorldPacket data;
+ bool notify = !(AccountMgr::IsGMAccount(sec) && sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL));
if (ban && !IsBanned(bad->GetGUID()))
{
banned.insert(bad->GetGUID());
- MakePlayerBanned(&data, bad->GetGUID(), good);
-
UpdateChannelInDB();
+
+ if (notify)
+ MakePlayerBanned(&data, bad->GetGUID(), good);
}
- else
+ else if (notify)
MakePlayerKicked(&data, bad->GetGUID(), good);
- SendToAll(&data);
+ if (notify)
+ SendToAll(&data);
+
players.erase(bad->GetGUID());
bad->LeftChannel(this);
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index be43862eaea..185ac487481 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -303,29 +303,29 @@ ChatCommand* ChatHandler::getCommandTable()
static ChatCommand ticketResponseCommandTable[] =
{
- { "append", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketResponseAppendCommand>, "", NULL },
- { "appendln", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketResponseAppendLnCommand>, "", NULL },
+ { "append", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketResponseAppendCommand>, "", NULL },
+ { "appendln", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketResponseAppendLnCommand>, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand ticketCommandTable[] =
{
- { "list", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketListCommand>, "", NULL },
- { "onlinelist", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketListOnlineCommand>, "", NULL },
- { "viewname", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketGetByNameCommand>, "", NULL },
- { "viewid", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketGetByIdCommand>, "", NULL },
- { "close", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketCloseByIdCommand>, "", NULL },
- { "closedlist", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketListClosedCommand>, "", NULL },
- { "escalatedlist", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleGMTicketListEscalatedCommand>, "", NULL },
- { "delete", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGMTicketDeleteByIdCommand>, "", NULL },
- { "reset", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGMTicketResetCommand>, "", NULL },
- { "assign", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleGMTicketAssignToCommand>, "", NULL },
- { "unassign", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleGMTicketUnAssignCommand>, "", NULL },
- { "comment", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketCommentCommand>, "", NULL },
- { "togglesystem", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleToggleGMTicketSystem>, "", NULL },
- { "escalate", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketEscalateCommand>, "", NULL },
- { "response", SEC_MODERATOR, false, NULL, "", ticketResponseCommandTable },
- { "complete", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGMTicketCompleteCommand>, "", NULL },
+ { "list", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketListCommand>, "", NULL },
+ { "onlinelist", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketListOnlineCommand>, "", NULL },
+ { "viewname", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketGetByNameCommand>, "", NULL },
+ { "viewid", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketGetByIdCommand>, "", NULL },
+ { "close", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketCloseByIdCommand>, "", NULL },
+ { "closedlist", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketListClosedCommand>, "", NULL },
+ { "escalatedlist", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGMTicketListEscalatedCommand>, "", NULL },
+ { "delete", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleGMTicketDeleteByIdCommand>, "", NULL },
+ { "reset", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleGMTicketResetCommand>, "", NULL },
+ { "assign", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGMTicketAssignToCommand>, "", NULL },
+ { "unassign", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleGMTicketUnAssignCommand>, "", NULL },
+ { "comment", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketCommentCommand>, "", NULL },
+ { "togglesystem", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleToggleGMTicketSystem>, "", NULL },
+ { "escalate", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketEscalateCommand>, "", NULL },
+ { "response", SEC_MODERATOR, true, NULL, "", ticketResponseCommandTable },
+ { "complete", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMTicketCompleteCommand>, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index 338ad49463e..97173f75652 100755
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -84,8 +84,8 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/)
bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
{
- uint32 PlayersNum = sWorld->GetPlayerCount();
- uint32 MaxPlayersNum = sWorld->GetMaxPlayerCount();
+ uint32 playersNum = sWorld->GetPlayerCount();
+ uint32 maxPlayersNum = sWorld->GetMaxPlayerCount();
uint32 activeClientsNum = sWorld->GetActiveSessionCount();
uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
@@ -94,10 +94,13 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
uint32 updateTime = sWorld->GetUpdateTime();
SendSysMessage(_FULLVERSION);
- PSendSysMessage(LANG_CONNECTED_PLAYERS, PlayersNum, MaxPlayersNum);
+ PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
PSendSysMessage(LANG_UPTIME, uptime.c_str());
- PSendSysMessage("Update time diff: %u.", updateTime);
+ PSendSysMessage(LANG_UPDATE_DIFF, updateTime);
+ //! Can't use sWorld->ShutdownMsg here in case of console command
+ if (sWorld->IsShuttingDown())
+ PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str());
return true;
}
diff --git a/src/server/game/Chat/Commands/TicketCommands.cpp b/src/server/game/Chat/Commands/TicketCommands.cpp
index 7caf63aac2b..d38da9eb97c 100755
--- a/src/server/game/Chat/Commands/TicketCommands.cpp
+++ b/src/server/game/Chat/Commands/TicketCommands.cpp
@@ -85,12 +85,14 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
guid = player->GetGUID();
else
guid = sObjectMgr->GetPlayerGUIDByName(name);
+
// Target must exist
if (!guid)
{
SendSysMessage(LANG_NO_PLAYERS_FOUND);
return true;
}
+
// Ticket must exist
GmTicket *ticket = sTicketMgr->GetTicketByPlayer(guid);
if (!ticket)
@@ -119,27 +121,32 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
return true;
}
- // Ticket must be assigned to player, who tries to close it.
- uint64 guid = m_session->GetPlayer()->GetGUID();
- if (ticket->IsAssignedNotTo(guid))
+
+ // Ticket should be assigned to the player who tries to close it.
+ // Console can override though
+ Player* player = m_session ? m_session->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
{
PSendSysMessage(LANG_COMMAND_TICKETCANNOTCLOSE, ticket->GetId());
return true;
}
- sTicketMgr->CloseTicket(ticket->GetId(), guid);
+
+ sTicketMgr->CloseTicket(ticket->GetId(), player ? player->GetGUID() : -1);
sTicketMgr->UpdateLastChange();
- std::string msg = ticket->FormatMessageString(*this, m_session->GetPlayer()->GetName(), NULL, NULL, NULL);
+ std::string msg = ticket->FormatMessageString(*this, player ? player->GetName() : "Console", NULL, NULL, NULL);
SendGlobalGMSysMessage(msg.c_str());
// Inform player, who submitted this ticket, that it is closed
- if (Player* player = ticket->GetPlayer())
- if (player->IsInWorld())
+ if (Player* submitter = ticket->GetPlayer())
+ {
+ if (submitter->IsInWorld())
{
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
- player->GetSession()->SendPacket(&data);
+ submitter->GetSession()->SendPacket(&data);
}
+ }
return true;
}
@@ -170,25 +177,30 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
uint64 targetGuid = sObjectMgr->GetPlayerGUIDByName(target.c_str());
uint64 targetAccId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccId, realmID);
+
// Target must exist and have administrative rights
if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel))
{
SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
return true;
}
+
// If already assigned, leave
if (ticket->IsAssignedTo(targetGuid))
{
PSendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_B, ticket->GetId());
return true;
}
+
// If assigned to different player other than current, leave
- Player* player = m_session->GetPlayer();
- if (ticket->IsAssignedNotTo(player->GetGUID()))
+ //! Console can override though
+ Player* player = m_session ? m_session->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
{
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId(), target.c_str());
return true;
}
+
// Assign ticket
SQLTransaction trans = SQLTransaction(NULL);
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel));
@@ -218,6 +230,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
PSendSysMessage(LANG_COMMAND_TICKETNOTASSIGNED, ticket->GetId());
return true;
}
+
// Get security level of player, whom this ticket is assigned to
uint32 security = SEC_PLAYER;
Player* assignedPlayer = ticket->GetAssignedPlayer();
@@ -229,9 +242,11 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
uint32 accountId = sObjectMgr->GetPlayerAccountIdByGUID(guid);
security = AccountMgr::GetSecurity(accountId, realmID);
}
+
// Check security
- Player* player = m_session->GetPlayer();
- if (security > uint32(player->GetSession()->GetSecurity()))
+ //! If no m_session present it means we're issuing this command from the console
+ uint32 mySecurity = m_session ? m_session->GetSecurity() : SEC_CONSOLE;
+ if (security > mySecurity)
{
SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
return true;
@@ -242,7 +257,8 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
ticket->SaveToDB(trans);
sTicketMgr->UpdateLastChange();
- std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(), player->GetName(), NULL);
+ std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(),
+ m_session ? m_session->GetPlayer()->GetName() : "Console", NULL);
SendGlobalGMSysMessage(msg.c_str());
return true;
}
@@ -265,9 +281,11 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
return true;
}
+
// Cannot comment ticket assigned to someone else
- Player* player = m_session->GetPlayer();
- if (ticket->IsAssignedNotTo(player->GetGUID()))
+ //! Console excluded
+ Player* player = m_session ? m_session->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
{
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
return true;
@@ -279,7 +297,7 @@ bool ChatHandler::HandleGMTicketCommentCommand(const char* args)
sTicketMgr->UpdateLastChange();
std::string msg = ticket->FormatMessageString(*this, NULL, ticket->GetAssignedToName().c_str(), NULL, NULL);
- msg += PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player->GetName(), comment);
+ msg += PGetParseString(LANG_COMMAND_TICKETLISTADDCOMMENT, player ? player->GetName() : "Console", comment);
SendGlobalGMSysMessage(msg.c_str());
return true;
@@ -297,19 +315,21 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
SendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
return true;
}
+
if (!ticket->IsClosed())
{
SendSysMessage(LANG_COMMAND_TICKETCLOSEFIRST);
return true;
}
- std::string msg = ticket->FormatMessageString(*this, NULL, NULL, NULL, m_session->GetPlayer()->GetName());
+ std::string msg = ticket->FormatMessageString(*this, NULL, NULL, NULL, m_session ? m_session->GetPlayer()->GetName() : "Console");
SendGlobalGMSysMessage(msg.c_str());
sTicketMgr->RemoveTicket(ticket->GetId());
sTicketMgr->UpdateLastChange();
if (Player* player = ticket->GetPlayer())
+ {
if (player->IsInWorld())
{
// Force abandon ticket
@@ -317,6 +337,7 @@ bool ChatHandler::HandleGMTicketDeleteByIdCommand(const char* args)
data << uint32(GMTICKET_RESPONSE_TICKET_DELETED);
player->GetSession()->SendPacket(&data);
}
+ }
return true;
}
@@ -406,9 +427,11 @@ inline bool ChatHandler::_HandleGMTicketResponseAppendCommand(const char* args,
PSendSysMessage(LANG_COMMAND_TICKETNOTEXIST);
return true;
}
+
// Cannot add response to ticket, assigned to someone else
- Player* player = m_session->GetPlayer();
- if (ticket->IsAssignedNotTo(player->GetGUID()))
+ //! Console excluded
+ Player* player = m_session ? m_session->GetPlayer() : NULL;
+ if (player && ticket->IsAssignedNotTo(player->GetGUID()))
{
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId());
return true;
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 3c0af8a1bfd..afc94880812 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -864,6 +864,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
SetCreateHealth(40*petlevel);
SetCreateMana(28 + 10*petlevel);
}
+ SetBonusDamage(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) * 0.5f);
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel));
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel));
break;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 8267298b895..ff5d5c4c0e1 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -12851,6 +12851,8 @@ void Player::SwapItem(uint16 src, uint16 dst)
RemoveItem(srcbag, srcslot, true);
StoreItem(dest, pSrcItem, true);
+ if (IsBankPos(src))
+ ItemAddedQuestCheck(pSrcItem->GetEntry(), pSrcItem->GetCount());
}
else if (IsBankPos (dst))
{
@@ -12864,6 +12866,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
RemoveItem(srcbag, srcslot, true);
BankItem(dest, pSrcItem, true);
+ ItemRemovedQuestCheck(pSrcItem->GetEntry(), pSrcItem->GetCount());
}
else if (IsEquipmentPos (dst))
{
@@ -13288,11 +13291,7 @@ void Player::UpdateSoulboundTradeItems()
// also checks for garbage data
for (ItemDurationList::iterator itr = m_itemSoulboundTradeable.begin(); itr != m_itemSoulboundTradeable.end();)
{
- if (!*itr)
- {
- m_itemSoulboundTradeable.erase(itr++);
- continue;
- }
+ ASSERT(*itr);
if ((*itr)->GetOwnerGUID() != GetGUID())
{
m_itemSoulboundTradeable.erase(itr++);
@@ -13307,16 +13306,10 @@ void Player::UpdateSoulboundTradeItems()
}
}
+//TODO: should never allow an item to be added to m_itemSoulboundTradeable twice
void Player::RemoveTradeableItem(Item* item)
{
- for (ItemDurationList::iterator itr = m_itemSoulboundTradeable.begin(); itr != m_itemSoulboundTradeable.end(); ++itr)
- {
- if ((*itr) == item)
- {
- m_itemSoulboundTradeable.erase(itr);
- break;
- }
- }
+ m_itemSoulboundTradeable.remove(item);
}
void Player::UpdateItemDuration(uint32 time, bool realtimeonly)
@@ -18872,7 +18865,7 @@ void Player::_SaveSkills(SQLTransaction& trans)
void Player::_SaveSpells(SQLTransaction& trans)
{
- for (PlayerSpellMap::iterator itr = m_spells.begin(), next = m_spells.begin(); itr != m_spells.end();)
+ for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();)
{
if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED)
trans->PAppend("DELETE FROM character_spell WHERE guid = '%u' and spell = '%u'", GetGUIDLow(), itr->first);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index e53f59df2d2..4f0dd7697eb 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1934,12 +1934,7 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext
CombatStart(victim);
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MELEE_ATTACK);
- uint32 hitInfo;
- if (attType == BASE_ATTACK)
- hitInfo = HITINFO_NORMALSWING2;
- else if (attType == OFF_ATTACK)
- hitInfo = HITINFO_LEFTSWING;
- else
+ if (attType != BASE_ATTACK && attType != OFF_ATTACK)
return; // ignore ranged case
// melee attack spell casted at main hand attack only - no normal melee dmg dealt
@@ -5482,7 +5477,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case CLASS_DRUID:
RandomSpells.push_back(71484);
RandomSpells.push_back(71485);
- RandomSpells.push_back(71486);
+ RandomSpells.push_back(71492);
break;
case CLASS_HUNTER:
RandomSpells.push_back(71486);
@@ -5528,7 +5523,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case CLASS_DRUID:
RandomSpells.push_back(71561);
RandomSpells.push_back(71556);
- RandomSpells.push_back(71558);
+ RandomSpells.push_back(71560);
break;
case CLASS_HUNTER:
RandomSpells.push_back(71558);
@@ -6510,7 +6505,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
RemoveAura(57934);
if (!redirectTarget)
break;
- redirectTarget->CastSpell(this,59628,true);
+ CastSpell(this,59628,true);
CastSpell(redirectTarget,57933,true);
break;
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 030a8e559b8..18f3e1a403c 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3734,11 +3734,11 @@ void ObjectMgr::LoadQuests()
// no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check)
}
//check for proper RequiredSkillId value (skill case)
- if (int32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort)))
+ if (uint32 skill_id = SkillByQuestSort(-int32(qinfo->ZoneOrSort)))
{
if (qinfo->RequiredSkillId != skill_id)
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%i).",
+ sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id);
//override, and force proper value here?
}
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 6311066f597..11175b13114 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1121,6 +1121,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
roll->getLoot()->unlootedCount--;
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(roll->itemid);
player->AutoStoreLoot(pProto->DisenchantID, LootTemplates_Disenchant, true);
+ player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, 13262); // Disenchant
}
}
}
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 34bc5f141f2..46c0ca1d8f5 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -1528,41 +1528,28 @@ inline GridMap* Map::GetGrid(float x, float y)
return GridMaps[gx][gy];
}
-float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchDist) const
+float Map::GetHeight(float x, float y, float z, bool checkVMap /*= true*/, float maxSearchDist /*= DEFAULT_HEIGHT_SEARCH*/) const
{
// find raw .map surface under Z coordinates
- float mapHeight;
+ float mapHeight = VMAP_INVALID_HEIGHT_VALUE;
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
{
- float _mapheight = gmap->getHeight(x, y);
-
+ float gridHeight = gmap->getHeight(x, y);
// look from a bit higher pos to find the floor, ignore under surface case
- if (z + 2.0f > _mapheight)
- mapHeight = _mapheight;
- else
- mapHeight = VMAP_INVALID_HEIGHT_VALUE;
+ if (z + 2.0f > gridHeight)
+ mapHeight = gridHeight;
}
- else
- mapHeight = VMAP_INVALID_HEIGHT_VALUE;
- float vmapHeight;
- if (pUseVmaps)
+ float vmapHeight = VMAP_INVALID_HEIGHT_VALUE;
+ if (checkVMap)
{
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
if (vmgr->isHeightCalcEnabled())
- {
- // look from a bit higher pos to find the floor
- vmapHeight = vmgr->getHeight(GetId(), x, y, z + 2.0f, maxSearchDist);
- }
- else
- vmapHeight = VMAP_INVALID_HEIGHT_VALUE;
+ vmapHeight = vmgr->getHeight(GetId(), x, y, z + 2.0f, maxSearchDist); // look from a bit higher pos to find the floor
}
- else
- vmapHeight = VMAP_INVALID_HEIGHT_VALUE;
// mapHeight set for any above raw ground Z or <= INVALID_HEIGHT
// vmapheight set for any under Z value or <= INVALID_HEIGHT
-
if (vmapHeight > INVALID_HEIGHT)
{
if (mapHeight > INVALID_HEIGHT)
@@ -1579,15 +1566,8 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchD
else
return vmapHeight; // we have only vmapHeight (if have)
}
- else
- {
- if (!pUseVmaps)
- return mapHeight; // explicitly use map data (if have)
- else if (mapHeight > INVALID_HEIGHT && (z < mapHeight + 2 || z == MAX_HEIGHT))
- return mapHeight; // explicitly use map data if original z < mapHeight but map found (z+2 > mapHeight)
- else
- return VMAP_INVALID_HEIGHT_VALUE; // we not have any height
- }
+
+ return mapHeight; // explicitly use map data
}
inline bool IsOutdoorWMO(uint32 mogpFlags, int32 /*adtId*/, int32 /*rootId*/, int32 /*groupId*/, WMOAreaTableEntry const* wmoEntry, AreaTableEntry const* atEntry)
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 5b652a2524a..8c4703a9f3a 100755
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -296,7 +296,7 @@ class Map : public GridRefManager<NGridType>
// some calls like isInWater should not use vmaps due to processor power
// can return INVALID_HEIGHT if under z+2 z coord not found height
- float GetHeight(float x, float y, float z, bool pCheckVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const;
+ float GetHeight(float x, float y, float z, bool checkVMap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = 0) const;
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index ffdf0131143..a6ff663b302 100755
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -42,8 +42,8 @@ enum TrinityStrings
LANG_GMS_ON_SRV = 16,
LANG_GMS_NOT_LOGGED = 17,
LANG_YOU_IN_FLIGHT = 18,
- //LANG_YOU_IN_BATTLEGROUND = 19, not used
- //LANG_TARGET_IN_FLIGHT = 20, not used
+ LANG_UPDATE_DIFF = 19,
+ LANG_SHUTDOWN_TIMELEFT = 20,
LANG_CHAR_IN_FLIGHT = 21,
LANG_CHAR_NON_MOUNTED = 22,
LANG_YOU_IN_COMBAT = 23,
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 5bd0a23207e..09af2303397 100755
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -47,11 +47,10 @@ template<>
void
RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature)
{
- float X, Y, Z, z, nx, ny, nz, ori, dist;
+ float X, Y, Z, nx, ny, nz, ori, dist;
creature.GetHomePosition(X, Y, Z, ori);
- z = creature.GetPositionZ();
Map const* map = creature.GetBaseMap();
// For 2D/3D system selection
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index cdcacb18aab..3fb75b09a47 100755
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
@@ -1096,7 +1096,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
// show time before shutdown if shutdown planned.
- if (sWorld->IsShutdowning())
+ if (sWorld->IsShuttingDown())
sWorld->ShutdownMsg(true, pCurrChar);
if (sWorld->getBoolConfig(CONFIG_ALL_TAXI_PATHS))
diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp
index 3f301a7aba8..de1a1b08ce3 100755
--- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp
@@ -931,6 +931,7 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket)
}
_player->RemoveItem(srcbag, srcslot, true);
+ _player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount());
_player->BankItem(dest, pItem, true);
}
@@ -958,6 +959,7 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket)
_player->RemoveItem(srcbag, srcslot, true);
_player->StoreItem(dest, pItem, true);
+ _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount());
}
else // moving from inventory to bank
{
diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
index a2aa5ea3c50..27e569fe921 100755
--- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp
@@ -878,19 +878,18 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data)
// reputation discount
float discountMod = _player->GetReputationPriceDiscount(unit);
- uint32 TotalCost = 0;
if (itemGUID)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID));
Item* item = _player->GetItemByGuid(itemGUID);
if (item)
- TotalCost = _player->DurabilityRepair(item->GetPos(), true, discountMod, guildBank);
+ _player->DurabilityRepair(item->GetPos(), true, discountMod, guildBank);
}
else
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID));
- TotalCost = _player->DurabilityRepairAll(true, discountMod, guildBank);
+ _player->DurabilityRepairAll(true, discountMod, guildBank);
}
}
diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp
index a931d8a5b3d..2e9b88bd3f0 100755
--- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp
@@ -311,21 +311,17 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid)
uint64 ownerguid = 0;
uint32 type;
std::string name = "NO_NAME_FOR_GUID";
- uint8 signs = 0;
- QueryResult result = CharacterDatabase.PQuery(
- "SELECT ownerguid, name, "
- " (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs, "
- " type "
- "FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid), GUID_LOPART(petitionguid));
+ // TODO: Use CHAR_LOAD_PETITION PS
+ QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid, name, type "
+ "FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid));
if (result)
{
Field* fields = result->Fetch();
ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER);
name = fields[1].GetString();
- signs = fields[2].GetUInt8();
- type = fields[3].GetUInt32();
+ type = fields[2].GetUInt32();
}
else
{
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index f7b49ebadd4..9c4341ec59a 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -1518,7 +1518,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
spellId3 = 47180;
break;
}
- target->CastSpell(target, spellId, true, NULL, this);
+ target->CastSpell(target, spellId3, true, NULL, this);
}
// Master Shapeshifter - Cat
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
@@ -4794,8 +4794,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (Aura* newAura = target->AddAura(71564, target))
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
break;
- case 59628: // Tricks of the Trade
- target->SetReducedThreatPercent(100,caster->GetGUID());
+ case 59628: // Tricks of the Trade
+ if (!caster->GetMisdirectionTarget())
+ break;
+ target->SetReducedThreatPercent(100,caster->GetMisdirectionTarget()->GetGUID());
break;
}
}
@@ -4948,9 +4950,14 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
// Tricks of the trade
switch(GetId())
{
- case 59628:
- case 57934:
+ case 59628: //Tricks of the trade buff on rogue (6sec duration)
target->SetReducedThreatPercent(0,0);
+ break;
+ case 57934: //Tricks of the trade buff on rogue (30sec duration)
+ if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE || !caster->GetMisdirectionTarget())
+ target->SetReducedThreatPercent(0,0);
+ else
+ target->SetReducedThreatPercent(0,caster->GetMisdirectionTarget()->GetGUID());
break;
}
default:
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 865dc8c531d..de1b453ac17 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -606,57 +606,67 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
case SPELLFAMILY_ROGUE:
{
// Envenom
- if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[1] & 0x8))
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x00000008)
{
- // consume from stack dozes not more that have combo-points
- if (uint32 combo = m_caster->ToPlayer()->GetComboPoints())
+ if (Player* player = m_caster->ToPlayer())
{
- // Lookup for Deadly poison (only attacker applied)
- if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0, 0, m_caster->GetGUID()))
+ // consume from stack dozes not more that have combo-points
+ if (uint32 combo = player->GetComboPoints())
{
- // count consumed deadly poison doses at target
- bool needConsume = true;
- uint32 spellId = aurEff->GetId();
- uint32 doses = aurEff->GetBase()->GetStackAmount();
- if (doses > combo)
- doses = combo;
- // Master Poisoner
- Unit::AuraEffectList const& auraList = m_caster->ToPlayer()->GetAuraEffectsByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
- for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
+ // Lookup for Deadly poison (only attacker applied)
+ if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00010000, 0, 0, m_caster->GetGUID()))
{
- if ((*iter)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellInfo()->SpellIconID == 1960)
+ // count consumed deadly poison doses at target
+ bool needConsume = true;
+ uint32 spellId = aurEff->GetId();
+
+ uint32 doses = aurEff->GetBase()->GetStackAmount();
+ if (doses > combo)
+ doses = combo;
+
+ // Master Poisoner
+ Unit::AuraEffectList const& auraList = player->GetAuraEffectsByType(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK);
+ for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
{
- uint32 chance = (*iter)->GetSpellInfo()->Effects[EFFECT_2].CalcValue(m_caster);
+ if ((*iter)->GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && (*iter)->GetSpellInfo()->SpellIconID == 1960)
+ {
+ uint32 chance = (*iter)->GetSpellInfo()->Effects[EFFECT_2].CalcValue(m_caster);
- if (chance && roll_chance_i(chance))
- needConsume = false;
+ if (chance && roll_chance_i(chance))
+ needConsume = false;
- break;
+ break;
+ }
}
+
+ if (needConsume)
+ for (uint32 i = 0; i < doses; ++i)
+ unitTarget->RemoveAuraFromStack(spellId);
+
+ damage *= doses;
+ damage += int32(player->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * combo);
}
- if (needConsume)
- for (uint32 i = 0; i < doses; ++i)
- unitTarget->RemoveAuraFromStack(spellId);
- damage *= doses;
- damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.09f * doses);
+ // Eviscerate and Envenom Bonus Damage (item set effect)
+ if (m_caster->HasAura(37169))
+ damage += combo * 40;
}
- // Eviscerate and Envenom Bonus Damage (item set effect)
- if (m_caster->HasAura(37169))
- damage += ((Player*)m_caster)->GetComboPoints()*40;
}
}
// Eviscerate
- else if ((m_spellInfo->SpellFamilyFlags[0] & 0x00020000) && m_caster->GetTypeId() == TYPEID_PLAYER)
+ else if (m_spellInfo->SpellFamilyFlags[0] & 0x00020000)
{
- if (uint32 combo = ((Player*)m_caster)->GetComboPoints())
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
- damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
+ if (uint32 combo = ((Player*)m_caster)->GetComboPoints())
+ {
+ float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
+ damage += irand(int32(ap * combo * 0.03f), int32(ap * combo * 0.07f));
- // Eviscerate and Envenom Bonus Damage (item set effect)
- if (m_caster->HasAura(37169))
- damage += combo*40;
+ // Eviscerate and Envenom Bonus Damage (item set effect)
+ if (m_caster->HasAura(37169))
+ damage += combo*40;
+ }
}
}
break;
@@ -6180,9 +6190,13 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
if (!unitTarget)
return;
- float x, y, z;
- unitTarget->GetContactPoint(m_caster, x, y, z);
- m_caster->GetMotionMaster()->MoveCharge(x, y, z);
+ float angle = unitTarget->GetRelativeAngle(m_caster);
+ Position pos;
+
+ unitTarget->GetContactPoint(m_caster, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
+ unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetObjectSize(), angle);
+
+ m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ + unitTarget->GetObjectSize());
}
if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)
@@ -6203,9 +6217,13 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/)
if (m_targets.HasDst())
{
- float x, y, z;
- m_targets.GetDst()->GetPosition(x, y, z);
- m_caster->GetMotionMaster()->MoveCharge(x, y, z);
+ Position pos;
+ m_targets.GetDst()->GetPosition(&pos);
+ float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY());
+ float dist = m_caster->GetDistance(pos);
+ m_caster->GetFirstCollisionPosition(pos, dist, angle);
+
+ m_caster->GetMotionMaster()->MoveCharge(pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}
}
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 3edf682f5bb..8c1a7e4f4a6 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -2378,6 +2378,19 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
if (Id == 30708)
return false;
break;
+ case SPELLFAMILY_ROGUE:
+ switch (Id)
+ {
+ // Envenom must be considered as a positive effect even though it deals damage
+ case 32645: // Envenom (Rank 1)
+ case 32684: // Envenom (Rank 2)
+ case 57992: // Envenom (Rank 3)
+ case 57993: // Envenom (Rank 4)
+ return true;
+ default:
+ break;
+ }
+ break;
default:
break;
}
@@ -2675,4 +2688,4 @@ SpellCooldownsEntry const* SpellInfo::GetSpellCooldowns() const
SpellEffectEntry const* SpellEntry::GetSpellEffect(uint32 eff) const
{
return GetSpellEffectEntry(Id, eff);
-} \ No newline at end of file
+}
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 553d4037430..fd0a05f469c 100755
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -636,7 +636,8 @@ class World
void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = NULL);
/// Are we in the middle of a shutdown?
- bool IsShutdowning() const { return m_ShutdownTimer > 0; }
+ bool IsShuttingDown() const { return m_ShutdownTimer > 0; }
+ uint32 GetShutDownTimeLeft() const { return m_ShutdownTimer; }
void ShutdownServ(uint32 time, uint32 options, uint8 exitcode);
void ShutdownCancel();
void ShutdownMsg(bool show = false, Player* player = NULL);
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
index 82f16dd7784..7cbb1b91755 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
@@ -582,7 +582,7 @@ public:
{
Unit* pJaina = GetClosestCreatureWithEntry(me, NPC_JAINA, 50.0f);
if (!pJaina)
- pJaina = pJaina = me->SummonCreature(NPC_JAINA, 1895.48f, 1292.66f, 143.706f, 0.023475f, TEMPSUMMON_DEAD_DESPAWN, 180000);
+ pJaina = me->SummonCreature(NPC_JAINA, 1895.48f, 1292.66f, 143.706f, 0.023475f, TEMPSUMMON_DEAD_DESPAWN, 180000);
if (pJaina)
uiJainaGUID = pJaina->GetGUID();
bStepping = false;
diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
index 545dc79453d..e0892ffb009 100644
--- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp
@@ -91,49 +91,50 @@ public:
struct boss_anub_arakAI : public ScriptedAI
{
- boss_anub_arakAI(Creature* c) : ScriptedAI(c), lSummons(me)
+ boss_anub_arakAI(Creature* creature) : ScriptedAI(creature), Summons(me)
{
- instance = c->GetInstanceScript();
+ instance = creature->GetInstanceScript();
}
InstanceScript* instance;
- bool bChanneling;
- bool bGuardianSummoned;
- bool bVenomancerSummoned;
- bool bDatterSummoned;
- uint8 uiPhase;
- uint32 uiUndergroundPhase;
- uint32 uiCarrionBeetlesTimer;
- uint32 uiLeechingSwarmTimer;
- uint32 uiPoundTimer;
- uint32 uiSubmergeTimer;
- uint32 uiUndergroundTimer;
- uint32 uiVenomancerTimer;
- uint32 uiDatterTimer;
-
- uint32 uiImpaleTimer;
- uint32 uiImpalePhase;
- uint64 uiImpaleTarget;
-
- SummonList lSummons;
+ bool Channeling;
+ bool GuardianSummoned;
+ bool VenomancerSummoned;
+ bool DatterSummoned;
+ uint8 Phase;
+ uint32 UndergroundPhase;
+ uint32 CarrionBeetlesTimer;
+ uint32 LeechingSwarmTimer;
+ uint32 PoundTimer;
+ uint32 SubmergeTimer;
+ uint32 UndergroundTimer;
+ uint32 VenomancerTimer;
+ uint32 DatterTimer;
+ uint32 DelayTimer;
+
+ uint32 ImpaleTimer;
+ uint32 ImpalePhase;
+ uint64 ImpaleTarget;
+
+ SummonList Summons;
void Reset()
{
- uiCarrionBeetlesTimer = 8*IN_MILLISECONDS;
- uiLeechingSwarmTimer = 20*IN_MILLISECONDS;
- uiImpaleTimer = 9*IN_MILLISECONDS;
- uiPoundTimer = 15*IN_MILLISECONDS;
+ CarrionBeetlesTimer = 8*IN_MILLISECONDS;
+ LeechingSwarmTimer = 20*IN_MILLISECONDS;
+ ImpaleTimer = 9*IN_MILLISECONDS;
+ PoundTimer = 15*IN_MILLISECONDS;
- uiPhase = PHASE_MELEE;
- uiUndergroundPhase = 0;
- bChanneling = false;
- uiImpalePhase = IMPALE_PHASE_TARGET;
+ Phase = PHASE_MELEE;
+ UndergroundPhase = 0;
+ Channeling = false;
+ ImpalePhase = IMPALE_PHASE_TARGET;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
me->RemoveAura(SPELL_SUBMERGE);
- lSummons.DespawnAll();
+ Summons.DespawnAll();
if (instance)
{
@@ -147,13 +148,13 @@ public:
Position targetPos;
target->GetPosition(&targetPos);
- if (TempSummon* pImpaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS))
+ if (TempSummon* impaleTarget = me->SummonCreature(CREATURE_IMPALE_TARGET, targetPos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 6*IN_MILLISECONDS))
{
- uiImpaleTarget = pImpaleTarget->GetGUID();
- pImpaleTarget->SetReactState(REACT_PASSIVE);
- pImpaleTarget->SetDisplayId(DISPLAY_INVISIBLE);
- pImpaleTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
- return pImpaleTarget;
+ ImpaleTarget = impaleTarget->GetGUID();
+ impaleTarget->SetReactState(REACT_PASSIVE);
+ impaleTarget->SetDisplayId(DISPLAY_INVISIBLE);
+ impaleTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ return impaleTarget;
}
return NULL;
@@ -162,11 +163,15 @@ public:
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
+ DelayTimer = 0;
if (instance)
- {
- instance->SetData(DATA_ANUBARAK_EVENT, IN_PROGRESS);
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
- }
+ }
+
+ void DelayEventStart()
+ {
+ if (instance)
+ instance->SetData(DATA_ANUBARAK_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
@@ -174,41 +179,45 @@ public:
if (!UpdateVictim())
return;
- switch (uiPhase)
+ if (DelayTimer && DelayTimer > 5000)
+ DelayEventStart();
+ else DelayTimer+=diff;
+
+ switch (Phase)
{
case PHASE_UNDERGROUND:
- if (uiImpaleTimer <= diff)
+ if (ImpaleTimer <= diff)
{
- switch (uiImpalePhase)
+ switch (ImpalePhase)
{
case IMPALE_PHASE_TARGET:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
- if (Creature* pImpaleTarget = DoSummonImpaleTarget(target))
- pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true);
- uiImpaleTimer = 3*IN_MILLISECONDS;
- uiImpalePhase = IMPALE_PHASE_ATTACK;
+ if (Creature* impaleTarget = DoSummonImpaleTarget(target))
+ impaleTarget->CastSpell(impaleTarget, SPELL_IMPALE_SHAKEGROUND, true);
+ ImpaleTimer = 3*IN_MILLISECONDS;
+ ImpalePhase = IMPALE_PHASE_ATTACK;
}
break;
case IMPALE_PHASE_ATTACK:
- if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget))
+ if (Creature* impaleTarget = Unit::GetCreature(*me, ImpaleTarget))
{
- pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SPIKE, false);
- pImpaleTarget->RemoveAurasDueToSpell(SPELL_IMPALE_SHAKEGROUND);
+ impaleTarget->CastSpell(impaleTarget, SPELL_IMPALE_SPIKE, false);
+ impaleTarget->RemoveAurasDueToSpell(SPELL_IMPALE_SHAKEGROUND);
}
- uiImpalePhase = IMPALE_PHASE_DMG;
- uiImpaleTimer = 1*IN_MILLISECONDS;
+ ImpalePhase = IMPALE_PHASE_DMG;
+ ImpaleTimer = 1*IN_MILLISECONDS;
break;
case IMPALE_PHASE_DMG:
- if (Creature* pImpaleTarget = Unit::GetCreature(*me, uiImpaleTarget))
- me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true);
- uiImpalePhase = IMPALE_PHASE_TARGET;
- uiImpaleTimer = 9*IN_MILLISECONDS;
+ if (Creature* impaleTarget = Unit::GetCreature(*me, ImpaleTarget))
+ me->CastSpell(impaleTarget, DUNGEON_MODE(SPELL_IMPALE_DMG, SPELL_IMPALE_DMG_H), true);
+ ImpalePhase = IMPALE_PHASE_TARGET;
+ ImpaleTimer = 9*IN_MILLISECONDS;
break;
}
- } else uiImpaleTimer -= diff;
+ } else ImpaleTimer -= diff;
- if (!bGuardianSummoned)
+ if (!GuardianSummoned)
{
for (uint8 i = 0; i < 2; ++i)
{
@@ -218,14 +227,14 @@ public:
DoZoneInCombat(Guardian);
}
}
- bGuardianSummoned = true;
+ GuardianSummoned = true;
}
- if (!bVenomancerSummoned)
+ if (!VenomancerSummoned)
{
- if (uiVenomancerTimer <= diff)
+ if (VenomancerTimer <= diff)
{
- if (uiUndergroundPhase > 1)
+ if (UndergroundPhase > 1)
{
for (uint8 i = 0; i < 2; ++i)
{
@@ -235,16 +244,16 @@ public:
DoZoneInCombat(Venomancer);
}
}
- bVenomancerSummoned = true;
+ VenomancerSummoned = true;
}
- } else uiVenomancerTimer -= diff;
+ } else VenomancerTimer -= diff;
}
- if (!bDatterSummoned)
+ if (!DatterSummoned)
{
- if (uiDatterTimer <= diff)
+ if (DatterTimer <= diff)
{
- if (uiUndergroundPhase > 2)
+ if (UndergroundPhase > 2)
{
for (uint8 i = 0; i < 2; ++i)
{
@@ -254,71 +263,74 @@ public:
DoZoneInCombat(Datter);
}
}
- bDatterSummoned = true;
+ DatterSummoned = true;
}
- } else uiDatterTimer -= diff;
+ } else DatterTimer -= diff;
+
+ if(me->HasAura(SPELL_LEECHING_SWARM))
+ me->RemoveAurasDueToSpell(SPELL_LEECHING_SWARM);
}
- if (uiUndergroundTimer <= diff)
+ if (UndergroundTimer <= diff)
{
me->RemoveAura(SPELL_SUBMERGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
- uiPhase = PHASE_MELEE;
- } else uiUndergroundTimer -= diff;
+ Phase = PHASE_MELEE;
+ } else UndergroundTimer -= diff;
break;
case PHASE_MELEE:
- if (((uiUndergroundPhase == 0 && HealthBelowPct(75))
- || (uiUndergroundPhase == 1 && HealthBelowPct(50))
- || (uiUndergroundPhase == 2 && HealthBelowPct(25)))
+ if (((UndergroundPhase == 0 && HealthBelowPct(75))
+ || (UndergroundPhase == 1 && HealthBelowPct(50))
+ || (UndergroundPhase == 2 && HealthBelowPct(25)))
&& !me->HasUnitState(UNIT_STAT_CASTING))
{
- bGuardianSummoned = false;
- bVenomancerSummoned = false;
- bDatterSummoned = false;
+ GuardianSummoned = false;
+ VenomancerSummoned = false;
+ DatterSummoned = false;
- uiUndergroundTimer = 40*IN_MILLISECONDS;
- uiVenomancerTimer = 25*IN_MILLISECONDS;
- uiDatterTimer = 32*IN_MILLISECONDS;
+ UndergroundTimer = 40*IN_MILLISECONDS;
+ VenomancerTimer = 25*IN_MILLISECONDS;
+ DatterTimer = 32*IN_MILLISECONDS;
- uiImpalePhase = 0;
- uiImpaleTimer = 9*IN_MILLISECONDS;
+ ImpalePhase = 0;
+ ImpaleTimer = 9*IN_MILLISECONDS;
DoCast(me, SPELL_SUBMERGE, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
- uiPhase = PHASE_UNDERGROUND;
- ++uiUndergroundPhase;
+ Phase = PHASE_UNDERGROUND;
+ ++UndergroundPhase;
}
- if (bChanneling == true)
+ if (Channeling == true)
{
for (uint8 i = 0; i < 8; ++i)
DoCast(me->getVictim(), SPELL_SUMMON_CARRION_BEETLES, true);
- bChanneling = false;
+ Channeling = false;
}
- else if (uiCarrionBeetlesTimer <= diff)
+ else if (CarrionBeetlesTimer <= diff)
{
- bChanneling = true;
+ Channeling = true;
DoCastVictim(SPELL_CARRION_BEETLES);
- uiCarrionBeetlesTimer = 25*IN_MILLISECONDS;
- } else uiCarrionBeetlesTimer -= diff;
+ CarrionBeetlesTimer = 25*IN_MILLISECONDS;
+ } else CarrionBeetlesTimer -= diff;
- if (uiLeechingSwarmTimer <= diff)
+ if (LeechingSwarmTimer <= diff)
{
DoCast(me, SPELL_LEECHING_SWARM, true);
- uiLeechingSwarmTimer = 19*IN_MILLISECONDS;
- } else uiLeechingSwarmTimer -= diff;
+ LeechingSwarmTimer = 19*IN_MILLISECONDS;
+ } else LeechingSwarmTimer -= diff;
- if (uiPoundTimer <= diff)
+ if (PoundTimer <= diff)
{
if (Unit* target = me->getVictim())
{
if (Creature* pImpaleTarget = DoSummonImpaleTarget(target))
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false);
}
- uiPoundTimer = 16500;
- } else uiPoundTimer -= diff;
+ PoundTimer = 16500;
+ } else PoundTimer -= diff;
DoMeleeAttackIfReady();
break;
@@ -328,7 +340,7 @@ public:
void JustDied(Unit* /*killer*/)
{
DoScriptText(SAY_DEATH, me);
- lSummons.DespawnAll();
+ Summons.DespawnAll();
if (instance)
instance->SetData(DATA_ANUBARAK_EVENT, DONE);
}
@@ -342,7 +354,7 @@ public:
void JustSummoned(Creature* summon)
{
- lSummons.Summon(summon);
+ Summons.Summon(summon);
}
};
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
index 877971aa502..13c174a9607 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp
@@ -590,7 +590,7 @@ class boss_freya : public CreatureScript
waveCount++;
}
- void JustDied(Unit* who)
+ void JustDied(Unit* /*who*/)
{
//! Freya's chest is dynamically spawned on death by different spells.
const uint32 summonSpell[2][4] =
diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
index 4f837870612..5965c352975 100644
--- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
@@ -303,9 +303,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript
if (resetcheck_timer <= diff)
{
- uint32 tempx, tempy;
- tempx = uint32(me->GetPositionX());
- tempy = uint32(me->GetPositionY());
+ uint32 tempx = uint32(me->GetPositionX());
if (tempx > 255 || tempx < 205)
{
EnterEvadeMode();
diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp
index c556253ecf1..bae3aa65b98 100644
--- a/src/server/scripts/Outland/nagrand.cpp
+++ b/src/server/scripts/Outland/nagrand.cpp
@@ -573,7 +573,7 @@ public:
{
Talk(SAY_KUR_MORE);
- if (Creature* temp = me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0], kurenaiAmbushB[1], kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
+ if (me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0], kurenaiAmbushB[1], kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
Talk(SAY_KUR_MORE_TWO);
me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0]-2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp
index 3bb969977b6..44c3ab9bdc9 100644
--- a/src/server/scripts/World/go_scripts.cpp
+++ b/src/server/scripts/World/go_scripts.cpp
@@ -47,6 +47,7 @@ go_jotunheim_cage
go_table_theka
go_soulwell
go_bashir_crystalforge
+go_ethereal_teleport_pad
EndContentData */
#include "ScriptPCH.h"
@@ -922,6 +923,32 @@ public:
};
/*######
+## go_ethereal_teleport_pad
+######*/
+
+enum eEtherealTeleportPad
+{
+ NPC_IMAGE_WIND_TRADER = 20518,
+ ITEM_TELEPORTER_POWER_PACK = 28969,
+};
+
+class go_ethereal_teleport_pad : public GameObjectScript
+{
+public:
+ go_ethereal_teleport_pad() : GameObjectScript("go_ethereal_teleport_pad") { }
+
+ bool OnGossipHello(Player* player, GameObject* pGO)
+ {
+ if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK, 1))
+ return false;
+
+ pGO->SummonCreature(NPC_IMAGE_WIND_TRADER, pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
+
+ return true;
+ }
+};
+
+/*######
## go_soulwell
######*/
@@ -1282,6 +1309,7 @@ void AddSC_go_scripts()
new go_jotunheim_cage;
new go_table_theka;
new go_inconspicuous_landmark;
+ new go_ethereal_teleport_pad;
new go_soulwell;
new go_tadpole_cage;
new go_dragonflayer_cage;
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index a5e5b467fc7..38a56f7b64a 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -1623,46 +1623,44 @@ public:
## npc_winter_reveler
####*/
+enum WinterReveler
+{
+ SPELL_MISTLETOE_DEBUFF = 26218,
+ SPELL_CREATE_MISTLETOE = 26206,
+ SPELL_CREATE_HOLLY = 26207,
+ SPELL_CREATE_SNOWFLAKES = 45036,
+};
+
class npc_winter_reveler : public CreatureScript
{
-public:
- npc_winter_reveler() : CreatureScript("npc_winter_reveler") { }
+ public:
+ npc_winter_reveler() : CreatureScript("npc_winter_reveler") { }
- struct npc_winter_revelerAI : public ScriptedAI
- {
- npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {}
- void ReceiveEmote(Player* player, uint32 emote)
+ struct npc_winter_revelerAI : public ScriptedAI
{
- if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL))
- return;
- //TODO: check auralist.
- if (player->HasAura(26218))
- return;
+ npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {}
- if (emote == TEXT_EMOTE_KISS)
+ void ReceiveEmote(Player* player, uint32 emote)
{
- me->CastSpell(me, 26218, false);
- player->CastSpell(player, 26218, false);
- switch (urand(0, 2))
+ if (player->HasAura(SPELL_MISTLETOE_DEBUFF))
+ return;
+
+ if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL))
+ return;
+
+ if (emote == TEXT_EMOTE_KISS)
{
- case 0:
- me->CastSpell(player, 26207, false);
- break;
- case 1:
- me->CastSpell(player, 26206, false);
- break;
- case 2:
- me->CastSpell(player, 45036, false);
- break;
+ uint32 spellId = RAND<uint32>(SPELL_CREATE_MISTLETOE, SPELL_CREATE_HOLLY, SPELL_CREATE_SNOWFLAKES);
+ me->CastSpell(player, spellId, false);
+ me->CastSpell(player, SPELL_MISTLETOE_DEBUFF, false);
}
}
- }
- };
+ };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_winter_revelerAI(creature);
- }
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_winter_revelerAI(creature);
+ }
};
/*####
@@ -1678,8 +1676,6 @@ public:
#define C_VIPER 19921
-#define RAND 5
-
class npc_snake_trap : public CreatureScript
{
public:
@@ -1726,7 +1722,7 @@ public:
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
- if (!(rand() % RAND))
+ if (!(rand() % 5))
{
me->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
SpellTimer = (rand() % 10) * 100;
@@ -2164,6 +2160,121 @@ public:
};
/*######
+# npc_fire_elemental
+######*/
+#define SPELL_FIRENOVA 12470
+#define SPELL_FIRESHIELD 13376
+#define SPELL_FIREBLAST 57984
+
+class npc_fire_elemental : public CreatureScript
+{
+public:
+ npc_fire_elemental() : CreatureScript("npc_fire_elemental") { }
+
+ struct npc_fire_elementalAI : public ScriptedAI
+ {
+ npc_fire_elementalAI(Creature* creature) : ScriptedAI(creature) {}
+
+ uint32 FireNova_Timer;
+ uint32 FireShield_Timer;
+ uint32 FireBlast_Timer;
+
+ void Reset()
+ {
+ FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ FireShield_Timer = 0;
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STAT_CASTING))
+ return;
+
+ if (FireShield_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIRESHIELD);
+ FireShield_Timer = 2 * IN_MILLISECONDS;
+ }
+ else
+ FireShield_Timer -= diff;
+
+ if (FireBlast_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIREBLAST);
+ FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ FireBlast_Timer -= diff;
+
+ if (FireNova_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_FIRENOVA);
+ FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ FireNova_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_fire_elementalAI(creature);
+ }
+};
+
+/*######
+# npc_earth_elemental
+######*/
+#define SPELL_ANGEREDEARTH 36213
+
+class npc_earth_elemental : public CreatureScript
+{
+public:
+ npc_earth_elemental() : CreatureScript("npc_earth_elemental") { }
+
+ struct npc_earth_elementalAI : public ScriptedAI
+ {
+ npc_earth_elementalAI(Creature* creature) : ScriptedAI(creature) {}
+
+ uint32 AngeredEarth_Timer;
+
+ void Reset()
+ {
+ AngeredEarth_Timer = 0;
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (AngeredEarth_Timer <= diff)
+ {
+ DoCast(me->getVictim(), SPELL_ANGEREDEARTH);
+ AngeredEarth_Timer = 5000 + rand() % 15000; // 5-20 sec cd
+ }
+ else
+ AngeredEarth_Timer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI *GetAI(Creature* creature) const
+ {
+ return new npc_earth_elementalAI(creature);
+ }
+};
+
+/*######
# npc_wormhole
######*/
@@ -2673,5 +2784,7 @@ void AddSC_npcs_special()
new npc_locksmith;
new npc_tabard_vendor;
new npc_experience;
+ new npc_fire_elemental;
+ new npc_earth_elemental;
}
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 564f6028eca..61352521d9f 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -104,7 +104,7 @@ void utf8print(void* /*arg*/, const char* str)
printf(temp_buf);
#else
{
- printf(str);
+ printf("%s", str);
fflush(stdout);
}
#endif
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index 71d4d1df035..82238ee54bc 100755
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -286,7 +286,7 @@ int RASocket::subnegotiate()
if (n >= 1024)
{
- sLog->outRemote("RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", n);
+ sLog->outRemote("RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
return -1;
}
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 6cff44baca8..57fde5b8ea7 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -1745,7 +1745,8 @@ Channel.RestrictedLfg = 1
#
# Channel.SilentlyGMJoin
-# Description: Silently join GM characters to channels
+# Description: Silently join GM characters to channels. If set to 1, channel kick and ban
+# commands issued by a GM will not be broadcasted.
# Default: 0 - (Disabled, Join with announcement)
# 1 - (Enabled, Join without announcement)