mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-19 14:39:43 -04:00
[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:
+2
-18
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user