[7133] Re-implement explicit spell discovery code.

* Replace reqClass by reqSkillVlaue field in `skill_discovery_template`
  and check expected skill points amount for specific reipe discovery.
* Add new `spell_loot_template` loot table for store item selection data for spells.
  At this moment for expclicit recipes discovery spells.
* Code cleanups.
This commit is contained in:
VladimirMangos 2009-01-21 06:14:34 +03:00
parent 205957df0a
commit 2b91a790bc
15 changed files with 201 additions and 95 deletions

View file

@ -19313,3 +19313,23 @@ void Player::InitRunes()
for(uint32 i = 0; i < NUM_RUNE_TYPES; ++i)
SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f);
}
void Player::AutoStoreLootItem(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store)
{
Loot loot;
loot.FillLoot (loot_id,store,this);
if(loot.items.empty ())
return;
LootItem const* lootItem = &loot.items[0];
ItemPosCountVec dest;
uint8 msg = CanStoreNewItem (bag,slot,dest,lootItem->itemid,lootItem->count);
if(msg != EQUIP_ERR_OK && slot != NULL_SLOT)
msg = CanStoreNewItem( bag, NULL_SLOT,dest,lootItem->itemid,lootItem->count);
if( msg != EQUIP_ERR_OK && bag != NULL_BAG)
msg = CanStoreNewItem( NULL_BAG, NULL_SLOT,dest,lootItem->itemid,lootItem->count);
if(msg != EQUIP_ERR_OK)
return;
StoreNewItem (dest,lootItem->itemid,true,lootItem->randomPropertyId);
}