Merge commit 'origin/master' into 320

Conflicts:
	src/game/DBCStructure.h
	src/game/DBCfmt.h
	src/game/MiscHandler.cpp
	src/game/ObjectMgr.cpp
This commit is contained in:
tomrus88 2009-09-04 21:16:59 +04:00
commit 4a8431f581
51 changed files with 739 additions and 612 deletions

View file

@ -445,10 +445,10 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
for (int i = 0; i < MAX_COMBAT_RATING; ++i)
m_baseRatingValue[i] = 0;
m_baseSpellDamage = 0;
m_baseSpellHealing = 0;
m_baseSpellPower = 0;
m_baseFeralAP = 0;
m_baseManaRegen = 0;
m_armorPenetrationPct = 0.0f;
// Honor System
m_lastHonorUpdateTime = time(NULL);
@ -809,10 +809,10 @@ void Player::StopMirrorTimer(MirrorTimerType Type)
GetSession()->SendPacket( &data );
}
void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{
if(!isAlive() || isGameMaster())
return;
return 0;
// Absorb, resist some environmental damage type
uint32 absorb = 0;
@ -834,7 +834,7 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
data << uint32(resist);
SendMessageToSet(&data, true);
DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
uint32 final_damage = DealDamage(this, damage, NULL, SELF_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
if(!isAlive())
{
@ -849,6 +849,8 @@ void Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type);
}
return final_damage;
}
int32 Player::getMaxTimer(MirrorTimerType timer)
@ -4980,6 +4982,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
}
break;
case CR_ARMOR_PENETRATION:
if(affectStats)
UpdateArmorPenetration();
break;
}
}
@ -6666,12 +6670,6 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
case ITEM_MOD_FERAL_ATTACK_POWER:
ApplyFeralAPBonus(int32(val), apply);
break;
case ITEM_MOD_SPELL_HEALING_DONE:
ApplySpellHealingBonus(int32(val), apply);
break;
case ITEM_MOD_SPELL_DAMAGE_DONE:
ApplySpellDamageBonus(int32(val), apply);
break;
case ITEM_MOD_MANA_REGENERATION:
ApplyManaRegenBonus(int32(val), apply);
break;
@ -6679,8 +6677,11 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
ApplyRatingMod(CR_ARMOR_PENETRATION, int32(val), apply);
break;
case ITEM_MOD_SPELL_POWER:
ApplySpellHealingBonus(int32(val), apply);
ApplySpellDamageBonus(int32(val), apply);
ApplySpellPowerBonus(int32(val), apply);
break;
// depricated item mods
case ITEM_MOD_SPELL_HEALING_DONE:
case ITEM_MOD_SPELL_DAMAGE_DONE:
break;
}
}
@ -10448,9 +10449,15 @@ Item* Player::EquipItem( uint16 pos, Item *pItem, bool update )
ApplyEquipCooldown(pItem);
if( slot == EQUIPMENT_SLOT_MAINHAND )
{
UpdateExpertise(BASE_ATTACK);
UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
{
UpdateExpertise(OFF_ATTACK);
UpdateArmorPenetration();
}
}
else
{
@ -10590,9 +10597,13 @@ void Player::RemoveItem( uint8 bag, uint8 slot, bool update )
}
UpdateExpertise(BASE_ATTACK);
UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
{
UpdateExpertise(OFF_ATTACK);
UpdateArmorPenetration();
}
}
}
// need update known currency
@ -10701,10 +10712,16 @@ void Player::DestroyItem( uint8 bag, uint8 slot, bool update )
RemoveItemDependentAurasAndCasts(pItem);
// update expertise
if ( slot == EQUIPMENT_SLOT_MAINHAND )
if( slot == EQUIPMENT_SLOT_MAINHAND )
{
UpdateExpertise(BASE_ATTACK);
UpdateArmorPenetration();
}
else if( slot == EQUIPMENT_SLOT_OFFHAND )
{
UpdateExpertise(OFF_ATTACK);
UpdateArmorPenetration();
}
// equipment visual show
SetVisibleItemSlot(slot, NULL);
@ -11939,14 +11956,6 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
((Player*)this)->ApplyFeralAPBonus(enchant_amount, apply);
sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount);
break;
case ITEM_MOD_SPELL_HEALING_DONE:
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
sLog.outDebug("+ %u SPELL_HEALING_DONE", enchant_amount);
break;
case ITEM_MOD_SPELL_DAMAGE_DONE:
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
sLog.outDebug("+ %u SPELL_DAMAGE_DONE", enchant_amount);
break;
case ITEM_MOD_MANA_REGENERATION:
((Player*)this)->ApplyManaRegenBonus(enchant_amount, apply);
sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount);
@ -11956,10 +11965,11 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount);
break;
case ITEM_MOD_SPELL_POWER:
((Player*)this)->ApplySpellHealingBonus(enchant_amount, apply);
((Player*)this)->ApplySpellDamageBonus(enchant_amount, apply);
((Player*)this)->ApplySpellPowerBonus(enchant_amount, apply);
sLog.outDebug("+ %u SPELL_POWER", enchant_amount);
break;
case ITEM_MOD_SPELL_HEALING_DONE: // deprecated
case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated
default:
break;
}
@ -18690,9 +18700,9 @@ void Player::UpdateForQuestWorldObjects()
continue;
SpellClickInfoMapBounds clickPair = objmgr.GetSpellClickInfoMapBounds(obj->GetEntry());
for(SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
for(SpellClickInfoMap::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr)
{
if(itr->second.questStart || itr->second.questEnd)
if(_itr->second.questStart || _itr->second.questEnd)
{
obj->BuildCreateUpdateBlockForPlayer(&udata,this);
break;
@ -19914,10 +19924,11 @@ void Player::HandleFall(MovementInfo const& movementInfo)
if (GetDummyAura(43621))
damage = GetMaxHealth()/2;
EnvironmentalDamage(DAMAGE_FALL, damage);
uint32 original_health = GetHealth();
uint32 final_damage = EnvironmentalDamage(DAMAGE_FALL, damage);
// recheck alive, might have died of EnvironmentalDamage
if (isAlive())
// recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case
if (isAlive() && final_damage < original_health)
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100));
}