Core/Skinning: Fixed the creatures becoming non-skinnable even before looting them completely.

Closes #5318
This commit is contained in:
Subv committed 2014-06-24 20:04:26 -05:00
1 parent cac491bef8
commit a0fedd1d78
6 files changed
+35 -8

No files matched your search

+15 -2
View File
@@ -4702,15 +4702,28 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/)
uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
bool awardPoints = true;
// Check if a skinning loot table was already generated for this creature
if (creature->loot.loot_type == LOOT_SKINNING)
{
if (creature->GetSkinner() != m_caster->GetGUID())
return;
awardPoints = false; // Do not grant skill points for this loot, they were already granted the first time.
}
else
creature->SetSkinner(m_caster->GetGUID());
m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING);
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
int32 reqValue = targetLevel < 10 ? 0 : targetLevel < 20 ? (targetLevel-10)*10 : targetLevel*5;
int32 skillValue = m_caster->ToPlayer()->GetPureSkillValue(skill);
// Double chances for elites
m_caster->ToPlayer()->UpdateGatherSkill(skill, skillValue, reqValue, creature->isElite() ? 2 : 1);
if (awardPoints)
m_caster->ToPlayer()->UpdateGatherSkill(skill, skillValue, reqValue, creature->isElite() ? 2 : 1);
}
void Spell::EffectCharge(SpellEffIndex /*effIndex*/)