Merge commit 'origin/master' into 310

Conflicts:
	src/game/SpellAuras.cpp
This commit is contained in:
tomrus88 2009-05-31 12:16:25 +04:00
commit cae3f0a532
53 changed files with 1074 additions and 954 deletions

View file

@ -78,41 +78,43 @@ bool readConfigFile(char *pConffile, VMAP::TileAssembler* pTa)
//======================================================= //=======================================================
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
if(argc == 3 || argc == 4) if(argc != 3 && argc != 4)
{
bool ok = true;
char *src = argv[1];
char *dest = argv[2];
char *conffile = NULL;
if(argc >= 4) {
conffile = argv[3];
}
VMAP::TileAssembler* ta = new VMAP::TileAssembler(std::string(src), std::string(dest));
ta->setModelNameFilterMethod(modelNameFilter);
/*
All the names in the list are considered to be world maps or huge instances.
These maps will be spilt into tiles in the vmap assemble process
*/
if(conffile != NULL) {
ok = readConfigFile(conffile, ta);
if(!ok) {
printf("Can not open file config file: %s\n", conffile);
}
}
if(ok) { ok = ta->convertWorld(); }
if(ok) {
printf("Ok, all done\n");
} else {
printf("exit with errors\n");
return 1;
}
delete ta;
}
else
{ {
printf("\nusage: %s <raw data dir> <vmap dest dir> [config file name]\n", argv[0]); printf("\nusage: %s <raw data dir> <vmap dest dir> [config file name]\n", argv[0]);
return 1; return 1;
} }
char *src = argv[1];
char *dest = argv[2];
char *conffile = NULL;
if(argc >= 4)
conffile = argv[3];
VMAP::TileAssembler* ta = new VMAP::TileAssembler(std::string(src), std::string(dest));
ta->setModelNameFilterMethod(modelNameFilter);
/*
All the names in the list are considered to be world maps or huge instances.
These maps will be spilt into tiles in the vmap assemble process
*/
if(conffile != NULL)
{
if(!readConfigFile(conffile, ta))
{
printf("Can not open file config file: %s\n", conffile);
delete ta;
return 1;
}
}
if(!ta->convertWorld())
{
printf("exit with errors\n");
delete ta;
return 1;
}
delete ta;
printf("Ok, all done\n");
return 0; return 0;
} }

View file

@ -530,10 +530,12 @@ This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVE
21 = ACTION_T_COMBAT_MOVEMENT: 21 = ACTION_T_COMBAT_MOVEMENT:
------------------------------ ------------------------------
Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before. Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before.
Parameter 2: If non-zero, then stop melee combat state (if param1=0) or start melee combat state (if param1!=0) and creature in combat with selected target.
This action controls whether or not the creature will always move towards its target. This action controls whether or not the creature will always move towards its target.
NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement) NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement)
This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who engage in Ranged Comabt (Either Spells or Ranged Attacks) This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who engage in Ranged Comabt (Either Spells or Ranged Attacks)
Parameter 2 specialy used for ranged combat proper client side visual show ranged weapon in proper state.
------------------------ ------------------------
22 = ACTION_T_SET_PHASE: 22 = ACTION_T_SET_PHASE:

View file

@ -589,6 +589,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS:
case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL:
case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL: case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL:
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED:
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED:
case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED:
case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN:
case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS:
@ -1063,7 +1065,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
if(miscvalue1 != achievementCriteria->equip_item.itemID) if(miscvalue1 != achievementCriteria->equip_item.itemID)
continue; continue;
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); SetCriteriaProgress(achievementCriteria, 1);
break; break;
case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT:
// miscvalue1 = go entry // miscvalue1 = go entry
@ -1202,8 +1204,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS: case ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS:
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED:
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED:
case ACHIEVEMENT_CRITERIA_TYPE_TOTAL: case ACHIEVEMENT_CRITERIA_TYPE_TOTAL:
break; // Not implemented yet :( break; // Not implemented yet :(
} }
@ -1360,6 +1360,8 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION:
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION:
case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS:
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED:
case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER:
case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR:

View file

@ -34,7 +34,7 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data)
uint64 guid; uint64 guid;
recv_data >> guid; recv_data >> guid;
sLog.outDebug("Inspect Arena stats " I64FMTD, guid); sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
if(Player *plr = objmgr.GetPlayer(guid)) if(Player *plr = objmgr.GetPlayer(guid))
{ {

View file

@ -606,7 +606,8 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() ); AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
//sLog.outDebug("Auctionhouse search guid: " I64FMTD ", list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u", guid, listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable); //sLog.outDebug("Auctionhouse search (GUID: %u TypeId: %u)", , list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
// GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
WorldPacket data( SMSG_AUCTION_LIST_RESULT, (4+4+4) ); WorldPacket data( SMSG_AUCTION_LIST_RESULT, (4+4+4) );
uint32 count = 0; uint32 count = 0;

View file

@ -682,6 +682,6 @@ void AuctionEntry::SaveToDB() const
{ {
//No SQL injection (no strings) //No SQL injection (no strings)
CharacterDatabase.PExecute("INSERT INTO auctionhouse (id,auctioneerguid,itemguid,item_template,itemowner,buyoutprice,time,buyguid,lastbid,startbid,deposit) " CharacterDatabase.PExecute("INSERT INTO auctionhouse (id,auctioneerguid,itemguid,item_template,itemowner,buyoutprice,time,buyguid,lastbid,startbid,deposit) "
"VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '" I64FMTD "', '%u', '%u', '%u', '%u')", "VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u')",
Id, auctioneer, item_guidlow, item_template, owner, buyout, (uint64)expire_time, bidder, bid, startbid, deposit); Id, auctioneer, item_guidlow, item_template, owner, buyout, (uint64)expire_time, bidder, bid, startbid, deposit);
} }

View file

@ -465,7 +465,7 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
if (plr) if (plr)
plr->GetSession()->SendPacket(packet); plr->GetSession()->SendPacket(packet);
else else
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
} }
} }
@ -477,7 +477,7 @@ void BattleGround::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
if (!plr) if (!plr)
{ {
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
continue; continue;
} }
@ -509,7 +509,7 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
if (!plr) if (!plr)
{ {
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
continue; continue;
} }
@ -532,7 +532,7 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
if (!plr) if (!plr)
{ {
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
continue; continue;
} }
@ -552,7 +552,7 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
if (!plr) if (!plr)
{ {
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
continue; continue;
} }
@ -577,7 +577,7 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
if (!plr) if (!plr)
{ {
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
continue; continue;
} }
@ -676,7 +676,7 @@ void BattleGround::EndBattleGround(uint32 winner)
else else
loser_arena_team->OfflineMemberLost(itr->first, winner_rating); loser_arena_team->OfflineMemberLost(itr->first, winner_rating);
} }
sLog.outError("BattleGround: Player " I64FMTD " not found!", itr->first); sLog.outError("BattleGround: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
continue; continue;
} }

View file

@ -143,7 +143,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]); Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
if (!plr) if (!plr)
{ {
sLog.outError("BattleGroundEY: Player " I64FMTD " not found!", m_PlayersNearPoint[EY_POINTS_MAX][j]); sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
++j; ++j;
continue; continue;
} }
@ -183,7 +183,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[i][j]); Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[i][j]);
if (!plr) if (!plr)
{ {
sLog.outError("BattleGroundEY: Player " I64FMTD " not found!", m_PlayersNearPoint[i][j]); sLog.outError("BattleGroundEY: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug //move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]); m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j); m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);

View file

@ -38,7 +38,7 @@ void WorldSession::HandleBattlemasterHelloOpcode( WorldPacket & recv_data )
uint64 guid; uint64 guid;
recv_data >> guid; recv_data >> guid;
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from: " I64FMT, guid); sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)));
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit) if (!unit)
@ -93,7 +93,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_); BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from: " I64FMT, guid); sLog.outDebug( "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
// can do this, since it's battleground, not arena // can do this, since it's battleground, not arena
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, 0); BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, 0);

View file

@ -1188,7 +1188,7 @@ void BattleGroundMgr::Update(uint32 diff)
{ {
DistributeArenaPoints(); DistributeArenaPoints();
m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS)); m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"I64FMTD"'", uint64(m_NextAutoDistributionTime)); CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"UI64FMTD"'", uint64(m_NextAutoDistributionTime));
} }
m_AutoDistributionTimeChecker = 600000; // check 10 minutes m_AutoDistributionTimeChecker = 600000; // check 10 minutes
} }
@ -1760,7 +1760,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution()
{ {
sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now."); sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS)); m_NextAutoDistributionTime = time_t(sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"I64FMTD"')", uint64(m_NextAutoDistributionTime)); CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"UI64FMTD"')", uint64(m_NextAutoDistributionTime));
} }
else else
{ {

View file

@ -69,7 +69,7 @@ bool LoginQueryHolder::Initialize()
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADREPUTATION, "SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, "SELECT data,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT button,action,type,misc FROM character_action WHERE guid = '%u' ORDER BY button", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, "SELECT button,action,type,misc FROM character_action WHERE guid = '%u' ORDER BY button", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" I64FMTD "'", GUID_LOPART(m_guid),(uint64)time(NULL)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(m_guid),(uint64)time(NULL));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSOCIALLIST, "SELECT friend,flags,note FROM character_social WHERE guid = '%u' LIMIT 255", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, "SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADHOMEBIND, "SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(m_guid));

View file

@ -519,6 +519,7 @@ class ChatHandler
bool HandleBanInfoHelper(uint32 accountid, char const* accountname); bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
bool HandleUnBanHelper(BanMode mode,char const* args); bool HandleUnBanHelper(BanMode mode,char const* args);
void HandleCharacterLevel(Player* player, uint64 player_guid, uint32 oldlevel, uint32 newlevel); void HandleCharacterLevel(Player* player, uint64 player_guid, uint32 oldlevel, uint32 newlevel);
void HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id);
void SetSentErrorMessage(bool val){ sentErrorMessage = val;}; void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
private: private:

View file

@ -1869,10 +1869,33 @@ bool Creature::LoadCreaturesAddon(bool reload)
Mount(cainfo->mount); Mount(cainfo->mount);
if (cainfo->bytes1 != 0) if (cainfo->bytes1 != 0)
SetUInt32Value(UNIT_FIELD_BYTES_1, cainfo->bytes1); {
// 0 StandState
// 1 FreeTalentPoints Pet only, so always 0 for default creature
// 2 StandFlags
// 3 StandMiscFlags
SetByteValue(UNIT_FIELD_BYTES_1, 0, uint8(cainfo->bytes1 & 0xFF));
//SetByteValue(UNIT_FIELD_BYTES_1, 1, uint8((cainfo->bytes1 >> 8) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_1, 1, 0);
SetByteValue(UNIT_FIELD_BYTES_1, 2, uint8((cainfo->bytes1 >> 16) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF));
}
if (cainfo->bytes2 != 0) if (cainfo->bytes2 != 0)
SetUInt32Value(UNIT_FIELD_BYTES_2, cainfo->bytes2); {
// 0 SheathState
// 1 Bytes2Flags
// 2 UnitRename Pet only, so always 0 for default creature
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
//SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
//SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 3, 0);
}
if (cainfo->emote != 0) if (cainfo->emote != 0)
SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote); SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote);

View file

@ -412,12 +412,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
} }
case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
{ {
if (action.morph.creatireId || action.morph.modelId) if (action.morph.creatureId || action.morph.modelId)
{ {
//set model based on entry from creature_template //set model based on entry from creature_template
if (action.morph.creatireId) if (action.morph.creatureId)
{ {
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatireId)) if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
{ {
//use default display //use default display
if (ci->DisplayID_A) if (ci->DisplayID_A)
@ -521,12 +521,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Creature* pCreature = NULL; Creature* pCreature = NULL;
if (action.summon.duration) if (action.summon.duration)
pCreature = m_creature->SummonCreature(action.summon.creatured, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration); pCreature = m_creature->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration);
else else
pCreature = m_creature->SummonCreature(action.summon.creatured, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); pCreature = m_creature->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!pCreature) if (!pCreature)
sLog.outErrorDb( "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatured, EventId, m_creature->GetEntry()); sLog.outErrorDb( "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, EventId, m_creature->GetEntry());
else if (action.summon.target != TARGET_T_SELF && target) else if (action.summon.target != TARGET_T_SELF && target)
pCreature->AI()->AttackStart(target); pCreature->AI()->AttackStart(target);
break; break;
@ -578,11 +578,19 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
MeleeEnabled = action.auto_attack.state != 0; MeleeEnabled = action.auto_attack.state != 0;
break; break;
case ACTION_T_COMBAT_MOVEMENT: case ACTION_T_COMBAT_MOVEMENT:
// ignore no affect case
if(CombatMovementEnabled==(action.combat_movement.state!=0))
return;
CombatMovementEnabled = action.combat_movement.state != 0; CombatMovementEnabled = action.combat_movement.state != 0;
//Allow movement (create new targeted movement gen only if idle) //Allow movement (create new targeted movement gen only if idle)
if (CombatMovementEnabled) if (CombatMovementEnabled)
{ {
if(action.combat_movement.melee && m_creature->isInCombat())
if(Unit* victim = m_creature->getVictim())
m_creature->SendMeleeAttackStart(victim);
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
{ {
m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->Clear(false);
@ -590,11 +598,17 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
} }
} }
else else
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
{ {
m_creature->GetMotionMaster()->Clear(false); if(action.combat_movement.melee && m_creature->isInCombat())
m_creature->GetMotionMaster()->MoveIdle(); if(Unit* victim = m_creature->getVictim())
m_creature->StopMoving(); m_creature->SendMeleeAttackStop(victim);
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
{
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
m_creature->StopMoving();
}
} }
break; break;
case ACTION_T_SET_PHASE: case ACTION_T_SET_PHASE:

View file

@ -193,7 +193,7 @@ struct CreatureEventAI_Action
// ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3 // ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3
struct struct
{ {
uint32 creatireId; // set one from fields (or 0 for both to demorph) uint32 creatureId; // set one from fields (or 0 for both to demorph)
uint32 modelId; uint32 modelId;
} morph; } morph;
// ACTION_T_SOUND = 4 // ACTION_T_SOUND = 4
@ -230,7 +230,7 @@ struct CreatureEventAI_Action
// ACTION_T_SUMMON = 12 // ACTION_T_SUMMON = 12
struct struct
{ {
uint32 creatured; uint32 creatureId;
uint32 target; uint32 target;
uint32 duration; uint32 duration;
} summon; } summon;
@ -281,6 +281,7 @@ struct CreatureEventAI_Action
struct struct
{ {
uint32 state; // 0 = stop combat based movement, anything else continue attacking uint32 state; // 0 = stop combat based movement, anything else continue attacking
uint32 melee; // if set: at stop send melee combat stop if in combat, use for terminate melee fighting state for switch to ranged
} combat_movement; } combat_movement;
// ACTION_T_SET_PHASE = 22 // ACTION_T_SET_PHASE = 22
struct struct

View file

@ -438,19 +438,19 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
} }
break; break;
case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: case ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
if (action.morph.creatireId !=0 || action.morph.modelId !=0) if (action.morph.creatureId !=0 || action.morph.modelId !=0)
{ {
if (action.morph.creatireId && !sCreatureStorage.LookupEntry<CreatureInfo>(action.morph.creatireId)) if (action.morph.creatureId && !sCreatureStorage.LookupEntry<CreatureInfo>(action.morph.creatureId))
{ {
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatireId); sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId);
action.morph.creatireId = 0; action.morph.creatureId = 0;
} }
if (action.morph.modelId) if (action.morph.modelId)
{ {
if (action.morph.creatireId) if (action.morph.creatureId)
{ {
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId,action.morph.creatireId); sLog.outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId,action.morph.creatureId);
action.morph.modelId = 0; action.morph.modelId = 0;
} }
else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId)) else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId))
@ -512,8 +512,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break; break;
} }
case ACTION_T_SUMMON: case ACTION_T_SUMMON:
if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.summon.creatured)) if (!sCreatureStorage.LookupEntry<CreatureInfo>(action.summon.creatureId))
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatured); sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId);
if (action.summon.target >= TARGET_T_END) if (action.summon.target >= TARGET_T_END)
sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);

View file

@ -1240,7 +1240,7 @@ struct SkillLineEntry
uint32 spellIcon; // 37 m_spellIconID uint32 spellIcon; // 37 m_spellIconID
//char* alternateVerb[16]; // 38-53 m_alternateVerb_lang //char* alternateVerb[16]; // 38-53 m_alternateVerb_lang
// 54 string flags // 54 string flags
// 55 m_canLink uint32 canLink; // 55 m_canLink (prof. with recipes
}; };
struct SkillLineAbilityEntry struct SkillLineAbilityEntry

View file

@ -77,7 +77,7 @@ const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii"; const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiii";
const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiii"; const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiii";
const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxx"; const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi";
const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx";
const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellCastTimefmt[]="nixx"; const char SpellCastTimefmt[]="nixx";

View file

@ -105,7 +105,7 @@ bool Group::Create(const uint64 &guid, const char * name)
CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid)); CharacterDatabase.PExecute("DELETE FROM groups WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid)); CharacterDatabase.PExecute("DELETE FROM group_member WHERE leaderGuid ='%u'", GUID_LOPART(m_leaderGuid));
CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty) " CharacterDatabase.PExecute("INSERT INTO groups(leaderGuid,mainTank,mainAssistant,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,isRaid,difficulty) "
"VALUES('%u','%u','%u','%u','%u','%u','" I64FMTD "','" I64FMTD "','" I64FMTD "','" I64FMTD "','" I64FMTD "','" I64FMTD "','" I64FMTD "','" I64FMTD "','%u','%u')", "VALUES('%u','%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u')",
GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod), GUID_LOPART(m_leaderGuid), GUID_LOPART(m_mainTank), GUID_LOPART(m_mainAssistant), uint32(m_lootMethod),
GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_difficulty); GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], isRaidGroup(), m_difficulty);
} }

View file

@ -391,6 +391,16 @@ void WorldSession::HandleLootRoll( WorldPacket &recv_data )
// everything's fine, do it // everything's fine, do it
group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, Choise); group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, Choise);
switch (Choise)
{
case 1:
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1);
break;
case 2:
GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1);
break;
}
} }
void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data)

View file

@ -82,7 +82,7 @@ bool Guild::create(Player* leader, std::string gname)
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", Id); CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", Id);
CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guildid='%u'", Id); CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guildid='%u'", Id);
CharacterDatabase.PExecute("INSERT INTO guild (guildid,name,leaderguid,info,motd,createdate,EmblemStyle,EmblemColor,BorderStyle,BorderColor,BackgroundColor,BankMoney) " CharacterDatabase.PExecute("INSERT INTO guild (guildid,name,leaderguid,info,motd,createdate,EmblemStyle,EmblemColor,BorderStyle,BorderColor,BackgroundColor,BankMoney) "
"VALUES('%u','%s','%u', '%s', '%s', NOW(),'%u','%u','%u','%u','%u','" I64FMTD "')", "VALUES('%u','%s','%u', '%s', '%s', NOW(),'%u','%u','%u','%u','%u','" UI64FMTD "')",
Id, gname.c_str(), GUID_LOPART(leaderGuid), dbGINFO.c_str(), dbMOTD.c_str(), EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, guildbank_money); Id, gname.c_str(), GUID_LOPART(leaderGuid), dbGINFO.c_str(), dbMOTD.c_str(), EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, guildbank_money);
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
@ -916,7 +916,7 @@ void Guild::LogGuildEvent(uint8 EventType, uint32 PlayerGuid1, uint32 PlayerGuid
// Add entry to map // Add entry to map
m_GuildEventlog.push_back(NewEvent); m_GuildEventlog.push_back(NewEvent);
// Add new eventlog entry into DB // Add new eventlog entry into DB
CharacterDatabase.PExecute("INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES ('%u','%u','%u','%u','%u','%u','" I64FMTD "')", CharacterDatabase.PExecute("INSERT INTO guild_eventlog (guildid, LogGuid, EventType, PlayerGuid1, PlayerGuid2, NewRank, TimeStamp) VALUES ('%u','%u','%u','%u','%u','%u','" UI64FMTD "')",
Id, NewEvent->LogGuid, uint32(NewEvent->EventType), NewEvent->PlayerGuid1, NewEvent->PlayerGuid2, uint32(NewEvent->NewRank), NewEvent->TimeStamp); Id, NewEvent->LogGuid, uint32(NewEvent->EventType), NewEvent->PlayerGuid1, NewEvent->PlayerGuid2, uint32(NewEvent->NewRank), NewEvent->TimeStamp);
} }
@ -1299,7 +1299,7 @@ void Guild::SetBankMoney(int64 money)
money = 0; money = 0;
guildbank_money = money; guildbank_money = money;
CharacterDatabase.PExecute("UPDATE guild SET BankMoney='" I64FMTD "' WHERE guildid='%u'", money, Id); CharacterDatabase.PExecute("UPDATE guild SET BankMoney='" UI64FMTD "' WHERE guildid='%u'", money, Id);
} }
// ************************************************* // *************************************************
@ -1665,7 +1665,7 @@ void Guild::LogBankEvent(uint8 LogEntry, uint8 TabId, uint32 PlayerGuidLow, uint
} }
m_GuildBankEventLog_Item[TabId].push_back(NewEvent); m_GuildBankEventLog_Item[TabId].push_back(NewEvent);
} }
CharacterDatabase.PExecute("INSERT INTO guild_bank_eventlog (guildid,LogGuid,LogEntry,TabId,PlayerGuid,ItemOrMoney,ItemStackCount,DestTabId,TimeStamp) VALUES ('%u','%u','%u','%u','%u','%u','%u','%u','" I64FMTD "')", CharacterDatabase.PExecute("INSERT INTO guild_bank_eventlog (guildid,LogGuid,LogEntry,TabId,PlayerGuid,ItemOrMoney,ItemStackCount,DestTabId,TimeStamp) VALUES ('%u','%u','%u','%u','%u','%u','%u','%u','" UI64FMTD "')",
Id, NewEvent->LogGuid, uint32(NewEvent->LogEntry), uint32(TabId), NewEvent->PlayerGuid, NewEvent->ItemOrMoney, uint32(NewEvent->ItemStackCount), uint32(NewEvent->DestTabId), NewEvent->TimeStamp); Id, NewEvent->LogGuid, uint32(NewEvent->LogEntry), uint32(TabId), NewEvent->PlayerGuid, NewEvent->ItemOrMoney, uint32(NewEvent->ItemStackCount), uint32(NewEvent->DestTabId), NewEvent->TimeStamp);
} }

View file

@ -130,7 +130,7 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
{ {
// save the resettime for normal instances only when they get unloaded // save the resettime for normal instances only when they get unloaded
if(time_t resettime = itr->second->GetResetTimeForDB()) if(time_t resettime = itr->second->GetResetTimeForDB())
CharacterDatabase.PExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", (uint64)resettime, InstanceId); CharacterDatabase.PExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", (uint64)resettime, InstanceId);
delete itr->second; delete itr->second;
m_instanceSaveById.erase(itr); m_instanceSaveById.erase(itr);
} }
@ -168,7 +168,7 @@ void InstanceSave::SaveToDB()
} }
} }
CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '"I64FMTD"', '%u', '%s')", m_instanceid, GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), data.c_str()); CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '"UI64FMTD"', '%u', '%s')", m_instanceid, GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), data.c_str());
} }
time_t InstanceSave::GetResetTimeForDB() time_t InstanceSave::GetResetTimeForDB()
@ -395,7 +395,7 @@ void InstanceSaveManager::LoadResetTimes()
ResetTimeMapType::iterator itr = InstResetTime.find(instance); ResetTimeMapType::iterator itr = InstResetTime.find(instance);
if(itr != InstResetTime.end() && itr->second.second != resettime) if(itr != InstResetTime.end() && itr->second.second != resettime)
{ {
CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"I64FMTD"' WHERE id = '%u'", uint64(resettime), instance); CharacterDatabase.DirectPExecute("UPDATE instance SET resettime = '"UI64FMTD"' WHERE id = '%u'", uint64(resettime), instance);
itr->second.second = resettime; itr->second.second = resettime;
} }
} }
@ -430,7 +430,7 @@ void InstanceSaveManager::LoadResetTimes()
uint64 oldresettime = fields[1].GetUInt64(); uint64 oldresettime = fields[1].GetUInt64();
uint64 newresettime = (oldresettime / DAY) * DAY + diff; uint64 newresettime = (oldresettime / DAY) * DAY + diff;
if(oldresettime != newresettime) if(oldresettime != newresettime)
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"I64FMTD"' WHERE mapid = '%u'", newresettime, mapid); CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u'", newresettime, mapid);
m_resetTimeByMapId[mapid] = newresettime; m_resetTimeByMapId[mapid] = newresettime;
} while(result->NextRow()); } while(result->NextRow());
@ -439,7 +439,7 @@ void InstanceSaveManager::LoadResetTimes()
// clean expired instances, references to them will be deleted in CleanupInstances // clean expired instances, references to them will be deleted in CleanupInstances
// must be done before calculating new reset times // must be done before calculating new reset times
_DelHelper(CharacterDatabase, "id, map, difficulty", "instance", "LEFT JOIN instance_reset ON mapid = map WHERE (instance.resettime < '"I64FMTD"' AND instance.resettime > '0') OR (NOT instance_reset.resettime IS NULL AND instance_reset.resettime < '"I64FMTD"')", (uint64)now, (uint64)now); _DelHelper(CharacterDatabase, "id, map, difficulty", "instance", "LEFT JOIN instance_reset ON mapid = map WHERE (instance.resettime < '"UI64FMTD"' AND instance.resettime > '0') OR (NOT instance_reset.resettime IS NULL AND instance_reset.resettime < '"UI64FMTD"')", (uint64)now, (uint64)now);
// calculate new global reset times for expired instances and those that have never been reset yet // calculate new global reset times for expired instances and those that have never been reset yet
// add the global reset times to the priority queue // add the global reset times to the priority queue
@ -459,7 +459,7 @@ void InstanceSaveManager::LoadResetTimes()
{ {
// initialize the reset time // initialize the reset time
t = today + period + diff; t = today + period + diff;
CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','"I64FMTD"')", i, (uint64)t); CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','"UI64FMTD"')", i, (uint64)t);
} }
if(t < now) if(t < now)
@ -468,7 +468,7 @@ void InstanceSaveManager::LoadResetTimes()
// calculate the next reset time // calculate the next reset time
t = (t / DAY) * DAY; t = (t / DAY) * DAY;
t += ((today - t) / period + 1) * period + diff; t += ((today - t) / period + 1) * period + diff;
CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"I64FMTD"' WHERE mapid = '%u'", (uint64)t, i); CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u'", (uint64)t, i);
} }
m_resetTimeByMapId[temp->map] = t; m_resetTimeByMapId[temp->map] = t;
@ -611,7 +611,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
uint32 period = temp->reset_delay * DAY; uint32 period = temp->reset_delay * DAY;
uint64 next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff; uint64 next_reset = ((now + timeLeft + MINUTE) / DAY * DAY) + period + diff;
// update it in the DB // update it in the DB
CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"I64FMTD"' WHERE mapid = '%d'", next_reset, mapid); CharacterDatabase.PExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%d'", next_reset, mapid);
} }
MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps(); MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();

View file

@ -642,7 +642,7 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
uint64 titles = 0; uint64 titles = 0;
sscanf((char*)args, I64FMTD, &titles); sscanf((char*)args, UI64FMTD, &titles);
Player *chr = getSelectedPlayer(); Player *chr = getSelectedPlayer();
if (!chr) if (!chr)

View file

@ -84,7 +84,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if (target) if (target)
target->GetSession()->m_muteTime = mutetime; target->GetSession()->m_muteTime = mutetime;
loginDatabase.PExecute("UPDATE account SET mutetime = " I64FMTD " WHERE id = '%u'",uint64(mutetime), account_id ); loginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'",uint64(mutetime), account_id );
if(target) if(target)
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime); ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime);
@ -3893,6 +3893,40 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
return true; return true;
} }
void ChatHandler::HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id)
{
uint32 classmask = player->getClassMask();
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
{
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
if (!skillLine)
continue;
// wrong skill
if( skillLine->skillId != skill_id)
continue;
// not high rank
if(skillLine->forward_spellid )
continue;
// skip racial skills
if (skillLine->racemask != 0)
continue;
// skip wrong class skills
if( skillLine->classmask && (skillLine->classmask & classmask) == 0)
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,player,false))
continue;
player->learnSpell(skillLine->spellId,false);
}
}
bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/) bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
{ {
uint32 classmask = m_session->GetPlayer()->getClassMask(); uint32 classmask = m_session->GetPlayer()->getClassMask();
@ -3903,31 +3937,10 @@ bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
if( !skillInfo ) if( !skillInfo )
continue; continue;
if( skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY ) if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) &&
skillInfo->canLink) // only prof. with recipes have
{ {
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) HandleLearnSkillRecipesHelper(m_session->GetPlayer(),skillInfo->id);
{
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
if( !skillLine )
continue;
// skip racial skills
if( skillLine->racemask != 0 )
continue;
// skip wrong class skills
if( skillLine->classmask && (skillLine->classmask & classmask) == 0)
continue;
if( skillLine->skillId != i || skillLine->forward_spellid )
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue;
m_session->GetPlayer()->learnSpell(skillLine->spellId,false);
}
} }
} }
@ -3960,54 +3973,58 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
uint32 classmask = m_session->GetPlayer()->getClassMask(); uint32 classmask = m_session->GetPlayer()->getClassMask();
for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i) std::string name;
SkillLineEntry const *targetSkillInfo = NULL;
for (uint32 i = 1; i < sSkillLineStore.GetNumRows(); ++i)
{ {
SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(i); SkillLineEntry const *skillInfo = sSkillLineStore.LookupEntry(i);
if( !skillInfo ) if (!skillInfo)
continue; continue;
if( skillInfo->categoryId != SKILL_CATEGORY_PROFESSION && if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION &&
skillInfo->categoryId != SKILL_CATEGORY_SECONDARY ) skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) ||
!skillInfo->canLink) // only prof with recipes have set
continue; continue;
int loc = GetSessionDbcLocale(); int loc = GetSessionDbcLocale();
std::string name = skillInfo->name[loc]; name = skillInfo->name[loc];
if(name.empty())
continue;
if(Utf8FitTo(name, wnamepart)) if (!Utf8FitTo(name, wnamepart))
{ {
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) loc = 0;
for(; loc < MAX_LOCALE; ++loc)
{ {
SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j); if(loc==GetSessionDbcLocale())
if( !skillLine )
continue; continue;
if( skillLine->skillId != i || skillLine->forward_spellid ) name = skillInfo->name[loc];
if(name.empty())
continue; continue;
// skip racial skills if (Utf8FitTo(name, wnamepart))
if( skillLine->racemask != 0 ) break;
continue;
// skip wrong class skills
if( skillLine->classmask && (skillLine->classmask & classmask) == 0)
continue;
SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
if(!spellInfo || !SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue;
if( !target->HasSpell(spellInfo->Id) )
m_session->GetPlayer()->learnSpell(skillLine->spellId,false);
} }
}
uint16 maxLevel = target->GetPureMaxSkillValue(skillInfo->id); if(loc < MAX_LOCALE)
target->SetSkill(skillInfo->id, maxLevel, maxLevel); {
PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str()); targetSkillInfo = skillInfo;
return true; break;
} }
} }
return false; if(!targetSkillInfo)
return false;
HandleLearnSkillRecipesHelper(target,targetSkillInfo->id);
uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id);
target->SetSkill(targetSkillInfo->id, maxLevel, maxLevel);
PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str());
return true;
} }
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args) bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)

View file

@ -873,7 +873,7 @@ void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 station
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
CharacterDatabase.escape_string(subject); CharacterDatabase.escape_string(subject);
CharacterDatabase.PExecute("INSERT INTO mail (id,messageType,stationery,mailTemplateId,sender,receiver,subject,itemTextId,has_items,expire_time,deliver_time,money,cod,checked) " CharacterDatabase.PExecute("INSERT INTO mail (id,messageType,stationery,mailTemplateId,sender,receiver,subject,itemTextId,has_items,expire_time,deliver_time,money,cod,checked) "
"VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%s', '%u', '%u', '" I64FMTD "','" I64FMTD "', '%u', '%u', '%d')", "VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%s', '%u', '%u', '" UI64FMTD "','" UI64FMTD "', '%u', '%u', '%d')",
mailId, messageType, stationery, mailTemplateId, sender_guidlow_or_entry, receiver_guidlow, subject.c_str(), itemTextId, (mi && !mi->empty() ? 1 : 0), (uint64)expire_time, (uint64)deliver_time, money, COD, checked); mailId, messageType, stationery, mailTemplateId, sender_guidlow_or_entry, receiver_guidlow, subject.c_str(), itemTextId, (mi && !mi->empty() ? 1 : 0), (uint64)expire_time, (uint64)deliver_time, money, COD, checked);
if(mi) if(mi)

View file

@ -428,7 +428,7 @@ Map::Add(T *obj)
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP ) if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
{ {
sLog.outError("Map::Add: Object " I64FMTD " have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord); sLog.outError("Map::Add: Object (GUID: %u TypeId: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
return; return;
} }
@ -482,7 +482,7 @@ void Map::MessageBroadcast(WorldObject *obj, WorldPacket *msg)
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP ) if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
{ {
sLog.outError("Map::MessageBroadcast: Object " I64FMTD " have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord); sLog.outError("Map::MessageBroadcast: Object (GUID: %u TypeId: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
return; return;
} }
@ -527,7 +527,7 @@ void Map::MessageDistBroadcast(WorldObject *obj, WorldPacket *msg, float dist)
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP ) if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
{ {
sLog.outError("Map::MessageBroadcast: Object " I64FMTD " have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord); sLog.outError("Map::MessageBroadcast: Object (GUID: %u TypeId: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
return; return;
} }
@ -732,7 +732,7 @@ Map::Remove(T *obj, bool remove)
CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP ) if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
{ {
sLog.outError("Map::Remove: Object " I64FMT " have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord); sLog.outError("Map::Remove: Object (GUID: %u TypeId:%u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
return; return;
} }
@ -740,7 +740,7 @@ Map::Remove(T *obj, bool remove)
if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) ) if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
return; return;
DEBUG_LOG("Remove object " I64FMT " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y); DEBUG_LOG("Remove object (GUID: %u TypeId:%u) from grid[%u,%u]", obj->GetGUIDLow(), obj->GetTypeId(), cell.data.Part.grid_x, cell.data.Part.grid_y);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert( grid != NULL ); assert( grid != NULL );

View file

@ -1081,8 +1081,8 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket&/* recv_data*/)
recv_data >> Orientation; recv_data >> Orientation;
// TODO for later may be we can use for anticheat // TODO for later may be we can use for anticheat
DEBUG_LOG("Guid " I64FMTD,guid); DEBUG_LOG("Guid " UI64FMTD,guid);
DEBUG_LOG("unknown1 " I64FMTD,unknown1); DEBUG_LOG("unknown1 " UI64FMTD,unknown1);
DEBUG_LOG("unknown2 %u",unknown2); DEBUG_LOG("unknown2 %u",unknown2);
DEBUG_LOG("X %f",PositionX); DEBUG_LOG("X %f",PositionX);
DEBUG_LOG("Y %f",PositionY); DEBUG_LOG("Y %f",PositionY);
@ -1115,8 +1115,8 @@ void WorldSession::HandleMoveRootAck(WorldPacket&/* recv_data*/)
recv_data >> Orientation; recv_data >> Orientation;
// for later may be we can use for anticheat // for later may be we can use for anticheat
DEBUG_LOG("Guid " I64FMTD,guid); DEBUG_LOG("Guid " UI64FMTD,guid);
DEBUG_LOG("unknown1 " I64FMTD,unknown1); DEBUG_LOG("unknown1 " UI64FMTD,unknown1);
DEBUG_LOG("unknown1 %u",unknown2); DEBUG_LOG("unknown1 %u",unknown2);
DEBUG_LOG("X %f",PositionX); DEBUG_LOG("X %f",PositionX);
DEBUG_LOG("Y %f",PositionY); DEBUG_LOG("Y %f",PositionY);
@ -1172,7 +1172,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
uint64 guid; uint64 guid;
recv_data >> guid; recv_data >> guid;
DEBUG_LOG("Inspected guid is " I64FMTD, guid); DEBUG_LOG("Inspected guid is (GUID: %u TypeId: %u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
_player->SetSelection(guid); _player->SetSelection(guid);
@ -1406,7 +1406,7 @@ void WorldSession::HandleFarSightOpcode( WorldPacket & recv_data )
sLog.outDebug("Removed FarSight from player %u", _player->GetGUIDLow()); sLog.outDebug("Removed FarSight from player %u", _player->GetGUIDLow());
break; break;
case 1: case 1:
sLog.outDebug("Added FarSight " I64FMT " to player %u", _player->GetFarSight(), _player->GetGUIDLow()); sLog.outDebug("Added FarSight (GUID:%u TypeId:%u) to player %u", GUID_LOPART(_player->GetFarSight()), GuidHigh2TypeId(GUID_HIPART(_player->GetFarSight())), _player->GetGUIDLow());
break; break;
} }
} }

View file

@ -171,7 +171,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
recv_data >> guid; recv_data >> guid;
recv_data >> flags >> time; recv_data >> flags >> time;
DEBUG_LOG("Guid " I64FMTD,guid); DEBUG_LOG("Guid " UI64FMTD,guid);
DEBUG_LOG("Flags %u, time %u",flags, time/IN_MILISECONDS); DEBUG_LOG("Flags %u, time %u",flags, time/IN_MILISECONDS);
Unit *mover = _player->m_mover; Unit *mover = _player->m_mover;

View file

@ -89,7 +89,7 @@ Object::~Object( )
if(IsInWorld()) if(IsInWorld())
{ {
///- Do NOT call RemoveFromWorld here, if the object is a player it will crash ///- Do NOT call RemoveFromWorld here, if the object is a player it will crash
sLog.outError("Object::~Object - guid="I64FMTD", typeid=%d deleted but still in world!!", GetGUID(), GetTypeId()); sLog.outError("Object::~Object (GUID: %u TypeId: %u) deleted but still in world!!", GetGUIDLow(), GetTypeId());
//assert(0); //assert(0);
} }

View file

@ -125,7 +125,7 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
CellPair q = MaNGOS::ComputeCellPair(obj->GetPositionX(),obj->GetPositionY()); CellPair q = MaNGOS::ComputeCellPair(obj->GetPositionX(),obj->GetPositionY());
if(q.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || q.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP ) if(q.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || q.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
{ {
sLog.outError("ObjectAccessor::GetObjecInWorld: object "I64FMTD" has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord); sLog.outError("ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
return NULL; return NULL;
} }

View file

@ -23,8 +23,8 @@
// used for creating values for respawn for example // used for creating values for respawn for example
#define MAKE_PAIR64(l, h) uint64( uint32(l) | ( uint64(h) << 32 ) ) #define MAKE_PAIR64(l, h) uint64( uint32(l) | ( uint64(h) << 32 ) )
#define PAIR64_HIPART(x) (uint32)((uint64(x) >> 32) & 0x00000000FFFFFFFFLL) #define PAIR64_HIPART(x) (uint32)((uint64(x) >> 32) & UI64LIT(0x00000000FFFFFFFF))
#define PAIR64_LOPART(x) (uint32)(uint64(x) & 0x00000000FFFFFFFFLL) #define PAIR64_LOPART(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF))
#define MAKE_PAIR32(l, h) uint32( uint16(l) | ( uint32(h) << 16 ) ) #define MAKE_PAIR32(l, h) uint32( uint16(l) | ( uint32(h) << 16 ) )
#define PAIR32_HIPART(x) (uint16)((uint32(x) >> 16) & 0x0000FFFF) #define PAIR32_HIPART(x) (uint16)((uint32(x) >> 16) & 0x0000FFFF)
@ -70,9 +70,9 @@ enum HighGuid
// We have different low and middle part size for different guid types // We have different low and middle part size for different guid types
#define _GUID_ENPART_2(x) 0 #define _GUID_ENPART_2(x) 0
#define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 24) & 0x0000000000FFFFFFLL) #define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 24) & UI64LIT(0x0000000000FFFFFF))
#define _GUID_LOPART_2(x) (uint32)(uint64(x) & 0x00000000FFFFFFFFLL) #define _GUID_LOPART_2(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF))
#define _GUID_LOPART_3(x) (uint32)(uint64(x) & 0x0000000000FFFFFFLL) #define _GUID_LOPART_3(x) (uint32)(uint64(x) & UI64LIT(0x0000000000FFFFFF))
inline bool IsGuidHaveEnPart(uint64 const& guid) inline bool IsGuidHaveEnPart(uint64 const& guid)
{ {

View file

@ -724,6 +724,15 @@ void ObjectMgr::LoadCreatureAddons()
if(!addon) if(!addon)
continue; continue;
if (addon->mount)
{
if (!sCreatureDisplayInfoStore.LookupEntry(addon->mount))
sLog.outErrorDb("Creature (Entry %u) have invalid displayInfoId for mount (%u) defined in `creature_template_addon`.",addon->guidOrEntry, addon->mount);
}
if (!sEmotesStore.LookupEntry(addon->emote))
sLog.outErrorDb("Creature (Entry %u) have invalid emote (%u) defined in `creature_template_addon`.",addon->guidOrEntry, addon->emote);
ConvertCreatureAddonAuras(const_cast<CreatureDataAddon*>(addon), "creature_template_addon", "Entry"); ConvertCreatureAddonAuras(const_cast<CreatureDataAddon*>(addon), "creature_template_addon", "Entry");
if(!sCreatureStorage.LookupEntry<CreatureInfo>(addon->guidOrEntry)) if(!sCreatureStorage.LookupEntry<CreatureInfo>(addon->guidOrEntry))
@ -742,6 +751,15 @@ void ObjectMgr::LoadCreatureAddons()
if(!addon) if(!addon)
continue; continue;
if (addon->mount)
{
if (!sCreatureDisplayInfoStore.LookupEntry(addon->mount))
sLog.outErrorDb("Creature (GUID %u) have invalid displayInfoId for mount (%u) defined in `creature_addon`.",addon->guidOrEntry, addon->mount);
}
if (!sEmotesStore.LookupEntry(addon->emote))
sLog.outErrorDb("Creature (GUID %u) have invalid emote (%u) defined in `creature_addon`.",addon->guidOrEntry, addon->emote);
ConvertCreatureAddonAuras(const_cast<CreatureDataAddon*>(addon), "creature_addon", "GUIDLow"); ConvertCreatureAddonAuras(const_cast<CreatureDataAddon*>(addon), "creature_addon", "GUIDLow");
if(mCreatureDataMap.find(addon->guidOrEntry)==mCreatureDataMap.end()) if(mCreatureDataMap.find(addon->guidOrEntry)==mCreatureDataMap.end())
@ -4283,9 +4301,9 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
sLog.outDebug("Returning mails current time: hour: %d, minute: %d, second: %d ", localtime(&basetime)->tm_hour, localtime(&basetime)->tm_min, localtime(&basetime)->tm_sec); sLog.outDebug("Returning mails current time: hour: %d, minute: %d, second: %d ", localtime(&basetime)->tm_hour, localtime(&basetime)->tm_min, localtime(&basetime)->tm_sec);
//delete all old mails without item and without body immediately, if starting server //delete all old mails without item and without body immediately, if starting server
if (!serverUp) if (!serverUp)
CharacterDatabase.PExecute("DELETE FROM mail WHERE expire_time < '" I64FMTD "' AND has_items = '0' AND itemTextId = 0", (uint64)basetime); CharacterDatabase.PExecute("DELETE FROM mail WHERE expire_time < '" UI64FMTD "' AND has_items = '0' AND itemTextId = 0", (uint64)basetime);
// 0 1 2 3 4 5 6 7 8 9 // 0 1 2 3 4 5 6 7 8 9
QueryResult* result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,itemTextId,has_items,expire_time,cod,checked,mailTemplateId FROM mail WHERE expire_time < '" I64FMTD "'", (uint64)basetime); QueryResult* result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,itemTextId,has_items,expire_time,cod,checked,mailTemplateId FROM mail WHERE expire_time < '" UI64FMTD "'", (uint64)basetime);
if ( !result ) if ( !result )
{ {
barGoLink bar(1); barGoLink bar(1);
@ -4360,7 +4378,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
else else
{ {
//mail will be returned: //mail will be returned:
CharacterDatabase.PExecute("UPDATE mail SET sender = '%u', receiver = '%u', expire_time = '" I64FMTD "', deliver_time = '" I64FMTD "',cod = '0', checked = '%u' WHERE id = '%u'", m->receiver, m->sender, (uint64)(basetime + 30*DAY), (uint64)basetime, MAIL_CHECK_MASK_RETURNED, m->messageID); CharacterDatabase.PExecute("UPDATE mail SET sender = '%u', receiver = '%u', expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "',cod = '0', checked = '%u' WHERE id = '%u'", m->receiver, m->sender, (uint64)(basetime + 30*DAY), (uint64)basetime, MAIL_CHECK_MASK_RETURNED, m->messageID);
delete m; delete m;
continue; continue;
} }
@ -6030,7 +6048,7 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t
mCreatureRespawnTimes[MAKE_PAIR64(loguid,instance)] = t; mCreatureRespawnTimes[MAKE_PAIR64(loguid,instance)] = t;
WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u' AND instance = '%u'", loguid, instance); WorldDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u' AND instance = '%u'", loguid, instance);
if(t) if(t)
WorldDatabase.PExecute("INSERT INTO creature_respawn VALUES ( '%u', '" I64FMTD "', '%u' )", loguid, uint64(t), instance); WorldDatabase.PExecute("INSERT INTO creature_respawn VALUES ( '%u', '" UI64FMTD "', '%u' )", loguid, uint64(t), instance);
} }
void ObjectMgr::DeleteCreatureData(uint32 guid) void ObjectMgr::DeleteCreatureData(uint32 guid)
@ -6048,7 +6066,7 @@ void ObjectMgr::SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t)
mGORespawnTimes[MAKE_PAIR64(loguid,instance)] = t; mGORespawnTimes[MAKE_PAIR64(loguid,instance)] = t;
WorldDatabase.PExecute("DELETE FROM gameobject_respawn WHERE guid = '%u' AND instance = '%u'", loguid, instance); WorldDatabase.PExecute("DELETE FROM gameobject_respawn WHERE guid = '%u' AND instance = '%u'", loguid, instance);
if(t) if(t)
WorldDatabase.PExecute("INSERT INTO gameobject_respawn VALUES ( '%u', '" I64FMTD "', '%u' )", loguid, uint64(t), instance); WorldDatabase.PExecute("INSERT INTO gameobject_respawn VALUES ( '%u', '" UI64FMTD "', '%u' )", loguid, uint64(t), instance);
} }
void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance) void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance)

View file

@ -1077,7 +1077,7 @@ void Pet::_SaveSpellCooldowns()
m_CreatureSpellCooldowns.erase(itr++); m_CreatureSpellCooldowns.erase(itr++);
else else
{ {
CharacterDatabase.PExecute("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '" I64FMTD "')", m_charmInfo->GetPetNumber(), itr->first, uint64(itr->second)); CharacterDatabase.PExecute("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '" UI64FMTD "')", m_charmInfo->GetPetNumber(), itr->first, uint64(itr->second));
++itr; ++itr;
} }
} }
@ -1250,7 +1250,7 @@ void Pet::_SaveAuras()
if (i == 3) if (i == 3)
{ {
CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) " CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "', '%u', '%u', '%u', '%d', '%d', '%d', '%d')", "VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%d', '%d', '%d', '%d')",
m_charmInfo->GetPetNumber(), itr2->second->GetCasterGUID(),(uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), stackCounter, itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges())); m_charmInfo->GetPetNumber(), itr2->second->GetCasterGUID(),(uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), stackCounter, itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
} }
} }

View file

@ -66,7 +66,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
CharmInfo *charmInfo = pet->GetCharmInfo(); CharmInfo *charmInfo = pet->GetCharmInfo();
if(!charmInfo) if(!charmInfo)
{ {
sLog.outError("WorldSession::HandlePetAction: object "I64FMTD" is considered pet-like but doesn't have a charminfo!", pet->GetGUID()); sLog.outError("WorldSession::HandlePetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return; return;
} }
@ -344,7 +344,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
CharmInfo *charmInfo = pet->GetCharmInfo(); CharmInfo *charmInfo = pet->GetCharmInfo();
if(!charmInfo) if(!charmInfo)
{ {
sLog.outError("WorldSession::HandlePetSetAction: object "I64FMTD" is considered pet-like but doesn't have a charminfo!", pet->GetGUID()); sLog.outError("WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return; return;
} }
@ -515,7 +515,7 @@ void WorldSession::HandlePetUnlearnOpcode(WorldPacket& recvPacket)
CharmInfo *charmInfo = pet->GetCharmInfo(); CharmInfo *charmInfo = pet->GetCharmInfo();
if(!charmInfo) if(!charmInfo)
{ {
sLog.outError("WorldSession::HandlePetUnlearnOpcode: object "I64FMTD" is considered pet-like but doesn't have a charminfo!", pet->GetGUID()); sLog.outError("WorldSession::HandlePetUnlearnOpcode: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return; return;
} }
pet->resetTalents(); pet->resetTalents();
@ -554,7 +554,7 @@ void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
CharmInfo *charmInfo = pet->GetCharmInfo(); CharmInfo *charmInfo = pet->GetCharmInfo();
if(!charmInfo) if(!charmInfo)
{ {
sLog.outError("WorldSession::HandlePetSpellAutocastOpcod: object "I64FMTD" is considered pet-like but doesn't have a charminfo!", pet->GetGUID()); sLog.outError("WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return; return;
} }

View file

@ -3354,7 +3354,7 @@ void Player::_SaveSpellCooldowns()
m_spellCooldowns.erase(itr++); m_spellCooldowns.erase(itr++);
else if(itr->second.end <= infTime) // not save locked cooldowns, it will be reset or set at reload else if(itr->second.end <= infTime) // not save locked cooldowns, it will be reset or set at reload
{ {
CharacterDatabase.PExecute("INSERT INTO character_spell_cooldown (guid,spell,item,time) VALUES ('%u', '%u', '%u', '" I64FMTD "')", GetGUIDLow(), itr->first, itr->second.itemid, uint64(itr->second.end)); CharacterDatabase.PExecute("INSERT INTO character_spell_cooldown (guid,spell,item,time) VALUES ('%u', '%u', '%u', '" UI64FMTD "')", GetGUIDLow(), itr->first, itr->second.itemid, uint64(itr->second.end));
++itr; ++itr;
} }
else else
@ -10316,6 +10316,8 @@ void Player::QuickEquipItem( uint16 pos, Item *pItem)
pItem->AddToWorld(); pItem->AddToWorld();
pItem->SendUpdateToPlayer( this ); pItem->SendUpdateToPlayer( this );
} }
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
} }
} }
@ -14793,7 +14795,7 @@ void Player::_LoadMailedItems(Mail *mail)
void Player::_LoadMailInit(QueryResult *resultUnread, QueryResult *resultDelivery) void Player::_LoadMailInit(QueryResult *resultUnread, QueryResult *resultDelivery)
{ {
//set a count of unread mails //set a count of unread mails
//QueryResult *resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" I64FMTD "'", GUID_LOPART(playerGuid),(uint64)cTime); //QueryResult *resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(playerGuid),(uint64)cTime);
if (resultUnread) if (resultUnread)
{ {
Field *fieldMail = resultUnread->Fetch(); Field *fieldMail = resultUnread->Fetch();
@ -15572,7 +15574,7 @@ void Player::_SaveAuras()
if (i == 3) if (i == 3)
{ {
CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) " CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "' ,'%u', '%u', '%u', '%d', '%d', '%d', '%d')", "VALUES ('%u', '" UI64FMTD "' ,'%u', '%u', '%u', '%d', '%d', '%d', '%d')",
GetGUIDLow(), itr2->second->GetCasterGUID(), (uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), stackCounter, itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges())); GetGUIDLow(), itr2->second->GetCasterGUID(), (uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), stackCounter, itr2->second->GetModifier()->m_amount,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
} }
} }
@ -15679,7 +15681,7 @@ void Player::_SaveMail()
Mail *m = (*itr); Mail *m = (*itr);
if (m->state == MAIL_STATE_CHANGED) if (m->state == MAIL_STATE_CHANGED)
{ {
CharacterDatabase.PExecute("UPDATE mail SET itemTextId = '%u',has_items = '%u',expire_time = '" I64FMTD "', deliver_time = '" I64FMTD "',money = '%u',cod = '%u',checked = '%u' WHERE id = '%u'", CharacterDatabase.PExecute("UPDATE mail SET itemTextId = '%u',has_items = '%u',expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "',money = '%u',cod = '%u',checked = '%u' WHERE id = '%u'",
m->itemTextId, m->HasItems() ? 1 : 0, (uint64)m->expire_time, (uint64)m->deliver_time, m->money, m->COD, m->checked, m->messageID); m->itemTextId, m->HasItems() ? 1 : 0, (uint64)m->expire_time, (uint64)m->deliver_time, m->money, m->COD, m->checked, m->messageID);
if(m->removedItems.size()) if(m->removedItems.size())
{ {
@ -15727,11 +15729,11 @@ void Player::_SaveQuestStatus()
{ {
case QUEST_NEW : case QUEST_NEW :
CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) " CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) "
"VALUES ('%u', '%u', '%u', '%u', '%u', '" I64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", "VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]); GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
break; break;
case QUEST_CHANGED : case QUEST_CHANGED :
CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" I64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ", CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" UI64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ",
i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first ); i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
break; break;
case QUEST_UNCHANGED: case QUEST_UNCHANGED:
@ -15754,7 +15756,7 @@ void Player::_SaveDailyQuestStatus()
CharacterDatabase.PExecute("DELETE FROM character_queststatus_daily WHERE guid = '%u'",GetGUIDLow()); CharacterDatabase.PExecute("DELETE FROM character_queststatus_daily WHERE guid = '%u'",GetGUIDLow());
for(uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) for(uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
if(GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)) if(GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx))
CharacterDatabase.PExecute("INSERT INTO character_queststatus_daily (guid,quest,time) VALUES ('%u', '%u','" I64FMTD "')", CharacterDatabase.PExecute("INSERT INTO character_queststatus_daily (guid,quest,time) VALUES ('%u', '%u','" UI64FMTD "')",
GetGUIDLow(), GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx),uint64(m_lastDailyQuestTime)); GetGUIDLow(), GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx),uint64(m_lastDailyQuestTime));
} }
@ -16420,7 +16422,7 @@ void Player::PossessSpellInitialize()
if(!charmInfo) if(!charmInfo)
{ {
sLog.outError("Player::PossessSpellInitialize(): charm ("I64FMTD") has no charminfo!", charm->GetGUID()); sLog.outError("Player::PossessSpellInitialize(): charm (GUID: %u TypeId: %u) has no charminfo!", charm->GetGUIDLow(),charm->GetTypeId());
return; return;
} }
@ -16448,7 +16450,7 @@ void Player::CharmSpellInitialize()
CharmInfo *charmInfo = charm->GetCharmInfo(); CharmInfo *charmInfo = charm->GetCharmInfo();
if(!charmInfo) if(!charmInfo)
{ {
sLog.outError("Player::CharmSpellInitialize(): the player's charm ("I64FMTD") has no charminfo!", charm->GetGUID()); sLog.outError("Player::CharmSpellInitialize(): the player's charm (GUID: %u TypeId: %u) has no charminfo!", charm->GetGUIDLow(),charm->GetTypeId());
return; return;
} }
@ -18844,8 +18846,9 @@ uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
void Player::ResurectUsingRequestData() void Player::ResurectUsingRequestData()
{ {
/// Teleport before resurrecting, otherwise the player might get attacked from creatures near his corpse /// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse
TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation()); if(IS_PLAYER_GUID(m_resurrectGUID))
TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation());
ResurrectPlayer(0.0f,false); ResurrectPlayer(0.0f,false);
@ -19909,9 +19912,9 @@ void Player::UpdateKnownCurrencies(uint32 itemId, bool apply)
if(CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemId)) if(CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemId))
{ {
if(apply) if(apply)
SetFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(1LL << (ctEntry->BitIndex-1))); SetFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(UI64LIT(1) << (ctEntry->BitIndex-1)));
else else
RemoveFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(1LL << (ctEntry->BitIndex-1))); RemoveFlag64(PLAYER_FIELD_KNOWN_CURRENCIES,(UI64LIT(1) << (ctEntry->BitIndex-1)));
} }
} }

View file

@ -403,48 +403,48 @@ enum PlayerFlags
// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1) // used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1)
// can't use enum for uint64 values // can't use enum for uint64 values
#define PLAYER_TITLE_DISABLED 0x0000000000000000LL #define PLAYER_TITLE_DISABLED UI64LIT(0x0000000000000000)
#define PLAYER_TITLE_NONE 0x0000000000000001LL #define PLAYER_TITLE_NONE UI64LIT(0x0000000000000001)
#define PLAYER_TITLE_PRIVATE 0x0000000000000002LL // 1 #define PLAYER_TITLE_PRIVATE UI64LIT(0x0000000000000002) // 1
#define PLAYER_TITLE_CORPORAL 0x0000000000000004LL // 2 #define PLAYER_TITLE_CORPORAL UI64LIT(0x0000000000000004) // 2
#define PLAYER_TITLE_SERGEANT_A 0x0000000000000008LL // 3 #define PLAYER_TITLE_SERGEANT_A UI64LIT(0x0000000000000008) // 3
#define PLAYER_TITLE_MASTER_SERGEANT 0x0000000000000010LL // 4 #define PLAYER_TITLE_MASTER_SERGEANT UI64LIT(0x0000000000000010) // 4
#define PLAYER_TITLE_SERGEANT_MAJOR 0x0000000000000020LL // 5 #define PLAYER_TITLE_SERGEANT_MAJOR UI64LIT(0x0000000000000020) // 5
#define PLAYER_TITLE_KNIGHT 0x0000000000000040LL // 6 #define PLAYER_TITLE_KNIGHT UI64LIT(0x0000000000000040) // 6
#define PLAYER_TITLE_KNIGHT_LIEUTENANT 0x0000000000000080LL // 7 #define PLAYER_TITLE_KNIGHT_LIEUTENANT UI64LIT(0x0000000000000080) // 7
#define PLAYER_TITLE_KNIGHT_CAPTAIN 0x0000000000000100LL // 8 #define PLAYER_TITLE_KNIGHT_CAPTAIN UI64LIT(0x0000000000000100) // 8
#define PLAYER_TITLE_KNIGHT_CHAMPION 0x0000000000000200LL // 9 #define PLAYER_TITLE_KNIGHT_CHAMPION UI64LIT(0x0000000000000200) // 9
#define PLAYER_TITLE_LIEUTENANT_COMMANDER 0x0000000000000400LL // 10 #define PLAYER_TITLE_LIEUTENANT_COMMANDER UI64LIT(0x0000000000000400) // 10
#define PLAYER_TITLE_COMMANDER 0x0000000000000800LL // 11 #define PLAYER_TITLE_COMMANDER UI64LIT(0x0000000000000800) // 11
#define PLAYER_TITLE_MARSHAL 0x0000000000001000LL // 12 #define PLAYER_TITLE_MARSHAL UI64LIT(0x0000000000001000) // 12
#define PLAYER_TITLE_FIELD_MARSHAL 0x0000000000002000LL // 13 #define PLAYER_TITLE_FIELD_MARSHAL UI64LIT(0x0000000000002000) // 13
#define PLAYER_TITLE_GRAND_MARSHAL 0x0000000000004000LL // 14 #define PLAYER_TITLE_GRAND_MARSHAL UI64LIT(0x0000000000004000) // 14
#define PLAYER_TITLE_SCOUT 0x0000000000008000LL // 15 #define PLAYER_TITLE_SCOUT UI64LIT(0x0000000000008000) // 15
#define PLAYER_TITLE_GRUNT 0x0000000000010000LL // 16 #define PLAYER_TITLE_GRUNT UI64LIT(0x0000000000010000) // 16
#define PLAYER_TITLE_SERGEANT_H 0x0000000000020000LL // 17 #define PLAYER_TITLE_SERGEANT_H UI64LIT(0x0000000000020000) // 17
#define PLAYER_TITLE_SENIOR_SERGEANT 0x0000000000040000LL // 18 #define PLAYER_TITLE_SENIOR_SERGEANT UI64LIT(0x0000000000040000) // 18
#define PLAYER_TITLE_FIRST_SERGEANT 0x0000000000080000LL // 19 #define PLAYER_TITLE_FIRST_SERGEANT UI64LIT(0x0000000000080000) // 19
#define PLAYER_TITLE_STONE_GUARD 0x0000000000100000LL // 20 #define PLAYER_TITLE_STONE_GUARD UI64LIT(0x0000000000100000) // 20
#define PLAYER_TITLE_BLOOD_GUARD 0x0000000000200000LL // 21 #define PLAYER_TITLE_BLOOD_GUARD UI64LIT(0x0000000000200000) // 21
#define PLAYER_TITLE_LEGIONNAIRE 0x0000000000400000LL // 22 #define PLAYER_TITLE_LEGIONNAIRE UI64LIT(0x0000000000400000) // 22
#define PLAYER_TITLE_CENTURION 0x0000000000800000LL // 23 #define PLAYER_TITLE_CENTURION UI64LIT(0x0000000000800000) // 23
#define PLAYER_TITLE_CHAMPION 0x0000000001000000LL // 24 #define PLAYER_TITLE_CHAMPION UI64LIT(0x0000000001000000) // 24
#define PLAYER_TITLE_LIEUTENANT_GENERAL 0x0000000002000000LL // 25 #define PLAYER_TITLE_LIEUTENANT_GENERAL UI64LIT(0x0000000002000000) // 25
#define PLAYER_TITLE_GENERAL 0x0000000004000000LL // 26 #define PLAYER_TITLE_GENERAL UI64LIT(0x0000000004000000) // 26
#define PLAYER_TITLE_WARLORD 0x0000000008000000LL // 27 #define PLAYER_TITLE_WARLORD UI64LIT(0x0000000008000000) // 27
#define PLAYER_TITLE_HIGH_WARLORD 0x0000000010000000LL // 28 #define PLAYER_TITLE_HIGH_WARLORD UI64LIT(0x0000000010000000) // 28
#define PLAYER_TITLE_GLADIATOR 0x0000000020000000LL // 29 #define PLAYER_TITLE_GLADIATOR UI64LIT(0x0000000020000000) // 29
#define PLAYER_TITLE_DUELIST 0x0000000040000000LL // 30 #define PLAYER_TITLE_DUELIST UI64LIT(0x0000000040000000) // 30
#define PLAYER_TITLE_RIVAL 0x0000000080000000LL // 31 #define PLAYER_TITLE_RIVAL UI64LIT(0x0000000080000000) // 31
#define PLAYER_TITLE_CHALLENGER 0x0000000100000000LL // 32 #define PLAYER_TITLE_CHALLENGER UI64LIT(0x0000000100000000) // 32
#define PLAYER_TITLE_SCARAB_LORD 0x0000000200000000LL // 33 #define PLAYER_TITLE_SCARAB_LORD UI64LIT(0x0000000200000000) // 33
#define PLAYER_TITLE_CONQUEROR 0x0000000400000000LL // 34 #define PLAYER_TITLE_CONQUEROR UI64LIT(0x0000000400000000) // 34
#define PLAYER_TITLE_JUSTICAR 0x0000000800000000LL // 35 #define PLAYER_TITLE_JUSTICAR UI64LIT(0x0000000800000000) // 35
#define PLAYER_TITLE_CHAMPION_OF_THE_NAARU 0x0000001000000000LL // 36 #define PLAYER_TITLE_CHAMPION_OF_THE_NAARU UI64LIT(0x0000001000000000) // 36
#define PLAYER_TITLE_MERCILESS_GLADIATOR 0x0000002000000000LL // 37 #define PLAYER_TITLE_MERCILESS_GLADIATOR UI64LIT(0x0000002000000000) // 37
#define PLAYER_TITLE_OF_THE_SHATTERED_SUN 0x0000004000000000LL // 38 #define PLAYER_TITLE_OF_THE_SHATTERED_SUN UI64LIT(0x0000004000000000) // 38
#define PLAYER_TITLE_HAND_OF_ADAL 0x0000008000000000LL // 39 #define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39
#define PLAYER_TITLE_VENGEFUL_GLADIATOR 0x0000010000000000LL // 40 #define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40
// used in PLAYER_FIELD_BYTES values // used in PLAYER_FIELD_BYTES values
enum PlayerFieldByteFlags enum PlayerFieldByteFlags

View file

@ -768,28 +768,28 @@ void Spell::prepareDataForTriggerSystem()
switch (m_spellInfo->SpellFamilyName) switch (m_spellInfo->SpellFamilyName)
{ {
case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it case SPELLFAMILY_MAGE: // Arcane Missles / Blizzard triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0000000000200080LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000200080))
m_canTrigger = true; m_canTrigger = true;
break; break;
case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0000800000000060LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000800000000060))
m_canTrigger = true; m_canTrigger = true;
break; break;
case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it case SPELLFAMILY_PRIEST: // For Penance heal/damage triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0001800000000000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001800000000000))
m_canTrigger = true; m_canTrigger = true;
break; break;
case SPELLFAMILY_ROGUE: // For poisons need do it case SPELLFAMILY_ROGUE: // For poisons need do it
if (m_spellInfo->SpellFamilyFlags & 0x000000101001E000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000000101001E000))
m_canTrigger = true; m_canTrigger = true;
break; break;
case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot
if (m_spellInfo->SpellFamilyFlags & 0x0100200000000214LL || if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0100200000000214)) ||
m_spellInfo->SpellFamilyFlags2 & 0x200) m_spellInfo->SpellFamilyFlags2 & 0x200)
m_canTrigger = true; m_canTrigger = true;
break; break;
case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it
if (m_spellInfo->SpellFamilyFlags & 0x0001000900B80400LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001000900B80400))
m_canTrigger = true; m_canTrigger = true;
break; break;
default: default:
@ -837,7 +837,7 @@ void Spell::prepareDataForTriggerSystem()
} }
// Hunter traps spells (for Entrapment trigger) // Hunter traps spells (for Entrapment trigger)
// Gives your Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap .... // Gives your Immolation Trap, Frost Trap, Explosive Trap, and Snake Trap ....
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->SpellFamilyFlags & 0x000020000000001CLL) if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000020000000001C)))
m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION; m_procAttacker |= PROC_FLAG_ON_TRAP_ACTIVATION;
} }
@ -894,7 +894,7 @@ void Spell::AddUnitTarget(Unit* pVictim, uint32 effIndex)
m_delayMoment = target.timeDelay; m_delayMoment = target.timeDelay;
} }
else else
target.timeDelay = 0LL; target.timeDelay = UI64LIT(0);
// If target reflect spell back to caster // If target reflect spell back to caster
if (target.missCondition == SPELL_MISS_REFLECT) if (target.missCondition == SPELL_MISS_REFLECT)
@ -957,7 +957,7 @@ void Spell::AddGOTarget(GameObject* pVictim, uint32 effIndex)
m_delayMoment = target.timeDelay; m_delayMoment = target.timeDelay;
} }
else else
target.timeDelay = 0LL; target.timeDelay = UI64LIT(0);
// Add target to list // Add target to list
m_UniqueGOTargetInfo.push_back(target); m_UniqueGOTargetInfo.push_back(target);
@ -1079,7 +1079,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
caster->DealSpellDamage(&damageInfo, true); caster->DealSpellDamage(&damageInfo, true);
// Judgement of Blood // Judgement of Blood
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags & 0x0000000800000000LL && m_spellInfo->SpellIconID==153) if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000800000000)) && m_spellInfo->SpellIconID==153)
{ {
int32 damagePoint = damageInfo.damage * 33 / 100; int32 damagePoint = damageInfo.damage * 33 / 100;
m_caster->CastCustomSpell(m_caster, 32220, &damagePoint, NULL, NULL, true); m_caster->CastCustomSpell(m_caster, 32220, &damagePoint, NULL, NULL, true);
@ -1371,7 +1371,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
{ {
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
// Starfall // Starfall
if (m_spellInfo->SpellFamilyFlags2 & 0x00000100LL) if (m_spellInfo->SpellFamilyFlags2 & UI64LIT(0x00000100))
unMaxTargets = 2; unMaxTargets = 2;
break; break;
default: default:
@ -2393,7 +2393,8 @@ void Spell::cast(bool skipCheck)
} }
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
{ {
if (m_spellInfo->SpellFamilyFlags&0x0000008000000000LL) // Ice Block // Ice Block
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000008000000000))
m_preCastSpell = 41425; // Hypothermia m_preCastSpell = 41425; // Hypothermia
break; break;
} }
@ -2408,7 +2409,8 @@ void Spell::cast(bool skipCheck)
} }
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
if (m_spellInfo->SpellFamilyFlags&0x0000000000400080LL) // Divine Shield, Divine Protection or Hand of Protection // Divine Shield, Divine Protection or Hand of Protection
if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000400080))
m_preCastSpell = 25771; // Forbearance m_preCastSpell = 25771; // Forbearance
break; break;
} }
@ -3860,9 +3862,8 @@ SpellCastResult Spell::CheckCast(bool strict)
{ {
//Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags //Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags
//Exclusion for Mutilate:Facing Limitation was removed in 2.0.1 and 3.0.3, but they still use the same, old Ex-Flags //Exclusion for Mutilate:Facing Limitation was removed in 2.0.1 and 3.0.3, but they still use the same, old Ex-Flags
if( (m_spellInfo->SpellFamilyName != SPELLFAMILY_DRUID || m_spellInfo->SpellFamilyFlags != 0x0000000000020000LL) && if ((m_spellInfo->SpellFamilyName != SPELLFAMILY_DRUID || (m_spellInfo->SpellFamilyFlags != UI64LIT(0x0000000000020000))) &&
(m_spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || m_spellInfo->SpellFamilyFlags != 0x0020000000000000LL) (m_spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || (m_spellInfo->SpellFamilyFlags != UI64LIT(0x0020000000000000))))
)
{ {
SendInterrupted(2); SendInterrupted(2);
return SPELL_FAILED_NOT_BEHIND; return SPELL_FAILED_NOT_BEHIND;
@ -5379,7 +5380,7 @@ bool Spell::CheckTargetCreatureType(Unit* target) const
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType; uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
// Curse of Doom : not find another way to fix spell target check :/ // Curse of Doom : not find another way to fix spell target check :/
if(m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags == 0x0200000000LL) if(m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags == UI64LIT(0x0200000000))
{ {
// not allow cast at player // not allow cast at player
if(target->GetTypeId()==TYPEID_PLAYER) if(target->GetTypeId()==TYPEID_PLAYER)

View file

@ -88,11 +88,11 @@ enum AuraType
SPELL_AURA_PROC_TRIGGER_DAMAGE = 43, SPELL_AURA_PROC_TRIGGER_DAMAGE = 43,
SPELL_AURA_TRACK_CREATURES = 44, SPELL_AURA_TRACK_CREATURES = 44,
SPELL_AURA_TRACK_RESOURCES = 45, SPELL_AURA_TRACK_RESOURCES = 45,
SPELL_AURA_46 = 46, // Ignore all Gear test spells SPELL_AURA_46 = 46, // Ignore all Gear test spells
SPELL_AURA_MOD_PARRY_PERCENT = 47, SPELL_AURA_MOD_PARRY_PERCENT = 47,
SPELL_AURA_48 = 48, // One periodic spell SPELL_AURA_48 = 48, // One periodic spell
SPELL_AURA_MOD_DODGE_PERCENT = 49, SPELL_AURA_MOD_DODGE_PERCENT = 49,
SPELL_AURA_MOD_CRITICAL_HEALING_BONUS = 50, SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50,
SPELL_AURA_MOD_BLOCK_PERCENT = 51, SPELL_AURA_MOD_BLOCK_PERCENT = 51,
SPELL_AURA_MOD_CRIT_PERCENT = 52, SPELL_AURA_MOD_CRIT_PERCENT = 52,
SPELL_AURA_PERIODIC_LEECH = 53, SPELL_AURA_PERIODIC_LEECH = 53,
@ -132,7 +132,7 @@ enum AuraType
SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87,
SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88, SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88,
SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89, SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89,
SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE
SPELL_AURA_MOD_DETECT_RANGE = 91, SPELL_AURA_MOD_DETECT_RANGE = 91,
SPELL_AURA_PREVENTS_FLEEING = 92, SPELL_AURA_PREVENTS_FLEEING = 92,
SPELL_AURA_MOD_UNATTACKABLE = 93, SPELL_AURA_MOD_UNATTACKABLE = 93,

View file

@ -100,7 +100,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT &Aura::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT
&Aura::HandleNULL, // 48 SPELL_AURA_48 spell Napalm (area damage spell with additional delayed damage effect) &Aura::HandleNULL, // 48 SPELL_AURA_48 spell Napalm (area damage spell with additional delayed damage effect)
&Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT &Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
&Aura::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_BONUS &Aura::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT implemented in Unit::SpellCriticalHealingBonus
&Aura::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT &Aura::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
&Aura::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT &Aura::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT
&Aura::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH &Aura::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH
@ -989,19 +989,19 @@ void Aura::_AddAura()
m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true); m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true);
// Faerie Fire (druid versions) // Faerie Fire (druid versions)
if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x0000000000000400LL) if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400)))
m_target->ModifyAuraState(AURA_STATE_FAERIE_FIRE, true); m_target->ModifyAuraState(AURA_STATE_FAERIE_FIRE, true);
// Victorious // Victorious
if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags & 0x0004000000000000LL) if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0004000000000000)))
m_target->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, true); m_target->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, true);
// Swiftmend state on Regrowth & Rejuvenation // Swiftmend state on Regrowth & Rejuvenation
if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x50 ) if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (m_spellProto->SpellFamilyFlags & UI64LIT(0x50)))
m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, true); m_target->ModifyAuraState(AURA_STATE_SWIFTMEND, true);
// Deadly poison aura state // Deadly poison aura state
if(m_spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellProto->SpellFamilyFlags & 0x10000) if(m_spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellProto->SpellFamilyFlags & UI64LIT(0x10000)))
m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON, true); m_target->ModifyAuraState(AURA_STATE_DEADLY_POISON, true);
// Enrage aura state // Enrage aura state
@ -1089,28 +1089,28 @@ void Aura::_RemoveAura()
removeState = AURA_STATE_JUDGEMENT; // Update Seals information removeState = AURA_STATE_JUDGEMENT; // Update Seals information
break; break;
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
if(m_spellProto->SpellFamilyFlags & 4) if(m_spellProto->SpellFamilyFlags & UI64LIT(0x4))
removeState = AURA_STATE_IMMOLATE; // Conflagrate aura state removeState = AURA_STATE_IMMOLATE; // Conflagrate aura state
break; break;
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
if(m_spellProto->SpellFamilyFlags & 0x0000000000000400LL) if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400))
removeState = AURA_STATE_FAERIE_FIRE; // Faerie Fire (druid versions) removeState = AURA_STATE_FAERIE_FIRE; // Faerie Fire (druid versions)
else if(m_spellProto->SpellFamilyFlags & 0x50) else if(m_spellProto->SpellFamilyFlags & UI64LIT(0x50))
{ {
removeFamilyFlag = 0x50; removeFamilyFlag = 0x50;
removeState = AURA_STATE_SWIFTMEND; // Swiftmend aura state removeState = AURA_STATE_SWIFTMEND; // Swiftmend aura state
} }
break; break;
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
if(m_spellProto->SpellFamilyFlags & 0x0004000000000000LL) if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0004000000000000))
removeState = AURA_STATE_WARRIOR_VICTORY_RUSH; // Victorious removeState = AURA_STATE_WARRIOR_VICTORY_RUSH; // Victorious
break; break;
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
if(m_spellProto->SpellFamilyFlags & 0x10000) if(m_spellProto->SpellFamilyFlags & UI64LIT(0x10000))
removeState = AURA_STATE_DEADLY_POISON; // Deadly poison aura state removeState = AURA_STATE_DEADLY_POISON; // Deadly poison aura state
break; break;
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
if(m_spellProto->SpellFamilyFlags & 0x1000000000000000LL) if(m_spellProto->SpellFamilyFlags & UI64LIT(0x1000000000000000))
removeState = AURA_STATE_FAERIE_FIRE; // Sting (hunter versions) removeState = AURA_STATE_FAERIE_FIRE; // Sting (hunter versions)
} }
@ -1301,7 +1301,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
((Player*)m_target)->AddSpellMod(m_spellmod, apply); ((Player*)m_target)->AddSpellMod(m_spellmod, apply);
// reapply some passive spells after add/remove related spellmods // reapply some passive spells after add/remove related spellmods
if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && (spellFamilyMask & 0x0000100000000000LL)) if(m_spellProto->SpellFamilyName==SPELLFAMILY_WARRIOR && (spellFamilyMask & UI64LIT(0x0000100000000000)))
{ {
m_target->RemoveAurasDueToSpell(45471); m_target->RemoveAurasDueToSpell(45471);
@ -1916,7 +1916,7 @@ void Aura::TriggerSpell()
{ {
SpellEntry const* spell = itr->second->GetSpellProto(); SpellEntry const* spell = itr->second->GetSpellProto();
if( spell->SpellFamilyName == SPELLFAMILY_SHAMAN && if( spell->SpellFamilyName == SPELLFAMILY_SHAMAN &&
spell->SpellFamilyFlags & 0x0000000000000400L) (spell->SpellFamilyFlags & UI64LIT(0x0000000000000400)))
return; return;
} }
target->RemoveAurasDueToSpell(28820); target->RemoveAurasDueToSpell(28820);
@ -2083,7 +2083,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
// Earth Shield // Earth Shield
if ( caster && GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && (GetSpellProto()->SpellFamilyFlags & 0x40000000000LL)) if ( caster && GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000)))
{ {
// prevent double apply bonuses // prevent double apply bonuses
if(m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()) if(m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading())
@ -2164,14 +2164,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{ {
// Stop caster Arcane Missle chanelling on death // Stop caster Arcane Missle chanelling on death
if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE &&
m_spellProto->SpellFamilyFlags&0x0000000000000800LL) (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000800)))
{ {
caster->InterruptSpell(CURRENT_CHANNELED_SPELL); caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
return; return;
} }
// Stop caster Penance chanelling on death // Stop caster Penance chanelling on death
if (m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && if (m_spellProto->SpellFamilyName == SPELLFAMILY_PRIEST &&
m_spellProto->SpellFamilyFlags2 & 0x00000080) (m_spellProto->SpellFamilyFlags2 & UI64LIT(0x00000080)))
{ {
caster->InterruptSpell(CURRENT_CHANNELED_SPELL); caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
return; return;
@ -2297,8 +2297,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
mod->value = m_modifier.m_amount; mod->value = m_modifier.m_amount;
mod->type = SPELLMOD_PCT; mod->type = SPELLMOD_PCT;
mod->spellId = GetId(); mod->spellId = GetId();
mod->mask = 0x0000200000000000LL; mod->mask = UI64LIT(0x0000200000000000);
mod->mask2= 0LL; mod->mask2= UI64LIT(0x0);
m_spellmod = mod; m_spellmod = mod;
} }
((Player*)m_target)->AddSpellMod(m_spellmod, apply); ((Player*)m_target)->AddSpellMod(m_spellmod, apply);
@ -2323,8 +2323,8 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
mod->value = m_modifier.m_amount/7; mod->value = m_modifier.m_amount/7;
mod->type = SPELLMOD_FLAT; mod->type = SPELLMOD_FLAT;
mod->spellId = GetId(); mod->spellId = GetId();
mod->mask = 0x001000000000LL; mod->mask = UI64LIT(0x001000000000);
mod->mask2= 0LL; mod->mask2= UI64LIT(0x0);
m_spellmod = mod; m_spellmod = mod;
} }
@ -2349,7 +2349,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
} }
// Lifebloom // Lifebloom
if ( GetSpellProto()->SpellFamilyFlags & 0x1000000000LL ) if (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000))
{ {
if ( apply ) if ( apply )
{ {
@ -2368,7 +2368,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
Unit::AuraList auras = m_target->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList auras = m_target->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::AuraList::iterator itr = auras.begin(); itr!=auras.end(); ++itr)
if((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID && if((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID &&
(*itr)->GetSpellProto()->SpellFamilyFlags & 0x1000000000LL) ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x1000000000)))
return; return;
// final heal // final heal
@ -2406,12 +2406,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
switch (m_effIndex) switch (m_effIndex)
{ {
case 0: case 0:
mod->mask = 0x00200000000LL; // Windfury Totem // Windfury Totem
mod->mask2= 0LL; mod->mask = UI64LIT(0x00200000000);
mod->mask2= UI64LIT(0x0);
break; break;
case 1: case 1:
mod->mask = 0x00400000000LL; // Flametongue Totem // Flametongue Totem
mod->mask2= 0LL; mod->mask = UI64LIT(0x00400000000);
mod->mask2= UI64LIT(0x0);
break; break;
} }
@ -3273,7 +3275,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
if(m_target->GetCharmInfo()) if(m_target->GetCharmInfo())
m_target->GetCharmInfo()->SetPetNumber(0, true); m_target->GetCharmInfo()->SetPetNumber(0, true);
else else
sLog.outError("Aura::HandleModCharm: target="I64FMTD" with typeid=%d has a charm aura but no charm info!", m_target->GetGUID(), m_target->GetTypeId()); sLog.outError("Aura::HandleModCharm: target (GUID: %u TypeId: %u) has a charm aura but no charm info!", m_target->GetGUIDLow(), m_target->GetTypeId());
} }
} }
@ -3414,7 +3416,10 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
if(m_target->GetTypeId() != TYPEID_PLAYER) if(m_target->GetTypeId() != TYPEID_PLAYER)
((Creature*)m_target)->StopMoving(); ((Creature*)m_target)->StopMoving();
else else
{
((Player*)m_target)->m_movementInfo.flags = 0; // Clear movement flags ((Player*)m_target)->m_movementInfo.flags = 0; // Clear movement flags
m_target->SetStandState(UNIT_STAND_STATE_STAND);
}
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8);
data.append(m_target->GetPackGUID()); data.append(m_target->GetPackGUID());
@ -3481,7 +3486,7 @@ void Aura::HandleAuraModStun(bool apply, bool Real)
} }
// Wyvern Sting // Wyvern Sting
if (m_spellProto->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellProto->SpellFamilyFlags & 0x0000100000000000LL) if (m_spellProto->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
{ {
Unit* caster = GetCaster(); Unit* caster = GetCaster();
if( !caster || caster->GetTypeId()!=TYPEID_PLAYER ) if( !caster || caster->GetTypeId()!=TYPEID_PLAYER )
@ -3552,7 +3557,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
pTarget->CastCustomSpell(pTarget,31665,&bp,NULL,NULL,true); pTarget->CastCustomSpell(pTarget,31665,&bp,NULL,NULL,true);
} }
// Overkill // Overkill
else if ((*i)->GetId() == 58426 && pSpellInfo->SpellFamilyFlags & 0x0000000000400000LL) else if ((*i)->GetId() == 58426 && pSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000400000))
{ {
pTarget->RemoveAurasDueToSpell(58428); pTarget->RemoveAurasDueToSpell(58428);
pTarget->CastSpell(pTarget, 58427, true); pTarget->CastSpell(pTarget, 58427, true);
@ -3592,7 +3597,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
if ((*i)->GetSpellProto()->SpellIconID == 2114) if ((*i)->GetSpellProto()->SpellIconID == 2114)
pTarget->CastSpell(pTarget, 31666, true); pTarget->CastSpell(pTarget, 31666, true);
// Overkill // Overkill
else if ((*i)->GetId() == 58426 && pSpellInfo->SpellFamilyFlags & 0x0000000000400000LL) else if ((*i)->GetId() == 58426 && pSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000400000))
pTarget->CastSpell(pTarget, 58428, true); pTarget->CastSpell(pTarget, 58428, true);
} }
} }
@ -4268,7 +4273,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Rend // Rend
if (m_spellProto->SpellFamilyFlags & 0x0000000000000020LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000020))
{ {
// $0.2*(($MWB+$mwb)/2+$AP/14*$MWS) bonus per tick // $0.2*(($MWB+$mwb)/2+$AP/14*$MWS) bonus per tick
float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK);
@ -4283,21 +4288,21 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
{ {
// Rake // Rake
if (m_spellProto->SpellFamilyFlags & 0x0000000000001000LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000001000))
{ {
// $AP*0.06 bonus per tick // $AP*0.06 bonus per tick
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 6 / 100); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 6 / 100);
return; return;
} }
// Lacerate // Lacerate
if (m_spellProto->SpellFamilyFlags & 0x000000010000000000LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x000000010000000000))
{ {
// $AP*0.05/5 bonus per tick // $AP*0.05/5 bonus per tick
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
return; return;
} }
// Rip // Rip
if (m_spellProto->SpellFamilyFlags & 0x000000000000800000LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x000000000000800000))
{ {
// 0.01*$AP*cp // 0.01*$AP*cp
if (caster->GetTypeId() != TYPEID_PLAYER) if (caster->GetTypeId() != TYPEID_PLAYER)
@ -4319,7 +4324,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
return; return;
} }
// Lock Jaw // Lock Jaw
if (m_spellProto->SpellFamilyFlags & 0x1000000000000000LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x1000000000000000))
{ {
// 0.15*$AP // 0.15*$AP
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 15 / 100); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 15 / 100);
@ -4330,7 +4335,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
{ {
// Rupture // Rupture
if (m_spellProto->SpellFamilyFlags & 0x000000000000100000LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x000000000000100000))
{ {
if (caster->GetTypeId() != TYPEID_PLAYER) if (caster->GetTypeId() != TYPEID_PLAYER)
return; return;
@ -4346,14 +4351,14 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
return; return;
} }
// Garrote // Garrote
if (m_spellProto->SpellFamilyFlags & 0x000000000000000100LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x000000000000000100))
{ {
// $AP*0.07 bonus per tick // $AP*0.07 bonus per tick
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 7 / 100); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 7 / 100);
return; return;
} }
// Deadly Poison // Deadly Poison
if (m_spellProto->SpellFamilyFlags & 0x0000000000010000) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000010000))
{ {
// 0.08*$AP / 4 * amount of stack // 0.08*$AP / 4 * amount of stack
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 2 * GetStackAmount() / 100); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 2 * GetStackAmount() / 100);
@ -4364,14 +4369,14 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real)
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
{ {
// Serpent Sting // Serpent Sting
if (m_spellProto->SpellFamilyFlags & 0x0000000000004000LL) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000004000))
{ {
// $RAP*0.1/5 bonus per tick // $RAP*0.1/5 bonus per tick
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500);
return; return;
} }
// Immolation Trap // Immolation Trap
if (m_spellProto->SpellFamilyFlags & 0x0000000000000004LL && m_spellProto->SpellIconID == 678) if ((m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) && m_spellProto->SpellIconID == 678)
{ {
// $RAP*0.1/5 bonus per tick // $RAP*0.1/5 bonus per tick
m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500); m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500);
@ -5595,7 +5600,7 @@ void Aura::HandleSpiritOfRedemption( bool apply, bool Real )
void Aura::CleanupTriggeredSpells() void Aura::CleanupTriggeredSpells()
{ {
if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && m_spellProto->SpellFamilyFlags & 0x0000001000000020LL) if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARRIOR && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000001000000020)))
{ {
// Blood Frenzy remove // Blood Frenzy remove
m_target->RemoveAurasDueToSpell(30069); m_target->RemoveAurasDueToSpell(30069);
@ -5644,7 +5649,9 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real)
} }
break; break;
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
if(m_spellProto->SpellFamilyFlags == 0x80100 || m_spellProto->SpellFamilyFlags == 0x8 || m_spellProto->SpellFamilyFlags == 0x100000000LL) if (m_spellProto->SpellFamilyFlags == UI64LIT(0x80100) ||
m_spellProto->SpellFamilyFlags == UI64LIT(0x8) ||
m_spellProto->SpellFamilyFlags == UI64LIT(0x100000000))
{ {
//frost ward, fire ward, ice barrier //frost ward, fire ward, ice barrier
//+10% from +spd bonus //+10% from +spd bonus
@ -5751,7 +5758,7 @@ void Aura::PeriodicTick()
pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount()); pdamage = pCaster->SpellDamageBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount());
// Curse of Agony damage-per-tick calculation // Curse of Agony damage-per-tick calculation
if (GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & 0x0000000000000400LL) && GetSpellProto()->SpellIconID==544) if (GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000400)) && GetSpellProto()->SpellIconID==544)
{ {
// 1..4 ticks, 1/2 from normal tick damage // 1..4 ticks, 1/2 from normal tick damage
if (m_duration >= ((m_maxduration-m_modifier.periodictime) * 2 / 3)) if (m_duration >= ((m_maxduration-m_modifier.periodictime) * 2 / 3))
@ -6462,7 +6469,7 @@ void Aura::PeriodicDummyTick()
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
{ {
// Explosive Shot // Explosive Shot
if (spell->SpellFamilyFlags & 0x8000000000000000LL) if (spell->SpellFamilyFlags & UI64LIT(0x8000000000000000))
{ {
if (!caster) if (!caster)
return; return;
@ -6512,17 +6519,17 @@ void Aura::PeriodicDummyTick()
case SPELLFAMILY_DEATHKNIGHT: case SPELLFAMILY_DEATHKNIGHT:
{ {
// Death and Decay // Death and Decay
if (spell->SpellFamilyFlags & 0x0000000000000020LL) if (spell->SpellFamilyFlags & UI64LIT(0x0000000000000020))
{ {
if (caster) if (caster)
caster->CastCustomSpell(m_target, 52212, &m_modifier.m_amount, NULL, NULL, true, 0, this); caster->CastCustomSpell(m_target, 52212, &m_modifier.m_amount, NULL, NULL, true, 0, this);
return; return;
} }
// Raise Dead // Raise Dead
// if (spell->SpellFamilyFlags & 0x0000000000001000LL) // if (spell->SpellFamilyFlags & UI64LIT(0x0000000000001000))
// return; // return;
// Chains of Ice // Chains of Ice
if (spell->SpellFamilyFlags & 0x0000400000000000LL) if (spell->SpellFamilyFlags & UI64LIT(0x0000400000000000))
{ {
// Get 0 effect aura // Get 0 effect aura
Aura *slow = m_target->GetAura(GetId(), 0); Aura *slow = m_target->GetAura(GetId(), 0);
@ -6537,10 +6544,10 @@ void Aura::PeriodicDummyTick()
return; return;
} }
// Summon Gargoyle // Summon Gargoyle
// if (spell->SpellFamilyFlags & 0x0000008000000000LL) // if (spell->SpellFamilyFlags & UI64LIT(0x0000008000000000))
// return; // return;
// Death Rune Mastery // Death Rune Mastery
// if (spell->SpellFamilyFlags & 0x0000000000004000LL) // if (spell->SpellFamilyFlags & UI64LIT(0x0000000000004000))
// return; // return;
// Bladed Armor // Bladed Armor
if (spell->SpellIconID == 2653) if (spell->SpellIconID == 2653)
@ -6593,7 +6600,7 @@ void Aura::HandleManaShield(bool apply, bool Real)
switch(m_spellProto->SpellFamilyName) switch(m_spellProto->SpellFamilyName)
{ {
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
if(m_spellProto->SpellFamilyFlags & 0x8000) if(m_spellProto->SpellFamilyFlags & UI64LIT(0x8000))
{ {
// Mana Shield // Mana Shield
// +50% from +spd bonus // +50% from +spd bonus

View file

@ -311,7 +311,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_GENERIC: case SPELLFAMILY_GENERIC:
{ {
//Gore //Gore
if(m_spellInfo->SpellIconID == 2269 ) if (m_spellInfo->SpellIconID == 2269 )
{ {
damage+= rand()%2 ? damage : 0; damage+= rand()%2 ? damage : 0;
} }
@ -362,7 +362,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
{ {
// Arcane Blast // Arcane Blast
if(m_spellInfo->SpellFamilyFlags & 0x20000000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000))
{ {
m_caster->CastSpell(m_caster, 36032, true); m_caster->CastSpell(m_caster, 36032, true);
} }
@ -371,27 +371,27 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Bloodthirst // Bloodthirst
if(m_spellInfo->SpellFamilyFlags & 0x40000000000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x40000000000))
{ {
damage = uint32(damage * (m_caster->GetTotalAttackPowerValue(BASE_ATTACK)) / 100); damage = uint32(damage * (m_caster->GetTotalAttackPowerValue(BASE_ATTACK)) / 100);
} }
// Shield Slam // Shield Slam
else if(m_spellInfo->SpellFamilyFlags & 0x0000020000000000LL && m_spellInfo->Category==1209) else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000020000000000)) && m_spellInfo->Category==1209)
damage += int32(m_caster->GetShieldBlockValue()); damage += int32(m_caster->GetShieldBlockValue());
// Victory Rush // Victory Rush
else if(m_spellInfo->SpellFamilyFlags & 0x10000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x10000000000))
{ {
damage = uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100); damage = uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
m_caster->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, false); m_caster->ModifyAuraState(AURA_STATE_WARRIOR_VICTORY_RUSH, false);
} }
// Revenge ${$m1+$AP*0.207} to ${$M1+$AP*0.207} // Revenge ${$m1+$AP*0.207} to ${$M1+$AP*0.207}
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000000400LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000400))
damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.207f); damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.207f);
// Heroic Throw ${$m1+$AP*.50} // Heroic Throw ${$m1+$AP*.50}
else if(m_spellInfo->SpellFamilyFlags & 0x0000000100000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000100000000))
damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f); damage+= uint32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f);
// Shockwave ${$m3/100*$AP} // Shockwave ${$m3/100*$AP}
else if(m_spellInfo->SpellFamilyFlags & 0x0000800000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000800000000000))
{ {
int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget); int32 pct = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
if (pct > 0) if (pct > 0)
@ -403,7 +403,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
{ {
// Incinerate Rank 1 & 2 // Incinerate Rank 1 & 2
if((m_spellInfo->SpellFamilyFlags & 0x00004000000000LL) && m_spellInfo->SpellIconID==2128) if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00004000000000)) && m_spellInfo->SpellIconID==2128)
{ {
// Incinerate does more dmg (dmg*0.25) if the target is Immolated. // Incinerate does more dmg (dmg*0.25) if the target is Immolated.
if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE)) if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE))
@ -414,14 +414,14 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
{ {
// Shadow Word: Death - deals damage equal to damage done to caster // Shadow Word: Death - deals damage equal to damage done to caster
if (m_spellInfo->SpellFamilyFlags & 0x0000000200000000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000200000000))
m_caster->CastCustomSpell(m_caster, 32409, &damage, 0, 0, true); m_caster->CastCustomSpell(m_caster, 32409, &damage, 0, 0, true);
break; break;
} }
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
{ {
// Ferocious Bite // Ferocious Bite
if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & 0x000800000) && m_spellInfo->SpellVisual[0]==6587) if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000800000)) && m_spellInfo->SpellVisual[0]==6587)
{ {
// converts each extra point of energy into ($f1+$AP/410) additional damage // converts each extra point of energy into ($f1+$AP/410) additional damage
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
@ -431,22 +431,22 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
m_caster->SetPower(POWER_ENERGY,0); m_caster->SetPower(POWER_ENERGY,0);
} }
// Rake // Rake
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000001000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000001000))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
} }
// Swipe // Swipe
else if(m_spellInfo->SpellFamilyFlags & 0x0010000000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0010000000000000))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.08f); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.08f);
} }
//Mangle Bonus for the initial damage of Lacerate and Rake //Mangle Bonus for the initial damage of Lacerate and Rake
if((m_spellInfo->SpellFamilyFlags==0x0000000000001000LL && m_spellInfo->SpellIconID==494) || if ((m_spellInfo->SpellFamilyFlags==UI64LIT(0x0000000000001000) && m_spellInfo->SpellIconID==494) ||
(m_spellInfo->SpellFamilyFlags==0x0000010000000000LL && m_spellInfo->SpellIconID==2246)) (m_spellInfo->SpellFamilyFlags==UI64LIT(0x0000010000000000) && m_spellInfo->SpellIconID==2246))
{ {
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) for(Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
if((*i)->GetSpellProto()->SpellFamilyFlags & 0x0000044000000000LL && (*i)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID) if(((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000044000000000)) && (*i)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID)
{ {
damage = int32(damage*(100.0f+(*i)->GetModifier()->m_amount)/100.0f); damage = int32(damage*(100.0f+(*i)->GetModifier()->m_amount)/100.0f);
break; break;
@ -457,7 +457,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
{ {
// Envenom // Envenom
if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & 0x800000000LL)) if (m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x800000000)))
{ {
// consume from stack dozes not more that have combo-points // consume from stack dozes not more that have combo-points
if(uint32 combo = ((Player*)m_caster)->GetComboPoints()) if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
@ -467,7 +467,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr) for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE && if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
(*itr)->GetSpellProto()->SpellFamilyFlags & 0x10000 && ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x10000)) &&
(*itr)->GetCasterGUID()==m_caster->GetGUID() ) (*itr)->GetCasterGUID()==m_caster->GetGUID() )
{ {
poison = *itr; poison = *itr;
@ -491,7 +491,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
} }
} }
// Eviscerate // Eviscerate
else if((m_spellInfo->SpellFamilyFlags & 0x00020000LL) && m_caster->GetTypeId()==TYPEID_PLAYER) else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00020000)) && m_caster->GetTypeId()==TYPEID_PLAYER)
{ {
if(uint32 combo = ((Player*)m_caster)->GetComboPoints()) if(uint32 combo = ((Player*)m_caster)->GetComboPoints())
{ {
@ -504,17 +504,17 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
} }
} }
// Gouge // Gouge
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000000008LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000008))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.21f); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.21f);
} }
// Instant Poison // Instant Poison
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000002000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.10f); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.10f);
} }
// Wound Poison // Wound Poison
else if(m_spellInfo->SpellFamilyFlags & 0x0000000010000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000010000000))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.04f); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.04f);
} }
@ -523,28 +523,28 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
{ {
// Mongoose Bite // Mongoose Bite
if((m_spellInfo->SpellFamilyFlags & 0x000000002) && m_spellInfo->SpellVisual[0]==342) if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x000000002)) && m_spellInfo->SpellVisual[0]==342)
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
} }
// Counterattack // Counterattack
else if(m_spellInfo->SpellFamilyFlags & 0x0008000000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0008000000000000))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f); damage += int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f);
} }
// Arcane Shot // Arcane Shot
else if((m_spellInfo->SpellFamilyFlags & 0x00000800) && m_spellInfo->maxLevel > 0) else if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000800)) && m_spellInfo->maxLevel > 0)
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.15f); damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.15f);
} }
// Steady Shot // Steady Shot
else if(m_spellInfo->SpellFamilyFlags & 0x100000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000))
{ {
int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE)); int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE));
damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f); damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f);
} }
// Explosive Trap Effect // Explosive Trap Effect
else if(m_spellInfo->SpellFamilyFlags & 0x00000004) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000004))
{ {
damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1f); damage += int32(m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1f);
} }
@ -553,7 +553,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
// Judgement of Vengeance ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance on the target // Judgement of Vengeance ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance on the target
if((m_spellInfo->SpellFamilyFlags & 0x800000000LL) && m_spellInfo->SpellIconID==2292) if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x800000000)) && m_spellInfo->SpellIconID==2292)
{ {
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) + int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
@ -573,7 +573,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
damage += damage * stacks * 10 /100; damage += damage * stacks * 10 /100;
} }
// Avenger's Shield ($m1+0.07*$SPH+0.07*$AP) - ranged sdb for future // Avenger's Shield ($m1+0.07*$SPH+0.07*$AP) - ranged sdb for future
else if(m_spellInfo->SpellFamilyFlags & 0x0000000000004000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000))
{ {
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) + int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
@ -581,7 +581,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
damage += int32(ap * 0.07f) + int32(holy * 7 / 100); damage += int32(ap * 0.07f) + int32(holy * 7 / 100);
} }
// Hammer of Wrath ($m1+0.15*$SPH+0.15*$AP) - ranged type sdb future fix // Hammer of Wrath ($m1+0.15*$SPH+0.15*$AP) - ranged type sdb future fix
else if(m_spellInfo->SpellFamilyFlags & 0x0000008000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000008000000000))
{ {
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) + int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) +
@ -589,7 +589,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
damage += int32(ap * 0.15f) + int32(holy * 15 / 100); damage += int32(ap * 0.15f) + int32(holy * 15 / 100);
} }
// Hammer of the Righteous // Hammer of the Righteous
else if(m_spellInfo->SpellFamilyFlags&0x0004000000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0004000000000000))
{ {
// Add main hand dps * effect[2] amount // Add main hand dps * effect[2] amount
float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2; float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
@ -597,7 +597,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
damage += count * int32(average * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK); damage += count * int32(average * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
} }
// Shield of Righteousness // Shield of Righteousness
else if(m_spellInfo->SpellFamilyFlags&0x0010000000000000LL) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0010000000000000))
{ {
damage+=int32(m_caster->GetShieldBlockValue()); damage+=int32(m_caster->GetShieldBlockValue());
} }
@ -1223,14 +1223,14 @@ void Spell::EffectDummy(uint32 i)
break; break;
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
// Charge // Charge
if(m_spellInfo->SpellFamilyFlags & 0x1 && m_spellInfo->SpellVisual[0] == 867) if((m_spellInfo->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867)
{ {
int32 chargeBasePoints0 = damage; int32 chargeBasePoints0 = damage;
m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true); m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true);
return; return;
} }
// Execute // Execute
if(m_spellInfo->SpellFamilyFlags & 0x20000000) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x20000000))
{ {
if(!unitTarget) if(!unitTarget)
return; return;
@ -1247,7 +1247,7 @@ void Spell::EffectDummy(uint32 i)
return; return;
} }
// Slam // Slam
if(m_spellInfo->SpellFamilyFlags & 0x0000000000200000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000200000))
{ {
if(!unitTarget) if(!unitTarget)
return; return;
@ -1256,7 +1256,7 @@ void Spell::EffectDummy(uint32 i)
return; return;
} }
// Concussion Blow // Concussion Blow
if(m_spellInfo->SpellFamilyFlags & 0x0000000004000000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000))
{ {
m_damage+= uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100); m_damage+= uint32(damage * m_caster->GetTotalAttackPowerValue(BASE_ATTACK) / 100);
return; return;
@ -1288,7 +1288,7 @@ void Spell::EffectDummy(uint32 i)
break; break;
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
// Life Tap // Life Tap
if (m_spellInfo->SpellFamilyFlags & 0x0000000000040000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000040000))
{ {
// In 303 exist spirit depend // In 303 exist spirit depend
uint32 spirit = uint32(m_caster->GetStat(STAT_SPIRIT)); uint32 spirit = uint32(m_caster->GetStat(STAT_SPIRIT));
@ -1344,7 +1344,7 @@ void Spell::EffectDummy(uint32 i)
break; break;
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
// Penance // Penance
if (m_spellInfo->SpellFamilyFlags & 0x0080000000000000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0080000000000000))
{ {
if (!unitTarget) if (!unitTarget)
return; return;
@ -1370,7 +1370,7 @@ void Spell::EffectDummy(uint32 i)
break; break;
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
// Starfall // Starfall
if (m_spellInfo->SpellFamilyFlags2 & 0x00000100LL) if (m_spellInfo->SpellFamilyFlags2 & UI64LIT(0x00000100))
{ {
//Shapeshifting into an animal form or mounting cancels the effect. //Shapeshifting into an animal form or mounting cancels the effect.
if(m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted()) if(m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted())
@ -1446,7 +1446,7 @@ void Spell::EffectDummy(uint32 i)
uint32 classspell = itr->first; uint32 classspell = itr->first;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(classspell); SpellEntry const *spellInfo = sSpellStore.LookupEntry(classspell);
if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags & 0x0000024000000860LL)) if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (spellInfo->SpellFamilyFlags & UI64LIT(0x0000024000000860)))
((Player*)m_caster)->RemoveSpellCooldown(classspell,true); ((Player*)m_caster)->RemoveSpellCooldown(classspell,true);
} }
return; return;
@ -1460,7 +1460,7 @@ void Spell::EffectDummy(uint32 i)
break; break;
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
// Steady Shot // Steady Shot
if(m_spellInfo->SpellFamilyFlags & 0x100000000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000))
{ {
if( !unitTarget || !unitTarget->isAlive()) if( !unitTarget || !unitTarget->isAlive())
return; return;
@ -1565,8 +1565,8 @@ void Spell::EffectDummy(uint32 i)
mod->value = -50; mod->value = -50;
mod->type = SPELLMOD_PCT; mod->type = SPELLMOD_PCT;
mod->spellId = m_spellInfo->Id; mod->spellId = m_spellInfo->Id;
mod->mask = 0x0000020000000000LL; mod->mask = UI64LIT(0x0000020000000000);
mod->mask2= 0LL; mod->mask2= UI64LIT(0x0);
((Player*)m_caster)->AddSpellMod(mod, true); ((Player*)m_caster)->AddSpellMod(mod, true);
m_caster->CastSpell(unitTarget, spell_proto, true, NULL); m_caster->CastSpell(unitTarget, spell_proto, true, NULL);
@ -1696,19 +1696,19 @@ void Spell::EffectDummy(uint32 i)
return; return;
} }
// Cleansing Totem // Cleansing Totem
if(m_spellInfo->SpellFamilyFlags & 0x0000000004000000LL && m_spellInfo->SpellIconID==1673) if((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->SpellIconID==1673)
{ {
m_caster->CastSpell(unitTarget, 52025, true); m_caster->CastSpell(unitTarget, 52025, true);
return; return;
} }
// Healing Stream Totem // Healing Stream Totem
if(m_spellInfo->SpellFamilyFlags & 0x0000000000002000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000002000))
{ {
m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID); m_caster->CastCustomSpell(unitTarget, 52042, &damage, 0, 0, true, 0, 0, m_originalCasterGUID);
return; return;
} }
// Mana Spring Totem // Mana Spring Totem
if(m_spellInfo->SpellFamilyFlags & 0x0000000000004000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000))
{ {
if(unitTarget->getPowerType()!=POWER_MANA) if(unitTarget->getPowerType()!=POWER_MANA)
return; return;
@ -1742,7 +1742,7 @@ void Spell::EffectDummy(uint32 i)
for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr) for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
{ {
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN && if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN &&
(*itr)->GetSpellProto()->SpellFamilyFlags & 0x0000000000200000LL && ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000200000)) &&
(*itr)->GetCastItemGUID() == item->GetGUID()) (*itr)->GetCastItemGUID() == item->GetGUID())
{ {
m_damage += m_damage * damage / 100; m_damage += m_damage * damage / 100;
@ -1755,7 +1755,7 @@ void Spell::EffectDummy(uint32 i)
break; break;
case SPELLFAMILY_DEATHKNIGHT: case SPELLFAMILY_DEATHKNIGHT:
// Death Coil // Death Coil
if(m_spellInfo->SpellFamilyFlags & 0x002000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x002000))
{ {
if(m_caster->IsFriendlyTo(unitTarget)) if(m_caster->IsFriendlyTo(unitTarget))
{ {
@ -2306,7 +2306,7 @@ void Spell::EffectApplyAura(uint32 i)
return; return;
// Prayer of Mending (jump animation), we need formal caster instead original for correct animation // Prayer of Mending (jump animation), we need formal caster instead original for correct animation
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & 0x00002000000000LL)) if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00002000000000)))
m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID); m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID);
} }
@ -2472,7 +2472,7 @@ void Spell::EffectHeal( uint32 /*i*/ )
if(!targetAura) if(!targetAura)
{ {
sLog.outError("Target(GUID:" I64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID()); sLog.outError("Target (GUID: %u TypeId: %u) has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUIDLow(), unitTarget->GetTypeId());
return; return;
} }
int idx = 0; int idx = 0;
@ -3296,9 +3296,10 @@ void Spell::EffectSummon(uint32 i)
map->Add((Creature*)spawnCreature); map->Add((Creature*)spawnCreature);
m_caster->SetPet(spawnCreature);
if(m_caster->GetTypeId() == TYPEID_PLAYER) if(m_caster->GetTypeId() == TYPEID_PLAYER)
{ {
m_caster->SetPet(spawnCreature);
spawnCreature->GetCharmInfo()->SetReactState( REACT_DEFENSIVE ); spawnCreature->GetCharmInfo()->SetReactState( REACT_DEFENSIVE );
spawnCreature->SavePetToDB(PET_SAVE_AS_CURRENT); spawnCreature->SavePetToDB(PET_SAVE_AS_CURRENT);
((Player*)m_caster)->PetSpellInitialize(); ((Player*)m_caster)->PetSpellInitialize();
@ -4325,7 +4326,7 @@ void Spell::EffectWeaponDmg(uint32 i)
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Whirlwind, single only spell with 2 weapon white damage apply if have // Whirlwind, single only spell with 2 weapon white damage apply if have
if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & 0x00000400000000LL)) if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000400000000)))
{ {
if(((Player*)m_caster)->GetWeaponForAttack(OFF_ATTACK,true)) if(((Player*)m_caster)->GetWeaponForAttack(OFF_ATTACK,true))
spell_bonus += m_caster->CalculateDamage (OFF_ATTACK, normalized); spell_bonus += m_caster->CalculateDamage (OFF_ATTACK, normalized);
@ -4340,7 +4341,7 @@ void Spell::EffectWeaponDmg(uint32 i)
{ {
SpellEntry const *spellInfo = (*itr).second->GetSpellProto(); SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if( spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && if( spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR &&
spellInfo->SpellFamilyFlags & 0x0000000000004000LL && (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000)) &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID()) (*itr).second->GetCasterGUID() == m_caster->GetGUID())
{ {
(*itr).second->RefreshAura(); (*itr).second->RefreshAura();
@ -4355,7 +4356,7 @@ void Spell::EffectWeaponDmg(uint32 i)
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
{ {
// Mutilate (for each hand) // Mutilate (for each hand)
if(m_spellInfo->SpellFamilyFlags & 0x600000000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x600000000))
{ {
bool found = false; bool found = false;
// fast check // fast check
@ -4383,7 +4384,7 @@ void Spell::EffectWeaponDmg(uint32 i)
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
// Seal of Command - receive benefit from Spell Damage and Healing // Seal of Command - receive benefit from Spell Damage and Healing
if(m_spellInfo->SpellFamilyFlags & 0x00000002000000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000002000000))
{ {
spellBonusNeedWeaponDamagePercentMod = true;// apply weaponDamagePercentMod to spell_bonus (and then to all bonus, fixes and weapon already have applied) spellBonusNeedWeaponDamagePercentMod = true;// apply weaponDamagePercentMod to spell_bonus (and then to all bonus, fixes and weapon already have applied)
spell_bonus += int32(0.23f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo))); spell_bonus += int32(0.23f*m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)));
@ -4395,7 +4396,7 @@ void Spell::EffectWeaponDmg(uint32 i)
{ {
// Skyshatter Harness item set bonus // Skyshatter Harness item set bonus
// Stormstrike // Stormstrike
if(m_spellInfo->SpellFamilyFlags & 0x001000000000LL) if(m_spellInfo->SpellFamilyFlags & UI64LIT(0x001000000000))
{ {
Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator citr = m_OverrideClassScript.begin(); citr != m_OverrideClassScript.end(); ++citr) for(Unit::AuraList::const_iterator citr = m_OverrideClassScript.begin(); citr != m_OverrideClassScript.end(); ++citr)
@ -4472,14 +4473,14 @@ void Spell::EffectWeaponDmg(uint32 i)
m_damage+= eff_damage; m_damage+= eff_damage;
// Hemorrhage // Hemorrhage
if(m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & 0x2000000)) if (m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x2000000)))
{ {
if(m_caster->GetTypeId()==TYPEID_PLAYER) if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1); ((Player*)m_caster)->AddComboPoints(unitTarget, 1);
} }
// Mangle (Cat): CP // Mangle (Cat): CP
if(m_spellInfo->SpellFamilyName==SPELLFAMILY_DRUID && (m_spellInfo->SpellFamilyFlags==0x0000040000000000LL)) if (m_spellInfo->SpellFamilyName==SPELLFAMILY_DRUID && (m_spellInfo->SpellFamilyFlags==UI64LIT(0x0000040000000000)))
{ {
if(m_caster->GetTypeId()==TYPEID_PLAYER) if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1); ((Player*)m_caster)->AddComboPoints(unitTarget, 1);
@ -5032,7 +5033,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
{ {
SpellEntry const *spellInfo = (*itr).second->GetSpellProto(); SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if(spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && if(spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
spellInfo->SpellFamilyFlags & 0x0000000000000002LL && (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000002)) &&
(*itr).second->GetCasterGUID()==m_caster->GetGUID()) (*itr).second->GetCasterGUID()==m_caster->GetGUID())
(*itr).second->RefreshAura(); (*itr).second->RefreshAura();
} }
@ -5055,8 +5056,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr) for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr)
{ {
SpellEntry const *spellInfo = (*itr).second->GetSpellProto(); SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if( spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && if (spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST &&
spellInfo->SpellFamilyFlags & 0x0000000000008000LL && (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000008000)) &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID()) (*itr).second->GetCasterGUID() == m_caster->GetGUID())
{ {
(*itr).second->RefreshAura(); (*itr).second->RefreshAura();
@ -5087,29 +5088,29 @@ void Spell::EffectScriptEffect(uint32 effIndex)
continue; continue;
// Search only Serpent Sting, Viper Sting, Scorpid Sting auras // Search only Serpent Sting, Viper Sting, Scorpid Sting auras
uint64 familyFlag = aura->GetSpellProto()->SpellFamilyFlags; uint64 familyFlag = aura->GetSpellProto()->SpellFamilyFlags;
if (!(familyFlag & 0x000000800000C000LL)) if (!(familyFlag & UI64LIT(0x000000800000C000)))
continue; continue;
// Refresh aura duration // Refresh aura duration
aura->RefreshAura(); aura->RefreshAura();
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting. // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
if (familyFlag & 0x0000000000004000LL && aura->GetEffIndex() == 0) if ((familyFlag & UI64LIT(0x0000000000004000)) && aura->GetEffIndex() == 0)
{ {
spellId = 53353; // 53353 Chimera Shot - Serpent spellId = 53353; // 53353 Chimera Shot - Serpent
basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100; basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100;
} }
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
if (familyFlag & 0x0000008000000000LL && aura->GetEffIndex() == 0) if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == 0)
{ {
spellId = 53358; // 53358 Chimera Shot - Viper spellId = 53358; // 53358 Chimera Shot - Viper
basePoint = aura->GetModifier()->m_amount * 4 * 60 / 100; basePoint = aura->GetModifier()->m_amount * 4 * 60 / 100;
} }
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
if (familyFlag & 0x0000000000008000LL) if (familyFlag & UI64LIT(0x0000000000008000))
spellId = 53359; // 53359 Chimera Shot - Scorpid spellId = 53359; // 53359 Chimera Shot - Scorpid
// ?? nothing say in spell desc (possibly need addition check) // ?? nothing say in spell desc (possibly need addition check)
//if (familyFlag & 0x0000010000000000LL || // dot //if ((familyFlag & UI64LIT(0x0000010000000000)) || // dot
// familyFlag & 0x0000100000000000LL) // stun // (familyFlag & UI64LIT(0x0000100000000000))) // stun
//{ //{
// spellId = 53366; // 53366 Chimera Shot - Wyvern // spellId = 53366; // 53366 Chimera Shot - Wyvern
//} //}
@ -5126,7 +5127,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
// Judgement // Judgement
if (m_spellInfo->SpellFamilyFlags & 0x0000000000800000LL) if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000800000))
{ {
if(!unitTarget || !unitTarget->isAlive()) if(!unitTarget || !unitTarget->isAlive())
return; return;

View file

@ -138,17 +138,17 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
{ {
// family flags 18(Molten), 25(Frost/Ice), 28(Mage) // family flags 18(Molten), 25(Frost/Ice), 28(Mage)
if (spellInfo->SpellFamilyFlags & 0x12040000) if (spellInfo->SpellFamilyFlags & UI64LIT(0x12040000))
return SPELL_MAGE_ARMOR; return SPELL_MAGE_ARMOR;
if ((spellInfo->SpellFamilyFlags & 0x1000000) && spellInfo->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE) if ((spellInfo->SpellFamilyFlags & UI64LIT(0x1000000)) && spellInfo->EffectApplyAuraName[0]==SPELL_AURA_MOD_CONFUSE)
return SPELL_MAGE_POLYMORPH; return SPELL_MAGE_POLYMORPH;
break; break;
} }
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
if (spellInfo->SpellFamilyFlags & 0x00008000010000LL) if (spellInfo->SpellFamilyFlags & UI64LIT(0x00008000010000))
return SPELL_POSITIVE_SHOUT; return SPELL_POSITIVE_SHOUT;
break; break;
@ -160,7 +160,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
return SPELL_CURSE; return SPELL_CURSE;
// Warlock (Demon Armor | Demon Skin | Fel Armor) // Warlock (Demon Armor | Demon Skin | Fel Armor)
if (spellInfo->SpellFamilyFlags & 0x2000002000000000LL || spellInfo->SpellFamilyFlags2 & 0x00000010) if (spellInfo->SpellFamilyFlags & UI64LIT(0x2000002000000000) || spellInfo->SpellFamilyFlags2 & 0x00000010)
return SPELL_WARLOCK_ARMOR; return SPELL_WARLOCK_ARMOR;
break; break;
@ -172,7 +172,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
return SPELL_STING; return SPELL_STING;
// only hunter aspects have this (but not all aspects in hunter family) // only hunter aspects have this (but not all aspects in hunter family)
if( spellInfo->SpellFamilyFlags & 0x0044000000380000LL || spellInfo->SpellFamilyFlags2 & 0x00003010) if( spellInfo->SpellFamilyFlags & UI64LIT(0x0044000000380000) || spellInfo->SpellFamilyFlags2 & 0x00003010)
return SPELL_ASPECT; return SPELL_ASPECT;
if( spellInfo->SpellFamilyFlags2 & 0x00000002 ) if( spellInfo->SpellFamilyFlags2 & 0x00000002 )
@ -185,10 +185,10 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if (IsSealSpell(spellInfo)) if (IsSealSpell(spellInfo))
return SPELL_SEAL; return SPELL_SEAL;
if (spellInfo->SpellFamilyFlags & 0x0000000011010002LL) if (spellInfo->SpellFamilyFlags & UI64LIT(0x0000000011010002))
return SPELL_BLESSING; return SPELL_BLESSING;
if ((spellInfo->SpellFamilyFlags & 0x00000820180400LL) && (spellInfo->AttributesEx3 & 0x200)) if ((spellInfo->SpellFamilyFlags & UI64LIT(0x00000820180400)) && (spellInfo->AttributesEx3 & 0x200))
return SPELL_JUDGEMENT; return SPELL_JUDGEMENT;
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
@ -339,11 +339,13 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
case SPELL_AURA_MOD_STAT: case SPELL_AURA_MOD_STAT:
case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative) case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative)
case SPELL_AURA_MOD_HEALING_DONE: case SPELL_AURA_MOD_HEALING_DONE:
{
if(spellproto->CalculateSimpleValue(effIndex) < 0) if(spellproto->CalculateSimpleValue(effIndex) < 0)
return false; return false;
break; break;
} case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
if(spellproto->CalculateSimpleValue(effIndex) > 0)
return true; // some expected possitive spells have SPELL_ATTR_EX_NEGATIVE
break;
case SPELL_AURA_ADD_TARGET_TRIGGER: case SPELL_AURA_ADD_TARGET_TRIGGER:
return true; return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL: case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
@ -1189,7 +1191,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Improved Hamstring -> Hamstring (multi-family check) // Improved Hamstring -> Hamstring (multi-family check)
if( (spellInfo_2->SpellFamilyFlags & 2) && spellInfo_1->Id == 23694 ) if( (spellInfo_2->SpellFamilyFlags & UI64LIT(0x2)) && spellInfo_1->Id == 23694 )
return false; return false;
break; break;
@ -1221,7 +1223,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
return false; return false;
// Improved Wing Clip -> Wing Clip (multi-family check) // Improved Wing Clip -> Wing Clip (multi-family check)
if( (spellInfo_2->SpellFamilyFlags & 0x40) && spellInfo_1->Id == 19229 ) if( (spellInfo_2->SpellFamilyFlags & UI64LIT(0x40)) && spellInfo_1->Id == 19229 )
return false; return false;
break; break;
} }
@ -1246,13 +1248,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_MAGE ) if( spellInfo_2->SpellFamilyName == SPELLFAMILY_MAGE )
{ {
// Blizzard & Chilled (and some other stacked with blizzard spells // Blizzard & Chilled (and some other stacked with blizzard spells
if( (spellInfo_1->SpellFamilyFlags & 0x80) && (spellInfo_2->SpellFamilyFlags & 0x100000) || if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x100000)) ||
(spellInfo_2->SpellFamilyFlags & 0x80) && (spellInfo_1->SpellFamilyFlags & 0x100000) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x80)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x100000)) )
return false; return false;
// Blink & Improved Blink // Blink & Improved Blink
if( (spellInfo_1->SpellFamilyFlags & 0x0000000000010000LL) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) || if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) ||
(spellInfo_2->SpellFamilyFlags & 0x0000000000010000LL) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) )
return false; return false;
} }
// Detect Invisibility and Mana Shield (multi-family check) // Detect Invisibility and Mana Shield (multi-family check)
@ -1296,8 +1298,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_WARRIOR ) if( spellInfo_2->SpellFamilyName == SPELLFAMILY_WARRIOR )
{ {
// Rend and Deep Wound // Rend and Deep Wound
if( (spellInfo_1->SpellFamilyFlags & 0x20) && (spellInfo_2->SpellFamilyFlags & 0x1000000000LL) || if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x1000000000)) ||
(spellInfo_2->SpellFamilyFlags & 0x20) && (spellInfo_1->SpellFamilyFlags & 0x1000000000LL) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1000000000)) )
return false; return false;
// Battle Shout and Rampage // Battle Shout and Rampage
@ -1307,7 +1309,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
} }
// Hamstring -> Improved Hamstring (multi-family check) // Hamstring -> Improved Hamstring (multi-family check)
if( (spellInfo_1->SpellFamilyFlags & 2) && spellInfo_2->Id == 23694 ) if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x2)) && spellInfo_2->Id == 23694 )
return false; return false;
// Defensive Stance and Scroll of Protection (multi-family check) // Defensive Stance and Scroll of Protection (multi-family check)
@ -1323,17 +1325,17 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_PRIEST ) if( spellInfo_2->SpellFamilyName == SPELLFAMILY_PRIEST )
{ {
//Devouring Plague and Shadow Vulnerability //Devouring Plague and Shadow Vulnerability
if( (spellInfo_1->SpellFamilyFlags & 0x2000000) && (spellInfo_2->SpellFamilyFlags & 0x800000000LL) || if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x800000000)) ||
(spellInfo_2->SpellFamilyFlags & 0x2000000) && (spellInfo_1->SpellFamilyFlags & 0x800000000LL) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x800000000)))
return false; return false;
//StarShards and Shadow Word: Pain //StarShards and Shadow Word: Pain
if( (spellInfo_1->SpellFamilyFlags & 0x200000) && (spellInfo_2->SpellFamilyFlags & 0x8000) || if ((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000)) ||
(spellInfo_2->SpellFamilyFlags & 0x200000) && (spellInfo_1->SpellFamilyFlags & 0x8000) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000)))
return false; return false;
// Dispersion // Dispersion
if( (spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) || if ((spellInfo_1->Id == 47585 && spellInfo_2->Id == 60069) ||
(spellInfo_2->Id == 47585 && spellInfo_1->Id == 60069) ) (spellInfo_2->Id == 47585 && spellInfo_1->Id == 60069))
return false; return false;
} }
break; break;
@ -1341,8 +1343,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_DRUID ) if( spellInfo_2->SpellFamilyName == SPELLFAMILY_DRUID )
{ {
//Omen of Clarity and Blood Frenzy //Omen of Clarity and Blood Frenzy
if( (spellInfo_1->SpellFamilyFlags == 0x0 && spellInfo_1->SpellIconID == 108) && (spellInfo_2->SpellFamilyFlags & 0x20000000000000LL) || if( (spellInfo_1->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_1->SpellIconID == 108) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000000)) ||
(spellInfo_2->SpellFamilyFlags == 0x0 && spellInfo_2->SpellIconID == 108) && (spellInfo_1->SpellFamilyFlags & 0x20000000000000LL) ) (spellInfo_2->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_2->SpellIconID == 108) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000000)) )
return false; return false;
// Tree of Life (Shapeshift) and 34123 Tree of Life (Passive) // Tree of Life (Shapeshift) and 34123 Tree of Life (Passive)
@ -1396,13 +1398,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
if( spellInfo_2->SpellFamilyName == SPELLFAMILY_HUNTER ) if( spellInfo_2->SpellFamilyName == SPELLFAMILY_HUNTER )
{ {
// Rapid Fire & Quick Shots // Rapid Fire & Quick Shots
if( (spellInfo_1->SpellFamilyFlags & 0x20) && (spellInfo_2->SpellFamilyFlags & 0x20000000000LL) || if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000)) ||
(spellInfo_2->SpellFamilyFlags & 0x20) && (spellInfo_1->SpellFamilyFlags & 0x20000000000LL) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000)) )
return false; return false;
// Serpent Sting & (Immolation/Explosive Trap Effect) // Serpent Sting & (Immolation/Explosive Trap Effect)
if( (spellInfo_1->SpellFamilyFlags & 0x4) && (spellInfo_2->SpellFamilyFlags & 0x00000004000LL) || if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x00000004000)) ||
(spellInfo_2->SpellFamilyFlags & 0x4) && (spellInfo_1->SpellFamilyFlags & 0x00000004000LL) ) (spellInfo_2->SpellFamilyFlags & UI64LIT(0x4)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x00000004000)) )
return false; return false;
// Bestial Wrath // Bestial Wrath
@ -1411,7 +1413,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
} }
// Wing Clip -> Improved Wing Clip (multi-family check) // Wing Clip -> Improved Wing Clip (multi-family check)
if( (spellInfo_1->SpellFamilyFlags & 0x40) && spellInfo_2->Id == 19229 ) if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x40)) && spellInfo_2->Id == 19229 )
return false; return false;
// Concussive Shot and Imp. Concussive Shot (multi-family check) // Concussive Shot and Imp. Concussive Shot (multi-family check)
@ -2710,34 +2712,34 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
case SPELLFAMILY_ROGUE: case SPELLFAMILY_ROGUE:
{ {
// Kidney Shot // Kidney Shot
if (spellproto->SpellFamilyFlags & 0x00000200000LL) if (spellproto->SpellFamilyFlags & UI64LIT(0x00000200000))
return DIMINISHING_KIDNEYSHOT; return DIMINISHING_KIDNEYSHOT;
// Blind // Blind
else if (spellproto->SpellFamilyFlags & 0x00001000000LL) else if (spellproto->SpellFamilyFlags & UI64LIT(0x00001000000))
return DIMINISHING_BLIND_CYCLONE; return DIMINISHING_BLIND_CYCLONE;
break; break;
} }
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
{ {
// Fear // Fear
if (spellproto->SpellFamilyFlags & 0x40840000000LL) if (spellproto->SpellFamilyFlags & UI64LIT(0x40840000000))
return DIMINISHING_WARLOCK_FEAR; return DIMINISHING_WARLOCK_FEAR;
// Curses/etc // Curses/etc
else if (spellproto->SpellFamilyFlags & 0x00080000000LL) else if (spellproto->SpellFamilyFlags & UI64LIT(0x00080000000))
return DIMINISHING_LIMITONLY; return DIMINISHING_LIMITONLY;
break; break;
} }
case SPELLFAMILY_DRUID: case SPELLFAMILY_DRUID:
{ {
// Cyclone // Cyclone
if (spellproto->SpellFamilyFlags & 0x02000000000LL) if (spellproto->SpellFamilyFlags & UI64LIT(0x02000000000))
return DIMINISHING_BLIND_CYCLONE; return DIMINISHING_BLIND_CYCLONE;
break; break;
} }
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Hamstring - limit duration to 10s in PvP // Hamstring - limit duration to 10s in PvP
if (spellproto->SpellFamilyFlags & 0x00000000002LL) if (spellproto->SpellFamilyFlags & UI64LIT(0x00000000002))
return DIMINISHING_LIMITONLY; return DIMINISHING_LIMITONLY;
break; break;
} }

View file

@ -67,15 +67,15 @@ enum SpellFamilyNames
}; };
//Some SpellFamilyFlags //Some SpellFamilyFlags
#define SPELLFAMILYFLAG_ROGUE_VANISH 0x000000800LL #define SPELLFAMILYFLAG_ROGUE_VANISH UI64LIT(0x000000800)
#define SPELLFAMILYFLAG_ROGUE_STEALTH 0x000400000LL #define SPELLFAMILYFLAG_ROGUE_STEALTH UI64LIT(0x000400000)
#define SPELLFAMILYFLAG_ROGUE_BACKSTAB 0x000800004LL #define SPELLFAMILYFLAG_ROGUE_BACKSTAB UI64LIT(0x000800004)
#define SPELLFAMILYFLAG_ROGUE_SAP 0x000000080LL #define SPELLFAMILYFLAG_ROGUE_SAP UI64LIT(0x000000080)
#define SPELLFAMILYFLAG_ROGUE_FEINT 0x008000000LL #define SPELLFAMILYFLAG_ROGUE_FEINT UI64LIT(0x008000000)
#define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT 0x000200000LL #define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT UI64LIT(0x000200000)
#define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE 0x9003E0000LL #define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE UI64LIT(0x9003E0000)
#define SPELLFAMILYFLAG_PALADIN_SEALS 0x26000C000A000000LL #define SPELLFAMILYFLAG_PALADIN_SEALS UI64LIT(0x26000C000A000000)
// Spell clasification // Spell clasification
enum SpellSpecific enum SpellSpecific
{ {
@ -130,7 +130,7 @@ inline bool IsSealSpell(SpellEntry const *spellInfo)
inline bool IsElementalShield(SpellEntry const *spellInfo) inline bool IsElementalShield(SpellEntry const *spellInfo)
{ {
// family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus // family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus
return (spellInfo->SpellFamilyFlags & 0x42000000400LL) || spellInfo->Id == 23552; return (spellInfo->SpellFamilyFlags & UI64LIT(0x42000000400)) || spellInfo->Id == 23552;
} }
inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo) inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)

View file

@ -2323,7 +2323,7 @@ float Unit::CalculateLevelPenalty(SpellEntry const* spellProto) const
return (100.0f - LvlPenalty) * LvlFactor / 100.0f; return (100.0f - LvlPenalty) * LvlFactor / 100.0f;
} }
void Unit::SendAttackStart(Unit* pVictim) void Unit::SendMeleeAttackStart(Unit* pVictim)
{ {
WorldPacket data( SMSG_ATTACKSTART, 8 + 8 ); WorldPacket data( SMSG_ATTACKSTART, 8 + 8 );
data << uint64(GetGUID()); data << uint64(GetGUID());
@ -2333,7 +2333,7 @@ void Unit::SendAttackStart(Unit* pVictim)
DEBUG_LOG( "WORLD: Sent SMSG_ATTACKSTART" ); DEBUG_LOG( "WORLD: Sent SMSG_ATTACKSTART" );
} }
void Unit::SendAttackStop(Unit* victim) void Unit::SendMeleeAttackStop(Unit* victim)
{ {
if(!victim) if(!victim)
return; return;
@ -3743,7 +3743,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit
{ {
// Custom dispel case // Custom dispel case
// Unstable Affliction // Unstable Affliction
if (aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (aur->GetSpellProto()->SpellFamilyFlags & 0x010000000000LL)) if (aur->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (aur->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x010000000000)))
{ {
int32 damage = aur->GetModifier()->m_amount*9; int32 damage = aur->GetModifier()->m_amount*9;
uint64 caster_guid = aur->GetCasterGUID(); uint64 caster_guid = aur->GetCasterGUID();
@ -4553,7 +4553,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{ {
if(SpellEntry const* iterSpellProto = (*iter)->GetSpellProto()) if(SpellEntry const* iterSpellProto = (*iter)->GetSpellProto())
{ {
if(iterSpellProto->SpellFamilyName==SPELLFAMILY_MAGE && (iterSpellProto->SpellFamilyFlags & 0x10000000)) if(iterSpellProto->SpellFamilyName==SPELLFAMILY_MAGE && (iterSpellProto->SpellFamilyFlags & UI64LIT(0x10000000)))
{ {
found=true; found=true;
break; break;
@ -4949,7 +4949,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Incanter's Regalia set (add trigger chance to Mana Shield) // Incanter's Regalia set (add trigger chance to Mana Shield)
if (dummySpell->SpellFamilyFlags & 0x0000000000008000LL) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000008000))
{ {
if(GetTypeId() != TYPEID_PLAYER) if(GetTypeId() != TYPEID_PLAYER)
return false; return false;
@ -5001,7 +5001,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Retaliation // Retaliation
if(dummySpell->SpellFamilyFlags==0x0000000800000000LL) if (dummySpell->SpellFamilyFlags == UI64LIT(0x0000000800000000))
{ {
// check attack comes not from behind // check attack comes not from behind
if (!HasInArc(M_PI, pVictim)) if (!HasInArc(M_PI, pVictim))
@ -5045,7 +5045,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
{ {
// Seed of Corruption // Seed of Corruption
if (dummySpell->SpellFamilyFlags & 0x0000001000000000LL) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000001000000000))
{ {
Modifier* mod = triggeredByAura->GetModifier(); Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need or target die from damage deal finish spell // if damage is more than need or target die from damage deal finish spell
@ -5067,7 +5067,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return true; return true;
} }
// Seed of Corruption (Mobs cast) - no die req // Seed of Corruption (Mobs cast) - no die req
if (dummySpell->SpellFamilyFlags == 0x00LL && dummySpell->SpellIconID == 1932) if (dummySpell->SpellFamilyFlags == UI64LIT(0x0) && dummySpell->SpellIconID == 1932)
{ {
Modifier* mod = triggeredByAura->GetModifier(); Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need deal finish spell // if damage is more than need deal finish spell
@ -5148,7 +5148,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_PRIEST: case SPELLFAMILY_PRIEST:
{ {
// Vampiric Touch // Vampiric Touch
if( dummySpell->SpellFamilyFlags & 0x0000040000000000LL ) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000))
{ {
if(!pVictim || !pVictim->isAlive()) if(!pVictim || !pVictim->isAlive())
return false; return false;
@ -5190,10 +5190,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 40438: case 40438:
{ {
// Shadow Word: Pain // Shadow Word: Pain
if( procSpell->SpellFamilyFlags & 0x0000000000008000LL ) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000008000))
triggered_spell_id = 40441; triggered_spell_id = 40441;
// Renew // Renew
else if( procSpell->SpellFamilyFlags & 0x0000000000000010LL ) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000010))
triggered_spell_id = 40440; triggered_spell_id = 40440;
else else
return false; return false;
@ -5275,19 +5275,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
float chance; float chance;
// Starfire // Starfire
if( procSpell->SpellFamilyFlags & 0x0000000000000004LL ) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{ {
triggered_spell_id = 40445; triggered_spell_id = 40445;
chance = 25.0f; chance = 25.0f;
} }
// Rejuvenation // Rejuvenation
else if( procSpell->SpellFamilyFlags & 0x0000000000000010LL ) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000010))
{ {
triggered_spell_id = 40446; triggered_spell_id = 40446;
chance = 25.0f; chance = 25.0f;
} }
// Mangle (cat/bear) // Mangle (cat/bear)
else if( procSpell->SpellFamilyFlags & 0x0000044000000000LL ) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000044000000000))
{ {
triggered_spell_id = 40452; triggered_spell_id = 40452;
chance = 40.0f; chance = 40.0f;
@ -5318,7 +5318,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (effIndex!=0) if (effIndex!=0)
return true; return true;
// Wrath crit // Wrath crit
if (procSpell->SpellFamilyFlags & 0x0000000000000001LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000001))
{ {
if (!roll_chance_i(60)) if (!roll_chance_i(60))
return false; return false;
@ -5327,7 +5327,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Starfire crit // Starfire crit
if (procSpell->SpellFamilyFlags & 0x0000000000000004LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000004))
{ {
triggered_spell_id = 48517; triggered_spell_id = 48517;
target = this; target = this;
@ -5368,8 +5368,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
for(AuraList::const_iterator itr = sd.begin(); itr != sd.end(); ++itr) for(AuraList::const_iterator itr = sd.begin(); itr != sd.end(); ++itr)
{ {
SpellEntry const *spellProto = (*itr)->GetSpellProto(); SpellEntry const *spellProto = (*itr)->GetSpellProto();
if( spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && if (spellProto->SpellFamilyName == SPELLFAMILY_ROGUE &&
spellProto->SpellFamilyFlags & 0x0000000000040000LL) (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000040000)))
{ {
(*itr)->SetAuraMaxDuration(GetSpellMaxDuration(spellProto)); (*itr)->SetAuraMaxDuration(GetSpellMaxDuration(spellProto));
(*itr)->RefreshAura(); (*itr)->RefreshAura();
@ -5404,7 +5404,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_HUNTER: case SPELLFAMILY_HUNTER:
{ {
// Aspect of the Viper // Aspect of the Viper
if ( dummySpell->SpellFamilyFlags & 0x4000000000000LL ) if (dummySpell->SpellFamilyFlags & UI64LIT(0x4000000000000))
{ {
uint32 maxmana = GetMaxPower(POWER_MANA); uint32 maxmana = GetMaxPower(POWER_MANA);
basepoints0 = maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f; basepoints0 = maxmana* GetAttackTime(RANGED_ATTACK)/1000.0f/100.0f;
@ -5414,7 +5414,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Thrill of the Hunt // Thrill of the Hunt
if ( dummySpell->SpellIconID == 2236 ) if (dummySpell->SpellIconID == 2236)
{ {
if(!procSpell) if(!procSpell)
return false; return false;
@ -5450,7 +5450,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if ( dummySpell->SpellIconID == 3560 ) if ( dummySpell->SpellIconID == 3560 )
{ {
// This effect only from Rapid Killing (mana regen) // This effect only from Rapid Killing (mana regen)
if (!(procSpell->SpellFamilyFlags & 0x0100000000000000LL)) if (!(procSpell->SpellFamilyFlags & UI64LIT(0x0100000000000000)))
return false; return false;
triggered_spell_id = 56654; triggered_spell_id = 56654;
target = this; target = this;
@ -5461,7 +5461,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
// Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage) // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
if (dummySpell->SpellFamilyFlags&0x000000008000000LL && effIndex==0) if ((dummySpell->SpellFamilyFlags & UI64LIT(0x000000008000000)) && effIndex==0)
{ {
triggered_spell_id = 25742; triggered_spell_id = 25742;
float ap = GetTotalAttackPowerValue(BASE_ATTACK); float ap = GetTotalAttackPowerValue(BASE_ATTACK);
@ -5471,7 +5471,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Sacred Shield // Sacred Shield
if (dummySpell->SpellFamilyFlags&0x0008000000000000LL) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0008000000000000))
{ {
triggered_spell_id = 58597; triggered_spell_id = 58597;
target = this; target = this;
@ -5607,19 +5607,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
// Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal) // Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal)
case 40470: case 40470:
{ {
if( !procSpell ) if (!procSpell)
return false; return false;
float chance; float chance;
// Flash of light/Holy light // Flash of light/Holy light
if( procSpell->SpellFamilyFlags & 0x00000000C0000000LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x00000000C0000000))
{ {
triggered_spell_id = 40471; triggered_spell_id = 40471;
chance = 15.0f; chance = 15.0f;
} }
// Judgement // Judgement
else if( procSpell->SpellFamilyFlags & 0x0000000000800000LL ) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000800000))
{ {
triggered_spell_id = 40472; triggered_spell_id = 40472;
chance = 50.0f; chance = 50.0f;
@ -5779,17 +5779,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false; return false;
float chance; float chance;
if (procSpell->SpellFamilyFlags & 0x0000000000000001LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000001))
{ {
triggered_spell_id = 40465; // Lightning Bolt triggered_spell_id = 40465; // Lightning Bolt
chance = 15.0f; chance = 15.0f;
} }
else if (procSpell->SpellFamilyFlags & 0x0000000000000080LL) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000080))
{ {
triggered_spell_id = 40465; // Lesser Healing Wave triggered_spell_id = 40465; // Lesser Healing Wave
chance = 10.0f; chance = 10.0f;
} }
else if (procSpell->SpellFamilyFlags & 0x0000001000000000LL) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000001000000000))
{ {
triggered_spell_id = 40466; // Stormstrike triggered_spell_id = 40466; // Stormstrike
chance = 50.0f; chance = 50.0f;
@ -5835,7 +5835,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Earth Shield // Earth Shield
if(dummySpell->SpellFamilyFlags & 0x0000040000000000LL) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000040000000000))
{ {
basepoints0 = triggerAmount; basepoints0 = triggerAmount;
target = this; target = this;
@ -5846,14 +5846,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellIconID == 2287) if (dummySpell->SpellIconID == 2287)
{ {
// Lesser Healing Wave need aditional 60% roll // Lesser Healing Wave need aditional 60% roll
if (procSpell->SpellFamilyFlags & 0x0000000000000080LL && !roll_chance_i(60)) if ((procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000080)) && !roll_chance_i(60))
return false; return false;
// lookup water shield // lookup water shield
AuraList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL); AuraList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
for(AuraList::const_iterator itr = vs.begin(); itr != vs.end(); ++itr) for(AuraList::const_iterator itr = vs.begin(); itr != vs.end(); ++itr)
{ {
if( (*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN &&
(*itr)->GetSpellProto()->SpellFamilyFlags & 0x0000002000000000LL) ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000002000000000)))
{ {
uint32 spell = (*itr)->GetSpellProto()->EffectTriggerSpell[(*itr)->GetEffIndex()]; uint32 spell = (*itr)->GetSpellProto()->EffectTriggerSpell[(*itr)->GetEffIndex()];
CastSpell(this, spell, true, castItem, triggeredByAura); CastSpell(this, spell, true, castItem, triggeredByAura);
@ -5914,12 +5914,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
mod->value = -100; mod->value = -100;
mod->type = SPELLMOD_PCT; mod->type = SPELLMOD_PCT;
mod->spellId = dummySpell->Id; mod->spellId = dummySpell->Id;
mod->mask = 0x0000000000000003LL; mod->mask = UI64LIT(0x0000000000000003);
mod->mask2= 0LL; mod->mask2= UI64LIT(0x0);
((Player*)this)->AddSpellMod(mod, true); ((Player*)this)->AddSpellMod(mod, true);
// Remove cooldown (Chain Lightning - have Category Recovery time) // Remove cooldown (Chain Lightning - have Category Recovery time)
if (procSpell->SpellFamilyFlags & 0x0000000000000002LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000002))
((Player*)this)->RemoveSpellCooldown(spellId); ((Player*)this)->RemoveSpellCooldown(spellId);
CastSpell(pVictim, spellId, true, castItem, triggeredByAura); CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
@ -5938,8 +5938,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
AuraList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL); AuraList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
for(AuraList::const_iterator itr = vs.begin(); itr != vs.end(); ++itr) for(AuraList::const_iterator itr = vs.begin(); itr != vs.end(); ++itr)
{ {
if( (*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN && if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_SHAMAN &&
(*itr)->GetSpellProto()->SpellFamilyFlags & 0x0000000000000400LL) ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000400)))
{ {
uint32 spell = 0; uint32 spell = 0;
switch ((*itr)->GetId()) switch ((*itr)->GetId())
@ -6006,7 +6006,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
break; break;
} }
// Vendetta // Vendetta
if (dummySpell->SpellFamilyFlags & 0x0000000000010000LL) if (dummySpell->SpellFamilyFlags & UI64LIT(0x0000000000010000))
{ {
basepoints0 = triggerAmount * GetMaxHealth() / 100; basepoints0 = triggerAmount * GetMaxHealth() / 100;
triggered_spell_id = 50181; triggered_spell_id = 50181;
@ -6269,10 +6269,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
uint32 tick = 1; // Default tick = 1 uint32 tick = 1; // Default tick = 1
// Hellfire have 15 tick // Hellfire have 15 tick
if (procSpell->SpellFamilyFlags&0x0000000000000040LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000040))
tick = 15; tick = 15;
// Rain of Fire have 4 tick // Rain of Fire have 4 tick
else if (procSpell->SpellFamilyFlags&0x0000000000000020LL) else if (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000020))
tick = 4; tick = 4;
else else
return false; return false;
@ -6291,7 +6291,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
trigger_spell_id = 18093; trigger_spell_id = 18093;
} }
// Drain Soul // Drain Soul
else if (auraSpellInfo->SpellFamilyFlags & 0x0000000000004000LL) else if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000))
{ {
Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
@ -6420,7 +6420,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
// procspell is triggered spell but we need mana cost of original casted spell // procspell is triggered spell but we need mana cost of original casted spell
uint32 originalSpellId = procSpell->Id; uint32 originalSpellId = procSpell->Id;
// Holy Shock heal // Holy Shock heal
if(procSpell->SpellFamilyFlags & 0x0001000000000000LL) if (procSpell->SpellFamilyFlags & UI64LIT(0x0001000000000000))
{ {
switch(procSpell->Id) switch(procSpell->Id)
{ {
@ -6488,7 +6488,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
case SPELLFAMILY_SHAMAN: case SPELLFAMILY_SHAMAN:
{ {
// Lightning Shield (overwrite non existing triggered spell call in spell.dbc // Lightning Shield (overwrite non existing triggered spell call in spell.dbc
if(auraSpellInfo->SpellFamilyFlags & 0x0000000000000400) if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000400))
{ {
switch(auraSpellInfo->Id) switch(auraSpellInfo->Id)
{ {
@ -6667,7 +6667,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
case 53232: case 53232:
{ {
// This effect only from Rapid Fire (ability cast) // This effect only from Rapid Fire (ability cast)
if (!(procSpell->SpellFamilyFlags & 0x0000000000000020LL)) if (!(procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000020)))
return false; return false;
break; break;
} }
@ -6725,7 +6725,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
if(!procSpell) if(!procSpell)
return false; return false;
// For trigger from Blizzard need exist Improved Blizzard // For trigger from Blizzard need exist Improved Blizzard
if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && procSpell->SpellFamilyFlags & 0x0000000000000080LL) if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && (procSpell->SpellFamilyFlags & UI64LIT(0x0000000000000080)))
{ {
bool found = false; bool found = false;
AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); AuraList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
@ -7250,7 +7250,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
if( meleeAttack && !hasUnitState(UNIT_STAT_MELEE_ATTACKING) ) if( meleeAttack && !hasUnitState(UNIT_STAT_MELEE_ATTACKING) )
{ {
addUnitState(UNIT_STAT_MELEE_ATTACKING); addUnitState(UNIT_STAT_MELEE_ATTACKING);
SendAttackStart(victim); SendMeleeAttackStart(victim);
return true; return true;
} }
return false; return false;
@ -7291,7 +7291,7 @@ bool Unit::Attack(Unit *victim, bool meleeAttack)
resetAttackTimer(OFF_ATTACK); resetAttackTimer(OFF_ATTACK);
if(meleeAttack) if(meleeAttack)
SendAttackStart(victim); SendMeleeAttackStart(victim);
return true; return true;
} }
@ -7320,7 +7320,7 @@ bool Unit::AttackStop(bool targetSwitch /*=false*/)
((Creature*)this)->SetNoSearchAssistance(false); ((Creature*)this)->SetNoSearchAssistance(false);
} }
SendAttackStop(victim); SendMeleeAttackStop(victim);
return true; return true;
} }
@ -7511,7 +7511,7 @@ void Unit::SetPet(Pet* pet)
SetUInt64Value(UNIT_FIELD_SUMMON, pet ? pet->GetGUID() : 0); SetUInt64Value(UNIT_FIELD_SUMMON, pet ? pet->GetGUID() : 0);
// FIXME: hack, speed must be set only at follow // FIXME: hack, speed must be set only at follow
if(pet) if(pet && GetTypeId()==TYPEID_PLAYER)
for(int i = 0; i < MAX_MOVE_TYPE; ++i) for(int i = 0; i < MAX_MOVE_TYPE; ++i)
pet->SetSpeed(UnitMoveType(i), m_speed_rate[i], true); pet->SetSpeed(UnitMoveType(i), m_speed_rate[i], true);
} }
@ -7695,7 +7695,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
for (AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr) for (AuraMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
{ {
SpellEntry const* m_spell = itr->second->GetSpellProto(); SpellEntry const* m_spell = itr->second->GetSpellProto();
if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags & 0x0004071B8044C402LL)) if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags & UI64LIT(0x0004071B8044C402)))
continue; continue;
modPercent += stepPercent * itr->second->GetStackAmount(); modPercent += stepPercent * itr->second->GetStackAmount();
if (modPercent >= maxPercent) if (modPercent >= maxPercent)
@ -7715,7 +7715,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
break; break;
case 5481: // Starfire Bonus case 5481: // Starfire Bonus
{ {
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x0000000000200002LL)) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, UI64LIT(0x0000000000200002)))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -7742,7 +7742,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
} }
else // Tundra Stalker else // Tundra Stalker
{ {
if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_DEATHKNIGHT, 0x0400000000000000LL)) if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_DEATHKNIGHT, UI64LIT(0x0400000000000000)))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -7750,14 +7750,14 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
} }
case 7293: // Rage of Rivendare case 7293: // Rage of Rivendare
{ {
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0x0200000000000000LL)) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, UI64LIT(0x0200000000000000)))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
// Twisted Faith // Twisted Faith
case 7377: case 7377:
{ {
if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x0000000000008000LL, 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, UI64LIT(0x0000000000008000), 0, GetGUID()))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -7768,7 +7768,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
case 7601: case 7601:
case 7602: case 7602:
{ {
if (pVictim->GetAura(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x0000000000000400LL)) if (pVictim->GetAura(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, UI64LIT(0x0000000000000400)))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -8044,7 +8044,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
{ {
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
// Sacred Shield // Sacred Shield
if (spellProto->SpellFamilyFlags & 0x0000000040000000LL) if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000040000000))
{ {
Aura *aura = pVictim->GetDummyAura(58597); Aura *aura = pVictim->GetDummyAura(58597);
if (aura && aura->GetCasterGUID() == GetGUID()) if (aura && aura->GetCasterGUID() == GetGUID())
@ -8054,9 +8054,9 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
break; break;
case SPELLFAMILY_SHAMAN: case SPELLFAMILY_SHAMAN:
// Lava Burst // Lava Burst
if (spellProto->SpellFamilyFlags & 0x0000100000000000LL) if (spellProto->SpellFamilyFlags & UI64LIT(0x0000100000000000))
{ {
if (Aura *flameShock = pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x0000000010000000LL, 0, GetGUID())) if (Aura *flameShock = pVictim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, UI64LIT(0x0000000010000000), 0, GetGUID()))
{ {
// Consume shock aura if not have Glyph of Flame Shock // Consume shock aura if not have Glyph of Flame Shock
if (!GetAura(55447, 0)) if (!GetAura(55447, 0))
@ -8143,8 +8143,6 @@ uint32 Unit::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 dama
break; break;
} }
crit_bonus = int32(crit_bonus * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_BONUS));
if(pVictim) if(pVictim)
{ {
uint32 creatureTypeMask = pVictim->GetCreatureTypeMask(); uint32 creatureTypeMask = pVictim->GetCreatureTypeMask();
@ -8154,6 +8152,8 @@ uint32 Unit::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 dama
if(crit_bonus > 0) if(crit_bonus > 0)
damage += crit_bonus; damage += crit_bonus;
damage = int32(damage * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT));
return damage; return damage;
} }
@ -8208,7 +8208,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
break; break;
case 7798: // Glyph of Regrowth case 7798: // Glyph of Regrowth
{ {
if (pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x0000000000000040LL)) if (pVictim->GetAura(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, UI64LIT(0x0000000000000040)))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -8222,8 +8222,8 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
if (itr->second->GetCasterGUID()!=GetGUID()) if (itr->second->GetCasterGUID()!=GetGUID())
continue; continue;
SpellEntry const* m_spell = itr->second->GetSpellProto(); SpellEntry const* m_spell = itr->second->GetSpellProto();
if ( m_spell->SpellFamilyName != SPELLFAMILY_DRUID || if (m_spell->SpellFamilyName != SPELLFAMILY_DRUID ||
!(m_spell->SpellFamilyFlags & 0x0000001000000050LL)) !(m_spell->SpellFamilyFlags & UI64LIT(0x0000001000000050)))
continue; continue;
modPercent += stepPercent * itr->second->GetStackAmount(); modPercent += stepPercent * itr->second->GetStackAmount();
} }
@ -8232,7 +8232,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
} }
case 7871: // Glyph of Lesser Healing Wave case 7871: // Glyph of Lesser Healing Wave
{ {
if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x0000040000000000LL, 0, GetGUID())) if (pVictim->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, UI64LIT(0x0000040000000000), 0, GetGUID()))
DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
break; break;
} }
@ -8328,7 +8328,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint
// Taken mods // Taken mods
// Healing Wave cast // Healing Wave cast
if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags & 0x0000000000000040LL) if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && (spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000040)))
{ {
// Search for Healing Way on Victim // Search for Healing Way on Victim
Unit::AuraList const& auraDummy = pVictim->GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraList const& auraDummy = pVictim->GetAurasByType(SPELL_AURA_DUMMY);
@ -8626,7 +8626,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
if(spellProto==NULL) if(spellProto==NULL)
break; break;
// Should increase Shred (initial Damage of Lacerate and Rake handled in Spell::EffectSchoolDMG) // Should increase Shred (initial Damage of Lacerate and Rake handled in Spell::EffectSchoolDMG)
if(spellProto->SpellFamilyName==SPELLFAMILY_DRUID && (spellProto->SpellFamilyFlags==0x00008000LL)) if(spellProto->SpellFamilyName==SPELLFAMILY_DRUID && (spellProto->SpellFamilyFlags == UI64LIT(0x00008000)))
TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f; TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
break; break;
} }
@ -10325,13 +10325,15 @@ CharmInfo::CharmInfo(Unit* unit)
void CharmInfo::InitPetActionBar() void CharmInfo::InitPetActionBar()
{ {
// the first 3 SpellOrActions are attack, follow and stay // the first 3 SpellOrActions are attack, follow and stay
// last 3 SpellOrActions are reactions
for(uint32 i = 0; i < 3; ++i) for(uint32 i = 0; i < 3; ++i)
{ {
SetActionBar(i,COMMAND_ATTACK - i,ACT_COMMAND); SetActionBar(i,COMMAND_ATTACK - i,ACT_COMMAND);
SetActionBar(i + 7,COMMAND_ATTACK - i,ACT_REACTION); SetActionBar(i + 7,COMMAND_ATTACK - i,ACT_REACTION);
} }
// middle 4 SpellOrActions are spells/special attacks/abilities
for(uint32 i = 0; i < 4; ++i) for(uint32 i = 0; i < 4; ++i)
SetActionBar(i,0,ACT_DISABLED); SetActionBar(i + 3,0,ACT_DISABLED);
} }
void CharmInfo::InitEmptyActionBar() void CharmInfo::InitEmptyActionBar()

View file

@ -921,6 +921,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void CombatStopWithPets(bool includingCast = false); void CombatStopWithPets(bool includingCast = false);
Unit* SelectNearbyTarget() const; Unit* SelectNearbyTarget() const;
bool hasNegativeAuraWithInterruptFlag(uint32 flag); bool hasNegativeAuraWithInterruptFlag(uint32 flag);
void SendMeleeAttackStop(Unit* victim);
void SendMeleeAttackStart(Unit* pVictim);
void addUnitState(uint32 f) { m_state |= f; } void addUnitState(uint32 f) { m_state |= f; }
bool hasUnitState(const uint32 f) const { return (m_state & f); } bool hasUnitState(const uint32 f) const { return (m_state & f); }
@ -1548,9 +1550,6 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
uint32 m_regenTimer; uint32 m_regenTimer;
private: private:
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, 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 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 HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);

View file

@ -1374,7 +1374,7 @@ void World::SetInitialWorldSettings()
sprintf( isoDate, "%04d-%02d-%02d %02d:%02d:%02d", sprintf( isoDate, "%04d-%02d-%02d %02d:%02d:%02d",
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec); local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " I64FMTD ", '%s', 0)", loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " UI64FMTD ", '%s', 0)",
realmID, uint64(m_startTime), isoDate); realmID, uint64(m_startTime), isoDate);
m_timers[WUPDATE_OBJECTS].SetInterval(0); m_timers[WUPDATE_OBJECTS].SetInterval(0);
@ -1544,7 +1544,7 @@ void World::Update(uint32 diff)
uint32 maxClientsNum = GetMaxActiveSessionCount(); uint32 maxClientsNum = GetMaxActiveSessionCount();
m_timers[WUPDATE_UPTIME].Reset(); m_timers[WUPDATE_UPTIME].Reset();
loginDatabase.PExecute("UPDATE uptime SET uptime = %u, maxplayers = %u WHERE realmid = %u AND starttime = " I64FMTD, tmpDiff, maxClientsNum, realmID, uint64(m_startTime)); loginDatabase.PExecute("UPDATE uptime SET uptime = %u, maxplayers = %u WHERE realmid = %u AND starttime = " UI64FMTD, tmpDiff, maxClientsNum, realmID, uint64(m_startTime));
} }
/// <li> Handle all other objects /// <li> Handle all other objects

View file

@ -119,8 +119,8 @@ void WorldSession::SendPacket(WorldPacket const* packet)
{ {
uint64 minTime = uint64(cur_time - lastTime); uint64 minTime = uint64(cur_time - lastTime);
uint64 fullTime = uint64(lastTime - firstTime); uint64 fullTime = uint64(lastTime - firstTime);
sLog.outDetail("Send all time packets count: " I64FMTD " bytes: " I64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u",sendPacketCount,sendPacketBytes,float(sendPacketCount)/fullTime,float(sendPacketBytes)/fullTime,uint32(fullTime)); sLog.outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u",sendPacketCount,sendPacketBytes,float(sendPacketCount)/fullTime,float(sendPacketBytes)/fullTime,uint32(fullTime));
sLog.outDetail("Send last min packets count: " I64FMTD " bytes: " I64FMTD " avr.count/sec: %f avr.bytes/sec: %f",sendLastPacketCount,sendLastPacketBytes,float(sendLastPacketCount)/minTime,float(sendLastPacketBytes)/minTime); sLog.outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f",sendLastPacketCount,sendLastPacketBytes,float(sendLastPacketCount)/minTime,float(sendLastPacketBytes)/minTime);
lastTime = cur_time; lastTime = cur_time;
sendLastPacketCount = 1; sendLastPacketCount = 1;

View file

@ -370,7 +370,7 @@ class ByteBuffer
{ {
if ((i == (j*8)) && ((i != (k*16)))) if ((i == (j*8)) && ((i != (k*16))))
{ {
if (read<uint8>(i) < 0x0F) if (read<uint8>(i) < 0x10)
{ {
sLog.outDebugInLine("| 0%X ", read<uint8>(i) ); sLog.outDebugInLine("| 0%X ", read<uint8>(i) );
} }
@ -382,7 +382,7 @@ class ByteBuffer
} }
else if (i == (k*16)) else if (i == (k*16))
{ {
if (read<uint8>(i) < 0x0F) if (read<uint8>(i) < 0x10)
{ {
sLog.outDebugInLine("\n"); sLog.outDebugInLine("\n");
if(sLog.IsIncludeTime()) if(sLog.IsIncludeTime())
@ -404,7 +404,7 @@ class ByteBuffer
} }
else else
{ {
if (read<uint8>(i) < 0x0F) if (read<uint8>(i) < 0x10)
{ {
sLog.outDebugInLine("0%X ", read<uint8>(i) ); sLog.outDebugInLine("0%X ", read<uint8>(i) );
} }

View file

@ -98,6 +98,7 @@
#include "LockedQueue.h" #include "LockedQueue.h"
#include "Threading.h" #include "Threading.h"
#include <ace/Basic_Types.h>
#include <ace/Guard_T.h> #include <ace/Guard_T.h>
#include <ace/RW_Thread_Mutex.h> #include <ace/RW_Thread_Mutex.h>
#include <ace/Thread_Mutex.h> #include <ace/Thread_Mutex.h>
@ -125,8 +126,6 @@
#include <float.h> #include <float.h>
#define I64FMT "%016I64X" #define I64FMT "%016I64X"
#define I64FMTD "%I64u"
#define SI64FMTD "%I64d"
#define snprintf _snprintf #define snprintf _snprintf
#define atoll __atoi64 #define atoll __atoi64
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
@ -138,10 +137,15 @@
#define stricmp strcasecmp #define stricmp strcasecmp
#define strnicmp strncasecmp #define strnicmp strncasecmp
#define I64FMT "%016llX" #define I64FMT "%016llX"
#define I64FMTD "%llu"
#define SI64FMTD "%lld"
#endif #endif
#define UI64FMTD ACE_UINT64_FORMAT_SPECIFIER
#define UI64LIT(N) ACE_UINT64_LITERAL(N)
#define SI64FMTD ACE_INT64_FORMAT_SPECIFIER
#define SI64LIT(N) ACE_INT64_LITERAL(N)
inline float finiteAlways(float f) { return finite(f) ? f : 0.0f; } inline float finiteAlways(float f) { return finite(f) ? f : 0.0f; }
#define atol(a) strtoul( a, NULL, 10) #define atol(a) strtoul( a, NULL, 10)

View file

@ -57,7 +57,7 @@ class Field
if(mValue) if(mValue)
{ {
uint64 value; uint64 value;
sscanf(mValue,I64FMTD,&value); sscanf(mValue,UI64FMTD,&value);
return value; return value;
} }
else else

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7911" #define REVISION_NR "7928"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__

View file

@ -85,63 +85,65 @@ namespace VMAP
bool CoordModelMapping::readCoordinateMapping(const std::string& pDirectoryFileName) bool CoordModelMapping::readCoordinateMapping(const std::string& pDirectoryFileName)
{ {
FILE *f = fopen(pDirectoryFileName.c_str(), "rb"); FILE *f = fopen(pDirectoryFileName.c_str(), "rb");
bool result = false; if(!f)
{
printf("ERROR: Can't open file: %s\n",pDirectoryFileName.c_str());
return false;
}
char buffer[500+1]; char buffer[500+1];
if(f) CMappingEntry* cMappingEntry;
while(fgets(buffer, 500, f))
{ {
result = true; //char namebuffer[500];
CMappingEntry* cMappingEntry; char positionbuffer[500];
while(fgets(buffer, 500, f)) int xpos, ypos, noVec;
float scale;
xpos = ypos = noVec = 0;
//sscanf(buffer, "%d %d %s %s %f %d", &xpos, &ypos, namebuffer,positionbuffer, &scale, &noVec);
// this is ugly, but the format has no read delimiter and a space could be in the first part of the name
int nameStart = findPosChar(buffer, ' ', 2);// find the 2. space
if(nameStart > -1 && (iFilterMethod == NULL || (*iFilterMethod)(buffer)))
{ {
//char namebuffer[500]; ++nameStart;
char positionbuffer[500]; // find the 1. / (now a space only can be found at the end of the name)
int xpos, ypos, noVec; int nameEnd = nameStart + findPosChar(&buffer[nameStart], '/', 1);
float scale; // find the 1. space (after the name)
xpos = ypos = noVec = 0; nameEnd += findPosChar(&buffer[nameEnd], ' ', 1);
buffer[nameEnd] = 0; // terminate the name
//sscanf(buffer, "%d %d %s %s %f %d", &xpos, &ypos, namebuffer,positionbuffer, &scale, &noVec); sscanf(buffer, "%d %d", &xpos, &ypos);
sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scale, &noVec);
// this is ugly, but the format has no read delimiter and a space could be in the first part of the name unsigned int mapId = getMapIdFromFilename(std::string(&buffer[nameStart]));
int nameStart = findPosChar(buffer, ' ', 2);// find the 2. space if(!iMapIds.contains(mapId))
if(nameStart > -1 && (iFilterMethod == NULL || (*iFilterMethod)(buffer)))
{ {
++nameStart; iMapIds.append(mapId);
// find the 1. / (now a space only can be found at the end of the name) printf("Coords for map %u...\n",mapId);
int nameEnd = nameStart + findPosChar(&buffer[nameStart], '/', 1);
// find the 1. space (after the name)
nameEnd += findPosChar(&buffer[nameEnd], ' ', 1);
buffer[nameEnd] = 0; // terminate the name
sscanf(buffer, "%d %d", &xpos, &ypos);
sscanf(&buffer[nameEnd+1], "%s %f %d", positionbuffer, &scale, &noVec);
unsigned int mapId = getMapIdFromFilename(std::string(&buffer[nameStart]));
if(!iMapIds.contains(mapId))
{
iMapIds.append(mapId);
}
if(!isWorldAreaMap(mapId))
{
xpos = 0; // store all files under the groupKey
ypos = 0;
}
std::string key = CMappingEntry::getKeyString(mapId, xpos, ypos);
cMappingEntry = getCMappingEntry(key);
if(cMappingEntry == 0)
{
cMappingEntry = new CMappingEntry(mapId, xpos, ypos);
addCMappingEntry(cMappingEntry);
}
char namebuffer2[500];
sprintf(namebuffer2, "%d %s#%s_%f", noVec, &buffer[nameStart], positionbuffer, scale);
cMappingEntry->addFilename(namebuffer2);
//break;
} }
if(!isWorldAreaMap(mapId))
{
xpos = 0; // store all files under the groupKey
ypos = 0;
}
std::string key = CMappingEntry::getKeyString(mapId, xpos, ypos);
cMappingEntry = getCMappingEntry(key);
if(cMappingEntry == 0)
{
cMappingEntry = new CMappingEntry(mapId, xpos, ypos);
addCMappingEntry(cMappingEntry);
}
char namebuffer2[500];
sprintf(namebuffer2, "%d %s#%s_%f", noVec, &buffer[nameStart], positionbuffer, scale);
cMappingEntry->addFilename(namebuffer2);
//break;
} }
fclose(f);
} }
return result; fclose(f);
return true;
} }
//============================================================ //============================================================

View file

@ -148,446 +148,454 @@ namespace VMAP
# endif # endif
#endif #endif
bool result = true;
std::string fname = iSrcDir; std::string fname = iSrcDir;
fname.append("/"); fname.append("/");
fname.append("dir"); fname.append("dir");
iCoordModelMapping->setModelNameFilterMethod(iFilterMethod); iCoordModelMapping->setModelNameFilterMethod(iFilterMethod);
iCoordModelMapping->readCoordinateMapping(fname);
printf("Read coordinate mapping...\n");
if(!iCoordModelMapping->readCoordinateMapping(fname))
return false;
Array<unsigned int> mapIds = iCoordModelMapping->getMaps(); Array<unsigned int> mapIds = iCoordModelMapping->getMaps();
if(mapIds.size() == 0) if(mapIds.size() == 0)
{ {
result = false; printf("Fatal error: empty map list!\n");
return false;
} }
for(int i=0; i<mapIds.size() && result; ++i)
for(int i=0; i<mapIds.size(); ++i)
{ {
unsigned int mapId = mapIds[i]; unsigned int mapId = mapIds[i];
#ifdef _ASSEMBLER_DEBUG #ifdef _ASSEMBLER_DEBUG
if(mapId == 0) // "Azeroth" just for debug if(mapId == 0) // "Azeroth" just for debug
{ {
for(int x=28; x<29 && result; ++x) //debug for(int x=28; x<29; ++x) //debug
{ {
for(int y=28; y<29 && result; ++y) for(int y=28; y<29; ++y)
{ {
#else #else
// ignore DeeprunTram (369) it is too large for short vector and not important // ignore DeeprunTram (369) it is too large for short vector and not important
// ignore test (13), Test (29) , development (451) // ignore test (13), Test (29) , development (451)
if(mapId != 369 && mapId != 13 && mapId != 29 && mapId != 451) if(mapId != 369 && mapId != 13 && mapId != 29 && mapId != 451)
{ {
for(int x=0; x<66 && result; ++x) for(int x=0; x<66; ++x)
{
for(int y=0; y<66 && result; ++y)
{
#endif
Array<ModelContainer*> mc;
std::string dirname;
char buffer[100];
if(iCoordModelMapping->isWorldAreaMap(mapId) && x<65 && y<65)
{
sprintf(buffer, "%03u_%d_%d",mapId,y,x); // Let's flip x and y here
dirname = std::string(buffer);
}
else
{
sprintf(buffer, "%03u",mapId);
dirname = std::string(buffer);
}
result = fillModelContainerArray(dirname, mapId, x, y, mc);
emptyArray(mc);
}
}
}
}
#ifdef _ASSEMBLER_DEBUG
if(::g_df) fclose(::g_df);
#endif
return result;
}
//=================================================================
bool TileAssembler::fillModelContainerArray(const std::string& pDirFileName, unsigned int pMapId, int pXPos, int pYPos, Array<ModelContainer*>& pMC)
{ {
bool result = true; for(int y=0; y<66; ++y)
ModelContainer* modelContainer;
NameCollection nameCollection = iCoordModelMapping->getFilenamesForCoordinate(pMapId, pXPos, pYPos);
if(nameCollection.size() > 0)
{ {
result = false; #endif
char dirfilename[500]; Array<ModelContainer*> mc;
sprintf(dirfilename,"%s/%s.vmdir",iDestDir.c_str(),pDirFileName.c_str()); std::string dirname;
FILE *dirfile = fopen(dirfilename, "ab"); char buffer[100];
if(dirfile) if(iCoordModelMapping->isWorldAreaMap(mapId) && x<65 && y<65)
{ {
result = true; sprintf(buffer, "%03u_%d_%d",mapId,y,x); // Let's flip x and y here
char destnamebuffer[500]; dirname = std::string(buffer);
char fullnamedestnamebuffer[500]; printf("%s...\n",dirname.c_str());
if(nameCollection.iMainFiles.size() >0)
{
sprintf(destnamebuffer,"%03u_%i_%i.vmap",pMapId, pYPos, pXPos); // flip it here too
std::string checkDoubleStr = std::string(dirfilename);
checkDoubleStr.append("##");
checkDoubleStr.append(std::string(destnamebuffer));
// Check, if same file already is in the same dir file
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(checkDoubleStr))
{
iCoordModelMapping->addAlreadyProcessedSingleFile(checkDoubleStr);
fprintf(dirfile, "%s\n",destnamebuffer);
sprintf(fullnamedestnamebuffer,"%s/%s",iDestDir.c_str(),destnamebuffer);
modelContainer = processNames(nameCollection.iMainFiles, fullnamedestnamebuffer);
if(modelContainer)
{
pMC.append(modelContainer);
}
else
{
result = false;
}
}
}
// process the large singe files
int pos = 0;
while(result && (pos < nameCollection.iSingeFiles.size()))
{
std::string destFileName = iDestDir;
destFileName.append("/");
std::string dirEntryName = getDirEntryNameFromModName(pMapId,nameCollection.iSingeFiles[pos]);
std::string checkDoubleStr = std::string(dirfilename);
checkDoubleStr.append("##");
checkDoubleStr.append(nameCollection.iSingeFiles[pos]);
// Check, if same file already is in the same dir file
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(checkDoubleStr))
{
iCoordModelMapping->addAlreadyProcessedSingleFile(checkDoubleStr);
fprintf(dirfile, "%s\n",dirEntryName.c_str());
destFileName.append(dirEntryName);
Array<std::string> positionarray;
positionarray.append(nameCollection.iSingeFiles[pos]);
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(nameCollection.iSingeFiles[pos]))
{
modelContainer = processNames(positionarray, destFileName.c_str());
iCoordModelMapping->addAlreadyProcessedSingleFile(nameCollection.iSingeFiles[pos]);
if(modelContainer)
{
pMC.append(modelContainer);
}
else
{
result = false;
}
}
}
++pos;
}
fclose(dirfile);
}
}
return(result);
}
//=================================================================
void removeEntriesFromTree(AABSPTree<SubModel *>* pTree)
{
Array<SubModel *> submodelArray;
pTree->getMembers(submodelArray);
int no = submodelArray.size();
while(no > 0)
{
--no;
delete submodelArray[no];
}
}
//=================================================================
ModelContainer* TileAssembler::processNames(const Array<std::string>& pPositions, const char* pDestFileName)
{
ModelContainer *modelContainer = 0;
Vector3 basepos = Vector3(0,0,0);
AABSPTree<SubModel *>* mainTree = new AABSPTree<SubModel *>();
int pos = 0;
bool result = true;
while(result && (pos < pPositions.size()))
{
std::string modelPosString = pPositions[pos];
std::string modelFileName = getModNameFromModPosName(modelPosString);
if(!fillModelIntoTree(mainTree, basepos, modelPosString, modelFileName))
{
result = false;
break;
}
++pos;
}
if(result && mainTree->size() > 0)
{
mainTree->balance();
modelContainer = new ModelContainer(mainTree);
modelContainer->writeFile(pDestFileName);
}
removeEntriesFromTree(mainTree);
delete mainTree;
return(modelContainer);
}
//=================================================================
bool TileAssembler::readRawFile(std::string& pModelFilename, ModelPosition& pModelPosition, AABSPTree<SubModel *> *pMainTree)
{
bool result = false;
std::string filename = iSrcDir;
if(filename.length() >0)
filename.append("/");
filename.append(pModelFilename);
FILE *rf = fopen(filename.c_str(), "rb");
if(!rf)
{
// depending on the extractor version, the data could be located in the root dir
std::string baseModelFilename = pModelFilename.substr((pModelFilename.find_first_of("/")+1),pModelFilename.length());
filename = iSrcDir;
if(filename.length() >0)
filename.append("/");
filename.append(baseModelFilename);
rf = fopen(filename.c_str(), "rb");
}
char ident[8];
int trianglecount =0;
#ifdef _ASSEMBLER_DEBUG
int startgroup = 0; //2;
int endgroup = INT_MAX; //2;
fprintf(::g_df,"-------------------------------------------------\n");
fprintf(::g_df,"%s\n", pModelFilename.c_str());
fprintf(::g_df,"-------------------------------------------------\n");
#else
int startgroup = 0;
int endgroup = INT_MAX;
#endif
// temporary use defines to simplify read/check code (close file and return at fail)
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { fclose(rf); return(false); }
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { fclose(rf); return(false); }
if(rf)
{
READ_OR_RETURN(&ident, 8);
if(strcmp(ident, "VMAP001") == 0)
{
// OK, do nothing
}
else if(strcmp(ident, "VMAP002") == 0)
{
// we have to read one int. This is needed during the export and we have to skip it here
int tempNVectors;
READ_OR_RETURN(&tempNVectors, sizeof(int));
} }
else else
{ {
// wrong version sprintf(buffer, "%03u",mapId);
fclose(rf); dirname = std::string(buffer);
return(false);
// prevent spam for small maps
if(x==0 && y==0)
printf("%s...\n",dirname.c_str());
} }
G3D::uint32 groups;
char blockId[5];
blockId[4] = 0;
int blocksize;
READ_OR_RETURN(&groups, sizeof(G3D::uint32)); bool result = fillModelContainerArray(dirname, mapId, x, y, mc);
emptyArray(mc);
for(int g=0;g<(int)groups;g++) if(!result)
{ return false;
// group MUST NOT have more then 65536 indexes !! Array will have a problem with that !! (strange ...)
Array<int> tempIndexArray;
Array<Vector3> tempVertexArray;
AABSPTree<Triangle> *gtree = new AABSPTree<Triangle>();
// add free gtree at fail
#undef READ_OR_RETURN
#undef CMP_OR_RETURN
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { fclose(rf); delete gtree; return(false); }
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { fclose(rf); delete gtree; return(false); }
G3D::uint32 flags;
READ_OR_RETURN(&flags, sizeof(G3D::uint32));
G3D::uint32 branches;
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "GRP ");
READ_OR_RETURN(&blocksize, sizeof(int));
READ_OR_RETURN(&branches, sizeof(G3D::uint32));
for(int b=0;b<(int)branches; b++)
{
G3D::uint32 indexes;
// indexes for each branch (not used jet)
READ_OR_RETURN(&indexes, sizeof(G3D::uint32));
}
// ---- indexes
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "INDX");
READ_OR_RETURN(&blocksize, sizeof(int));
unsigned int nindexes;
READ_OR_RETURN(&nindexes, sizeof(G3D::uint32));
if(nindexes >0)
{
unsigned short *indexarray = new unsigned short[nindexes*sizeof(unsigned short)];
READ_OR_RETURN(indexarray, sizeof(unsigned short));
for(int i=0;i<(int)nindexes; i++)
{
unsigned short val = indexarray[i];
tempIndexArray.append(val);
}
delete[] indexarray;
}
// ---- vectors
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "VERT");
READ_OR_RETURN(&blocksize, sizeof(int));
unsigned int nvectors;
READ_OR_RETURN(&nvectors, sizeof(int));
float *vectorarray = 0;
// add vectorarray free
#undef READ_OR_RETURN
#undef CMP_OR_RETURN
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { fclose(rf); delete gtree; delete[] vectorarray; return(false); }
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { fclose(rf); delete gtree; delete[] vectorarray; return(false); }
if(nvectors >0)
{
vectorarray = new float[nvectors*sizeof(float)*3];
READ_OR_RETURN(vectorarray, sizeof(float)*3);
}
// ----- liquit
if(flags & 1)
{
// we have liquit -> not handled yet ... skip
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "LIQU");
READ_OR_RETURN(&blocksize, sizeof(int));
fseek(rf, blocksize, SEEK_CUR);
}
for(unsigned int i=0, indexNo=0; indexNo<nvectors; indexNo++)
{
Vector3 v = Vector3(vectorarray[i+2], vectorarray[i+1], vectorarray[i+0]);
i+=3;
v = pModelPosition.transform(v);
float swapy = v.y;
v.y = v.x;
v.x = swapy;
tempVertexArray.append(v);
}
// ---- calculate triangles
int rest = nindexes%3;
if(rest != 0)
{
nindexes -= rest;
}
for(unsigned int i=0;i<(nindexes);)
{
Triangle t = Triangle(tempVertexArray[tempIndexArray[i+2]], tempVertexArray[tempIndexArray[i+1]], tempVertexArray[tempIndexArray[i+0]] );
i+=3;
++trianglecount;
if(g>= startgroup && g <= endgroup)
{
gtree->insert(t);
}
}
// drop of temporary use defines
#undef READ_OR_RETURN
#undef CMP_OR_RETURN
if(vectorarray != 0)
{
delete vectorarray;
}
if(gtree->size() >0)
{
gtree->balance();
SubModel *sm = new SubModel(gtree);
#ifdef _ASSEMBLER_DEBUG
if(::g_df) fprintf(::g_df,"group trianglies: %d, Tris: %d, Nodes: %d, gtree.triangles: %d\n", g, sm->getNTriangles(), sm->getNNodes(), gtree->memberTable.size());
if(sm->getNTriangles() != gtree->memberTable.size())
{
if(::g_df) fprintf(::g_df,"ERROR !!!! group trianglies: %d, Tris: %d, Nodes: %d, gtree.triangles: %d\n", g, sm->getNTriangles(), sm->getNNodes(), gtree->memberTable.size());
}
#endif
sm->setBasePosition(pModelPosition.iPos);
pMainTree->insert(sm);
}
delete gtree;
}
fclose(rf);
result = true;
} }
return(result);
} }
}
}
#ifdef _ASSEMBLER_DEBUG
if(::g_df) fclose(::g_df);
#endif
//================================================================= return true;
}
bool TileAssembler::fillModelIntoTree(AABSPTree<SubModel *> *pMainTree, const Vector3& pBasePos, std::string& pPos, std::string& pModelFilename) //=================================================================
bool TileAssembler::fillModelContainerArray(const std::string& pDirFileName, unsigned int pMapId, int pXPos, int pYPos, Array<ModelContainer*>& pMC)
{
ModelContainer* modelContainer;
NameCollection nameCollection = iCoordModelMapping->getFilenamesForCoordinate(pMapId, pXPos, pYPos);
if(nameCollection.size() == 0)
return true; // no data...
char dirfilename[500];
sprintf(dirfilename,"%s/%s.vmdir",iDestDir.c_str(),pDirFileName.c_str());
FILE *dirfile = fopen(dirfilename, "ab");
if(!dirfile)
{
printf("ERROR: Can't create file %s",dirfilename);
return false;
}
char destnamebuffer[500];
char fullnamedestnamebuffer[500];
if(nameCollection.iMainFiles.size() >0)
{
sprintf(destnamebuffer,"%03u_%i_%i.vmap",pMapId, pYPos, pXPos); // flip it here too
std::string checkDoubleStr = std::string(dirfilename);
checkDoubleStr.append("##");
checkDoubleStr.append(std::string(destnamebuffer));
// Check, if same file already is in the same dir file
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(checkDoubleStr))
{
iCoordModelMapping->addAlreadyProcessedSingleFile(checkDoubleStr);
fprintf(dirfile, "%s\n",destnamebuffer);
sprintf(fullnamedestnamebuffer,"%s/%s",iDestDir.c_str(),destnamebuffer);
modelContainer = processNames(nameCollection.iMainFiles, fullnamedestnamebuffer);
if(modelContainer)
pMC.append(modelContainer);
else
printf("warning: (if) problems in processing data for %s\n",destnamebuffer);
}
}
// process the large singe files
int pos = 0;
while(pos < nameCollection.iSingeFiles.size())
{
std::string destFileName = iDestDir;
destFileName.append("/");
std::string dirEntryName = getDirEntryNameFromModName(pMapId,nameCollection.iSingeFiles[pos]);
std::string checkDoubleStr = std::string(dirfilename);
checkDoubleStr.append("##");
checkDoubleStr.append(nameCollection.iSingeFiles[pos]);
// Check, if same file already is in the same dir file
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(checkDoubleStr))
{
iCoordModelMapping->addAlreadyProcessedSingleFile(checkDoubleStr);
fprintf(dirfile, "%s\n",dirEntryName.c_str());
destFileName.append(dirEntryName);
Array<std::string> positionarray;
positionarray.append(nameCollection.iSingeFiles[pos]);
if(!iCoordModelMapping->isAlreadyProcessedSingleFile(nameCollection.iSingeFiles[pos]))
{ {
bool result = false; modelContainer = processNames(positionarray, destFileName.c_str());
ModelPosition modelPosition; iCoordModelMapping->addAlreadyProcessedSingleFile(nameCollection.iSingeFiles[pos]);
getModelPosition(pPos, modelPosition); if(modelContainer)
// all should be relative to object base position pMC.append(modelContainer);
modelPosition.moveToBasePos(pBasePos); else
printf("warning: (while) problems in processing data for %s\n",destFileName.c_str());
modelPosition.init();
if(readRawFile(pModelFilename, modelPosition, pMainTree))
{
result = true;
}
return result;
} }
}
++pos;
}
//================================================================= fclose(dirfile);
void TileAssembler::getModelPosition(std::string& pPosString, ModelPosition& pModelPosition) return true;
}
//=================================================================
void removeEntriesFromTree(AABSPTree<SubModel *>* pTree)
{
Array<SubModel *> submodelArray;
pTree->getMembers(submodelArray);
int no = submodelArray.size();
while(no > 0)
{
--no;
delete submodelArray[no];
}
}
//=================================================================
ModelContainer* TileAssembler::processNames(const Array<std::string>& pPositions, const char* pDestFileName)
{
ModelContainer *modelContainer = 0;
Vector3 basepos = Vector3(0,0,0);
AABSPTree<SubModel *>* mainTree = new AABSPTree<SubModel *>();
int pos = 0;
bool result = true;
while(result && (pos < pPositions.size()))
{
std::string modelPosString = pPositions[pos];
std::string modelFileName = getModNameFromModPosName(modelPosString);
if(!fillModelIntoTree(mainTree, basepos, modelPosString, modelFileName))
{
result = false;
break;
}
++pos;
}
if(result && mainTree->size() > 0)
{
mainTree->balance();
modelContainer = new ModelContainer(mainTree);
modelContainer->writeFile(pDestFileName);
}
removeEntriesFromTree(mainTree);
delete mainTree;
return(modelContainer);
}
//=================================================================
bool TileAssembler::readRawFile(std::string& pModelFilename, ModelPosition& pModelPosition, AABSPTree<SubModel *> *pMainTree)
{
std::string filename = iSrcDir;
if(filename.length() >0)
filename.append("/");
filename.append(pModelFilename);
FILE *rf = fopen(filename.c_str(), "rb");
if(!rf)
{
// depending on the extractor version, the data could be located in the root dir
std::string baseModelFilename = pModelFilename.substr((pModelFilename.find_first_of("/")+1),pModelFilename.length());
filename = iSrcDir;
if(filename.length() >0)
filename.append("/");
filename.append(baseModelFilename);
rf = fopen(filename.c_str(), "rb");
}
if(!rf)
{
printf("ERROR: Can't open model file in form: %s",pModelFilename.c_str());
printf("... or form: %s",filename );
return false;
}
char ident[8];
int trianglecount =0;
#ifdef _ASSEMBLER_DEBUG
int startgroup = 0; //2;
int endgroup = INT_MAX; //2;
fprintf(::g_df,"-------------------------------------------------\n");
fprintf(::g_df,"%s\n", pModelFilename.c_str());
fprintf(::g_df,"-------------------------------------------------\n");
#else
int startgroup = 0;
int endgroup = INT_MAX;
#endif
// temporary use defines to simplify read/check code (close file and return at fail)
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); return(false); }
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
fclose(rf); return(false); }
READ_OR_RETURN(&ident, 8);
if(strcmp(ident, "VMAP001") == 0)
{
// OK, do nothing
}
else if(strcmp(ident, "VMAP002") == 0)
{
// we have to read one int. This is needed during the export and we have to skip it here
int tempNVectors;
READ_OR_RETURN(&tempNVectors, sizeof(int));
}
else
{
// wrong version
fclose(rf);
return(false);
}
G3D::uint32 groups;
char blockId[5];
blockId[4] = 0;
int blocksize;
READ_OR_RETURN(&groups, sizeof(G3D::uint32));
for(int g=0;g<(int)groups;g++)
{
// group MUST NOT have more then 65536 indexes !! Array will have a problem with that !! (strange ...)
Array<int> tempIndexArray;
Array<Vector3> tempVertexArray;
AABSPTree<Triangle> *gtree = new AABSPTree<Triangle>();
// add free gtree at fail
#undef READ_OR_RETURN
#undef CMP_OR_RETURN
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); delete gtree; return(false); }
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
fclose(rf); delete gtree; return(false); }
G3D::uint32 flags;
READ_OR_RETURN(&flags, sizeof(G3D::uint32));
G3D::uint32 branches;
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "GRP ");
READ_OR_RETURN(&blocksize, sizeof(int));
READ_OR_RETURN(&branches, sizeof(G3D::uint32));
for(int b=0;b<(int)branches; b++)
{
G3D::uint32 indexes;
// indexes for each branch (not used jet)
READ_OR_RETURN(&indexes, sizeof(G3D::uint32));
}
// ---- indexes
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "INDX");
READ_OR_RETURN(&blocksize, sizeof(int));
unsigned int nindexes;
READ_OR_RETURN(&nindexes, sizeof(G3D::uint32));
if(nindexes >0)
{
unsigned short *indexarray = new unsigned short[nindexes*sizeof(unsigned short)];
READ_OR_RETURN(indexarray, nindexes*sizeof(unsigned short));
for(int i=0;i<(int)nindexes; i++)
{ {
float vposarray[3]; unsigned short val = indexarray[i];
float vdirarray[3]; tempIndexArray.append(val);
float scale;
size_t spos = pPosString.find_first_of('#');
std::string stripedPosString = pPosString.substr(spos+1,pPosString.length());
sscanf(stripedPosString.c_str(), "%f,%f,%f_%f,%f,%f_%f",
&vposarray[0],&vposarray[1],&vposarray[2],
&vdirarray[0],&vdirarray[1],&vdirarray[2],
&scale);
pModelPosition.iPos = Vector3(vposarray[0], vposarray[1], vposarray[2]);
pModelPosition.iDir = Vector3(vdirarray[0], vdirarray[1], vdirarray[2]);
pModelPosition.iScale = scale;
} }
//========================================== delete[] indexarray;
}
} // VMAP // ---- vectors
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "VERT");
READ_OR_RETURN(&blocksize, sizeof(int));
unsigned int nvectors;
READ_OR_RETURN(&nvectors, sizeof(int));
float *vectorarray = 0;
// add vectorarray free
#undef READ_OR_RETURN
#undef CMP_OR_RETURN
#define READ_OR_RETURN(V,S) if(fread((V), (S), 1, rf) != 1) { \
fclose(rf); delete gtree; delete[] vectorarray; return(false); }
#define CMP_OR_RETURN(V,S) if(strcmp((V),(S)) != 0) { \
fclose(rf); delete gtree; delete[] vectorarray; return(false); }
if(nvectors >0)
{
vectorarray = new float[nvectors*sizeof(float)*3];
READ_OR_RETURN(vectorarray, nvectors*sizeof(float)*3);
}
// ----- liquit
if(flags & 1)
{
// we have liquit -> not handled yet ... skip
READ_OR_RETURN(&blockId, 4);
CMP_OR_RETURN(blockId, "LIQU");
READ_OR_RETURN(&blocksize, sizeof(int));
fseek(rf, blocksize, SEEK_CUR);
}
for(unsigned int i=0, indexNo=0; indexNo<nvectors; indexNo++)
{
Vector3 v = Vector3(vectorarray[i+2], vectorarray[i+1], vectorarray[i+0]);
i+=3;
v = pModelPosition.transform(v);
float swapy = v.y;
v.y = v.x;
v.x = swapy;
tempVertexArray.append(v);
}
// ---- calculate triangles
int rest = nindexes%3;
if(rest != 0)
{
nindexes -= rest;
}
for(unsigned int i=0;i<(nindexes);)
{
Triangle t = Triangle(tempVertexArray[tempIndexArray[i+2]], tempVertexArray[tempIndexArray[i+1]], tempVertexArray[tempIndexArray[i+0]] );
i+=3;
++trianglecount;
if(g>= startgroup && g <= endgroup)
{
gtree->insert(t);
}
}
// drop of temporary use defines
#undef READ_OR_RETURN
#undef CMP_OR_RETURN
if(vectorarray != 0)
{
delete vectorarray;
}
if(gtree->size() >0)
{
gtree->balance();
SubModel *sm = new SubModel(gtree);
#ifdef _ASSEMBLER_DEBUG
if(::g_df) fprintf(::g_df,"group trianglies: %d, Tris: %d, Nodes: %d, gtree.triangles: %d\n", g, sm->getNTriangles(), sm->getNNodes(), gtree->memberTable.size());
if(sm->getNTriangles() != gtree->memberTable.size())
{
if(::g_df) fprintf(::g_df,"ERROR !!!! group trianglies: %d, Tris: %d, Nodes: %d, gtree.triangles: %d\n", g, sm->getNTriangles(), sm->getNNodes(), gtree->memberTable.size());
}
#endif
sm->setBasePosition(pModelPosition.iPos);
pMainTree->insert(sm);
}
delete gtree;
}
fclose(rf);
return true;
}
//=================================================================
bool TileAssembler::fillModelIntoTree(AABSPTree<SubModel *> *pMainTree, const Vector3& pBasePos, std::string& pPos, std::string& pModelFilename)
{
ModelPosition modelPosition;
getModelPosition(pPos, modelPosition);
// all should be relative to object base position
modelPosition.moveToBasePos(pBasePos);
modelPosition.init();
return readRawFile(pModelFilename, modelPosition, pMainTree);
}
//=================================================================
void TileAssembler::getModelPosition(std::string& pPosString, ModelPosition& pModelPosition)
{
float vposarray[3];
float vdirarray[3];
float scale;
size_t spos = pPosString.find_first_of('#');
std::string stripedPosString = pPosString.substr(spos+1,pPosString.length());
sscanf(stripedPosString.c_str(), "%f,%f,%f_%f,%f,%f_%f",
&vposarray[0],&vposarray[1],&vposarray[2],
&vdirarray[0],&vdirarray[1],&vdirarray[2],
&scale);
pModelPosition.iPos = Vector3(vposarray[0], vposarray[1], vposarray[2]);
pModelPosition.iDir = Vector3(vdirarray[0], vdirarray[1], vdirarray[2]);
pModelPosition.iScale = scale;
}
//==========================================
} // VMAP