void Inventory::AddItem(HudItem* pItem) { // Any free slots? if(!HasFreeSlots()) return; // Remove previous level item. if(pItem->GetLevel() > 1) RemoveItem(GetItemLoader()->GetItem(ItemKey(pItem->GetName(), pItem->GetLevel()-1))); // Add item to player. mPlayer->AddItem(pItem); // Send message to server. SendItemAdded(mPlayer->GetId(), pItem->GetName(), pItem->GetLevel()); // Clear the inventory and update it with the players current items. UpdateItems(); }
void SkillInventory::AddItem(HudItem* pItem) { // Any free slots? if(!HasFreeSlots()) return; Skill* skill = mPlayer->AddSkill(pItem->GetName()); // Pass on the attributes. // [NOTE] REALLY UGLY [HACK][WARNING]. skill->SetAttributes(pItem->GetAttributes()); skill->SetDescription(pItem->GetDescription()); skill->SetCost(pItem->GetCost()); skill->SetLevel(pItem->GetLevel()); // Send message to server. SendItemAdded(mPlayer->GetPlayer()->GetId(), pItem->GetName(), pItem->GetLevel()); UpdateItems(); }
bool CBattleground::CanPlayerJoin(Player * plr) { return HasFreeSlots(plr->m_bgTeam); }
bool CBattleground::CanPlayerJoin(Player* plr, uint32 type) { return HasFreeSlots(plr->m_bgTeam, type) && (GetLevelGrouping(plr->getLevel()) == GetLevelGroup()) && (!plr->HasAura(BG_DESERTER)); }