REPO: code-style clean-up
* Fixed pPlayer->player * Fixed pCreature->creature ~DevNote: codestyle for Player should be (*player), not *plr or *p... same goes for Creatures (*creature)... more cleaning needed. We've way too many codestyles happening here.
This commit is contained in:
@@ -100,7 +100,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
|
||||
}
|
||||
|
||||
/* Causes certain things to never leave the threat list (Priest Lightwell, etc):
|
||||
for (Unit::ControlList::const_iterator itr = pPlayer->m_Controlled.begin(); itr != pPlayer->m_Controlled.end(); ++itr)
|
||||
for (Unit::ControlList::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr)
|
||||
{
|
||||
creature->SetInCombatWith(*itr);
|
||||
(*itr)->SetInCombatWith(creature);
|
||||
|
||||
@@ -1527,36 +1527,36 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
if (!map)
|
||||
return NULL;
|
||||
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
Creature* creature = new Creature;
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
{
|
||||
sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete pCreature;
|
||||
delete creature;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pCreature->SetHomePosition(x, y, z, o);
|
||||
creature->SetHomePosition(x, y, z, o);
|
||||
|
||||
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete pCreature;
|
||||
delete creature;
|
||||
return NULL;
|
||||
}
|
||||
// Force using DB speeds
|
||||
pCreature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
|
||||
pCreature->SetSpeed(MOVE_RUN, cinfo->speed_run);
|
||||
creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
|
||||
creature->SetSpeed(MOVE_RUN, cinfo->speed_run);
|
||||
|
||||
map->Add(pCreature);
|
||||
m_BgCreatures[type] = pCreature->GetGUID();
|
||||
map->Add(creature);
|
||||
m_BgCreatures[type] = creature->GetGUID();
|
||||
|
||||
if (respawntime)
|
||||
pCreature->SetRespawnDelay(respawntime);
|
||||
creature->SetRespawnDelay(respawntime);
|
||||
|
||||
return pCreature;
|
||||
return creature;
|
||||
}
|
||||
|
||||
bool Battleground::DelCreature(uint32 type)
|
||||
@@ -1601,18 +1601,18 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
|
||||
BG_CREATURE_ENTRY_A_SPIRITGUIDE :
|
||||
BG_CREATURE_ENTRY_H_SPIRITGUIDE;
|
||||
|
||||
if (Creature* pCreature = AddCreature(entry, type, team, x, y, z, o))
|
||||
if (Creature* creature = AddCreature(entry, type, team, x, y, z, o))
|
||||
{
|
||||
pCreature->setDeathState(DEAD);
|
||||
pCreature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pCreature->GetGUID());
|
||||
creature->setDeathState(DEAD);
|
||||
creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, creature->GetGUID());
|
||||
// aura
|
||||
// TODO: Fix display here
|
||||
// pCreature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL);
|
||||
// creature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL);
|
||||
// casting visual effect
|
||||
pCreature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL);
|
||||
creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL);
|
||||
// correct cast speed
|
||||
pCreature->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
|
||||
//pCreature->CastSpell(pCreature, SPELL_SPIRIT_HEAL_CHANNEL, true);
|
||||
creature->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
|
||||
//creature->CastSpell(creature, SPELL_SPIRIT_HEAL_CHANNEL, true);
|
||||
return true;
|
||||
}
|
||||
sLog->outError("Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
@@ -1887,8 +1887,8 @@ bool Battleground::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxSc
|
||||
void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (Player* pPlayer = ObjectAccessor::FindPlayer(itr->first))
|
||||
pPlayer->GetAchievementMgr().StartTimedAchievement(type, entry);
|
||||
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
|
||||
player->GetAchievementMgr().StartTimedAchievement(type, entry);
|
||||
}
|
||||
|
||||
void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry)
|
||||
|
||||
@@ -1308,12 +1308,12 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
||||
// Save wait times before redoing groups
|
||||
for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
LfgProposalPlayer* pPlayer = pProposal->players[(*it)->GetGUID()];
|
||||
LfgProposalPlayer* player = pProposal->players[(*it)->GetGUID()];
|
||||
uint32 lowgroupguid = (*it)->GetGroup() ? (*it)->GetGroup()->GetLowGUID() : 0;
|
||||
if (pPlayer->groupLowGuid != lowgroupguid)
|
||||
sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, pPlayer->groupLowGuid);
|
||||
if (player->groupLowGuid != lowgroupguid)
|
||||
sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid);
|
||||
|
||||
uint64 guid = pPlayer->groupLowGuid ? MAKE_NEW_GUID(pPlayer->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID();
|
||||
uint64 guid = player->groupLowGuid ? MAKE_NEW_GUID(player->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID();
|
||||
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid);
|
||||
if (itQueue == m_QueueInfoMap.end())
|
||||
{
|
||||
|
||||
@@ -657,14 +657,14 @@ void Creature::DoFleeToGetAssistance()
|
||||
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
|
||||
if (radius >0)
|
||||
{
|
||||
Creature* pCreature = NULL;
|
||||
Creature* creature = NULL;
|
||||
|
||||
CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, getVictim(), radius);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, pCreature, u_check);
|
||||
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
@@ -673,12 +673,12 @@ void Creature::DoFleeToGetAssistance()
|
||||
SetNoSearchAssistance(true);
|
||||
UpdateSpeed(MOVE_RUN, false);
|
||||
|
||||
if (!pCreature)
|
||||
if (!creature)
|
||||
//SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY));
|
||||
//TODO: use 31365
|
||||
SetControlled(true, UNIT_STAT_FLEEING);
|
||||
else
|
||||
GetMotionMaster()->MoveSeekAssistance(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ());
|
||||
GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +805,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
|
||||
bool Creature::isCanTrainingOf(Player* player, bool msg) const
|
||||
{
|
||||
if (!isTrainer())
|
||||
return false;
|
||||
@@ -822,65 +822,65 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
|
||||
switch (GetCreatureInfo()->trainer_type)
|
||||
{
|
||||
case TRAINER_TYPE_CLASS:
|
||||
if (pPlayer->getClass() != GetCreatureInfo()->trainer_class)
|
||||
if (player->getClass() != GetCreatureInfo()->trainer_class)
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (GetCreatureInfo()->trainer_class)
|
||||
{
|
||||
case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break;
|
||||
case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break;
|
||||
case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328, GetGUID()); break;
|
||||
case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635, GetGUID()); break;
|
||||
case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436, GetGUID()); break;
|
||||
case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797, GetGUID()); break;
|
||||
case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003, GetGUID()); break;
|
||||
case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836, GetGUID()); break;
|
||||
case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985, GetGUID()); break;
|
||||
case CLASS_DRUID: player->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break;
|
||||
case CLASS_HUNTER: player->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break;
|
||||
case CLASS_MAGE: player->PlayerTalkClass->SendGossipMenu(328, GetGUID()); break;
|
||||
case CLASS_PALADIN:player->PlayerTalkClass->SendGossipMenu(1635, GetGUID()); break;
|
||||
case CLASS_PRIEST: player->PlayerTalkClass->SendGossipMenu(4436, GetGUID()); break;
|
||||
case CLASS_ROGUE: player->PlayerTalkClass->SendGossipMenu(4797, GetGUID()); break;
|
||||
case CLASS_SHAMAN: player->PlayerTalkClass->SendGossipMenu(5003, GetGUID()); break;
|
||||
case CLASS_WARLOCK:player->PlayerTalkClass->SendGossipMenu(5836, GetGUID()); break;
|
||||
case CLASS_WARRIOR:player->PlayerTalkClass->SendGossipMenu(4985, GetGUID()); break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case TRAINER_TYPE_PETS:
|
||||
if (pPlayer->getClass() != CLASS_HUNTER)
|
||||
if (player->getClass() != CLASS_HUNTER)
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetGUID());
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->SendGossipMenu(3620, GetGUID());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case TRAINER_TYPE_MOUNTS:
|
||||
if (GetCreatureInfo()->trainer_race && pPlayer->getRace() != GetCreatureInfo()->trainer_race)
|
||||
if (GetCreatureInfo()->trainer_race && player->getRace() != GetCreatureInfo()->trainer_race)
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (GetCreatureInfo()->trainer_class)
|
||||
{
|
||||
case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break;
|
||||
case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break;
|
||||
case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861, GetGUID()); break;
|
||||
case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
|
||||
case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863, GetGUID()); break;
|
||||
case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
|
||||
case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816, GetGUID()); break;
|
||||
case RACE_UNDEAD_PLAYER:pPlayer->PlayerTalkClass->SendGossipMenu(624, GetGUID()); break;
|
||||
case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
|
||||
case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
|
||||
case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break;
|
||||
case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break;
|
||||
case RACE_HUMAN: player->PlayerTalkClass->SendGossipMenu(5861, GetGUID()); break;
|
||||
case RACE_NIGHTELF: player->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
|
||||
case RACE_ORC: player->PlayerTalkClass->SendGossipMenu(5863, GetGUID()); break;
|
||||
case RACE_TAUREN: player->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
|
||||
case RACE_TROLL: player->PlayerTalkClass->SendGossipMenu(5816, GetGUID()); break;
|
||||
case RACE_UNDEAD_PLAYER:player->PlayerTalkClass->SendGossipMenu(624, GetGUID()); break;
|
||||
case RACE_BLOODELF: player->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break;
|
||||
case RACE_DRAENEI: player->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case TRAINER_TYPE_TRADESKILLS:
|
||||
if (GetCreatureInfo()->trainer_spell && !pPlayer->HasSpell(GetCreatureInfo()->trainer_spell))
|
||||
if (GetCreatureInfo()->trainer_spell && !player->HasSpell(GetCreatureInfo()->trainer_spell))
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetGUID());
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->SendGossipMenu(11031, GetGUID());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -891,23 +891,23 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
|
||||
bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const
|
||||
{
|
||||
if (!isBattleMaster())
|
||||
return false;
|
||||
|
||||
BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(GetEntry());
|
||||
if (!msg)
|
||||
return pPlayer->GetBGAccessByLevel(bgTypeId);
|
||||
return player->GetBGAccessByLevel(bgTypeId);
|
||||
|
||||
if (!pPlayer->GetBGAccessByLevel(bgTypeId))
|
||||
if (!player->GetBGAccessByLevel(bgTypeId))
|
||||
{
|
||||
pPlayer->PlayerTalkClass->ClearMenus();
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (bgTypeId)
|
||||
{
|
||||
case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break;
|
||||
case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break;
|
||||
case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break;
|
||||
case BATTLEGROUND_AV: player->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break;
|
||||
case BATTLEGROUND_WS: player->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break;
|
||||
case BATTLEGROUND_AB: player->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break;
|
||||
case BATTLEGROUND_EY:
|
||||
case BATTLEGROUND_NA:
|
||||
case BATTLEGROUND_BE:
|
||||
@@ -915,7 +915,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
|
||||
case BATTLEGROUND_RL:
|
||||
case BATTLEGROUND_SA:
|
||||
case BATTLEGROUND_DS:
|
||||
case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break;
|
||||
case BATTLEGROUND_RV: player->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break;
|
||||
default: break;
|
||||
}
|
||||
return false;
|
||||
@@ -923,11 +923,11 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Creature::isCanTrainingAndResetTalentsOf(Player* pPlayer) const
|
||||
bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const
|
||||
{
|
||||
return pPlayer->getLevel() >= 10
|
||||
return player->getLevel() >= 10
|
||||
&& GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS
|
||||
&& pPlayer->getClass() == GetCreatureInfo()->trainer_class;
|
||||
&& player->getClass() == GetCreatureInfo()->trainer_class;
|
||||
}
|
||||
|
||||
void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 /*MovementFlags*/, uint8 /*type*/)
|
||||
@@ -2132,16 +2132,16 @@ void Creature::SetInCombatWithZone()
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if (Player* pPlayer = i->getSource())
|
||||
if (Player* player = i->getSource())
|
||||
{
|
||||
if (pPlayer->isGameMaster())
|
||||
if (player->isGameMaster())
|
||||
continue;
|
||||
|
||||
if (pPlayer->isAlive())
|
||||
if (player->isAlive())
|
||||
{
|
||||
this->SetInCombatWith(pPlayer);
|
||||
pPlayer->SetInCombatWith(this);
|
||||
AddThreat(pPlayer, 0.0f);
|
||||
this->SetInCombatWith(player);
|
||||
player->SetInCombatWith(this);
|
||||
AddThreat(player, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ class Creature : public Unit, public GridObject<Creature>
|
||||
///// TODO RENAME THIS!!!!!
|
||||
bool isCanTrainingOf(Player* player, bool msg) const;
|
||||
bool isCanInteractWithBattleMaster(Player* player, bool msg) const;
|
||||
bool isCanTrainingAndResetTalentsOf(Player* pPlayer) const;
|
||||
bool isCanTrainingAndResetTalentsOf(Player* player) const;
|
||||
bool canCreatureAttack(Unit const* pVictim, bool force = true) const;
|
||||
bool IsImmunedToSpell(SpellInfo const* spellInfo);
|
||||
// redefine Unit::IsImmunedToSpell
|
||||
|
||||
@@ -778,14 +778,14 @@ bool Item::CanBeTraded(bool mail, bool trade) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Item::HasEnchantRequiredSkill(const Player* pPlayer) const
|
||||
bool Item::HasEnchantRequiredSkill(const Player* player) const
|
||||
{
|
||||
|
||||
// Check all enchants for required skill
|
||||
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
|
||||
if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)))
|
||||
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id))
|
||||
if (enchantEntry->requiredSkill && pPlayer->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
|
||||
if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -264,7 +264,7 @@ class Item : public Object
|
||||
void SetInTrade(bool b = true) { mb_in_trade = b; }
|
||||
bool IsInTrade() const { return mb_in_trade; }
|
||||
|
||||
bool HasEnchantRequiredSkill(const Player* pPlayer) const;
|
||||
bool HasEnchantRequiredSkill(const Player* player) const;
|
||||
uint32 GetEnchantRequiredLevel() const;
|
||||
|
||||
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
|
||||
|
||||
@@ -13291,11 +13291,11 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Player::SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint32 param)
|
||||
void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED");
|
||||
WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1));
|
||||
data << uint64(pCreature ? pCreature->GetGUID() : 0);
|
||||
data << uint64(creature ? creature->GetGUID() : 0);
|
||||
data << uint32(item);
|
||||
if (param > 0)
|
||||
data << uint32(param);
|
||||
@@ -13303,11 +13303,11 @@ void Player::SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint3
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Player::SendSellError(SellResult msg, Creature* pCreature, uint64 guid, uint32 param)
|
||||
void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM");
|
||||
WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10
|
||||
data << uint64(pCreature ? pCreature->GetGUID() : 0);
|
||||
data << uint64(creature ? creature->GetGUID() : 0);
|
||||
data << uint64(guid);
|
||||
if (param > 0)
|
||||
data << uint32(param);
|
||||
@@ -14348,11 +14348,11 @@ void Player::PrepareQuestMenu(uint64 guid)
|
||||
QuestRelationBounds pObjectQIR;
|
||||
|
||||
// pets also can have quests
|
||||
Creature* pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
|
||||
if (pCreature)
|
||||
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
|
||||
if (creature)
|
||||
{
|
||||
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry());
|
||||
pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(pCreature->GetEntry());
|
||||
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
|
||||
pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -14459,10 +14459,10 @@ void Player::SendPreparedQuest(uint64 guid)
|
||||
std::string title = "";
|
||||
|
||||
// need pet case for some quests
|
||||
Creature* pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
|
||||
if (pCreature)
|
||||
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
|
||||
if (creature)
|
||||
{
|
||||
uint32 textid = GetGossipTextId(pCreature);
|
||||
uint32 textid = GetGossipTextId(creature);
|
||||
GossipText const* gossiptext = sObjectMgr->GetGossipText(textid);
|
||||
if (!gossiptext)
|
||||
{
|
||||
@@ -14507,9 +14507,9 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* pQuest)
|
||||
{
|
||||
QuestRelationBounds pObjectQR;
|
||||
|
||||
Creature* pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
|
||||
if (pCreature)
|
||||
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry());
|
||||
Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid);
|
||||
if (creature)
|
||||
pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
|
||||
else
|
||||
{
|
||||
//we should obtain map pointer from GetMap() in 99% of cases. Special case
|
||||
@@ -16253,12 +16253,12 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SendPushToPartyResponse(Player* pPlayer, uint32 msg)
|
||||
void Player::SendPushToPartyResponse(Player* player, uint32 msg)
|
||||
{
|
||||
if (pPlayer)
|
||||
if (player)
|
||||
{
|
||||
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8+1));
|
||||
data << uint64(pPlayer->GetGUID());
|
||||
data << uint64(player->GetGUID());
|
||||
data << uint8(msg); // valid values: 0-8
|
||||
GetSession()->SendPacket(&data);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_QUEST_PUSH_RESULT");
|
||||
@@ -20434,24 +20434,24 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* pCreature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
VendorItemData const* vItems = pCreature->GetVendorItems();
|
||||
VendorItemData const* vItems = creature->GetVendorItems();
|
||||
if (!vItems || vItems->Empty())
|
||||
{
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (vendorslot >= vItems->GetItemCount())
|
||||
{
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20459,23 +20459,23 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
// store diff item (cheating)
|
||||
if (!crItem || crItem->item != item)
|
||||
{
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, item, 0);
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check current item amount if it limited
|
||||
if (crItem->maxcount != 0)
|
||||
{
|
||||
if (pCreature->GetVendorItemCurrentCount(crItem) < pProto->BuyCount * count)
|
||||
if (creature->GetVendorItemCurrentCount(crItem) < pProto->BuyCount * count)
|
||||
{
|
||||
SendBuyError(BUY_ERR_ITEM_ALREADY_SOLD, pCreature, item, 0);
|
||||
SendBuyError(BUY_ERR_ITEM_ALREADY_SOLD, creature, item, 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (pProto->RequiredReputationFaction && (uint32(GetReputationRank(pProto->RequiredReputationFaction)) < pProto->RequiredReputationRank))
|
||||
{
|
||||
SendBuyError(BUY_ERR_REPUTATION_REQUIRE, pCreature, item, 0);
|
||||
SendBuyError(BUY_ERR_REPUTATION_REQUIRE, creature, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20525,17 +20525,17 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
|
||||
// reputation discount
|
||||
if (price)
|
||||
price = uint32(floor(price * GetReputationPriceDiscount(pCreature)));
|
||||
price = uint32(floor(price * GetReputationPriceDiscount(creature)));
|
||||
|
||||
if (!HasEnoughMoney(price))
|
||||
{
|
||||
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, item, 0);
|
||||
SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((bag == NULL_BAG && slot == NULL_SLOT) || IsInventoryPos(bag, slot))
|
||||
{
|
||||
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, pCreature, crItem, true))
|
||||
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, true))
|
||||
return false;
|
||||
}
|
||||
else if (IsEquipmentPos(bag, slot))
|
||||
@@ -20545,7 +20545,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, NULL, NULL);
|
||||
return false;
|
||||
}
|
||||
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, pCreature, crItem, false))
|
||||
if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, false))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -21961,9 +21961,9 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
|
||||
return true;
|
||||
}
|
||||
|
||||
float Player::GetReputationPriceDiscount(Creature const* pCreature) const
|
||||
float Player::GetReputationPriceDiscount(Creature const* creature) const
|
||||
{
|
||||
FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry();
|
||||
FactionTemplateEntry const* vendor_faction = creature->getFactionTemplateEntry();
|
||||
if (!vendor_faction || !vendor_faction->faction)
|
||||
return 1.0f;
|
||||
|
||||
|
||||
@@ -1317,8 +1317,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
|
||||
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
|
||||
void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0);
|
||||
void SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint32 param);
|
||||
void SendSellError(SellResult msg, Creature* pCreature, uint64 guid, uint32 param);
|
||||
void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param);
|
||||
void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param);
|
||||
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
|
||||
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
|
||||
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
|
||||
@@ -1337,7 +1337,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
|
||||
bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
|
||||
|
||||
float GetReputationPriceDiscount(Creature const* pCreature) const;
|
||||
float GetReputationPriceDiscount(Creature const* creature) const;
|
||||
|
||||
Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : NULL; }
|
||||
TradeData* GetTradeData() const { return m_trade; }
|
||||
@@ -1485,7 +1485,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void SendQuestTimerFailed(uint32 quest_id);
|
||||
void SendCanTakeQuestResponse(uint32 msg);
|
||||
void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver);
|
||||
void SendPushToPartyResponse(Player* pPlayer, uint32 msg);
|
||||
void SendPushToPartyResponse(Player* player, uint32 msg);
|
||||
void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint16 count);
|
||||
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count);
|
||||
void SendQuestUpdateAddPlayer(Quest const* pQuest, uint16 old_count, uint16 add_count);
|
||||
|
||||
@@ -642,39 +642,39 @@ void Transport::BuildStopMovePacket(Map const* targetMap)
|
||||
uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim)
|
||||
{
|
||||
Map* map = GetMap();
|
||||
Creature* pCreature = new Creature;
|
||||
Creature* creature = new Creature;
|
||||
|
||||
if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0))
|
||||
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0))
|
||||
{
|
||||
delete pCreature;
|
||||
delete creature;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pCreature->SetTransport(this);
|
||||
pCreature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
pCreature->m_movementInfo.guid = GetGUID();
|
||||
pCreature->m_movementInfo.t_pos.Relocate(x, y, z, o);
|
||||
creature->SetTransport(this);
|
||||
creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
creature->m_movementInfo.guid = GetGUID();
|
||||
creature->m_movementInfo.t_pos.Relocate(x, y, z, o);
|
||||
|
||||
if (anim)
|
||||
pCreature->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim);
|
||||
creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim);
|
||||
|
||||
pCreature->Relocate(
|
||||
creature->Relocate(
|
||||
GetPositionX() + (x * cos(GetOrientation()) + y * sin(GetOrientation() + float(M_PI))),
|
||||
GetPositionY() + (y * cos(GetOrientation()) + x * sin(GetOrientation())),
|
||||
z + GetPositionZ(),
|
||||
o + GetOrientation());
|
||||
|
||||
pCreature->SetHomePosition(pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ(), pCreature->GetOrientation());
|
||||
creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
|
||||
|
||||
if (!pCreature->IsPositionValid())
|
||||
if (!creature->IsPositionValid())
|
||||
{
|
||||
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", pCreature->GetGUIDLow(), pCreature->GetEntry(), pCreature->GetPositionX(), pCreature->GetPositionY());
|
||||
delete pCreature;
|
||||
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY());
|
||||
delete creature;
|
||||
return 0;
|
||||
}
|
||||
|
||||
map->Add(pCreature);
|
||||
m_NPCPassengerSet.insert(pCreature);
|
||||
map->Add(creature);
|
||||
m_NPCPassengerSet.insert(creature);
|
||||
|
||||
if (tguid == 0)
|
||||
{
|
||||
@@ -684,8 +684,8 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
|
||||
else
|
||||
currenttguid = std::max(tguid, currenttguid);
|
||||
|
||||
pCreature->SetGUIDTransport(tguid);
|
||||
sScriptMgr->OnAddCreaturePassenger(this, pCreature);
|
||||
creature->SetGUIDTransport(tguid);
|
||||
sScriptMgr->OnAddCreaturePassenger(this, creature);
|
||||
return tguid;
|
||||
}
|
||||
|
||||
|
||||
@@ -13805,8 +13805,8 @@ CharmInfo::~CharmInfo()
|
||||
void CharmInfo::RestoreState()
|
||||
{
|
||||
if (m_unit->GetTypeId() == TYPEID_UNIT)
|
||||
if (Creature* pCreature = m_unit->ToCreature())
|
||||
pCreature->SetReactState(m_oldReactState);
|
||||
if (Creature* creature = m_unit->ToCreature())
|
||||
creature->SetReactState(m_oldReactState);
|
||||
}
|
||||
|
||||
void CharmInfo::InitPetActionBar()
|
||||
|
||||
@@ -1174,12 +1174,12 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
// We use spawn coords to spawn
|
||||
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
|
||||
{
|
||||
Creature* pCreature = new Creature;
|
||||
Creature* creature = new Creature;
|
||||
//sLog->outDebug("Spawning creature %u", *itr);
|
||||
if (!pCreature->LoadFromDB(*itr, map))
|
||||
delete pCreature;
|
||||
if (!creature->LoadFromDB(*itr, map))
|
||||
delete creature;
|
||||
else
|
||||
map->Add(pCreature);
|
||||
map->Add(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1248,8 +1248,8 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
{
|
||||
sObjectMgr->RemoveCreatureFromGrid(*itr, data);
|
||||
|
||||
if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->AddObjectToRemoveList();
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1296,38 +1296,38 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
continue;
|
||||
|
||||
// Update if spawned
|
||||
Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL);
|
||||
if (pCreature)
|
||||
Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL);
|
||||
if (creature)
|
||||
{
|
||||
if (activate)
|
||||
{
|
||||
itr->second.equipement_id_prev = pCreature->GetCurrentEquipmentId();
|
||||
itr->second.modelid_prev = pCreature->GetDisplayId();
|
||||
pCreature->LoadEquipment(itr->second.equipment_id, true);
|
||||
itr->second.equipement_id_prev = creature->GetCurrentEquipmentId();
|
||||
itr->second.modelid_prev = creature->GetDisplayId();
|
||||
creature->LoadEquipment(itr->second.equipment_id, true);
|
||||
if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid)
|
||||
{
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid);
|
||||
if (minfo)
|
||||
{
|
||||
pCreature->SetDisplayId(itr->second.modelid);
|
||||
pCreature->SetNativeDisplayId(itr->second.modelid);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
|
||||
creature->SetDisplayId(itr->second.modelid);
|
||||
creature->SetNativeDisplayId(itr->second.modelid);
|
||||
creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
|
||||
creature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pCreature->LoadEquipment(itr->second.equipement_id_prev, true);
|
||||
creature->LoadEquipment(itr->second.equipement_id_prev, true);
|
||||
if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid)
|
||||
{
|
||||
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(itr->second.modelid_prev);
|
||||
if (minfo)
|
||||
{
|
||||
pCreature->SetDisplayId(itr->second.modelid_prev);
|
||||
pCreature->SetNativeDisplayId(itr->second.modelid_prev);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
|
||||
pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
|
||||
creature->SetDisplayId(itr->second.modelid_prev);
|
||||
creature->SetNativeDisplayId(itr->second.modelid_prev);
|
||||
creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius);
|
||||
creature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1231,10 +1231,10 @@ namespace Trinity
|
||||
{
|
||||
public:
|
||||
PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : unit(unit), fRange(fMinRange) {}
|
||||
bool operator() (Player* pPlayer)
|
||||
bool operator() (Player* player)
|
||||
{
|
||||
//No threat list check, must be done explicit if expected to be in combat with creature
|
||||
if (!pPlayer->isGameMaster() && pPlayer->isAlive() && !unit->IsWithinDist(pPlayer, fRange, false))
|
||||
if (!player->isGameMaster() && player->isAlive() && !unit->IsWithinDist(player, fRange, false))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -172,7 +172,6 @@ void Group::LoadGroupFromDB(Field* fields)
|
||||
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
else
|
||||
m_raidDifficulty = Difficulty(r_diff);
|
||||
|
||||
}
|
||||
|
||||
void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles)
|
||||
@@ -720,12 +719,12 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
|
||||
}
|
||||
|
||||
// notify group members which player is the allowed looter for the given creature
|
||||
void Group::SendLooter(Creature* pCreature, Player* pLooter)
|
||||
void Group::SendLooter(Creature* creature, Player* pLooter)
|
||||
{
|
||||
ASSERT(pCreature);
|
||||
ASSERT(creature);
|
||||
|
||||
WorldPacket data(SMSG_LOOT_LIST, (8+8));
|
||||
data << uint64(pCreature->GetGUID());
|
||||
data << uint64(creature->GetGUID());
|
||||
data << uint8(0); // unk1
|
||||
|
||||
if (pLooter)
|
||||
@@ -770,7 +769,6 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
{
|
||||
if (member->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false))
|
||||
{
|
||||
|
||||
r->totalPlayersRolling++;
|
||||
|
||||
if (member->GetPassOnGroupLoot())
|
||||
@@ -1255,19 +1253,18 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Group::UpdatePlayerOutOfRange(Player* pPlayer)
|
||||
void Group::UpdatePlayerOutOfRange(Player* player)
|
||||
{
|
||||
if (!pPlayer || !pPlayer->IsInWorld())
|
||||
if (!player || !player->IsInWorld())
|
||||
return;
|
||||
|
||||
Player* player;
|
||||
WorldPacket data;
|
||||
pPlayer->GetSession()->BuildPartyMemberStatsChangedPacket(pPlayer, &data);
|
||||
player->GetSession()->BuildPartyMemberStatsChangedPacket(player, &data);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
player = itr->getSource();
|
||||
if (player && !player->IsWithinDist(pPlayer, player->GetSightRange(), false))
|
||||
if (player && !player->IsWithinDist(player, player->GetSightRange(), false))
|
||||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
}
|
||||
@@ -1589,9 +1586,9 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pPlayer = itr->getSource();
|
||||
if (pPlayer && !pPlayer->getAttackers().empty() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaidOrHeroicDungeon()))
|
||||
for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i != pPlayer->getAttackers().end(); ++i)
|
||||
Player* player = itr->getSource();
|
||||
if (player && !player->getAttackers().empty() && player->GetInstanceId() == instanceId && (player->GetMap()->IsRaidOrHeroicDungeon()))
|
||||
for (std::set<Unit*>::const_iterator i = player->getAttackers().begin(); i != player->getAttackers().end(); ++i)
|
||||
if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
return true;
|
||||
}
|
||||
@@ -1755,7 +1752,6 @@ void Group::BroadcastGroupUpdate(void)
|
||||
// -- not very efficient but safe
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
|
||||
Player* pp = ObjectAccessor::FindPlayer(citr->guid);
|
||||
if (pp && pp->IsInWorld())
|
||||
{
|
||||
@@ -2069,4 +2065,4 @@ void Group::ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply)
|
||||
slot->flags |= flag;
|
||||
else
|
||||
slot->flags &= ~flag;
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ class Group
|
||||
void SendTargetIconList(WorldSession* session);
|
||||
void SendUpdate();
|
||||
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = NULL);
|
||||
void UpdatePlayerOutOfRange(Player* pPlayer);
|
||||
void UpdatePlayerOutOfRange(Player* player);
|
||||
// ignore: GUID of player that will be ignored
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0);
|
||||
void BroadcastReadyCheck(WorldPacket* packet);
|
||||
@@ -276,7 +276,7 @@ class Group
|
||||
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
|
||||
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
|
||||
void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r);
|
||||
void SendLooter(Creature* pCreature, Player* pLooter);
|
||||
void SendLooter(Creature* creature, Player* pLooter);
|
||||
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject);
|
||||
void MasterLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
|
||||
@@ -292,8 +292,8 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
if (!lPlayers.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
if (Player* pPlayer = itr->getSource())
|
||||
pPlayer->SendUpdateWorldState(uiStateId, uiStateData);
|
||||
if (Player* player = itr->getSource())
|
||||
player->SendUpdateWorldState(uiStateId, uiStateData);
|
||||
}
|
||||
else
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map.");
|
||||
@@ -311,8 +311,8 @@ void InstanceScript::DoSendNotifyToInstance(const char *format, ...)
|
||||
va_start(ap, format);
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
if (Player* pPlayer = i->getSource())
|
||||
if (WorldSession* pSession = pPlayer->GetSession())
|
||||
if (Player* player = i->getSource())
|
||||
if (WorldSession* pSession = player->GetSession())
|
||||
pSession->SendNotification(format, ap);
|
||||
}
|
||||
va_end(ap);
|
||||
@@ -326,8 +326,8 @@ void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type,
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* pPlayer = i->getSource())
|
||||
pPlayer->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
|
||||
if (Player* player = i->getSource())
|
||||
player->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
|
||||
}
|
||||
|
||||
// Start timed achievement for all players in instance
|
||||
@@ -337,8 +337,8 @@ void InstanceScript::DoStartTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* pPlayer = i->getSource())
|
||||
pPlayer->GetAchievementMgr().StartTimedAchievement(type, entry);
|
||||
if (Player* player = i->getSource())
|
||||
player->GetAchievementMgr().StartTimedAchievement(type, entry);
|
||||
}
|
||||
|
||||
// Stop timed achievement for all players in instance
|
||||
@@ -348,8 +348,8 @@ void InstanceScript::DoStopTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* pPlayer = i->getSource())
|
||||
pPlayer->GetAchievementMgr().RemoveTimedAchievement(type, entry);
|
||||
if (Player* player = i->getSource())
|
||||
player->GetAchievementMgr().RemoveTimedAchievement(type, entry);
|
||||
}
|
||||
|
||||
// Remove Auras due to Spell on all players in instance
|
||||
|
||||
@@ -220,8 +220,8 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
|
||||
{
|
||||
sObjectMgr->RemoveCreatureFromGrid(guid, data);
|
||||
|
||||
if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->AddObjectToRemoveList();
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
creature->AddObjectToRemoveList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,15 +363,15 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
|
||||
// We use spawn coords to spawn
|
||||
if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY))
|
||||
{
|
||||
Creature* pCreature = new Creature;
|
||||
Creature* creature = new Creature;
|
||||
//sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning creature %u", guid);
|
||||
if (!pCreature->LoadFromDB(obj->guid, map))
|
||||
if (!creature->LoadFromDB(obj->guid, map))
|
||||
{
|
||||
delete pCreature;
|
||||
delete creature;
|
||||
return;
|
||||
}
|
||||
else
|
||||
map->Add(pCreature);
|
||||
map->Add(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -506,8 +506,8 @@ template <>
|
||||
void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid))
|
||||
if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->GetMap()->Add(pCreature);
|
||||
if (Creature* creature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
creature->GetMap()->Add(creature);
|
||||
}
|
||||
|
||||
// Method that does the respawn job on the specified gameobject
|
||||
|
||||
@@ -166,16 +166,16 @@ Quest::Quest(Field* questRecord)
|
||||
++m_rewchoiceitemscount;
|
||||
}
|
||||
|
||||
uint32 Quest::XPValue(Player* pPlayer) const
|
||||
uint32 Quest::XPValue(Player* player) const
|
||||
{
|
||||
if (pPlayer)
|
||||
if (player)
|
||||
{
|
||||
int32 quest_level = (QuestLevel == -1 ? pPlayer->getLevel() : QuestLevel);
|
||||
int32 quest_level = (QuestLevel == -1 ? player->getLevel() : QuestLevel);
|
||||
const QuestXPEntry* xpentry = sQuestXPStore.LookupEntry(quest_level);
|
||||
if (!xpentry)
|
||||
return 0;
|
||||
|
||||
int32 diffFactor = 2 * (quest_level - pPlayer->getLevel()) + 20;
|
||||
int32 diffFactor = 2 * (quest_level - player->getLevel()) + 20;
|
||||
if (diffFactor < 1)
|
||||
diffFactor = 1;
|
||||
else if (diffFactor > 10)
|
||||
|
||||
@@ -183,7 +183,7 @@ class Quest
|
||||
friend class ObjectMgr;
|
||||
public:
|
||||
Quest(Field* questRecord);
|
||||
uint32 XPValue(Player* pPlayer) const;
|
||||
uint32 XPValue(Player* player) const;
|
||||
|
||||
bool HasFlag(uint32 flag) const { return (QuestFlags & flag) != 0; }
|
||||
void SetFlag(uint32 flag) { QuestFlags |= flag; }
|
||||
|
||||
@@ -100,29 +100,29 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
|
||||
// Helpers for ScriptProcess method.
|
||||
inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo) const
|
||||
{
|
||||
Player* pPlayer = NULL;
|
||||
Player* player = NULL;
|
||||
if (!source && !target)
|
||||
sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
|
||||
else
|
||||
{
|
||||
// Check target first, then source.
|
||||
if (target)
|
||||
pPlayer = target->ToPlayer();
|
||||
if (!pPlayer && source)
|
||||
pPlayer = source->ToPlayer();
|
||||
player = target->ToPlayer();
|
||||
if (!player && source)
|
||||
player = source->ToPlayer();
|
||||
|
||||
if (!pPlayer)
|
||||
if (!player)
|
||||
sLog->outError("%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
|
||||
scriptInfo->GetDebugInfo().c_str(),
|
||||
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
|
||||
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
|
||||
}
|
||||
return pPlayer;
|
||||
return player;
|
||||
}
|
||||
|
||||
inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* target, const ScriptInfo* scriptInfo, bool bReverse) const
|
||||
{
|
||||
Creature* pCreature = NULL;
|
||||
Creature* creature = NULL;
|
||||
if (!source && !target)
|
||||
sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
|
||||
else
|
||||
@@ -131,26 +131,26 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
|
||||
{
|
||||
// Check target first, then source.
|
||||
if (target)
|
||||
pCreature = target->ToCreature();
|
||||
if (!pCreature && source)
|
||||
pCreature = source->ToCreature();
|
||||
creature = target->ToCreature();
|
||||
if (!creature && source)
|
||||
creature = source->ToCreature();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check source first, then target.
|
||||
if (source)
|
||||
pCreature = source->ToCreature();
|
||||
if (!pCreature && target)
|
||||
pCreature = target->ToCreature();
|
||||
creature = source->ToCreature();
|
||||
if (!creature && target)
|
||||
creature = target->ToCreature();
|
||||
}
|
||||
|
||||
if (!pCreature)
|
||||
if (!creature)
|
||||
sLog->outError("%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
|
||||
scriptInfo->GetDebugInfo().c_str(),
|
||||
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
|
||||
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
|
||||
}
|
||||
return pCreature;
|
||||
return creature;
|
||||
}
|
||||
|
||||
inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
|
||||
@@ -173,32 +173,32 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
|
||||
|
||||
inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
|
||||
{
|
||||
Player* pPlayer = NULL;
|
||||
Player* player = NULL;
|
||||
if (!obj)
|
||||
sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
|
||||
else
|
||||
{
|
||||
pPlayer = obj->ToPlayer();
|
||||
if (!pPlayer)
|
||||
player = obj->ToPlayer();
|
||||
if (!player)
|
||||
sLog->outError("%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
|
||||
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
|
||||
}
|
||||
return pPlayer;
|
||||
return player;
|
||||
}
|
||||
|
||||
inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
|
||||
{
|
||||
Creature* pCreature = NULL;
|
||||
Creature* creature = NULL;
|
||||
if (!obj)
|
||||
sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
|
||||
else
|
||||
{
|
||||
pCreature = obj->ToCreature();
|
||||
if (!pCreature)
|
||||
creature = obj->ToCreature();
|
||||
if (!creature)
|
||||
sLog->outError("%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
|
||||
isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
|
||||
}
|
||||
return pCreature;
|
||||
return creature;
|
||||
}
|
||||
|
||||
inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const ScriptInfo* scriptInfo) const
|
||||
|
||||
@@ -130,14 +130,14 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
if (!item || !bid || !etime)
|
||||
return; //check for cheaters
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
|
||||
return;
|
||||
}
|
||||
|
||||
AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(pCreature->getFaction());
|
||||
AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction());
|
||||
if (!auctionHouseEntry)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer)));
|
||||
@@ -195,7 +195,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
//we have to take deposit :
|
||||
uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, it, count);
|
||||
@@ -262,8 +262,8 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
if (!auctionId || !price)
|
||||
return; //check for cheaters
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
|
||||
return;
|
||||
@@ -273,7 +273,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
|
||||
Player* pl = GetPlayer();
|
||||
@@ -380,8 +380,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
|
||||
recv_data >> auctionId;
|
||||
//sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId);
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer)));
|
||||
return;
|
||||
@@ -391,7 +391,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
AuctionEntry* auction = auctionHouse->GetAuction(auctionId);
|
||||
Player* pl = GetPlayer();
|
||||
@@ -465,8 +465,8 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
|
||||
outbiddedCount = 0;
|
||||
}
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
|
||||
return;
|
||||
@@ -476,7 +476,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4));
|
||||
Player* pl = GetPlayer();
|
||||
@@ -512,8 +512,8 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
|
||||
recv_data >> guid;
|
||||
recv_data >> listfrom; // not used in fact (this list not have page control in client)
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
|
||||
return;
|
||||
@@ -523,7 +523,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4));
|
||||
data << (uint32) 0; // amount place holder
|
||||
@@ -565,8 +565,8 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
|
||||
recv_data.read_skip<uint8>();
|
||||
}
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
|
||||
return;
|
||||
@@ -576,7 +576,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction());
|
||||
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
|
||||
|
||||
//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);
|
||||
|
||||
@@ -494,8 +494,8 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
if (!itemguid)
|
||||
return;
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0);
|
||||
@@ -512,21 +512,21 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
// prevent sell not owner item
|
||||
if (_player->GetGUID() != pItem->GetOwnerGUID())
|
||||
{
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent sell non empty bag by drag-and-drop at vendor's item list
|
||||
if (pItem->IsNotEmptyBag())
|
||||
{
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent sell currently looted item
|
||||
if (_player->GetLootGUID() == pItem->GetGUID())
|
||||
{
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -546,7 +546,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
// prevent sell more items that exist in stack (possible only not from client)
|
||||
if (count > pItem->GetCount())
|
||||
{
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -562,7 +562,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
if (!pNewItem)
|
||||
{
|
||||
sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -589,11 +589,11 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data)
|
||||
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
|
||||
}
|
||||
else
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_ITEM, pCreature, itemguid, 0);
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_ITEM, creature, itemguid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -605,8 +605,8 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
|
||||
recv_data >> vendorguid >> slot;
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid)));
|
||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
||||
@@ -623,7 +623,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START);
|
||||
if (!_player->HasEnoughMoney(price))
|
||||
{
|
||||
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, pItem->GetEntry(), 0);
|
||||
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
else
|
||||
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, 0, 0);
|
||||
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, 0, 0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data)
|
||||
@@ -867,8 +867,8 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||
|
||||
// cheating protection
|
||||
/* not critical if "cheated", and check skip allow by slots in bank windows open by .bank command.
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug("WORLD: HandleBuyBankSlotOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
|
||||
return;
|
||||
|
||||
@@ -78,17 +78,17 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
else
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
|
||||
if (!ok_loot || !pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
|
||||
if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
|
||||
{
|
||||
player->SendLootRelease(lguid);
|
||||
return;
|
||||
}
|
||||
|
||||
loot = &pCreature->loot;
|
||||
loot = &creature->loot;
|
||||
}
|
||||
|
||||
player->StoreLootItem(lootSlot, loot);
|
||||
@@ -384,20 +384,20 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
}
|
||||
else
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
|
||||
if (!ok_loot || !pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
|
||||
bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed);
|
||||
if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
|
||||
return;
|
||||
|
||||
loot = &pCreature->loot;
|
||||
loot = &creature->loot;
|
||||
if (loot->isLooted())
|
||||
{
|
||||
// skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
|
||||
if (!pCreature->isAlive())
|
||||
pCreature->AllLootRemovedFromCorpse();
|
||||
if (!creature->isAlive())
|
||||
creature->AllLootRemovedFromCorpse();
|
||||
|
||||
pCreature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
loot->clear();
|
||||
}
|
||||
else
|
||||
@@ -410,10 +410,10 @@ void WorldSession::DoLootRelease(uint64 lguid)
|
||||
if (group->GetLootMethod() != MASTER_LOOT)
|
||||
{
|
||||
loot->roundRobinPlayer = 0;
|
||||
group->SendLooter(pCreature, NULL);
|
||||
group->SendLooter(creature, NULL);
|
||||
|
||||
// force update of dynamic flags, otherwise other group's players still not able to loot.
|
||||
pCreature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
|
||||
creature->ForceValuesUpdateAtIndex(UNIT_DYNAMIC_FLAGS);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -452,11 +452,11 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID()))
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lootguid);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lootguid);
|
||||
if (!creature)
|
||||
return;
|
||||
|
||||
pLoot = &pCreature->loot;
|
||||
pLoot = &creature->loot;
|
||||
}
|
||||
else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID()))
|
||||
{
|
||||
|
||||
@@ -90,8 +90,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str());
|
||||
|
||||
// prevent cheating
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC));
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
uint32 charterid = 0;
|
||||
uint32 cost = 0;
|
||||
uint32 type = 0;
|
||||
if (pCreature->isTabardDesigner())
|
||||
if (creature->isTabardDesigner())
|
||||
{
|
||||
// if tabard designer, then trying to buy a guild charter.
|
||||
// do not let if already in guild.
|
||||
@@ -189,7 +189,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (!_player->HasEnoughMoney(cost))
|
||||
{ //player hasn't got enough money
|
||||
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, charterid, 0);
|
||||
_player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, charterid, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -881,8 +881,8 @@ void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data)
|
||||
|
||||
void WorldSession::SendPetitionShowList(uint64 guid)
|
||||
{
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
|
||||
return;
|
||||
@@ -891,7 +891,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
|
||||
WorldPacket data(SMSG_PETITION_SHOWLIST, 8+1+4*6);
|
||||
data << guid; // npc guid
|
||||
|
||||
if (pCreature->isTabardDesigner())
|
||||
if (creature->isTabardDesigner())
|
||||
{
|
||||
data << uint8(1); // count
|
||||
data << uint32(1); // index
|
||||
|
||||
@@ -86,8 +86,8 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
|
||||
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid));
|
||||
|
||||
Creature* pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
|
||||
if (!pCreature)
|
||||
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
|
||||
if (!creature)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.",
|
||||
GUID_LOPART(guid));
|
||||
@@ -98,15 +98,15 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STAT_DIED))
|
||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||
// Stop the npc if moving
|
||||
pCreature->StopMoving();
|
||||
creature->StopMoving();
|
||||
|
||||
if (sScriptMgr->OnGossipHello(_player, pCreature))
|
||||
if (sScriptMgr->OnGossipHello(_player, creature))
|
||||
return;
|
||||
|
||||
_player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId, true);
|
||||
_player->SendPreparedGossip(pCreature);
|
||||
_player->PrepareGossipMenu(creature, creature->GetCreatureInfo()->GossipMenuId, true);
|
||||
_player->SendPreparedGossip(creature);
|
||||
|
||||
pCreature->AI()->sGossipHello(_player);
|
||||
creature->AI()->sGossipHello(_player);
|
||||
}
|
||||
|
||||
void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
@@ -146,10 +146,10 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
|
||||
if (_player->GetDivider() != 0)
|
||||
{
|
||||
Player* pPlayer = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (pPlayer)
|
||||
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (player)
|
||||
{
|
||||
pPlayer->SendPushToPartyResponse(_player, QUEST_PARTY_MSG_ACCEPT_QUEST);
|
||||
player->SendPushToPartyResponse(_player, QUEST_PARTY_MSG_ACCEPT_QUEST);
|
||||
_player->SetDivider(0);
|
||||
}
|
||||
}
|
||||
@@ -164,19 +164,19 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pPlayer = itr->getSource();
|
||||
Player* player = itr->getSource();
|
||||
|
||||
if (!pPlayer || pPlayer == _player) // not self
|
||||
if (!player || player == _player) // not self
|
||||
continue;
|
||||
|
||||
if (pPlayer->CanTakeQuest(qInfo, true))
|
||||
if (player->CanTakeQuest(qInfo, true))
|
||||
{
|
||||
pPlayer->SetDivider(_player->GetGUID());
|
||||
player->SetDivider(_player->GetGUID());
|
||||
|
||||
//need confirmation that any gossip window will close
|
||||
pPlayer->PlayerTalkClass->SendCloseGossip();
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
_player->SendQuestConfirmAccept(qInfo, pPlayer);
|
||||
_player->SendQuestConfirmAccept(qInfo, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -550,45 +550,45 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pPlayer = itr->getSource();
|
||||
Player* player = itr->getSource();
|
||||
|
||||
if (!pPlayer || pPlayer == _player) // skip self
|
||||
if (!player || player == _player) // skip self
|
||||
continue;
|
||||
|
||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_SHARING_QUEST);
|
||||
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST);
|
||||
|
||||
if (!pPlayer->SatisfyQuestStatus(pQuest, false))
|
||||
if (!player->SatisfyQuestStatus(pQuest, false))
|
||||
{
|
||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_HAVE_QUEST);
|
||||
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_HAVE_QUEST);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pPlayer->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE)
|
||||
if (player->GetQuestStatus(questId) == QUEST_STATUS_COMPLETE)
|
||||
{
|
||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_FINISH_QUEST);
|
||||
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_FINISH_QUEST);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!pPlayer->CanTakeQuest(pQuest, false))
|
||||
if (!player->CanTakeQuest(pQuest, false))
|
||||
{
|
||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
|
||||
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_CANT_TAKE_QUEST);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!pPlayer->SatisfyQuestLog(false))
|
||||
if (!player->SatisfyQuestLog(false))
|
||||
{
|
||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_LOG_FULL);
|
||||
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_LOG_FULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pPlayer->GetDivider() != 0)
|
||||
if (player->GetDivider() != 0)
|
||||
{
|
||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_BUSY);
|
||||
_player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_BUSY);
|
||||
continue;
|
||||
}
|
||||
|
||||
pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true);
|
||||
pPlayer->SetDivider(_player->GetGUID());
|
||||
player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true);
|
||||
player->SetDivider(_player->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -604,19 +604,19 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
|
||||
|
||||
if (_player->GetDivider() != 0)
|
||||
{
|
||||
Player* pPlayer = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (pPlayer)
|
||||
Player* player = ObjectAccessor::FindPlayer(_player->GetDivider());
|
||||
if (player)
|
||||
{
|
||||
WorldPacket data(MSG_QUEST_PUSH_RESULT, (8+1));
|
||||
data << uint64(guid);
|
||||
data << uint8(msg); // valid values: 0-8
|
||||
pPlayer->GetSession()->SendPacket(&data);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
_player->SetDivider(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32 defstatus)
|
||||
uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 defstatus)
|
||||
{
|
||||
uint32 result = defstatus;
|
||||
|
||||
@@ -651,12 +651,12 @@ uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32
|
||||
if (!pQuest) continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId());
|
||||
if (!sConditionMgr->IsPlayerMeetToConditions(pPlayer, conditions))
|
||||
if (!sConditionMgr->IsPlayerMeetToConditions(player, conditions))
|
||||
continue;
|
||||
|
||||
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
|
||||
if ((status == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(quest_id)) ||
|
||||
(pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)))
|
||||
QuestStatus status = player->GetQuestStatus(quest_id);
|
||||
if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(quest_id)) ||
|
||||
(pQuest->IsAutoComplete() && player->CanTakeQuest(pQuest, false)))
|
||||
{
|
||||
if (pQuest->IsAutoComplete() && pQuest->IsRepeatable())
|
||||
result2 = DIALOG_STATUS_REWARD_REP;
|
||||
@@ -679,19 +679,19 @@ uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32
|
||||
continue;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId());
|
||||
if (!sConditionMgr->IsPlayerMeetToConditions(pPlayer, conditions))
|
||||
if (!sConditionMgr->IsPlayerMeetToConditions(player, conditions))
|
||||
continue;
|
||||
|
||||
QuestStatus status = pPlayer->GetQuestStatus(quest_id);
|
||||
QuestStatus status = player->GetQuestStatus(quest_id);
|
||||
if (status == QUEST_STATUS_NONE)
|
||||
{
|
||||
if (pPlayer->CanSeeStartQuest(pQuest))
|
||||
if (player->CanSeeStartQuest(pQuest))
|
||||
{
|
||||
if (pPlayer->SatisfyQuestLevel(pQuest, false))
|
||||
if (player->SatisfyQuestLevel(pQuest, false))
|
||||
{
|
||||
if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->IsQuestRewarded(quest_id)))
|
||||
if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && player->IsQuestRewarded(quest_id)))
|
||||
result2 = DIALOG_STATUS_REWARD_REP;
|
||||
else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
|
||||
else if (player->getLevel() <= ((player->GetQuestLevel(pQuest) == -1) ? player->getLevel() : player->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF)))
|
||||
{
|
||||
if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY))
|
||||
result2 = DIALOG_STATUS_AVAILABLE_REP;
|
||||
|
||||
@@ -367,7 +367,7 @@ class WorldSession
|
||||
|
||||
uint32 GetLatency() const { return m_latency; }
|
||||
void SetLatency(uint32 latency) { m_latency = latency; }
|
||||
uint32 getDialogStatus(Player* pPlayer, Object* questgiver, uint32 defstatus);
|
||||
uint32 getDialogStatus(Player* player, Object* questgiver, uint32 defstatus);
|
||||
|
||||
time_t m_timeOutTime;
|
||||
void UpdateTimeOutTime(uint32 diff)
|
||||
|
||||
@@ -6287,7 +6287,7 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex)
|
||||
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
Player* pPlayer = unitTarget->ToPlayer();
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
|
||||
uint32 quest_id = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
|
||||
@@ -6297,24 +6297,24 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
// Player has never done this quest
|
||||
if (pPlayer->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
|
||||
if (player->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
|
||||
return;
|
||||
|
||||
// remove all quest entries for 'entry' from quest log
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot)
|
||||
{
|
||||
uint32 quest = pPlayer->GetQuestSlotQuestId(slot);
|
||||
uint32 quest = player->GetQuestSlotQuestId(slot);
|
||||
if (quest == quest_id)
|
||||
{
|
||||
pPlayer->SetQuestSlot(slot, 0);
|
||||
player->SetQuestSlot(slot, 0);
|
||||
|
||||
// we ignore unequippable quest items in this case, its' still be equipped
|
||||
pPlayer->TakeQuestSourceItem(quest, false);
|
||||
player->TakeQuestSourceItem(quest, false);
|
||||
}
|
||||
}
|
||||
|
||||
pPlayer->RemoveActiveQuest(quest_id);
|
||||
pPlayer->RemoveRewardedQuest(quest_id);
|
||||
player->RemoveActiveQuest(quest_id);
|
||||
player->RemoveRewardedQuest(quest_id);
|
||||
}
|
||||
|
||||
void Spell::EffectSendTaxi(SpellEffIndex effIndex)
|
||||
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
|
||||
struct npc_vereth_the_cunningAI : public ScriptedAI
|
||||
{
|
||||
npc_vereth_the_cunningAI(Creature* pCreature) : ScriptedAI(pCreature) {}
|
||||
npc_vereth_the_cunningAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user