Ejemplo n.º 1
0
bool canCreateExtraItems(Player* pPlayer, uint32 spellId, float &additionalChance, uint8 &additionalMax, uint32 &newItemId)
{
    // get the info for the specified spell
    SkillExtraItemMap::const_iterator ret = SkillExtraItemStore.find(spellId);
    if(ret == SkillExtraItemStore.end())
        return false;

    SkillExtraItemEntry const* specEntry = &ret->second;

    // if no entry, then no extra items can be created
    if(!specEntry)
        return false;

    // the player doesn't have the required specialization, return false
    if(!pPlayer->HasSpell(specEntry->requiredSpecialization))
        return false;

    // set the arguments to the appropriate values
    additionalChance = specEntry->additionalCreateChance;
    additionalMax = specEntry->additionalMaxNum;
    newItemId = specEntry->newItemId;

    // enable extra item creation
    return true;
}