mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Merge branch 'master' into 310
Conflicts: src/game/GameObject.cpp
This commit is contained in:
commit
9d2acc22b4
47 changed files with 1772 additions and 1246 deletions
|
|
@ -750,9 +750,9 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
|||
}
|
||||
|
||||
// if this is ammo then use it
|
||||
uint8 msg = CanUseAmmo( pItem->GetProto()->ItemId );
|
||||
uint8 msg = CanUseAmmo( pItem->GetEntry() );
|
||||
if( msg == EQUIP_ERR_OK )
|
||||
SetAmmo( pItem->GetProto()->ItemId );
|
||||
SetAmmo( pItem->GetEntry() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2891,8 +2891,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
|||
continue;
|
||||
|
||||
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
|
||||
// lockpicking special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
|
||||
pSkill->id==SKILL_LOCKPICKING && _spell_idx->second->max_value==0 )
|
||||
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
|
||||
(pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 )
|
||||
{
|
||||
switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask!=0))
|
||||
{
|
||||
|
|
@ -2929,8 +2929,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
|
|||
|
||||
if(IsInWorld())
|
||||
{
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL,spell_id);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,spell_id);
|
||||
}
|
||||
|
||||
// return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell
|
||||
|
|
@ -3101,8 +3101,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_
|
|||
continue;
|
||||
|
||||
if(_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ||
|
||||
// lockpicking special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
|
||||
pSkill->id==SKILL_LOCKPICKING && _spell_idx->second->max_value==0 )
|
||||
// lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
|
||||
(pSkill->id==SKILL_LOCKPICKING || pSkill->id==SKILL_RUNEFORGING) && _spell_idx->second->max_value==0 )
|
||||
{
|
||||
// not reset skills for professions and racial abilities
|
||||
if( (pSkill->categoryId==SKILL_CATEGORY_SECONDARY || pSkill->categoryId==SKILL_CATEGORY_PROFESSION) &&
|
||||
|
|
@ -4029,7 +4029,7 @@ void Player::CreateCorpse()
|
|||
flags |= CORPSE_FLAG_HIDE_HELM;
|
||||
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
|
||||
flags |= CORPSE_FLAG_HIDE_CLOAK;
|
||||
if(InBattleGround())
|
||||
if(InBattleGround() && !InArena())
|
||||
flags |= CORPSE_FLAG_LOOTABLE; // to be able to remove insignia
|
||||
corpse->SetUInt32Value( CORPSE_FIELD_FLAGS, flags );
|
||||
|
||||
|
|
@ -5344,12 +5344,12 @@ void Player::SendInitialActionButtons()
|
|||
sLog.outDetail( "Action Buttons for '%u' Initialized", GetGUIDLow() );
|
||||
}
|
||||
|
||||
void Player::addActionButton(const uint8 button, const uint16 action, const uint8 type, const uint8 misc)
|
||||
bool Player::addActionButton(const uint8 button, const uint16 action, const uint8 type, const uint8 misc)
|
||||
{
|
||||
if(button >= MAX_ACTION_BUTTONS)
|
||||
{
|
||||
sLog.outError( "Action %u not added into button %u for player %s: button must be < 132", action, button, GetName() );
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// check cheating with adding non-known spells to action bar
|
||||
|
|
@ -5358,13 +5358,13 @@ void Player::addActionButton(const uint8 button, const uint16 action, const uint
|
|||
if(!sSpellStore.LookupEntry(action))
|
||||
{
|
||||
sLog.outError( "Action %u not added into button %u for player %s: spell not exist", action, button, GetName() );
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!HasSpell(action))
|
||||
{
|
||||
sLog.outError( "Action %u not added into button %u for player %s: player don't known this spell", action, button, GetName() );
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5382,6 +5382,7 @@ void Player::addActionButton(const uint8 button, const uint16 action, const uint
|
|||
};
|
||||
|
||||
sLog.outDetail( "Player '%u' Added Action '%u' to Button '%u'", GetGUIDLow(), action, button );
|
||||
return true;
|
||||
}
|
||||
|
||||
void Player::removeActionButton(uint8 button)
|
||||
|
|
@ -5934,8 +5935,8 @@ bool Player::ModifyOneFactionReputation(FactionEntry const* factionEntry, int32
|
|||
}
|
||||
}
|
||||
}
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION,factionEntry->ID);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION,factionEntry->ID);
|
||||
SendFactionState(&(itr->second));
|
||||
|
||||
return true;
|
||||
|
|
@ -6001,8 +6002,8 @@ bool Player::SetOneFactionReputation(FactionEntry const* factionEntry, int32 sta
|
|||
SetFactionAtWar(&itr->second,true);
|
||||
|
||||
SendFactionState(&(itr->second));
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION,factionEntry->ID);
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION,factionEntry->ID);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -7004,7 +7005,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
|
|||
if(apply)
|
||||
{
|
||||
// Cannot be used in this stance/form
|
||||
if(GetErrorAtShapeshiftedCast(spellInfo, m_form)!=0)
|
||||
if(GetErrorAtShapeshiftedCast(spellInfo, m_form) != SPELL_CAST_OK)
|
||||
return;
|
||||
|
||||
if(form_change) // check aura active state from other form
|
||||
|
|
@ -7038,7 +7039,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
|
|||
if(form_change) // check aura compatibility
|
||||
{
|
||||
// Cannot be used in this stance/form
|
||||
if(GetErrorAtShapeshiftedCast(spellInfo, m_form)==0)
|
||||
if(GetErrorAtShapeshiftedCast(spellInfo, m_form)==SPELL_CAST_OK)
|
||||
return; // and remove only not compatible at form change
|
||||
}
|
||||
|
||||
|
|
@ -7450,6 +7451,9 @@ void Player::SendLootRelease( uint64 guid )
|
|||
|
||||
void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||
{
|
||||
if (uint64 lguid = GetLootGUID())
|
||||
m_session->DoLootRelease(lguid);
|
||||
|
||||
Loot *loot = 0;
|
||||
PermissionTypes permission = ALL_PERMISSION;
|
||||
|
||||
|
|
@ -10667,6 +10671,8 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
|
|||
}
|
||||
}
|
||||
|
||||
// only for full equip instead adding to stack
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry());
|
||||
return pItem;
|
||||
}
|
||||
|
||||
|
|
@ -10913,60 +10919,60 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
|
|||
void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool unequip_check)
|
||||
{
|
||||
sLog.outDebug( "STORAGE: DestroyItemCount item = %u, count = %u", item, count);
|
||||
Item *pItem;
|
||||
ItemPrototype const *pProto;
|
||||
uint32 remcount = 0;
|
||||
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
{
|
||||
pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->GetEntry() == item )
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
if( pItem->GetCount() + remcount <= count )
|
||||
if (pItem->GetEntry() == item)
|
||||
{
|
||||
// all items in inventory can unequipped
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
if (pItem->GetCount() + remcount <= count)
|
||||
{
|
||||
// all items in inventory can unequipped
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
if(remcount >=count)
|
||||
if (remcount >=count)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() & update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pProto = pItem->GetProto();
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if( IsInWorld() & update )
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
|
||||
{
|
||||
pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->GetEntry() == item )
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
if( pItem->GetCount() + remcount <= count )
|
||||
if (pItem->GetEntry() == item)
|
||||
{
|
||||
// all keys can be unequipped
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
if (pItem->GetCount() + remcount <= count)
|
||||
{
|
||||
// all keys can be unequipped
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
if(remcount >=count)
|
||||
if (remcount >=count)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() & update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pProto = pItem->GetProto();
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if( IsInWorld() & update )
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10978,27 +10984,28 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
|||
{
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
{
|
||||
pItem = pBag->GetItemByPos(j);
|
||||
if( pItem && pItem->GetEntry() == item )
|
||||
if(Item* pItem = pBag->GetItemByPos(j))
|
||||
{
|
||||
// all items in bags can be unequipped
|
||||
if( pItem->GetCount() + remcount <= count )
|
||||
if (pItem->GetEntry() == item)
|
||||
{
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( i, j, update );
|
||||
// all items in bags can be unequipped
|
||||
if (pItem->GetCount() + remcount <= count)
|
||||
{
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( i, j, update );
|
||||
|
||||
if(remcount >=count)
|
||||
if (remcount >=count)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() && update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
pProto = pItem->GetProto();
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if( IsInWorld() && update )
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11008,29 +11015,30 @@ void Player::DestroyItemCount( uint32 item, uint32 count, bool update, bool uneq
|
|||
// in equipment and bag list
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->GetEntry() == item )
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
{
|
||||
if( pItem->GetCount() + remcount <= count )
|
||||
if (pItem && pItem->GetEntry() == item)
|
||||
{
|
||||
if(!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i,false) == EQUIP_ERR_OK )
|
||||
if (pItem->GetCount() + remcount <= count)
|
||||
{
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
if (!unequip_check || CanUnequipItem(INVENTORY_SLOT_BAG_0 << 8 | i,false) == EQUIP_ERR_OK )
|
||||
{
|
||||
remcount += pItem->GetCount();
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
if(remcount >=count)
|
||||
return;
|
||||
if (remcount >=count)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if (IsInWorld() & update)
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pProto = pItem->GetProto();
|
||||
ItemRemovedQuestCheck( pItem->GetEntry(), count - remcount );
|
||||
pItem->SetCount( pItem->GetCount() - count + remcount );
|
||||
if( IsInWorld() & update )
|
||||
pItem->SendUpdateToPlayer( this );
|
||||
pItem->SetState(ITEM_CHANGED, this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11042,40 +11050,28 @@ void Player::DestroyZoneLimitedItem( bool update, uint32 new_zone )
|
|||
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
{
|
||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
for(int i = KEYRING_SLOT_START; i < QUESTBAG_SLOT_END; i++)
|
||||
{
|
||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
// in inventory bags
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pBag )
|
||||
{
|
||||
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
{
|
||||
Item* pItem = pBag->GetItemByPos(j);
|
||||
if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
|
||||
DestroyItem( i, j, update);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
|
||||
DestroyItem( i, j, update);
|
||||
|
||||
// in equipment and bag list
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone) )
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(),new_zone))
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
|
||||
void Player::DestroyConjuredItems( bool update )
|
||||
|
|
@ -11086,40 +11082,23 @@ void Player::DestroyConjuredItems( bool update )
|
|||
|
||||
// in inventory
|
||||
for(int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++)
|
||||
{
|
||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->GetProto() &&
|
||||
(pItem->GetProto()->Class == ITEM_CLASS_CONSUMABLE) &&
|
||||
(pItem->GetProto()->Flags & ITEM_FLAGS_CONJURED) )
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsConjuredConsumable())
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
|
||||
// in inventory bags
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pBag )
|
||||
{
|
||||
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
{
|
||||
Item* pItem = pBag->GetItemByPos(j);
|
||||
if( pItem && pItem->GetProto() &&
|
||||
(pItem->GetProto()->Class == ITEM_CLASS_CONSUMABLE) &&
|
||||
(pItem->GetProto()->Flags & ITEM_FLAGS_CONJURED) )
|
||||
DestroyItem( i, j, update);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Item* pItem = pBag->GetItemByPos(j))
|
||||
if (pItem->IsConjuredConsumable())
|
||||
DestroyItem( i, j, update);
|
||||
|
||||
// in equipment and bag list
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; i++)
|
||||
{
|
||||
Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i );
|
||||
if( pItem && pItem->GetProto() &&
|
||||
(pItem->GetProto()->Class == ITEM_CLASS_CONSUMABLE) &&
|
||||
(pItem->GetProto()->Flags & ITEM_FLAGS_CONJURED) )
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
if (Item* pItem = GetItemByPos( INVENTORY_SLOT_BAG_0, i ))
|
||||
if (pItem->IsConjuredConsumable())
|
||||
DestroyItem( INVENTORY_SLOT_BAG_0, i, update);
|
||||
}
|
||||
|
||||
void Player::DestroyItemCount( Item* pItem, uint32 &count, bool update )
|
||||
|
|
@ -12250,7 +12229,7 @@ void Player::SendNewItem(Item *item, uint32 count, bool received, bool created,
|
|||
data << GetItemCount(item->GetEntry()); // count of items in inventory
|
||||
|
||||
if (broadcast && GetGroup())
|
||||
GetGroup()->BroadcastPacket(&data);
|
||||
GetGroup()->BroadcastPacket(&data, true);
|
||||
else
|
||||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
|
@ -12817,7 +12796,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
|
|||
GiveXP( XP , NULL );
|
||||
else
|
||||
{
|
||||
int32 money = int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY));
|
||||
uint32 money = uint32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY));
|
||||
ModifyMoney( money );
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, money);
|
||||
}
|
||||
|
|
@ -12826,7 +12805,9 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
|
|||
if(pQuest->GetRewOrReqMoney())
|
||||
{
|
||||
ModifyMoney( pQuest->GetRewOrReqMoney() );
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, pQuest->GetRewOrReqMoney());
|
||||
|
||||
if(pQuest->GetRewOrReqMoney() > 0)
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, pQuest->GetRewOrReqMoney());
|
||||
}
|
||||
|
||||
// honor reward
|
||||
|
|
@ -14785,9 +14766,15 @@ void Player::_LoadActions(QueryResult *result)
|
|||
|
||||
uint8 button = fields[0].GetUInt8();
|
||||
|
||||
addActionButton(button, fields[1].GetUInt16(), fields[2].GetUInt8(), fields[3].GetUInt8());
|
||||
if(addActionButton(button, fields[1].GetUInt16(), fields[2].GetUInt8(), fields[3].GetUInt8()))
|
||||
m_actionButtons[button].uState = ACTIONBUTTON_UNCHANGED;
|
||||
else
|
||||
{
|
||||
sLog.outError( " ...at loading, and will deleted in DB also");
|
||||
|
||||
m_actionButtons[button].uState = ACTIONBUTTON_UNCHANGED;
|
||||
// Will deleted in DB at next save (it can create data until save but marked as deleted)
|
||||
m_actionButtons[button].uState = ACTIONBUTTON_DELETED;
|
||||
}
|
||||
}
|
||||
while( result->NextRow() );
|
||||
|
||||
|
|
@ -18261,7 +18248,8 @@ void Player::ClearComboPoints()
|
|||
|
||||
void Player::SetGroup(Group *group, int8 subgroup)
|
||||
{
|
||||
if(group == NULL) m_group.unlink();
|
||||
if(group == NULL)
|
||||
m_group.unlink();
|
||||
else
|
||||
{
|
||||
// never use SetGroup without a subgroup unless you specify NULL for group
|
||||
|
|
@ -19215,7 +19203,7 @@ void Player::UpdateAreaDependentAuras( uint32 newArea )
|
|||
for(AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();)
|
||||
{
|
||||
// use m_zoneUpdateId for speed: UpdateArea called from UpdateZone or instead UpdateZone in both cases m_zoneUpdateId up-to-date
|
||||
if(spellmgr.GetSpellAllowedInLocationError(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea,this)!=0)
|
||||
if(spellmgr.GetSpellAllowedInLocationError(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea,this) != SPELL_CAST_OK)
|
||||
RemoveAura(iter);
|
||||
else
|
||||
++iter;
|
||||
|
|
@ -19348,6 +19336,41 @@ PartyResult Player::CanUninviteFromGroup() const
|
|||
return PARTY_RESULT_OK;
|
||||
}
|
||||
|
||||
void Player::SetBattleGroundRaid(Group* group, int8 subgroup)
|
||||
{
|
||||
//we must move references from m_group to m_originalGroup
|
||||
SetOriginalGroup(GetGroup(), GetSubGroup());
|
||||
|
||||
m_group.unlink();
|
||||
m_group.link(group, this);
|
||||
m_group.setSubGroup((uint8)subgroup);
|
||||
}
|
||||
|
||||
void Player::RemoveFromBattleGroundRaid()
|
||||
{
|
||||
//remove existing reference
|
||||
m_group.unlink();
|
||||
if( Group* group = GetOriginalGroup() )
|
||||
{
|
||||
m_group.link(group, this);
|
||||
m_group.setSubGroup(GetOriginalSubGroup());
|
||||
}
|
||||
SetOriginalGroup(NULL);
|
||||
}
|
||||
|
||||
void Player::SetOriginalGroup(Group *group, int8 subgroup)
|
||||
{
|
||||
if( group == NULL )
|
||||
m_originalGroup.unlink();
|
||||
else
|
||||
{
|
||||
// never use SetOriginalGroup without a subgroup unless you specify NULL for group
|
||||
assert(subgroup >= 0);
|
||||
m_originalGroup.link(group, this);
|
||||
m_originalGroup.setSubGroup((uint8)subgroup);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::UpdateUnderwaterState( Map* m, float x, float y, float z )
|
||||
{
|
||||
LiquidData liquid_status;
|
||||
|
|
@ -19425,6 +19448,7 @@ bool Player::CanUseBattleGroundObject()
|
|||
{
|
||||
return ( //InBattleGround() && // in battleground - not need, check in other cases
|
||||
//!IsMounted() && - not correct, player is dismounted when he clicks on flag
|
||||
//i'm not sure if these two are correct, because invisible players should get visible when they click on flag
|
||||
!HasStealthAura() && // not stealthed
|
||||
!HasInvisibilityAura() && // not invisible
|
||||
!HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
|
||||
|
|
@ -19742,8 +19766,20 @@ void Player::_LoadSkills()
|
|||
else
|
||||
SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id,0));
|
||||
|
||||
uint32 vskill = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i)));
|
||||
// set fixed skill ranges
|
||||
switch(GetSkillRangeType(pSkill,false))
|
||||
{
|
||||
case SKILL_RANGE_LANGUAGE: // 300..300
|
||||
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(300,300));
|
||||
break;
|
||||
case SKILL_RANGE_MONO: // 1..1, grey monolite bar
|
||||
SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(1,1));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
uint32 vskill = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i)));
|
||||
learnSkillRewardedSpells(id, vskill);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue