rendered paste bodybool ItemUse_item_cooking_pot(Player *player, Item* _Item, SpellCastTargets const& targets)
{
Unit * unit_target = targets.getUnitTarget();
if (player->GetQuestStatus(11379) == QUEST_STATUS_INCOMPLETE)
{
if(unit_target->isDead() && unit_target->GetEntry()==19973 )// cast only on corpse 19973
{
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 43753, 1);
if( msg == EQUIP_ERR_OK )
{
Item * item = player->StoreNewItem( dest, 43753, 1);
}else player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL);
((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
return false; // all ok
}
}
WorldPacket data(SMSG_CAST_RESULT, (4+2)); // prepare packet error message
data << uint32(33852); // itemId
data << uint8(SPELL_FAILED_BAD_TARGETS); // reason
player->GetSession()->SendPacket(&data); // send message: Bad target
player->SendEquipError(EQUIP_ERR_NONE,_Item,NULL); // break spell
return true;
}