aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-08 21:54:13 -0600
committermegamage <none@none>2009-02-08 21:54:13 -0600
commit2bd90deeedb6282eab9dfce650fbaf2bda451ee8 (patch)
tree26a6af03fd6757b52002e56469a728f75a42abc8 /src/game/SpellAuras.cpp
parent11b9bd42f76db238af914112bdc065fc8293451d (diff)
[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
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 55ea69eefb2..cf7ad71245e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -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