[9934] Skinning related fixes

* Show skinning tooltip only after creature loot
  (when creature can be explcitly skinned).
* Allow reopen skinning loot if still have not looted items.
This commit is contained in:
VladimirMangos 2010-05-19 14:40:20 +04:00
parent cad8693819
commit d4f1b510ae
7 changed files with 52 additions and 19 deletions

View file

@ -566,9 +566,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
pVictim->SetHealth(0);
// allow loot only if has loot_id in creature_template
CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
if(cInfo && cInfo->lootid)
pVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
((Creature*)pVictim)->PrepareBodyLootState();
// some critters required for quests (need normal entry instead possible heroic in any cases)
if(GetTypeId() == TYPEID_PLAYER)
@ -809,10 +807,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
{
cVictim->DeleteThreatList();
// only lootable if it has loot or can drop gold
if(cVictim->GetCreatureInfo()->lootid || cVictim->GetCreatureInfo()->maxgold > 0)
cVictim->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
else
cVictim->lootForBody = true; // needed for skinning
cVictim->PrepareBodyLootState();
}
// Call creature just died function
if (cVictim->AI())