mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 07:22:02 -04:00
*Update to Mangos 6982.
--HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@
|
||||
|
||||
DROP TABLE IF EXISTS `character_db_version`;
|
||||
CREATE TABLE `character_db_version` (
|
||||
`required_2008_12_22_19_characters_item_instance` bit(1) default NULL
|
||||
`required_6976_02_characters_character_db_version` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
||||
@@ -363,7 +363,7 @@ void AchievementMgr::CheckAllAchievementCriteria()
|
||||
*/
|
||||
void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time)
|
||||
{
|
||||
sLog.outString("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time);
|
||||
sLog.outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time);
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = objmgr.GetAchievementCriteriaByType(type);
|
||||
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "MapManager.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "AccountMgr.h"
|
||||
|
||||
bool ChatHandler::load_command_table = true;
|
||||
|
||||
@@ -668,6 +669,38 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
|
||||
return m_session->GetSecurity() >= cmd.SecurityLevel;
|
||||
}
|
||||
|
||||
bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid)
|
||||
{
|
||||
uint32 target_sec;
|
||||
|
||||
if (!sWorld.getConfig(CONFIG_GM_LOWER_SECURITY))
|
||||
return false;
|
||||
|
||||
// allow everything from RA console
|
||||
if (!m_session)
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
target_sec = target->GetSession()->GetSecurity();
|
||||
else if (guid)
|
||||
target_sec = accmgr.GetSecurity(objmgr.GetPlayerAccountIdByGUID(guid));
|
||||
else
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_session->GetSecurity() < target_sec)
|
||||
{
|
||||
SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
|
||||
SetSentErrorMessage(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChatHandler::hasStringAbbr(const char* name, const char* part)
|
||||
{
|
||||
// non "" command
|
||||
|
||||
@@ -79,6 +79,7 @@ class ChatHandler
|
||||
|
||||
virtual bool isAvailable(ChatCommand const& cmd) const;
|
||||
virtual bool needReportToTarget(Player* chr) const;
|
||||
bool HasLowerSecurity(Player* target, uint64 guid);
|
||||
|
||||
void SendGlobalSysMessage(const char *str);
|
||||
void SendGlobalGMSysMessage(const char *str);
|
||||
|
||||
@@ -113,6 +113,10 @@ bool ChatHandler::HandleNpcWhisperCommand(const char* args)
|
||||
|
||||
uint64 receiver_guid= atol(receiver_str);
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(objmgr.GetPlayer(receiver_guid), 0))
|
||||
return false;
|
||||
|
||||
pCreature->Whisper(text,receiver_guid);
|
||||
|
||||
return true;
|
||||
@@ -389,6 +393,10 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->IsBeingTeleported()==true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, chr->GetName());
|
||||
@@ -449,6 +457,10 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
||||
}
|
||||
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, guid))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_SUMMONING, name.c_str(),GetTrinityString(LANG_OFFLINE));
|
||||
|
||||
// in point where GM stay
|
||||
@@ -489,6 +501,10 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
Map* cMap = chr->GetMap();
|
||||
if(cMap->IsBattleGroundOrArena())
|
||||
{
|
||||
@@ -582,6 +598,10 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
|
||||
if (uint64 guid = objmgr.GetPlayerGUIDByName(name))
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, guid))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_APPEARING_AT, name.c_str());
|
||||
|
||||
// to point where player stay (if loaded)
|
||||
@@ -621,6 +641,10 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
||||
chr = getSelectedPlayer();
|
||||
if(!chr)
|
||||
chr = m_session->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -641,6 +665,10 @@ bool ChatHandler::HandleRecallCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
}
|
||||
|
||||
if(chr->IsBeingTeleported())
|
||||
@@ -679,6 +707,10 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
||||
for(int i=1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
@@ -728,6 +760,10 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_HP, chr->GetName(), hp, hpm);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetName(), hp, hpm);
|
||||
@@ -772,6 +808,10 @@ bool ChatHandler::HandleModifyManaCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_MANA, chr->GetName(), mana, manam);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_MANA_CHANGED, GetName(), mana, manam);
|
||||
@@ -817,6 +857,10 @@ bool ChatHandler::HandleModifyEnergyCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_ENERGY, chr->GetName(), energy/10, energym/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, GetName(), energy/10, energym/10);
|
||||
@@ -864,6 +908,10 @@ bool ChatHandler::HandleModifyRageCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_RAGE, chr->GetName(), rage/10, ragem/10);
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, GetName(), rage/10, ragem/10);
|
||||
@@ -1022,6 +1070,10 @@ bool ChatHandler::HandleModifySpellCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellflatid, val, mark, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, GetName(), spellflatid, val, mark);
|
||||
@@ -1052,6 +1104,11 @@ bool ChatHandler::HandleModifyTalentCommand (const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
player->SetFreeTalentPoints(tp);
|
||||
return true;
|
||||
}
|
||||
@@ -1076,6 +1133,10 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
|
||||
chr=m_session->GetPlayer();
|
||||
}
|
||||
|
||||
// check online security
|
||||
else if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if (argstr == "on")
|
||||
{
|
||||
chr->SetTaxiCheater(true);
|
||||
@@ -1123,6 +1184,10 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
@@ -1165,6 +1230,10 @@ bool ChatHandler::HandleModifySpeedCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
@@ -1204,6 +1273,10 @@ bool ChatHandler::HandleModifySwimCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
@@ -1243,6 +1316,10 @@ bool ChatHandler::HandleModifyBWalkCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->isInFlight())
|
||||
{
|
||||
PSendSysMessage(LANG_CHAR_IN_FLIGHT,chr->GetName());
|
||||
@@ -1282,6 +1359,10 @@ bool ChatHandler::HandleModifyFlyCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_FLY_SPEED, FSpeed, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_FLY_SPEED_CHANGED, GetName(), FSpeed);
|
||||
@@ -1313,6 +1394,10 @@ bool ChatHandler::HandleModifyScaleCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, GetName(), Scale);
|
||||
@@ -1556,6 +1641,10 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_YOU_GIVE_MOUNT, chr->GetName());
|
||||
if (needReportToTarget(chr))
|
||||
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetName());
|
||||
@@ -1593,6 +1682,10 @@ bool ChatHandler::HandleModifyMoneyCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
int32 addmoney = atoi((char*)args);
|
||||
|
||||
uint32 moneyuser = chr->GetMoney();
|
||||
@@ -1645,6 +1738,10 @@ bool ChatHandler::HandleModifyBitCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
char* pField = strtok((char*)args, " ");
|
||||
if (!pField)
|
||||
return false;
|
||||
@@ -1697,6 +1794,10 @@ bool ChatHandler::HandleModifyHonorCommand (const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
int32 amount = (uint32)atoi(args);
|
||||
|
||||
target->ModifyHonorPoints(amount);
|
||||
@@ -2053,6 +2154,9 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
||||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(chr, 0))
|
||||
return false;
|
||||
|
||||
if(chr->IsBeingTeleported()==true)
|
||||
{
|
||||
@@ -2079,6 +2183,10 @@ bool ChatHandler::HandleNameTeleCommand(const char * args)
|
||||
}
|
||||
else if (uint64 guid = objmgr.GetPlayerGUIDByName(name.c_str()))
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, guid))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_TELEPORTING_TO, name.c_str(), GetTrinityString(LANG_OFFLINE), tele->name.c_str());
|
||||
Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation,MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y),guid);
|
||||
}
|
||||
@@ -2102,6 +2210,10 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
GameTele const* tele = extractGameTeleFromLink((char*)args);
|
||||
if(!tele)
|
||||
@@ -2133,6 +2245,10 @@ bool ChatHandler::HandleGroupTeleCommand(const char * args)
|
||||
if(!pl || !pl->GetSession() )
|
||||
continue;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(pl, 0))
|
||||
return false;
|
||||
|
||||
if(pl->IsBeingTeleported())
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
||||
@@ -2182,6 +2298,10 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
Group *grp = player->GetGroup();
|
||||
|
||||
if(!grp)
|
||||
@@ -2212,6 +2332,10 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||
if(!pl || pl==m_session->GetPlayer() || !pl->GetSession() )
|
||||
continue;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(pl, 0))
|
||||
return false;
|
||||
|
||||
if(pl->IsBeingTeleported()==true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, pl->GetName());
|
||||
|
||||
+125
-69
@@ -10,12 +10,12 @@
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
@@ -563,7 +563,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)
|
||||
return false;
|
||||
|
||||
// Can be NULL at console call
|
||||
Player *target = getSelectedPlayer ();
|
||||
Player *target = getSelectedPlayer ();
|
||||
|
||||
std::string namepart = args;
|
||||
std::wstring wnamepart;
|
||||
@@ -582,12 +582,13 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)
|
||||
if (factionEntry)
|
||||
{
|
||||
FactionState const* repState = NULL;
|
||||
if(target)
|
||||
{
|
||||
FactionStateList::const_iterator repItr = target->m_factions.find (factionEntry->reputationListID);
|
||||
if(repItr != target->m_factions.end())
|
||||
repState = &repItr->second;
|
||||
}
|
||||
if(target)
|
||||
{
|
||||
FactionStateList::const_iterator repItr = target->m_factions.find (factionEntry->reputationListID);
|
||||
if(repItr != target->m_factions.end())
|
||||
repState = &repItr->second;
|
||||
}
|
||||
|
||||
|
||||
int loc = m_session ? m_session->GetSessionDbcLocale() : sWorld.GetDefaultDbcLocale();
|
||||
std::string name = factionEntry->name[loc];
|
||||
@@ -617,9 +618,9 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)
|
||||
// or "id - [faction] [no reputation]" format
|
||||
std::ostringstream ss;
|
||||
if (m_session)
|
||||
ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r";
|
||||
else
|
||||
ss << id << " - " << name << " " << localeNames[loc];
|
||||
ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << " " << localeNames[loc] << "]|h|r";
|
||||
else
|
||||
ss << id << " - " << name << " " << localeNames[loc];
|
||||
|
||||
if (repState) // and then target!=NULL also
|
||||
{
|
||||
@@ -669,6 +670,10 @@ bool ChatHandler::HandleModifyRepCommand(const char * args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
char* factionTxt = extractKeyFromLink((char*)args,"Hfaction");
|
||||
if(!factionTxt)
|
||||
return false;
|
||||
@@ -750,7 +755,7 @@ bool ChatHandler::HandleModifyRepCommand(const char * args)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleNameCommand(const char* args)
|
||||
bool ChatHandler::HandleNameCommand(const char* /*args*/)
|
||||
{
|
||||
/* Temp. disabled
|
||||
if(!*args)
|
||||
@@ -1057,7 +1062,7 @@ bool ChatHandler::HandleTurnObjectCommand(const char* args)
|
||||
float rot2 = sin(o/2);
|
||||
float rot3 = cos(o/2);
|
||||
|
||||
Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), o);
|
||||
@@ -1141,7 +1146,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
|
||||
const_cast<CreatureData*>(data)->posZ = z;
|
||||
const_cast<CreatureData*>(data)->orientation = o;
|
||||
}
|
||||
MapManager::Instance().GetMap(pCreature->GetMapId(),pCreature)->CreatureRelocation(pCreature,x, y, z,o);
|
||||
pCreature->GetMap()->CreatureRelocation(pCreature,x, y, z,o);
|
||||
pCreature->GetMotionMaster()->Initialize();
|
||||
if(pCreature->isAlive()) // dead creature will reset movement generator at respawn
|
||||
{
|
||||
@@ -1188,7 +1193,7 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
|
||||
{
|
||||
Player *chr = m_session->GetPlayer();
|
||||
|
||||
Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), obj->GetOrientation());
|
||||
@@ -1214,7 +1219,7 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(x, y, z, obj->GetOrientation());
|
||||
@@ -1240,6 +1245,11 @@ bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
|
||||
if(!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
target->DeMorph();
|
||||
|
||||
return true;
|
||||
@@ -1315,7 +1325,6 @@ bool ChatHandler::HandleDelVendorItemCommand(const char* args)
|
||||
}
|
||||
uint32 itemId = atol(pitem);
|
||||
|
||||
|
||||
if(!objmgr.RemoveVendorItem(vendor->GetEntry(),itemId))
|
||||
{
|
||||
PSendSysMessage(LANG_ITEM_NOT_IN_LIST,itemId);
|
||||
@@ -1630,6 +1639,10 @@ bool ChatHandler::HandleMorphCommand(const char* args)
|
||||
if(!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
target->SetDisplayId(display_id);
|
||||
|
||||
return true;
|
||||
@@ -1704,7 +1717,11 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
{
|
||||
|
||||
@@ -1830,6 +1847,10 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
// get additional information from Player object
|
||||
if(target)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
targetGUID = target->GetGUID();
|
||||
name = target->GetName(); // re-read for case getSelectedPlayer() target
|
||||
accId = target->GetSession()->GetAccountId();
|
||||
@@ -1841,6 +1862,11 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
// get additional information from DB
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, targetGUID))
|
||||
return false;
|
||||
|
||||
// 0
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT totaltime FROM characters WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
||||
if (!result)
|
||||
{
|
||||
@@ -1851,7 +1877,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
Field *fields = result->Fetch();
|
||||
total_player_time = fields[0].GetUInt32();
|
||||
delete result;
|
||||
|
||||
|
||||
Tokens data;
|
||||
if (!Player::LoadValuesArrayFromDB(data,targetGUID))
|
||||
{
|
||||
@@ -1859,7 +1885,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
money = Player::GetUInt32ValueFromArray(data, PLAYER_FIELD_COINAGE);
|
||||
level = Player::GetUInt32ValueFromArray(data, UNIT_FIELD_LEVEL);
|
||||
accId = objmgr.GetPlayerAccountIdByGUID(targetGUID);
|
||||
@@ -1876,8 +1902,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
Field* fields = result->Fetch();
|
||||
username = fields[0].GetCppString();
|
||||
security = fields[1].GetUInt32();
|
||||
|
||||
if(!m_session || m_session->GetSecurity() >= security)
|
||||
|
||||
if(!m_session || m_session->GetSecurity() >= security)
|
||||
{
|
||||
last_ip = fields[2].GetCppString();
|
||||
last_login = fields[3].GetCppString();
|
||||
@@ -1959,30 +1985,30 @@ bool ChatHandler::HandleTicketCommand(const char* args)
|
||||
// ticket<end>
|
||||
if (!px)
|
||||
{
|
||||
if(!m_session)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
if(!m_session)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t count = ticketmgr.GetTicketCount();
|
||||
|
||||
bool accept = m_session->GetPlayer()->isAcceptTickets();
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_TICKETCOUNT, count, accept ? GetTrinityString(LANG_ON) : GetTrinityString(LANG_OFF));
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_TICKETCOUNT, count, accept ? GetMangosString(LANG_ON) : GetMangosString(LANG_OFF));
|
||||
return true;
|
||||
}
|
||||
|
||||
// ticket on
|
||||
if(strncmp(px,"on",3) == 0)
|
||||
{
|
||||
if(!m_session)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
if(!m_session)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_session->GetPlayer()->SetAcceptTicket(true);
|
||||
SendSysMessage(LANG_COMMAND_TICKETON);
|
||||
@@ -1992,12 +2018,12 @@ bool ChatHandler::HandleTicketCommand(const char* args)
|
||||
// ticket off
|
||||
if(strncmp(px,"off",4) == 0)
|
||||
{
|
||||
if(!m_session)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
if(!m_session)
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_session->GetPlayer()->SetAcceptTicket(false);
|
||||
SendSysMessage(LANG_COMMAND_TICKETOFF);
|
||||
@@ -2081,9 +2107,7 @@ bool ChatHandler::HandleDelTicketCommand(const char *args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
delete result;
|
||||
|
||||
@@ -3131,8 +3155,8 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
delete result;
|
||||
return false;
|
||||
}
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
|
||||
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
|
||||
pCreature->LoadFromDB(pCreature->GetDBTableGUIDLow(), map);
|
||||
map->Add(pCreature);
|
||||
|
||||
@@ -3243,12 +3267,20 @@ bool ChatHandler::HandleRenameCommand(const char* args)
|
||||
|
||||
if(target)
|
||||
{
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_RENAME_PLAYER, target->GetName());
|
||||
target->SetAtLoginFlag(AT_LOGIN_RENAME);
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", target->GetGUIDLow());
|
||||
}
|
||||
else
|
||||
{
|
||||
// check offline security
|
||||
if (HasLowerSecurity(NULL, targetGUID))
|
||||
return false;
|
||||
|
||||
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldname.c_str(), GUID_LOPART(targetGUID));
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '1' WHERE guid = '%u'", GUID_LOPART(targetGUID));
|
||||
}
|
||||
@@ -3417,6 +3449,10 @@ bool ChatHandler::HandleAddHonorCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
uint32 amount = (uint32)atoi(args);
|
||||
target->RewardHonor(NULL, 1, amount);
|
||||
return true;
|
||||
@@ -3432,6 +3468,10 @@ bool ChatHandler::HandleHonorAddKillCommand(const char* /*args*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
|
||||
m_session->GetPlayer()->RewardHonor(target, 1);
|
||||
return true;
|
||||
}
|
||||
@@ -3446,6 +3486,10 @@ bool ChatHandler::HandleUpdateHonorFieldsCommand(const char* /*args*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
target->UpdateHonorFields();
|
||||
return true;
|
||||
}
|
||||
@@ -3479,12 +3523,12 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
|
||||
if (Utf8FitTo(descr, wnamepart))
|
||||
{
|
||||
char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
|
||||
|
||||
if(m_session)
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active );
|
||||
else
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active );
|
||||
char const* active = activeEvents.find(id) != activeEvents.end() ? GetMangosString(LANG_ACTIVE) : "";
|
||||
|
||||
if(m_session)
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active );
|
||||
else
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active );
|
||||
|
||||
++counter;
|
||||
}
|
||||
@@ -3511,9 +3555,9 @@ bool ChatHandler::HandleEventActiveListCommand(const char* args)
|
||||
GameEventData const& eventData = events[event_id];
|
||||
|
||||
if(m_session)
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,event_id,event_id,eventData.description.c_str(),active );
|
||||
else
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,event_id,eventData.description.c_str(),active );
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,event_id,event_id,eventData.description.c_str(),active );
|
||||
else
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,event_id,eventData.description.c_str(),active );
|
||||
|
||||
++counter;
|
||||
}
|
||||
@@ -3688,6 +3732,10 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
|
||||
player = m_session->GetPlayer();
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
player->CombatStop();
|
||||
player->getHostilRefManager().deleteReferences();
|
||||
return true;
|
||||
@@ -3814,13 +3862,13 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
||||
{
|
||||
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
std::string ip = strtok ((char*)args, " ");
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
|
||||
loginDatabase.escape_string (ip);
|
||||
|
||||
@@ -3835,8 +3883,8 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
return false;
|
||||
|
||||
std::string account = strtok ((char*)args, " ");
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
|
||||
if (!AccountMgr::normilizeString (account))
|
||||
return false;
|
||||
@@ -3850,13 +3898,13 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
{
|
||||
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
std::string email = strtok ((char*)args, " ");
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
|
||||
loginDatabase.escape_string (email);
|
||||
|
||||
@@ -3880,7 +3928,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, int32 limit)
|
||||
Field* fields = result->Fetch();
|
||||
uint32 acc_id = fields[0].GetUInt32();
|
||||
std::string acc_name = fields[1].GetCppString();
|
||||
|
||||
|
||||
QueryResult* chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
|
||||
if(chars)
|
||||
{
|
||||
@@ -3912,8 +3960,8 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult* result, int32 limit)
|
||||
/// Triggering corpses expire check in world
|
||||
bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
|
||||
{
|
||||
CorpsesErase();
|
||||
return true;
|
||||
CorpsesErase();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/)
|
||||
@@ -3925,7 +3973,11 @@ bool ChatHandler::HandleRepairitemsCommand(const char* /*args*/)
|
||||
PSendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
// Repair items
|
||||
target->DurabilityRepairAll(false, 0, false);
|
||||
@@ -3950,6 +4002,10 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
if (strncmp(args, "on", 3) == 0)
|
||||
player->SetMovement(MOVE_WATER_WALK); // ON
|
||||
else if (strncmp(args, "off", 4) == 0)
|
||||
@@ -4286,4 +4342,4 @@ bool ChatHandler::HandleActivateObjectCommand(const char *args)
|
||||
PSendSysMessage("Object activated!");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -428,7 +428,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object
|
||||
float GetDistance2d(const WorldObject* obj) const;
|
||||
float GetDistance2d(const float x, const float y) const;
|
||||
float GetDistanceZ(const WorldObject* obj) const;
|
||||
bool IsInMap(const WorldObject* obj) const { return GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
|
||||
bool IsInMap(const WorldObject* obj) const { return IsInWorld() && obj->IsInWorld() && GetMapId()==obj->GetMapId() && GetInstanceId()==obj->GetInstanceId(); }
|
||||
bool IsWithinDistInMap(const WorldObject* obj, const float dist2compare, const bool is3D = true) const;
|
||||
bool IsWithinLOS(const float x, const float y, const float z ) const;
|
||||
bool IsWithinLOSInMap(const WorldObject* obj) const;
|
||||
|
||||
@@ -290,7 +290,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/)
|
||||
float z = corpse->GetPositionZ();
|
||||
int32 corpsemapid = _player->GetMapId();
|
||||
|
||||
if(Map *map = corpse->GetMap())
|
||||
if(Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()))
|
||||
{
|
||||
if(map->IsDungeon())
|
||||
{
|
||||
|
||||
+1
-14
@@ -954,21 +954,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||
|
||||
caster->DealSpellDamage(&damageInfo, true);
|
||||
|
||||
// Shadow Word: Death - deals damage equal to damage done to caster if victim is not killed
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellInfo->SpellFamilyFlags&0x0000000200000000LL &&
|
||||
caster != unitTarget && unitTarget->isAlive())
|
||||
{
|
||||
// Redirect damage to caster if victim Alive
|
||||
damageInfo.target = caster;
|
||||
damageInfo.absorb = 0;
|
||||
damageInfo.resist = 0;
|
||||
damageInfo.blocked = 0;
|
||||
// Send log damage message to client
|
||||
caster->SendSpellNonMeleeDamageLog(&damageInfo);
|
||||
caster->DealSpellDamage(&damageInfo, true);
|
||||
}
|
||||
// Judgement of Blood
|
||||
else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags & 0x0000000800000000LL && m_spellInfo->SpellIconID==153)
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags & 0x0000000800000000LL && m_spellInfo->SpellIconID==153)
|
||||
{
|
||||
int32 damagePoint = damageInfo.damage * 33 / 100;
|
||||
m_caster->CastCustomSpell(m_caster, 32220, &damagePoint, NULL, NULL, true);
|
||||
|
||||
@@ -5636,10 +5636,10 @@ void Aura::PeriodicTick()
|
||||
data << uint32(1);
|
||||
data << uint32(m_modifier.m_auraname);
|
||||
data << (uint32)pdamage;
|
||||
data << uint32(0); // overkill
|
||||
data << (uint32)GetSpellSchoolMask(GetSpellProto()); // will be mask in 2.4.x
|
||||
data << (uint32)absorb;
|
||||
data << (uint32)resist;
|
||||
data << uint32(0); // wotlk
|
||||
m_target->SendMessageToSet(&data,true);
|
||||
|
||||
Unit* target = m_target; // aura can be deleted in DealDamage
|
||||
|
||||
@@ -436,6 +436,13 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PRIEST:
|
||||
{
|
||||
// Shadow Word: Death - deals damage equal to damage done to caster
|
||||
if (m_spellInfo->SpellFamilyFlags & 0x0000000200000000LL)
|
||||
m_caster->CastCustomSpell(m_caster, 32409, &damage, 0, 0, true);
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DRUID:
|
||||
{
|
||||
// Ferocious Bite
|
||||
|
||||
@@ -1094,7 +1094,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
|
||||
return false;
|
||||
|
||||
// Always trigger for this
|
||||
if (EventProcFlag & (PROC_FLAG_KILLED | PROC_FLAG_KILL_AND_GET_XP))
|
||||
if (EventProcFlag & (PROC_FLAG_KILLED | PROC_FLAG_KILL))
|
||||
return true;
|
||||
|
||||
if (spellProcEvent) // Exist event data
|
||||
|
||||
+1
-1
@@ -481,7 +481,7 @@ enum ProcFlags
|
||||
PROC_FLAG_NONE = 0x00000000,
|
||||
|
||||
PROC_FLAG_KILLED = 0x00000001, // 00 Killed by agressor
|
||||
PROC_FLAG_KILL_AND_GET_XP = 0x00000002, // 01 Kill that yields experience or honor
|
||||
PROC_FLAG_KILL = 0x00000002, // 01 Kill target (in most cases need XP/Honor reward)
|
||||
|
||||
PROC_FLAG_SUCCESSFUL_MILEE_HIT = 0x00000004, // 02 Successful melee auto attack
|
||||
PROC_FLAG_TAKEN_MELEE_HIT = 0x00000008, // 03 Taken damage from melee auto attack hit
|
||||
|
||||
+23
-21
@@ -670,10 +670,8 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
// call kill spell proc event (before real die and combat stop to triggering auras removed at death/combat stop)
|
||||
if(player && player!=pVictim)
|
||||
{
|
||||
if(player->RewardPlayerAndGroupAtKill(pVictim))
|
||||
player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL_AND_GET_XP, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
|
||||
else
|
||||
player->ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_KILLED,PROC_EX_NONE, 0);
|
||||
player->RewardPlayerAndGroupAtKill(pVictim);
|
||||
player->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0);
|
||||
}
|
||||
|
||||
DEBUG_LOG("DealDamageAttackStop");
|
||||
@@ -2178,7 +2176,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
}
|
||||
}
|
||||
|
||||
if(GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !((Creature*)this)->isPet() && !SpellCasted /*Only autoattack can be crushing blow*/ )
|
||||
if ((GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) && !((Creature*)this)->isPet()) &&
|
||||
!SpellCasted /*Only autoattack can be crashing blow*/ )
|
||||
{
|
||||
// mobs can score crushing blows if they're 3 or more levels above victim
|
||||
// or when their weapon skill is 15 or more above victim's defense skill
|
||||
@@ -9014,8 +9013,11 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
|
||||
int32 randomPoints = int32(spellProto->EffectDieSides[effect_index] + level * randomPointsPerLevel);
|
||||
float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index];
|
||||
|
||||
// prevent random generator from getting confused by spells casted with Unit::CastCustomSpell
|
||||
int32 randvalue = spellProto->EffectBaseDice[effect_index] >= randomPoints ? spellProto->EffectBaseDice[effect_index]:irand(spellProto->EffectBaseDice[effect_index], randomPoints);
|
||||
// range can have possitive and negative values, so order its for irand
|
||||
int32 randvalue = int32(spellProto->EffectBaseDice[effect_index]) >= randomPoints
|
||||
? irand(randomPoints, int32(spellProto->EffectBaseDice[effect_index]))
|
||||
: irand(int32(spellProto->EffectBaseDice[effect_index]), randomPoints);
|
||||
|
||||
int32 value = basePoints + randvalue;
|
||||
//random damage
|
||||
if(comboDamage != 0 && unitPlayer /*&& target && (target->GetGUID() == unitPlayer->GetComboTarget())*/)
|
||||
@@ -9862,6 +9864,7 @@ bool InitTriggerAuraData()
|
||||
isTriggerAura[i]=false;
|
||||
isNonTriggerAura[i] = false;
|
||||
}
|
||||
isTriggerAura[SPELL_AURA_PERIODIC_DAMAGE] = true;
|
||||
isTriggerAura[SPELL_AURA_DUMMY] = true;
|
||||
isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true;
|
||||
isTriggerAura[SPELL_AURA_MOD_THREAT] = true;
|
||||
@@ -9935,18 +9938,8 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
|
||||
return procEx;
|
||||
}
|
||||
|
||||
static int deep = 0;
|
||||
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage )
|
||||
{
|
||||
deep ++;
|
||||
if (deep > 5)
|
||||
{
|
||||
sLog.outError("Prevent possible stack owerflow in Unit::ProcDamageAndSpellFor");
|
||||
if (procSpell)
|
||||
sLog.outError(" Spell %u", procSpell->Id);
|
||||
deep--;
|
||||
return;
|
||||
}
|
||||
// For melee/ranged based attack need update skills and set some Aura states
|
||||
if (procFlag & MELEE_BASED_TRIGGER_MASK)
|
||||
{
|
||||
@@ -10030,7 +10023,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||
for(AuraMap::const_iterator itr = GetAuras().begin(); itr!= GetAuras().end(); ++itr)
|
||||
{
|
||||
SpellProcEventEntry const* spellProcEvent = NULL;
|
||||
if(!IsTriggeredAtSpellProcEvent(itr->second, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), spellProcEvent))
|
||||
if(!IsTriggeredAtSpellProcEvent(pTarget, itr->second, procSpell, procFlag, procExtra, attType, isVictim, (damage > 0), spellProcEvent))
|
||||
continue;
|
||||
|
||||
procTriggered.push_back( ProcTriggeredData(spellProcEvent, itr->second) );
|
||||
@@ -10208,7 +10201,6 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
|
||||
for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();i++)
|
||||
RemoveAurasDueToSpell(*i);
|
||||
}
|
||||
deep--;
|
||||
}
|
||||
|
||||
SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const
|
||||
@@ -10823,7 +10815,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
|
||||
return pet;
|
||||
}
|
||||
|
||||
bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
|
||||
bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent )
|
||||
{
|
||||
SpellEntry const* spellProto = aura->GetSpellProto ();
|
||||
|
||||
@@ -10853,7 +10845,17 @@ bool Unit::IsTriggeredAtSpellProcEvent(Aura* aura, SpellEntry const* procSpell,
|
||||
if(!SpellMgr::IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active))
|
||||
return false;
|
||||
|
||||
// Aura added by spell can`t trogger from self (prevent drop cahres/do triggers)
|
||||
// In most cases req get honor or XP from kill
|
||||
if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
bool allow = ((Player*)this)->isHonorOrXPTarget(pVictim);
|
||||
// Shadow Word: Death - can trigger from every kill
|
||||
if (aura->GetId() == 32409)
|
||||
allow = true;
|
||||
if (!allow)
|
||||
return false;
|
||||
}
|
||||
// Aura added by spell can`t trogger from self (prevent drop charges/do triggers)
|
||||
// But except periodic triggers (can triggered from self)
|
||||
if(procSpell && procSpell->Id == spellProto->Id && !(spellProto->procFlags&PROC_FLAG_ON_TAKE_PERIODIC))
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -1522,7 +1522,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
|
||||
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
|
||||
|
||||
bool IsTriggeredAtSpellProcEvent( Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
|
||||
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
|
||||
bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||
bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||
bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
|
||||
|
||||
@@ -778,6 +778,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
sLog.outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
|
||||
m_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
|
||||
}
|
||||
m_configs[CONFIG_GM_LOWER_SECURITY] = sConfig.GetBoolDefault("GM.LowerSecurity", false);
|
||||
|
||||
m_configs[CONFIG_GROUP_VISIBILITY] = sConfig.GetIntDefault("Visibility.GroupMode",0);
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ enum WorldConfigs
|
||||
CONFIG_GM_IN_WHO_LIST,
|
||||
CONFIG_GM_LOG_TRADE,
|
||||
CONFIG_START_GM_LEVEL,
|
||||
CONFIG_GM_LOWER_SECURITY,
|
||||
CONFIG_GROUP_VISIBILITY,
|
||||
CONFIG_MAIL_DELIVERY_DELAY,
|
||||
CONFIG_UPTIME_UPDATE,
|
||||
|
||||
@@ -891,6 +891,11 @@ Channel.SilentlyGMJoin = 0
|
||||
# GM starting level (1-100)
|
||||
# Default: 1
|
||||
#
|
||||
# GM.LowerSecurity
|
||||
# Disallow a lower security member to interact with a higher one using commands
|
||||
# Default: 0 (disable)
|
||||
# 1 (enable)
|
||||
#
|
||||
###################################################################################################################
|
||||
|
||||
GM.LoginState = 2
|
||||
@@ -901,6 +906,7 @@ GM.InGMList = 0
|
||||
GM.InWhoList = 0
|
||||
GM.LogTrade = 1
|
||||
GM.StartLevel = 70
|
||||
GM.LowerSecurity = 0
|
||||
|
||||
###################################################################################################################
|
||||
# VISIBILITY AND RADIUSES
|
||||
|
||||
+5
-5
@@ -36,27 +36,27 @@ static MTRandTSS mtRand;
|
||||
|
||||
int32 irand (int32 min, int32 max)
|
||||
{
|
||||
return int32 (mtRand.get ().randInt (max - min)) + min;
|
||||
return int32 (mtRand.get ().randInt (max - min)) + min;
|
||||
}
|
||||
|
||||
uint32 urand (uint32 min, uint32 max)
|
||||
{
|
||||
return mtRand.get ().randInt (max - min) + min;
|
||||
return mtRand.get ().randInt (max - min) + min;
|
||||
}
|
||||
|
||||
int32 rand32 ()
|
||||
{
|
||||
return mtRand.get ().randInt ();
|
||||
return mtRand.get ().randInt ();
|
||||
}
|
||||
|
||||
double rand_norm(void)
|
||||
{
|
||||
return mtRand.get ().randExc ();
|
||||
return mtRand.get ().randExc ();
|
||||
}
|
||||
|
||||
double rand_chance (void)
|
||||
{
|
||||
return mtRand.get ().randExc (100.0);
|
||||
return mtRand.get ().randExc (100.0);
|
||||
}
|
||||
|
||||
Tokens StrSplit(const std::string &src, const std::string &sep)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6973"
|
||||
#define REVISION_NR "6982"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user