Core/Loot: Skinning improvements
* Set skinnable flag only after all loot was taken * Creatures are skinnable only once - after skinning, the player only has to loot the creature again if he did not take all skinning loot
This commit is contained in:
1 parent
224b5c08df
commit
74850abcfc
8 files changed
+51
-74
No files matched your search
@@ -5058,13 +5058,11 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_TARGET_UNSKINNABLE;
|
||||
|
||||
Creature* creature = m_targets.GetUnitTarget()->ToCreature();
|
||||
if (creature->GetCreatureType() != CREATURE_TYPE_CRITTER && creature->loot.loot_type != LOOT_SKINNING && !creature->loot.isLooted())
|
||||
if (creature->GetCreatureType() != CREATURE_TYPE_CRITTER && !creature->loot.isLooted())
|
||||
return SPELL_FAILED_TARGET_NOT_LOOTED;
|
||||
|
||||
uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill();
|
||||
|
||||
bool alreadySkinned = creature->loot.loot_type == LOOT_SKINNING && creature->GetSkinner() == m_caster->GetGUID();
|
||||
|
||||
int32 skillValue = m_caster->ToPlayer()->GetSkillValue(skill);
|
||||
int32 TargetLevel = m_targets.GetUnitTarget()->getLevel();
|
||||
int32 ReqValue = (skillValue < 100 ? (TargetLevel-10) * 10 : TargetLevel * 5);
|
||||
@@ -5074,7 +5072,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
// chance for fail at orange skinning attempt
|
||||
if ((m_selfContainer && (*m_selfContainer) == this) &&
|
||||
skillValue < sWorld->GetConfigMaxSkillValue() &&
|
||||
(ReqValue < 0 ? 0 : ReqValue) > irand(skillValue - 25, skillValue + 37) && !alreadySkinned)
|
||||
(ReqValue < 0 ? 0 : ReqValue) > irand(skillValue - 25, skillValue + 37))
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user