[7239] Support multiply items loot and not normal loot items in Player::AutoStoreLoot. Author: VladimirMangos

Use this function in more cases and simplify and fix some related code.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-08 21:54:13 -06:00
parent 11b9bd42f7
commit 2bd90deeed
7 changed files with 37 additions and 53 deletions
+2 -18
View File
@@ -1369,26 +1369,10 @@ void Aura::TriggerSpell()
Creature* creature = (Creature*)target;
// missing lootid has been reported on startup - just return
if (!creature->GetCreatureInfo()->SkinLootId)
{
return;
}
Loot *loot = &creature->loot;
loot->clear();
loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, player, true);
for(uint8 i=0;i<loot->items.size();i++)
{
LootItem *item = loot->LootItemInSlot(i,player);
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, item->itemid, item->count );
if ( msg == EQUIP_ERR_OK )
{
Item * newitem = player->StoreNewItem( dest, item->itemid, true, item->randomPropertyId);
player->SendNewItem(newitem, uint32(item->count), false, false, true);
}
else
player->SendEquipError( msg, NULL, NULL );
}
player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId,LootTemplates_Skinning,true);
creature->setDeathState(JUST_DIED);
creature->RemoveCorpse();
creature->SetHealth(0); // just for nice GM-mode view