Page 4 of 7 FirstFirst 1234567 LastLast
Results 46 to 60 of 91

Thread: Bugs Fixing

http://idgs.in/581078
  1. #46
    Achernar_Altair's Avatar
    Join Date
    Mar 2007
    Location
    Kamar, Masjid, Kantor n Warnet, g jauh2 dah dari situ
    Posts
    877
    Points
    1,872.78
    Thanks: 15 / 131 / 30

    Default [C++]Archaeology?

    Description : well knapa saya kasih tanda tanya? karena ane sendiri g yakin ini bisa ngefix 100% atau ada efeknya, tapi tak ada salahnya di coba, karena ane ud muter2 nyari FIx buat archaeology g ktemu2, dapet dari PS laen, access ke sourcenya denied
    -_-'a, ada yang punya script 100% work, bayar 150$, cabe dah

    Reference : here

    Code :

    these goes to src/server/game/DataStores

    Spoiler untuk DBCStores.cpp :

    Code:
    /*
     * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
     * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    #include "DBCStores.h"
    #include "Log.h"
    #include "SharedDefines.h"
    #include "SpellMgr.h"
    #include "DBCfmt.h"
    #include "ItemPrototype.h"
    
    #include <map>
    
    typedef std::map<uint16, uint32> AreaFlagByAreaID;
    typedef std::map<uint32, uint32> AreaFlagByMapID;
    
    struct WMOAreaTableTripple
    {
        WMOAreaTableTripple(int32 r, int32 a, int32 g) :  groupId(g), rootId(r), adtId(a)
        {
        }
    
        bool operator <(const WMOAreaTableTripple& b) const
        {
            return memcmp(this, &b, sizeof(WMOAreaTableTripple))<0;
        }
    
        // ordered by entropy; that way memcmp will have a minimal medium runtime
        int32 groupId;
        int32 rootId;
        int32 adtId;
    };
    
    typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTripple;
    
    DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt);
    DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt);
    DBCStorage <AreaPOIEntry> sAreaPOIStore(AreaPOIEntryfmt);
    static AreaFlagByAreaID sAreaFlagByAreaID;
    static AreaFlagByMapID sAreaFlagByMapID;                    // for instances without generated *.map files
    
    static WMOAreaInfoByTripple sWMOAreaInfoByTripple;
    
    DBCStorage <AchievementEntry> sAchievementStore(Achievementfmt);
    DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore(AchievementCriteriafmt);
    DBCStorage <AreaTriggerEntry> sAreaTriggerStore(AreaTriggerEntryfmt);
    DBCStorage <ArmorLocationEntry> sArmorLocationStore(ArmorLocationfmt);
    DBCStorage <AuctionHouseEntry> sAuctionHouseStore(AuctionHouseEntryfmt);
    DBCStorage <BankBagSlotPricesEntry> sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt);
    DBCStorage <BattlemasterListEntry> sBattlemasterListStore(BattlemasterListEntryfmt);
    DBCStorage <BarberShopStyleEntry> sBarberShopStyleStore(BarberShopStyleEntryfmt);
    DBCStorage <CharStartOutfitEntry> sCharStartOutfitStore(CharStartOutfitEntryfmt);
    DBCStorage <CharTitlesEntry> sCharTitlesStore(CharTitlesEntryfmt);
    DBCStorage <ChatChannelsEntry> sChatChannelsStore(ChatChannelsEntryfmt);
    DBCStorage <ChrClassesEntry> sChrClassesStore(ChrClassesEntryfmt);
    DBCStorage <ChrRacesEntry> sChrRacesStore(ChrRacesEntryfmt);
    DBCStorage <ChrPowerTypesEntry> sChrPowerTypesStore(ChrClassesXPowerTypesfmt);
    DBCStorage <CinematicSequencesEntry> sCinematicSequencesStore(CinematicSequencesEntryfmt);
    DBCStorage <CreatureDisplayInfoEntry> sCreatureDisplayInfoStore(CreatureDisplayInfofmt);
    DBCStorage <CreatureFamilyEntry> sCreatureFamilyStore(CreatureFamilyfmt);
    DBCStorage <CreatureModelDataEntry> sCreatureModelDataStore(CreatureModelDatafmt);
    DBCStorage <CreatureSpellDataEntry> sCreatureSpellDataStore(CreatureSpellDatafmt);
    DBCStorage <CreatureTypeEntry> sCreatureTypeStore(CreatureTypefmt);
    DBCStorage <CurrencyTypesEntry> sCurrencyTypesStore(CurrencyTypesfmt);
    uint32 PowersByClass[MAX_CLASSES][MAX_POWERS];
    
    DBCStorage <DestructibleModelDataEntry> sDestructibleModelDataStore(DestructibleModelDatafmt);
    DBCStorage <DungeonEncounterEntry> sDungeonEncounterStore(DungeonEncounterfmt);
    DBCStorage <DurabilityQualityEntry> sDurabilityQualityStore(DurabilityQualityfmt);
    DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore(DurabilityCostsfmt);
    
    DBCStorage <EmotesEntry> sEmotesStore(EmotesEntryfmt);
    DBCStorage <EmotesTextEntry> sEmotesTextStore(EmotesTextEntryfmt);
    
    typedef std::map<uint32, SimpleFactionsList> FactionTeamMap;
    static FactionTeamMap sFactionTeamMap;
    DBCStorage <FactionEntry> sFactionStore(FactionEntryfmt);
    DBCStorage <FactionTemplateEntry> sFactionTemplateStore(FactionTemplateEntryfmt);
    
    DBCStorage <GameObjectDisplayInfoEntry> sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt);
    DBCStorage <GemPropertiesEntry> sGemPropertiesStore(GemPropertiesEntryfmt);
    DBCStorage <GlyphPropertiesEntry> sGlyphPropertiesStore(GlyphPropertiesfmt);
    DBCStorage <GlyphSlotEntry> sGlyphSlotStore(GlyphSlotfmt);
    
    DBCStorage <GtBarberShopCostBaseEntry>    sGtBarberShopCostBaseStore(GtBarberShopCostBasefmt);
    DBCStorage <GtCombatRatingsEntry>         sGtCombatRatingsStore(GtCombatRatingsfmt);
    DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore(GtChanceToMeleeCritBasefmt);
    DBCStorage <GtChanceToMeleeCritEntry>     sGtChanceToMeleeCritStore(GtChanceToMeleeCritfmt);
    DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt);
    DBCStorage <GtChanceToSpellCritEntry>     sGtChanceToSpellCritStore(GtChanceToSpellCritfmt);
    DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt);
    DBCStorage <GtOCTRegenHPEntry>            sGtOCTRegenHPStore(GtOCTRegenHPfmt);
    //DBCStorage <GtOCTRegenMPEntry>            sGtOCTRegenMPStore(GtOCTRegenMPfmt);  -- not used currently
    DBCStorage <gtOCTHpPerStaminaEntry>       sGtOCTHpPerStaminaStore(GtOCTHpPerStaminafmt);
    DBCStorage <GtRegenMPPerSptEntry>         sGtRegenMPPerSptStore(GtRegenMPPerSptfmt);
    DBCStorage <GtSpellScalingEntry>          sGtSpellScalingStore(GtSpellScalingfmt);
    DBCStorage <GtOCTBaseHPByClassEntry>      sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt);
    DBCStorage <GtOCTBaseMPByClassEntry>      sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt);
    DBCStorage <GuildPerkSpellsEntry>         sGuildPerkSpellsStore(GuildPerkSpellsfmt);
    
    DBCStorage <HolidaysEntry>                sHolidaysStore(Holidaysfmt);
    
    DBCStorage <ImportPriceArmorEntry>        sImportPriceArmorStore(ImportPriceArmorfmt);
    DBCStorage <ImportPriceQualityEntry>      sImportPriceQualityStore(ImportPriceQualityfmt);
    DBCStorage <ImportPriceShieldEntry>       sImportPriceShieldStore(ImportPriceShieldfmt);
    DBCStorage <ImportPriceWeaponEntry>       sImportPriceWeaponStore(ImportPriceWeaponfmt);
    DBCStorage <ItemPriceBaseEntry>           sItemPriceBaseStore(ItemPriceBasefmt);
    DBCStorage <ItemReforgeEntry>             sItemReforgeStore(ItemReforgefmt);
    DBCStorage <ItemArmorQualityEntry>        sItemArmorQualityStore(ItemArmorQualityfmt);
    DBCStorage <ItemArmorShieldEntry>         sItemArmorShieldStore(ItemArmorShieldfmt);
    DBCStorage <ItemArmorTotalEntry>          sItemArmorTotalStore(ItemArmorTotalfmt);
    DBCStorage <ItemClassEntry>               sItemClassStore(ItemClassfmt);
    DBCStorage <ItemBagFamilyEntry>           sItemBagFamilyStore(ItemBagFamilyfmt);
    DBCStorage <ItemDamageEntry>              sItemDamageAmmoStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageOneHandStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageOneHandCasterStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageRangedStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageThrownStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageTwoHandStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageTwoHandCasterStore(ItemDamagefmt);
    DBCStorage <ItemDamageEntry>              sItemDamageWandStore(ItemDamagefmt);
    DBCStorage <ItemDisenchantLootEntry>      sItemDisenchantLootStore(ItemDisenchantLootfmt);
    //DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently
    DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt);
    DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt);
    DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
    DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
    
    DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
    DBCStorage <LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
    DBCStorage <LockEntry> sLockStore(LockEntryfmt);
    
    DBCStorage <MailTemplateEntry> sMailTemplateStore(MailTemplateEntryfmt);
    DBCStorage <MapEntry> sMapStore(MapEntryfmt);
    
    // DBC used only for initialization sMapDifficultyMap at startup.
    DBCStorage <MapDifficultyEntry> sMapDifficultyStore(MapDifficultyEntryfmt); // only for loading
    MapDifficultyMap sMapDifficultyMap;
    
    DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
    DBCStorage <MountCapabilityEntry> sMountCapabilityStore(MountCapabilityfmt);
    DBCStorage <MountTypeEntry> sMountTypeStore(MountTypefmt);
    
    DBCStorage <NameGenEntry> sNameGenStore(NameGenfmt);
    NameGenVectorArraysMap sGenNameVectoArraysMap;
    DBCStorage <NumTalentsAtLevelEntry> sNumTalentsAtLevelStore(NumTalentsAtLevelfmt);
    
    DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
    
    DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
    
    DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
    DBCStorage <QuestXPEntry>   sQuestXPStore(QuestXPfmt);
    DBCStorage <QuestFactionRewEntry>  sQuestFactionRewardStore(QuestFactionRewardfmt);
    DBCStorage <QuestPOIBlobEntry> sQuestPOIBlobStorage(QuestPOIBlobfmt);
    DBCStorage <QuestPOIPointEntry> sQuestPOIPointStorage(QuestPOIPointfmt);
    
    DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore(RandomPropertiesPointsfmt);
    
    DBCStorage <ResearchBranchEntry> sResearchBranchStore(ResearchBranchfmt);
    DBCStorage <ResearchDigsiteEntry> sResearchDigsiteStore(ResearchDigsitefmt);
    DBCStorage <ResearchProjectEntry> sResearchProjectStore(ResearchProjectfmt);
    
    DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore(ScalingStatDistributionfmt);
    DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore(ScalingStatValuesfmt);
    
    DBCStorage <SkillLineEntry> sSkillLineStore(SkillLinefmt);
    DBCStorage <SkillLineAbilityEntry> sSkillLineAbilityStore(SkillLineAbilityfmt);
    
    DBCStorage <SoundEntriesEntry> sSoundEntriesStore(SoundEntriesfmt);
    
    DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore(SpellItemEnchantmentfmt);
    DBCStorage <SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore(SpellItemEnchantmentConditionfmt);
    DBCStorage <SpellEntry> sSpellStore(SpellEntryfmt);
    SpellCategoryStore sSpellCategoryStore;
    PetFamilySpellsStore sPetFamilySpellsStore;
    
    
    DBCStorage <SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt);
    DBCStorage <SpellScalingEntry> sSpellScalingStore(SpellScalingEntryfmt);
    DBCStorage <SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt);
    DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt);
    DBCStorage <SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt);
    DBCStorage <SpellLevelsEntry> sSpellLevelsStore(SpellLevelsEntryfmt);
    DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore(SpellInterruptsEntryfmt);
    DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt);
    DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
    DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore(SpellCooldownsEntryfmt);
    DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt);
    DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
    DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt);
    DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt);
    DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore(SpellCategoriesEntryfmt);
    DBCStorage <SpellEffectEntry> sSpellEffectStore(SpellEffectEntryfmt);
    DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore(SpellDifficultyfmt);
    DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt);
    DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt);
    DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt);
    DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt);
    DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt);
    DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftEntryfmt);
    DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt);
    DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt);
    DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt);
    DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt);
    TalentSpellPosMap sTalentSpellPosMap;
    DBCStorage <TalentTabEntry> sTalentTabStore(TalentTabEntryfmt);
    DBCStorage <TalentTreePrimarySpellsEntry> sTalentTreePrimarySpellsStore(TalentTreePrimarySpellsfmt);
    typedef std::map<uint32, std::vector<uint32> > TalentTreePrimarySpellsMap;
    TalentTreePrimarySpellsMap sTalentTreePrimarySpellsMap;
    
    // store absolute bit position for first rank for talent inspect
    static uint32 sTalentTabPages[MAX_CLASSES][3];
    
    DBCStorage <TaxiNodesEntry> sTaxiNodesStore(TaxiNodesEntryfmt);
    TaxiMask sTaxiNodesMask;
    TaxiMask sOldContinentsNodesMask;
    TaxiMask sHordeTaxiNodesMask;
    TaxiMask sAllianceTaxiNodesMask;
    TaxiMask sDeathKnightTaxiNodesMask;
    
    // DBC used only for initialization sTaxiPathSetBySource at startup.
    TaxiPathSetBySource sTaxiPathSetBySource;
    DBCStorage <TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt);
    
    // DBC used only for initialization sTaxiPathNodeStore at startup.
    TaxiPathNodesByPath sTaxiPathNodesByPath;
    static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt);
    
    DBCStorage <TeamContributionPointsEntry> sTeamContributionPointsStore(TeamContributionPointsfmt);
    DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt);
    DBCStorage <VehicleEntry> sVehicleStore(VehicleEntryfmt);
    DBCStorage <VehicleSeatEntry> sVehicleSeatStore(VehicleSeatEntryfmt);
    DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore(WMOAreaTableEntryfmt);
    DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
    DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt);
    DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt);
    DBCStorage <PhaseEntry> sPhaseStores(PhaseEntryfmt);
    
    typedef std::list<std::string> StoreProblemList;
    
    uint32 DBCFileCount = 0;
    
    static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename)
    {
        sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
    
        // ASSERT must fail after function call
        return false;
    }
    
    template<class T>
    inline void LoadDBC(uint32& availableDbcLocales, StoreProblemList& errors, DBCStorage<T>& storage, std::string const& dbcPath, std::string const& filename, std::string const* customFormat = NULL, std::string const* customIndexName = NULL)
    {
        // compatibility format and C++ structure sizes
        ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()), sizeof(T), filename));
    
        ++DBCFileCount;
        std::string dbcFilename = dbcPath + filename;
        SqlDbc * sql = NULL;
        if (customFormat)
            sql = new SqlDbc(&filename, customFormat, customIndexName, storage.GetFormat());
    
        if (storage.Load(dbcFilename.c_str(), sql))
        {
            for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
            {
                if (!(availableDbcLocales & (1 << i)))
                    continue;
    
                std::string localizedName(dbcPath);
                localizedName.append(localeNames[i]);
                localizedName.push_back('/');
                localizedName.append(filename);
    
                if (!storage.LoadStringsFrom(localizedName.c_str()))
                    availableDbcLocales &= ~(1<<i);             // mark as not available for speedup next checks
            }
        }
        else
        {
            // sort problematic dbc to (1) non compatible and (2) non-existed
            if (FILE* f = fopen(dbcFilename.c_str(), "rb"))
            {
                char buf[100];
                snprintf(buf, 100, " (exists, but has %u fields instead of " SIZEFMTD ") Possible wrong client version.", storage.GetFieldCount(), strlen(storage.GetFormat()));
                errors.push_back(dbcFilename + buf);
                fclose(f);
            }
            else
                errors.push_back(dbcFilename);
        }
    
        delete sql;
    }
    
    void LoadDBCStores(const std::string& dataPath)
    {
        uint32 oldMSTime = getMSTime();
    
        std::string dbcPath = dataPath+"dbc/";
    
        StoreProblemList bad_dbc_files;
        uint32 availableDbcLocales = 0xFFFFFFFF;
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sAreaStore,                   dbcPath, "AreaTable.dbc");
    
        // must be after sAreaStore loading
        for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i)           // areaflag numbered from 0
        {
            if (AreaTableEntry const* area = sAreaStore.LookupEntry(i))
            {
                // fill AreaId->DBC records
                sAreaFlagByAreaID.insert(AreaFlagByAreaID::value_type(uint16(area->ID), area->exploreFlag));
    
                // fill MapId->DBC records (skip sub zones and continents)
                if (area->zone == 0 && area->mapid != 0 && area->mapid != 1 && area->mapid != 530 && area->mapid != 571)
                    sAreaFlagByMapID.insert(AreaFlagByMapID::value_type(area->mapid, area->exploreFlag));
            }
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore,            dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore,    dbcPath, "Achievement_Criteria.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore,            dbcPath, "AreaTrigger.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore,              dbcPath, "AreaGroup.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore,                dbcPath, "AreaPOI.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore,           dbcPath, "AuctionHouse.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sArmorLocationStore,          dbcPath, "ArmorLocation.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore,      dbcPath, "BankBagSlotPrices.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sBattlemasterListStore,       dbcPath, "BattlemasterList.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sBarberShopStyleStore,        dbcPath, "BarberShopStyle.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore,        dbcPath, "CharStartOutfit.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore,             dbcPath, "CharTitles.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore,           dbcPath, "ChatChannels.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore,             dbcPath, "ChrClasses.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore,               dbcPath, "ChrRaces.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sChrPowerTypesStore,          dbcPath, "ChrClassesXPowerTypes.dbc");//14545
        for (uint32 i = 0; i < MAX_CLASSES; ++i)
            for (uint32 j = 0; j < MAX_POWERS; ++j)
                PowersByClass[i][j] = MAX_POWERS;
    
        for (uint32 i = 0; i < sChrPowerTypesStore.GetNumRows(); ++i)
        {
            if (ChrPowerTypesEntry const* power = sChrPowerTypesStore.LookupEntry(i))
            {
                uint32 index = 0;
                for (uint32 j = 0; j < MAX_POWERS; ++j)
                    if (PowersByClass[power->classId][j] != MAX_POWERS)
                        ++index;
    
                PowersByClass[power->classId][power->power] = index;
            }
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore,     dbcPath, "CinematicSequences.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore,    dbcPath, "CreatureDisplayInfo.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore,         dbcPath, "CreatureFamily.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureModelDataStore,      dbcPath, "CreatureModelData.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureSpellDataStore,      dbcPath, "CreatureSpellData.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureTypeStore,           dbcPath, "CreatureType.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sCurrencyTypesStore,          dbcPath, "CurrencyTypes.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sDestructibleModelDataStore,  dbcPath, "DestructibleModelData.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sDungeonEncounterStore,       dbcPath, "DungeonEncounter.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityCostsStore,        dbcPath, "DurabilityCosts.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityQualityStore,      dbcPath, "DurabilityQuality.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesStore,                 dbcPath, "Emotes.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesTextStore,             dbcPath, "EmotesText.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sFactionStore,                dbcPath, "Faction.dbc");//14545
        for (uint32 i=0; i<sFactionStore.GetNumRows(); ++i)
        {
            FactionEntry const* faction = sFactionStore.LookupEntry(i);
            if (faction && faction->team)
            {
                SimpleFactionsList &flist = sFactionTeamMap[faction->team];
                flist.push_back(i);
            }
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sFactionTemplateStore,        dbcPath, "FactionTemplate.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGameObjectDisplayInfoStore,  dbcPath, "GameObjectDisplayInfo.dbc");//14545
        for (uint32 i = 0; i < sGameObjectDisplayInfoStore.GetNumRows(); ++i)
        {
            if (GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(i))
            {
                if (info->maxX < info->minX)
                    std::swap(*(float*)(&info->maxX), *(float*)(&info->minX));
                if (info->maxY < info->minY)
                    std::swap(*(float*)(&info->maxY), *(float*)(&info->minY));
                if (info->maxZ < info->minZ)
                    std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ));
            }
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sGemPropertiesStore,          dbcPath, "GemProperties.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGlyphPropertiesStore,        dbcPath, "GlyphProperties.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGlyphSlotStore,              dbcPath, "GlyphSlot.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtBarberShopCostBaseStore,   dbcPath, "gtBarberShopCostBase.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtCombatRatingsStore,        dbcPath, "gtCombatRatings.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritBaseStore, dbcPath, "gtChanceToMeleeCritBase.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritStore,    dbcPath, "gtChanceToMeleeCrit.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritBaseStore, dbcPath, "gtChanceToSpellCritBase.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritStore,    dbcPath, "gtChanceToSpellCrit.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTClassCombatRatingScalarStore,    dbcPath, "gtOCTClassCombatRatingScalar.dbc");//14545
        //LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTRegenHPStore,           dbcPath, "gtOCTRegenHP.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTHpPerStaminaStore,      dbcPath, "gtOCTHpPerStamina.dbc");//14545
        //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sGtOCTRegenMPStore,           dbcPath, "gtOCTRegenMP.dbc");       -- not used currently
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenMPPerSptStore,        dbcPath, "gtRegenMPPerSpt.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtSpellScalingStore,        dbcPath, "gtSpellScaling.dbc");//15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseHPByClassStore,        dbcPath, "gtOCTBaseHPByClass.dbc");//15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseMPByClassStore,        dbcPath, "gtOCTBaseMPByClass.dbc");//15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sGuildPerkSpellsStore,        dbcPath, "GuildPerkSpells.dbc");//15595
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore,               dbcPath, "Holidays.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceArmorStore,       dbcPath, "ImportPriceArmor.dbc"); // 15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceQualityStore,     dbcPath, "ImportPriceQuality.dbc"); // 15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceShieldStore,      dbcPath, "ImportPriceShield.dbc"); // 15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceWeaponStore,      dbcPath, "ImportPriceWeapon.dbc"); // 15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemPriceBaseStore,          dbcPath, "ItemPriceBase.dbc"); // 15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemReforgeStore,            dbcPath, "ItemReforge.dbc"); // 15595
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore,          dbcPath, "ItemBagFamily.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore,              dbcPath, "ItemClass.dbc"); // 15595
        //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore,        dbcPath, "ItemDisplayInfo.dbc");     -- not used currently
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemLimitCategoryStore,      dbcPath, "ItemLimitCategory.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore,   dbcPath, "ItemRandomProperties.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore,       dbcPath, "ItemRandomSuffix.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore,                dbcPath, "ItemSet.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore,       dbcPath, "ItemArmorQuality.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore,        dbcPath, "ItemArmorShield.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorTotalStore,         dbcPath, "ItemArmorTotal.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageAmmoStore,         dbcPath, "ItemDamageAmmo.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandStore,      dbcPath, "ItemDamageOneHand.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandCasterStore,dbcPath, "ItemDamageOneHandCaster.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageRangedStore,       dbcPath, "ItemDamageRanged.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageThrownStore,       dbcPath, "ItemDamageThrown.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandStore,      dbcPath, "ItemDamageTwoHand.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandCasterStore,dbcPath, "ItemDamageTwoHandCaster.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore,         dbcPath, "ItemDamageWand.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore,     dbcPath, "ItemDisenchantLoot.dbc");
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore,             dbcPath, "LFGDungeons.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sLiquidTypeStore,             dbcPath, "LiquidType.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore,                   dbcPath, "Lock.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStores,                 dbcPath, "Phase.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sMailTemplateStore,           dbcPath, "MailTemplate.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sMapStore,                    dbcPath, "Map.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sMapDifficultyStore,          dbcPath, "MapDifficulty.dbc");//14545
        // fill data
        sMapDifficultyMap[MAKE_PAIR32(0, 0)] = MapDifficulty(0, 0, false);//map 0 is missingg from MapDifficulty.dbc use this till its ported to sql
        for (uint32 i = 0; i < sMapDifficultyStore.GetNumRows(); ++i)
            if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i))
                sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0);
        sMapDifficultyStore.Clear();
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sMountCapabilityStore,        dbcPath, "MountCapability.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sMountTypeStore,              dbcPath, "MountType.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore,                dbcPath, "NameGen.dbc");//14545
        for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i)
            if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i))
                sGenNameVectoArraysMap[entry->race].stringVectorArray[entry->gender].push_back(std::string(entry->name));
        sNameGenStore.Clear();
        LoadDBC(availableDbcLocales, bad_dbc_files, sNumTalentsAtLevelStore,      dbcPath, "NumTalentsAtLevel.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore,                  dbcPath, "Movie.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore,      dbcPath, "OverrideSpellData.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sPvPDifficultyStore,          dbcPath, "PvpDifficulty.dbc");//14545
        for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
            if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
                if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
                    ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore,                dbcPath, "QuestXP.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sQuestFactionRewardStore,     dbcPath, "QuestFactionReward.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sQuestSortStore,              dbcPath, "QuestSort.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore,      dbcPath, "ScalingStatValues.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore,              dbcPath, "SkillLine.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore,       dbcPath, "SkillLineAbility.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore,           dbcPath, "SoundEntries.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellStore,                  dbcPath, "Spell.dbc"/*, &CustomSpellEntryfmt, &CustomSpellEntryIndex*/);//
        for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
        {
            SpellCategoriesEntry const* spell = sSpellCategoriesStore.LookupEntry(i);
            if (spell && spell->Category)
                sSpellCategoryStore[spell->Category].insert(i);
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore,          dbcPath,"SpellReagents.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore,           dbcPath,"SpellScaling.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore,            dbcPath,"SpellTotems.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore,dbcPath,"SpellTargetRestrictions.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellPowerStore,             dbcPath,"SpellPower.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore,            dbcPath,"SpellLevels.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore,        dbcPath,"SpellInterrupts.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEquippedItemsStore,     dbcPath,"SpellEquippedItems.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellClassOptionsStore,      dbcPath,"SpellClassOptions.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCooldownsStore,         dbcPath,"SpellCooldowns.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore,       dbcPath,"SpellAuraOptions.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore,  dbcPath,"SpellAuraRestrictions.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCategoriesStore,        dbcPath,"SpellCategories.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore,            dbcPath,"SpellEffect.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore,         dbcPath, "SpellCastTimes.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore,        dbcPath, "SpellDifficulty.dbc"/*, &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex*/);//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore,          dbcPath, "SpellDuration.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore,       dbcPath, "SpellFocusObject.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore,   dbcPath, "SpellItemEnchantment.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore,            dbcPath, "SpellRadius.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore,             dbcPath, "SpellRange.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore,          dbcPath, "SpellRuneCost.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore,        dbcPath, "SpellShapeshift.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftFormStore,    dbcPath, "SpellShapeshiftForm.dbc");//14545
        //LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore,       dbcPath, "StableSlotPrices.dbc");
        LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore,       dbcPath, "SummonProperties.dbc");//14545
    
        // Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded
        for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
        {
            SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j);
            if (!skillLine)
                continue;
    
            SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId);
            if (!spellInfo)
                continue;
    
            SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsId);
            if (spellInfo->SpellLevelsId && (!levels || levels->spellLevel))
                continue;
    
            if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
            {
                for (uint32 i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i)
                {
                    CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i);
                    if (!cFamily)
                        continue;
    
                    if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1])
                        continue;
    
                    if (skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL)
                        continue;
    
                    sPetFamilySpellsStore[i].insert(spellInfo->Id);
                }
            }
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore,                 dbcPath, "Talent.dbc");//14545
    
        // Create Spelldifficulty searcher
        for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i)
        {
            SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(i);
            if (!spellDiff)
                continue;
    
            SpellDifficultyEntry newEntry;
            memset(newEntry.SpellID, 0, 4*sizeof(uint32));
            for (int x = 0; x < MAX_DIFFICULTY; ++x)
            {
                if (spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x]))
                {
                    if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
                        sLog->outError(LOG_FILTER_SQL, "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
                    newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
                }
                else
                    newEntry.SpellID[x] = spellDiff->SpellID[x];
            }
            if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set!
                continue;
    
            for (int x = 0; x < MAX_DIFFICULTY; ++x)
                sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID);
        }
    
        // create talent spells set
        for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i)
        {
            TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
            if (!talentInfo)
                continue;
    
            for (int j = 0; j < MAX_TALENT_RANK; j++)
                if (talentInfo->RankID[j])
                    sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j);
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sTalentTabStore,              dbcPath, "TalentTab.dbc");//14545
    
        // prepare fast data access to bit pos of talent ranks for use at inspecting
        {
            // now have all max ranks (and then bit amount used for store talent ranks in inspect)
            for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
            {
                TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentTabId);
                if (!talentTabInfo)
                    continue;
    
                // prevent memory corruption; otherwise cls will become 12 below
                if ((talentTabInfo->ClassMask & CLASSMASK_ALL_PLAYABLE) == 0)
                    continue;
    
                // store class talent tab pages
                for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
                    if (talentTabInfo->ClassMask & (1 << (cls - 1)))
                        sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId;
            }
        }
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sTalentTreePrimarySpellsStore, dbcPath, "TalentTreePrimarySpells.dbc");
        for (uint32 i = 0; i < sTalentTreePrimarySpellsStore.GetNumRows(); ++i)
            if (TalentTreePrimarySpellsEntry const* talentSpell = sTalentTreePrimarySpellsStore.LookupEntry(i))
                sTalentTreePrimarySpellsMap[talentSpell->TalentTree].push_back(talentSpell->SpellId);
        sTalentTreePrimarySpellsStore.Clear();
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiNodesStore,              dbcPath, "TaxiNodes.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathStore,               dbcPath, "TaxiPath.dbc");//14545
        for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
            if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
                sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price);
        uint32 pathCount = sTaxiPathStore.GetNumRows();
    
        //## TaxiPathNode.dbc ## Loaded only for initialization different structures
        LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathNodeStore,           dbcPath, "TaxiPathNode.dbc");//14545
        // Calculate path nodes count
        std::vector<uint32> pathLength;
        pathLength.resize(pathCount);                           // 0 and some other indexes not used
        for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
            if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
            {
                if (pathLength[entry->path] < entry->index + 1)
                    pathLength[entry->path] = entry->index + 1;
            }
        // Set path length
        sTaxiPathNodesByPath.resize(pathCount);                 // 0 and some other indexes not used
        for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
            sTaxiPathNodesByPath[i].resize(pathLength[i]);
        // fill data
        for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
            if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
                sTaxiPathNodesByPath[entry->path].set(entry->index, entry);
    
        // Initialize global taxinodes mask
        // include existed nodes that have at least single not spell base (scripted) path
        {
            std::set<uint32> spellPaths;
            for (uint32 i = 1; i < sSpellEffectStore.GetNumRows(); ++i)
                if (SpellEffectEntry const* sInfo = sSpellEffectStore.LookupEntry (i))
                    if (sInfo->Effect == SPELL_EFFECT_SEND_TAXI)
                        spellPaths.insert(sInfo->EffectMiscValue);
    
            memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask));
            memset(sOldContinentsNodesMask, 0, sizeof(sOldContinentsNodesMask));
            memset(sHordeTaxiNodesMask, 0, sizeof(sHordeTaxiNodesMask));
            memset(sAllianceTaxiNodesMask, 0, sizeof(sAllianceTaxiNodesMask));
            memset(sDeathKnightTaxiNodesMask, 0, sizeof(sDeathKnightTaxiNodesMask));
            for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
            {
                TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
                if (!node)
                    continue;
    
                TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i);
                if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty())
                {
                    bool ok = false;
                    for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
                    {
                        // not spell path
                        if (spellPaths.find(dest_i->second.ID) == spellPaths.end())
                        {
                            ok = true;
                            break;
                        }
                    }
    
                    if (!ok)
                        continue;
                }
    
                // valid taxi network node
                uint8  field   = (uint8)((i - 1) / 8);
                uint32 submask = 1 << ((i-1) % 8);
    
                sTaxiNodesMask[field] |= submask;
                if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981)
                    sHordeTaxiNodesMask[field] |= submask;
                if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981)
                    sAllianceTaxiNodesMask[field] |= submask;
                if (node->MountCreatureID[0] == 32981 || node->MountCreatureID[1] == 32981)
                    sDeathKnightTaxiNodesMask[field] |= submask;
    
                // old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info)
                if (node->map_id < 2 || i == 82 || i == 83 || i == 93 || i == 94)
                    sOldContinentsNodesMask[field] |= submask;
    
                // fix DK node at Ebon Hold and Shadow Vault flight master
                if (i == 315 || i == 333)
                    ((TaxiNodesEntry*)node)->MountCreatureID[1] = 32981;
            }
        }
    
        //LoadDBC(availableDbcLocales, bad_dbc_files, sTeamContributionPointsStore, dbcPath, "TeamContributionPoints.dbc");
        LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore,          dbcPath, "TotemCategory.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore,                dbcPath, "Vehicle.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleSeatStore,            dbcPath, "VehicleSeat.dbc");//14545
    
        LoadDBC(availableDbcLocales, bad_dbc_files, sWMOAreaTableStore,           dbcPath, "WMOAreaTable.dbc");//14545
        for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i)
            if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i))
                sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->rootId, entry->adtId, entry->groupId), entry));
        LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapAreaStore,           dbcPath, "WorldMapArea.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapOverlayStore,        dbcPath, "WorldMapOverlay.dbc");//14545
        LoadDBC(availableDbcLocales, bad_dbc_files, sWorldSafeLocsStore,          dbcPath, "WorldSafeLocs.dbc");//14545
    
        // error checks
        if (bad_dbc_files.size() >= DBCFileCount)
        {
            sLog->outError(LOG_FILTER_GENERAL, "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFileCount, dataPath.c_str());
            exit(1);
        }
        else if (!bad_dbc_files.empty())
        {
            std::string str;
            for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
                str += *i + "\n";
    
            sLog->outError(LOG_FILTER_GENERAL, "Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
            exit(1);
        }
    
        // Check loaded DBC files proper version
        if (!sAreaStore.LookupEntry(4713)          ||     // last area (areaflag) added in 4.3.4 (15595)
            !sCharTitlesStore.LookupEntry(287)     ||     // last char title added in 4.3.4 (15595)
            !sGemPropertiesStore.LookupEntry(2250) ||     // last gem property added in 4.3.4 (15595)
            !sMapStore.LookupEntry(980)            ||     // last map added in 4.3.4 (15595)
            !sSpellStore.LookupEntry(121820)       )      // last spell added in 4.3.4 (15595)
        {
            sLog->outError(LOG_FILTER_GENERAL, "You have _outdated_ DBC files. Please extract correct versions from current using client.");
            exit(1);
        }
    
        sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Initialized %d DBC data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
    }
    
    const std::string* GetRandomCharacterName(uint8 race, uint8 gender)
    {
        uint32 size = sGenNameVectoArraysMap[race].stringVectorArray[gender].size();
        uint32 randPos = urand(0,size-1);
    
        return &sGenNameVectoArraysMap[race].stringVectorArray[gender][randPos];
    }
    
    SimpleFactionsList const* GetFactionTeamList(uint32 faction)
    {
        FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
        if (itr != sFactionTeamMap.end())
            return &itr->second;
    
        return NULL;
    }
    
    char const* GetPetName(uint32 petfamily, uint32 /*dbclang*/)
    {
        if (!petfamily)
            return NULL;
        CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily);
        if (!pet_family)
            return NULL;
        return pet_family->Name ? pet_family->Name : NULL;
    }
    
    TalentSpellPos const* GetTalentSpellPos(uint32 spellId)
    {
        TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId);
        if (itr == sTalentSpellPosMap.end())
            return NULL;
    
        return &itr->second;
    }
    
    uint32 GetTalentSpellCost(uint32 spellId)
    {
        if (TalentSpellPos const* pos = GetTalentSpellPos(spellId))
            return pos->rank+1;
    
        return 0;
    }
    
    int32 GetAreaFlagByAreaID(uint32 area_id)
    {
        AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);
        if (i == sAreaFlagByAreaID.end())
            return -1;
    
        return i->second;
    }
    
    WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid)
    {
        WMOAreaInfoByTripple::iterator i = sWMOAreaInfoByTripple.find(WMOAreaTableTripple(rootid, adtid, groupid));
            if (i == sWMOAreaInfoByTripple.end())
                return NULL;
            return i->second;
    }
    
    AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
    {
        int32 areaflag = GetAreaFlagByAreaID(area_id);
        if (areaflag < 0)
            return NULL;
    
        return sAreaStore.LookupEntry(areaflag);
    }
    
    AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id)
    {
        if (area_flag)
            return sAreaStore.LookupEntry(area_flag);
    
        if (MapEntry const* mapEntry = sMapStore.LookupEntry(map_id))
            return GetAreaEntryByAreaID(mapEntry->linked_zone);
    
        return NULL;
    }
    
    uint32 GetAreaFlagByMapId(uint32 mapid)
    {
        AreaFlagByMapID::iterator i = sAreaFlagByMapID.find(mapid);
        if (i == sAreaFlagByMapID.end())
            return 0;
        else
            return i->second;
    }
    
    uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId)
    {
        if (mapid != 530 && mapid != 571 && mapid != 732)   // speed for most cases
            return mapid;
    
        if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId))
            return wma->virtual_map_id >= 0 ? wma->virtual_map_id : wma->map_id;
    
        return mapid;
    }
    
    /*
    Used only for calculate xp gain by content lvl.
    Calculation on Gilneas and group maps of LostIslands calculated as CONTENT_1_60.
    */
    ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId)
    {
        mapid = GetVirtualMapForMapAndZone(mapid, zoneId);
        if (mapid < 2)
            return CONTENT_1_60;
    
        MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
        if (!mapEntry)
            return CONTENT_1_60;
    
        // no need enum all maps from phasing
        if (mapEntry->rootPhaseMap >= 0)
            mapid = mapEntry->rootPhaseMap;
    
        switch (mapid)
        {
            case 648:   //LostIslands
            case 654:   //Gilneas
                return CONTENT_1_60;
            default:
                return ContentLevels(mapEntry->Expansion());
        }
    }
    
    bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId)
    {
        if (requiredTotemCategoryId == 0)
            return true;
        if (itemTotemCategoryId == 0)
            return false;
    
        TotemCategoryEntry const* itemEntry = sTotemCategoryStore.LookupEntry(itemTotemCategoryId);
        if (!itemEntry)
            return false;
        TotemCategoryEntry const* reqEntry = sTotemCategoryStore.LookupEntry(requiredTotemCategoryId);
        if (!reqEntry)
            return false;
    
        if (itemEntry->categoryType != reqEntry->categoryType)
            return false;
    
        return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask;
    }
    
    void Zone2MapCoordinates(float& x, float& y, uint32 zone)
    {
        WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
    
        // if not listed then map coordinates (instance)
        if (!maEntry)
            return;
    
        std::swap(x, y);                                         // at client map coords swapped
        x = x*((maEntry->x2-maEntry->x1)/100)+maEntry->x1;
        y = y*((maEntry->y2-maEntry->y1)/100)+maEntry->y1;      // client y coord from top to down
    }
    
    void Map2ZoneCoordinates(float& x, float& y, uint32 zone)
    {
        WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone);
    
        // if not listed then map coordinates (instance)
        if (!maEntry)
            return;
    
        x = (x-maEntry->x1)/((maEntry->x2-maEntry->x1)/100);
        y = (y-maEntry->y1)/((maEntry->y2-maEntry->y1)/100);    // client y coord from top to down
        std::swap(x, y);                                         // client have map coords swapped
    }
    
    MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
    {
        MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId, difficulty));
        return itr != sMapDifficultyMap.end() ? &itr->second : NULL;
    }
    
    MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty)
    {
        uint32 tmpDiff = difficulty;
        MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff));
        if (!mapDiff)
        {
            if (tmpDiff > RAID_DIFFICULTY_25MAN_NORMAL) // heroic, downscale to normal
                tmpDiff -= 2;
            else
                tmpDiff -= 1;   // any non-normal mode for raids like tbc (only one mode)
    
            // pull new data
            mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // we are 10 normal or 25 normal
            if (!mapDiff)
            {
                tmpDiff -= 1;
                mapDiff = GetMapDifficultyData(mapId, Difficulty(tmpDiff)); // 10 normal
            }
        }
    
        difficulty = Difficulty(tmpDiff);
        return mapDiff;
    }
    
    PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level)
    {
        PvPDifficultyEntry const* maxEntry = NULL;              // used for level > max listed level case
        for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
        {
            if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
            {
                // skip unrelated and too-high brackets
                if (entry->mapId != mapid || entry->minLevel > level)
                    continue;
    
                // exactly fit
                if (entry->maxLevel >= level)
                    return entry;
    
                // remember for possible out-of-range case (search higher from existed)
                if (!maxEntry || maxEntry->maxLevel < entry->maxLevel)
                    maxEntry = entry;
            }
        }
    
        return maxEntry;
    }
    
    PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id)
    {
        for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
            if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
                if (entry->mapId == mapid && entry->GetBracketId() == id)
                    return entry;
    
        return NULL;
    }
    
    uint32 const* GetTalentTabPages(uint8 cls)
    {
        return sTalentTabPages[cls];
    }
    
    std::vector<uint32> const* GetTalentTreePrimarySpells(uint32 talentTree)
    {
        TalentTreePrimarySpellsMap::const_iterator itr = sTalentTreePrimarySpellsMap.find(talentTree);
        if (itr == sTalentTreePrimarySpellsMap.end())
            return NULL;
    
        return &itr->second;
    }
    
    uint32 GetLiquidFlags(uint32 liquidType)
    {
        if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
            return 1 << liq->Type;
    
        return 0;
    }
    
    uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId)
    {
        return PowersByClass[classId][powerType];
    }
    
    uint32 ScalingStatValuesEntry::GetStatMultiplier(uint32 inventoryType) const
    {
        if (inventoryType < MAX_INVTYPE)
        {
            switch (inventoryType)
            {
                case INVTYPE_NON_EQUIP:
                case INVTYPE_BODY:
                case INVTYPE_BAG:
                case INVTYPE_TABARD:
                case INVTYPE_AMMO:
                case INVTYPE_QUIVER:
                    return 0;
                case INVTYPE_HEAD:
                case INVTYPE_CHEST:
                case INVTYPE_LEGS:
                case INVTYPE_2HWEAPON:
                case INVTYPE_ROBE:
                    return StatMultiplier[0];
                case INVTYPE_SHOULDERS:
                case INVTYPE_WAIST:
                case INVTYPE_FEET:
                case INVTYPE_HANDS:
                case INVTYPE_TRINKET:
                    return StatMultiplier[1];
                case INVTYPE_NECK:
                case INVTYPE_WRISTS:
                case INVTYPE_FINGER:
                case INVTYPE_SHIELD:
                case INVTYPE_CLOAK:
                case INVTYPE_HOLDABLE:
                    return StatMultiplier[2];
                case INVTYPE_RANGED:
                case INVTYPE_THROWN:
                case INVTYPE_RANGEDRIGHT:
                case INVTYPE_RELIC:
                    return StatMultiplier[3];
                case INVTYPE_WEAPON:
                case INVTYPE_WEAPONMAINHAND:
                case INVTYPE_WEAPONOFFHAND:
                    return StatMultiplier[4];
                default:
                    break;
            }
        }
        return 0;
    }
    
    uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) const
    {
        if (inventoryType <= INVTYPE_ROBE && armorType < 4)
        {
            switch (inventoryType)
            {
                case INVTYPE_NON_EQUIP:
                case INVTYPE_NECK:
                case INVTYPE_BODY:
                case INVTYPE_FINGER:
                case INVTYPE_TRINKET:
                case INVTYPE_WEAPON:
                case INVTYPE_SHIELD:
                case INVTYPE_RANGED:
                case INVTYPE_2HWEAPON:
                case INVTYPE_BAG:
                case INVTYPE_TABARD:
                    break;
                case INVTYPE_SHOULDERS:
                    return Armor[0][armorType];
                case INVTYPE_CHEST:
                case INVTYPE_ROBE:
                    return Armor[1][armorType];
                case INVTYPE_HEAD:
                    return Armor[2][armorType];
                case INVTYPE_LEGS:
                    return Armor[3][armorType];
                case INVTYPE_FEET:
                    return Armor[4][armorType];
                case INVTYPE_WAIST:
                    return Armor[5][armorType];
                case INVTYPE_HANDS:
                    return Armor[6][armorType];
                case INVTYPE_WRISTS:
                    return Armor[7][armorType];
                case INVTYPE_CLOAK:
                    return CloakArmor;
                default:
                    break;
            }
        }
        return 0;
    }
    
    uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool isCasterWeapon, float* damageMultiplier) const
    {
        if (!isCasterWeapon)
        {
            switch (subClass)
            {
                case ITEM_SUBCLASS_WEAPON_AXE:
                case ITEM_SUBCLASS_WEAPON_MACE:
                case ITEM_SUBCLASS_WEAPON_SWORD:
                case ITEM_SUBCLASS_WEAPON_DAGGER:
                case ITEM_SUBCLASS_WEAPON_THROWN:
                    *damageMultiplier = 0.3f;
                    return dpsMod[0];
                case ITEM_SUBCLASS_WEAPON_AXE2:
                case ITEM_SUBCLASS_WEAPON_MACE2:
                case ITEM_SUBCLASS_WEAPON_POLEARM:
                case ITEM_SUBCLASS_WEAPON_SWORD2:
                case ITEM_SUBCLASS_WEAPON_STAFF:
                case ITEM_SUBCLASS_WEAPON_FISHING_POLE:
                    *damageMultiplier = 0.2f;
                    return dpsMod[1];
                case ITEM_SUBCLASS_WEAPON_BOW:
                case ITEM_SUBCLASS_WEAPON_GUN:
                case ITEM_SUBCLASS_WEAPON_CROSSBOW:
                    *damageMultiplier = 0.3f;
                    return dpsMod[4];
                case ITEM_SUBCLASS_WEAPON_Obsolete:
                case ITEM_SUBCLASS_WEAPON_EXOTIC:
                case ITEM_SUBCLASS_WEAPON_EXOTIC2:
                case ITEM_SUBCLASS_WEAPON_FIST_WEAPON:
                case ITEM_SUBCLASS_WEAPON_MISCELLANEOUS:
                case ITEM_SUBCLASS_WEAPON_SPEAR:
                case ITEM_SUBCLASS_WEAPON_WAND:
                    break;
            }
        }
        else
        {
            if (subClass <= ITEM_SUBCLASS_WEAPON_WAND)
            {
                uint32 mask = 1 << subClass;
                // two-handed weapons
                if (mask & 0x562)
                {
                    *damageMultiplier = 0.2f;
                    return dpsMod[3];
                }
    
                if (mask & (1 << ITEM_SUBCLASS_WEAPON_WAND))
                {
                    *damageMultiplier = 0.3f;
                    return dpsMod[5];
                }
            }
            *damageMultiplier = 0.3f;
            return dpsMod[2];
        }
        return 0;
    }


    Spoiler untuk DBCStores.h :

    Code:
    /*
     * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
     * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    #ifndef TRINITY_DBCSTORES_H
    #define TRINITY_DBCSTORES_H
    
    #include "Common.h"
    #include "DBCStore.h"
    #include "DBCStructure.h"
    
    #include <list>
    
    typedef std::list<uint32> SimpleFactionsList;
    SimpleFactionsList const* GetFactionTeamList(uint32 faction);
    
    char const* GetPetName(uint32 petfamily, uint32 dbclang);
    uint32 GetTalentSpellCost(uint32 spellId);
    TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
    
    int32 GetAreaFlagByAreaID(uint32 area_id);                  // -1 if not found
    AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
    AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id);
    uint32 GetAreaFlagByMapId(uint32 mapid);
    
    WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid);
    
    uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId);
    
    const std::string* GetRandomCharacterName(uint8 race, uint8 gender);
    
    enum ContentLevels
    {
        CONTENT_1_60    = 0,
        CONTENT_61_70   = 1,
        CONTENT_71_80   = 2,
        CONTENT_81_85   = 3,
        MAX_CONTENT
    };
    
    ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId);
    
    bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId);
    
    void Zone2MapCoordinates(float &x, float &y, uint32 zone);
    void Map2ZoneCoordinates(float &x, float &y, uint32 zone);
    
    typedef std::map<uint32/*pair32(map, diff)*/, MapDifficulty> MapDifficultyMap;
    MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
    MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
    
    uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls);
    std::vector<uint32> const* GetTalentTreePrimarySpells(uint32 talentTree);
    
    uint32 GetLiquidFlags(uint32 liquidType);
    
    PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
    PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
    
    uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId);
    
    extern DBCStorage <AchievementEntry>             sAchievementStore;
    extern DBCStorage <AchievementCriteriaEntry>     sAchievementCriteriaStore;
    extern DBCStorage <AreaTableEntry>               sAreaStore;// recommend access using functions
    extern DBCStorage <AreaGroupEntry>               sAreaGroupStore;
    extern DBCStorage <AreaPOIEntry>                 sAreaPOIStore;
    extern DBCStorage <AreaTriggerEntry>             sAreaTriggerStore;
    extern DBCStorage <ArmorLocationEntry>           sArmorLocationStore;
    extern DBCStorage <AuctionHouseEntry>            sAuctionHouseStore;
    extern DBCStorage <BankBagSlotPricesEntry>       sBankBagSlotPricesStore;
    extern DBCStorage <BarberShopStyleEntry>         sBarberShopStyleStore;
    extern DBCStorage <BattlemasterListEntry>        sBattlemasterListStore;
    extern DBCStorage <ChatChannelsEntry>            sChatChannelsStore;
    extern DBCStorage <CharStartOutfitEntry>         sCharStartOutfitStore;
    extern DBCStorage <CharTitlesEntry>              sCharTitlesStore;
    extern DBCStorage <ChrClassesEntry>              sChrClassesStore;
    extern DBCStorage <ChrRacesEntry>                sChrRacesStore;
    extern DBCStorage <ChrPowerTypesEntry>           sChrPowerTypesStore;
    extern DBCStorage <CinematicSequencesEntry>      sCinematicSequencesStore;
    extern DBCStorage <CreatureDisplayInfoEntry>     sCreatureDisplayInfoStore;
    extern DBCStorage <CreatureFamilyEntry>          sCreatureFamilyStore;
    extern DBCStorage <CreatureModelDataEntry>       sCreatureModelDataStore;
    extern DBCStorage <CreatureSpellDataEntry>       sCreatureSpellDataStore;
    extern DBCStorage <CreatureTypeEntry>            sCreatureTypeStore;
    extern DBCStorage <CurrencyTypesEntry>           sCurrencyTypesStore;
    extern DBCStorage <DestructibleModelDataEntry>   sDestructibleModelDataStore;
    extern DBCStorage <DungeonEncounterEntry>        sDungeonEncounterStore;
    extern DBCStorage <DurabilityCostsEntry>         sDurabilityCostsStore;
    extern DBCStorage <DurabilityQualityEntry>       sDurabilityQualityStore;
    extern DBCStorage <EmotesEntry>                  sEmotesStore;
    extern DBCStorage <EmotesTextEntry>              sEmotesTextStore;
    extern DBCStorage <FactionEntry>                 sFactionStore;
    extern DBCStorage <FactionTemplateEntry>         sFactionTemplateStore;
    extern DBCStorage <GameObjectDisplayInfoEntry>   sGameObjectDisplayInfoStore;
    extern DBCStorage <GemPropertiesEntry>           sGemPropertiesStore;
    extern DBCStorage <GlyphPropertiesEntry>         sGlyphPropertiesStore;
    extern DBCStorage <GlyphSlotEntry>               sGlyphSlotStore;
    
    extern DBCStorage <GtBarberShopCostBaseEntry>    sGtBarberShopCostBaseStore;
    extern DBCStorage <GtCombatRatingsEntry>         sGtCombatRatingsStore;
    extern DBCStorage <GtChanceToMeleeCritBaseEntry> sGtChanceToMeleeCritBaseStore;
    extern DBCStorage <GtChanceToMeleeCritEntry>     sGtChanceToMeleeCritStore;
    extern DBCStorage <GtChanceToSpellCritBaseEntry> sGtChanceToSpellCritBaseStore;
    extern DBCStorage <GtChanceToSpellCritEntry>     sGtChanceToSpellCritStore;
    extern DBCStorage <GtOCTClassCombatRatingScalarEntry> sGtOCTClassCombatRatingScalarStore;
    //extern DBCStorage <GtOCTRegenMPEntry>            sGtOCTRegenMPStore; -- not used currently
    extern DBCStorage <gtOCTHpPerStaminaEntry>       sGtOCTHpPerStaminaStore;
    extern DBCStorage <GtRegenMPPerSptEntry>         sGtRegenMPPerSptStore;
    extern DBCStorage <GtSpellScalingEntry>          sGtSpellScalingStore;
    extern DBCStorage <GtOCTBaseHPByClassEntry>      sGtOCTBaseHPByClassStore;
    extern DBCStorage <GtOCTBaseMPByClassEntry>      sGtOCTBaseMPByClassStore;
    extern DBCStorage <GuildPerkSpellsEntry>         sGuildPerkSpellsStore;
    extern DBCStorage <HolidaysEntry>                sHolidaysStore;
    extern DBCStorage <ImportPriceArmorEntry>        sImportPriceArmorStore;
    extern DBCStorage <ImportPriceQualityEntry>      sImportPriceQualityStore;
    extern DBCStorage <ImportPriceShieldEntry>       sImportPriceShieldStore;
    extern DBCStorage <ImportPriceWeaponEntry>       sImportPriceWeaponStore;
    extern DBCStorage <ItemPriceBaseEntry>           sItemPriceBaseStore;
    extern DBCStorage <ItemReforgeEntry>             sItemReforgeStore;
    extern DBCStorage <ItemArmorQualityEntry>        sItemArmorQualityStore;
    extern DBCStorage <ItemArmorShieldEntry>         sItemArmorShieldStore;
    extern DBCStorage <ItemArmorTotalEntry>          sItemArmorTotalStore;
    extern DBCStorage <ItemClassEntry>               sItemClassStore;
    extern DBCStorage <ItemBagFamilyEntry>           sItemBagFamilyStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageAmmoStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageOneHandStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageOneHandCasterStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageRangedStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageThrownStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageTwoHandStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageTwoHandCasterStore;
    extern DBCStorage <ItemDamageEntry>              sItemDamageWandStore;
    //extern DBCStorage <ItemDisplayInfoEntry>      sItemDisplayInfoStore; -- not used currently
    extern DBCStorage <ItemDisenchantLootEntry>      sItemDisenchantLootStore;
    extern DBCStorage <ItemLimitCategoryEntry>       sItemLimitCategoryStore;
    extern DBCStorage <ItemRandomPropertiesEntry>    sItemRandomPropertiesStore;
    extern DBCStorage <ItemRandomSuffixEntry>        sItemRandomSuffixStore;
    extern DBCStorage <ItemSetEntry>                 sItemSetStore;
    extern DBCStorage <LFGDungeonEntry>              sLFGDungeonStore;
    extern DBCStorage <LiquidTypeEntry>              sLiquidTypeStore;
    extern DBCStorage <LockEntry>                    sLockStore;
    extern DBCStorage <MailTemplateEntry>            sMailTemplateStore;
    extern DBCStorage <MapEntry>                     sMapStore;
    extern DBCStorage <MountCapabilityEntry>         sMountCapabilityStore;
    extern DBCStorage <MountTypeEntry>               sMountTypeStore;
    extern DBCStorage <NameGenEntry>                 sNameGenStore;
    extern DBCStorage <NumTalentsAtLevelEntry>       sNumTalentsAtLevelStore;
    extern DBCStorage <PhaseEntry>                   sPhaseStore;
    //extern DBCStorage <MapDifficultyEntry>           sMapDifficultyStore; -- use GetMapDifficultyData insteed
    extern MapDifficultyMap                          sMapDifficultyMap;
    extern DBCStorage <MovieEntry>                   sMovieStore;
    extern DBCStorage <OverrideSpellDataEntry>       sOverrideSpellDataStore;
    extern DBCStorage <QuestSortEntry>               sQuestSortStore;
    extern DBCStorage <QuestXPEntry>                 sQuestXPStore;
    extern DBCStorage <QuestFactionRewEntry>         sQuestFactionRewardStore;
    extern DBCStorage <QuestPOIPointEntry>           sQuestPOIPointStore;
    extern DBCStorage <QuestPOIBlobEntry>            sQuestPOIBlobStore;
    extern DBCStorage <RandomPropertiesPointsEntry>  sRandomPropertiesPointsStore;
    extern DBCStorage <ResearchBranchEntry>          sResearchBranchStore;
    extern DBCStorage <ResearchDigsiteEntry>         sResearchDigsiteStore;
    extern DBCStorage <ResearchProjectEntry>         sResearchProjectStore;
    extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore;
    extern DBCStorage <ScalingStatValuesEntry>       sScalingStatValuesStore;
    extern DBCStorage <SkillLineEntry>               sSkillLineStore;
    extern DBCStorage <SkillLineAbilityEntry>        sSkillLineAbilityStore;
    extern DBCStorage <SoundEntriesEntry>            sSoundEntriesStore;
    extern DBCStorage <SpellCastTimesEntry>          sSpellCastTimesStore;
    extern DBCStorage <SpellDifficultyEntry>         sSpellDifficultyStore;
    extern DBCStorage <SpellDurationEntry>           sSpellDurationStore;
    extern DBCStorage <SpellFocusObjectEntry>        sSpellFocusObjectStore;
    extern DBCStorage <SpellItemEnchantmentEntry>    sSpellItemEnchantmentStore;
    extern DBCStorage <SpellItemEnchantmentConditionEntry> sSpellItemEnchantmentConditionStore;
    extern SpellCategoryStore                        sSpellCategoryStore;
    extern PetFamilySpellsStore                      sPetFamilySpellsStore;
    extern DBCStorage <SpellRadiusEntry>             sSpellRadiusStore;
    extern DBCStorage <SpellRangeEntry>              sSpellRangeStore;
    extern DBCStorage <SpellRuneCostEntry>           sSpellRuneCostStore;
    extern DBCStorage <SpellShapeshiftEntry>         sSpellShapeshiftStore;
    extern DBCStorage <SpellShapeshiftFormEntry>     sSpellShapeshiftFormStore;
    extern DBCStorage <SpellEntry>                   sSpellStore;
    extern DBCStorage <SpellAuraOptionsEntry>        sSpellAuraOptionsStore;
    extern DBCStorage <SpellAuraRestrictionsEntry>   sSpellAuraRestrictionsStore;
    extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore;
    extern DBCStorage <SpellCategoriesEntry>         sSpellCategoriesStore;
    extern DBCStorage <SpellClassOptionsEntry>       sSpellClassOptionsStore;
    extern DBCStorage <SpellCooldownsEntry>          sSpellCooldownsStore;
    extern DBCStorage <SpellEffectEntry>             sSpellEffectStore;
    extern DBCStorage <SpellEquippedItemsEntry>      sSpellEquippedItemsStore;
    extern DBCStorage <SpellInterruptsEntry>         sSpellInterruptsStore;
    extern DBCStorage <SpellLevelsEntry>             sSpellLevelsStore;
    extern DBCStorage <SpellPowerEntry>              sSpellPowerStore;
    extern DBCStorage <SpellReagentsEntry>           sSpellReagentsStore;
    extern DBCStorage <SpellScalingEntry>            sSpellScalingStore;
    extern DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore;
    extern DBCStorage <SpellTotemsEntry>             sSpellTotemsStore;
    //extern DBCStorage <StableSlotPricesEntry>        sStableSlotPricesStore;
    extern DBCStorage <SummonPropertiesEntry>        sSummonPropertiesStore;
    extern DBCStorage <TalentEntry>                  sTalentStore;
    extern DBCStorage <TalentTabEntry>               sTalentTabStore;
    extern DBCStorage <TaxiNodesEntry>               sTaxiNodesStore;
    extern DBCStorage <TaxiPathEntry>                sTaxiPathStore;
    extern TaxiMask                                  sTaxiNodesMask;
    extern TaxiMask                                  sOldContinentsNodesMask;
    extern TaxiMask                                  sHordeTaxiNodesMask;
    extern TaxiMask                                  sAllianceTaxiNodesMask;
    extern TaxiMask                                  sDeathKnightTaxiNodesMask;
    extern TaxiPathSetBySource                       sTaxiPathSetBySource;
    extern TaxiPathNodesByPath                       sTaxiPathNodesByPath;
    extern DBCStorage <TotemCategoryEntry>           sTotemCategoryStore;
    extern DBCStorage <VehicleEntry>                 sVehicleStore;
    extern DBCStorage <VehicleSeatEntry>             sVehicleSeatStore;
    extern DBCStorage <WMOAreaTableEntry>            sWMOAreaTableStore;
    //extern DBCStorage <WorldMapAreaEntry>           sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
    extern DBCStorage <WorldMapOverlayEntry>         sWorldMapOverlayStore;
    extern DBCStorage <WorldSafeLocsEntry>           sWorldSafeLocsStore;
    
    void LoadDBCStores(const std::string& dataPath);
    
    #endif




    Spoiler untuk DBCfmt.h :

    Code:
    /*
     * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
     * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     * more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program. If not, see <http://www.gnu.org/licenses/>.
     */
    
    #ifndef TRINITY_DBCSFRM_H
    #define TRINITY_DBCSFRM_H
    
    // x - skip<uint32>, X - skip<uint8>, s - char*, f - float, i - uint32, b - uint8, d - index (not included)
    // n - index (included), l - bool, p - field present in sql dbc, a - field absent in sql dbc
    
    const char Achievementfmt[]="niixsxiixixxii";
    //const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp";
    //const std::string CustomAchievementIndex = "ID";
    const char AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii";
    const char AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx";
    const char AreaGroupEntryfmt[]="niiiiiii";
    const char AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx";
    const char AreaTriggerEntryfmt[]="nifffxxxfffff";
    const char ArmorLocationfmt[]="nfffff";
    const char AuctionHouseEntryfmt[]="niiix";
    const char BankBagSlotPricesEntryfmt[]="ni";
    const char BarberShopStyleEntryfmt[]="nixxxiii";
    const char BattlemasterListEntryfmt[]="niiiiiiiiixsiiiixxxx";
    const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    const char CharTitlesEntryfmt[]="nxsxix";
    const char ChatChannelsEntryfmt[]="nixsx";
    
    const char ChrClassesEntryfmt[]="nixsxxxixiiiii";
    const char ChrRacesEntryfmt[]="nxixiixixxxxixsxxxxxixxx";
    const char ChrClassesXPowerTypesfmt[]="nii";
    
    const char CinematicSequencesEntryfmt[]="nxxxxxxxxx";
    const char CreatureDisplayInfofmt[]="nixxfxxxxxxxxxxxx";
    const char CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx";
    const char CreatureFamilyfmt[]="nfifiiiiixsx";
    const char CreatureSpellDatafmt[]="niiiixxxx";
    const char CreatureTypefmt[]="nxx";
    const char CurrencyTypesfmt[]="nxxxxxiiiix";
    
    const char DestructibleModelDatafmt[]="ixxixxxixxxixxxixxxxxxxx";
    const char DungeonEncounterfmt[]="iiixisxx";
    const char DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
    const char DurabilityQualityfmt[]="nf";
    const char EmotesEntryfmt[]="nxxiiixx";
    const char EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx";
    const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixsxx";
    const char FactionTemplateEntryfmt[]="niiiiiiiiiiiii";
    const char GameObjectDisplayInfofmt[]="nsxxxxxxxxxxffffffxxx";
    
    const char GemPropertiesEntryfmt[]="nixxix";
    const char GlyphPropertiesfmt[]="niii";
    const char GlyphSlotfmt[]="nii";
    
    const char GtBarberShopCostBasefmt[]="xf";
    const char GtCombatRatingsfmt[]="xf";
    const char GtOCTHpPerStaminafmt[]="df";
    const char GtChanceToMeleeCritBasefmt[]="xf";
    const char GtChanceToMeleeCritfmt[]="xf";
    const char GtChanceToSpellCritBasefmt[]="xf";
    const char GtChanceToSpellCritfmt[]="xf";
    const char GtOCTClassCombatRatingScalarfmt[]="df";
    const char GtOCTRegenHPfmt[]="f";
    //const char GtOCTRegenMPfmt[]="f";
    const char GtRegenMPPerSptfmt[]="xf";
    const char GtSpellScalingfmt[]="df";
    const char GtOCTBaseHPByClassfmt[]="df";
    const char GtOCTBaseMPByClassfmt[]="df";
    const char GuildPerkSpellsfmt[]="dii";
    const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix";
    const char ImportPriceArmorfmt[]="nffff";
    const char ImportPriceQualityfmt[]="nf";
    const char ImportPriceShieldfmt[]="nf";
    const char ImportPriceWeaponfmt[]="nf";
    const char ItemPriceBasefmt[]="diff";
    const char ItemReforgefmt[]="nifif";
    const char ItemBagFamilyfmt[]="nx";
    const char ItemArmorQualityfmt[]="nfffffffi";
    const char ItemArmorShieldfmt[]="nifffffff";
    const char ItemArmorTotalfmt[]="niffff";
    const char ItemClassfmt[]="dixxfx";
    const char ItemDamagefmt[]="nfffffffi";
    const char ItemDisenchantLootfmt[]="niiiiii";
    //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
    const char ItemLimitCategoryEntryfmt[]="nxii";
    const char ItemRandomPropertiesfmt[]="nxiiixxs";
    const char ItemRandomSuffixfmt[]="nsxiiiiiiiiii";
    const char ItemSetEntryfmt[]="dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii";
    const char LFGDungeonEntryfmt[]="nxiiiiiiixixxixixxxxx";
    const char LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";
    const char PhaseEntryfmt[]="nsi";
    const char MailTemplateEntryfmt[]="nxs";
    const char MapEntryfmt[]="nxixxxsixxixiffxiixi";
    const char MapDifficultyEntryfmt[]="diisiix";
    const char MovieEntryfmt[]="nxxx";
    const char MountCapabilityfmt[]="niiiiiii";
    const char MountTypefmt[]="niiiiiiiiiiiiiiiiiiiiiiii";
    const char NameGenfmt[] = "dsii";
    const char NumTalentsAtLevelfmt[]="df";
    const char OverrideSpellDatafmt[]="niiiiiiiiiixx";
    const char QuestSortEntryfmt[]="nx";
    const char QuestXPfmt[]="niiiiiiiiii";
    const char QuestFactionRewardfmt[]="niiiiiiiiii";
    const char QuestPOIBlobfmt[]="niii";
    const char QuestPOIPointfmt[]="niii";
    const char PvPDifficultyfmt[]="diiiii";
    const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
    const char ResearchBranchfmt[] ="nsxixi";
    const char ResearchDigsitefmt[]="niisx";
    const char ResearchProjectfmt[]="nsxxiiixi";
    const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi";
    const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
    const char SkillLinefmt[]="nisxixi";
    const char SkillLineAbilityfmt[]="niiiixxiiiiixx";
    const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    const char SpellCastTimefmt[]="nixx";
    const char SpellCategoriesEntryfmt[]="diiiiii";
    const char SpellDifficultyfmt[]="niiii";
    const std::string CustomSpellDifficultyfmt="ppppp";
    const std::string CustomSpellDifficultyIndex="id";
    const char SpellDurationfmt[]="niii";
    const char SpellEffectEntryfmt[]="nifiiiffiiiiiifiifiiiiiiiix";
    const char SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxixiiiiiiixiiiiiiiix";
    const std::string CustomSpellEntryfmt="papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa";
    const std::string CustomSpellEntryIndex = "Id";
    const char SpellFocusObjectfmt[]="nx";
    const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiisiiiiiiix";
    const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
    const char SpellRadiusfmt[]="nfxf";
    const char SpellRangefmt[]="nffffixx";
    const char SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiii";
    const char SpellScalingEntryfmt[]="diiiiffffffffffi";
    const char SpellTotemsEntryfmt[]="niiii";
    const char SpellTargetRestrictionsEntryfmt[]="nxiiii";
    const char SpellPowerEntryfmt[]="diiiixxx";
    const char SpellInterruptsEntryfmt[]="dixixi";
    const char SpellEquippedItemsEntryfmt[]="diii";
    const char SpellAuraOptionsEntryfmt[]="niiii";
    const char SpellAuraRestrictionsEntryfmt[]="diiiiiiii";
    const char SpellCastingRequirementsEntryfmt[]="dixxixi";
    const char SpellClassOptionsEntryfmt[]="dxiiiix";
    const char SpellCooldownsEntryfmt[]="diii";
    const char SpellLevelsEntryfmt[]="diii";
    const char SpellRuneCostfmt[]="niiii";
    const char SpellShapeshiftEntryfmt[]="nixixx";
    const char SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx";
    const char StableSlotPricesfmt[] = "ni";
    const char SummonPropertiesfmt[] = "niiiii";
    const char TalentEntryfmt[]="niiiiiiiiixxixxxxxx";
    const char TalentTabEntryfmt[]="nxxiiixxxxx";
    const char TalentTreePrimarySpellsfmt[]="diix";
    const char TaxiNodesEntryfmt[]="nifffsiixxx";
    const char TaxiPathEntryfmt[]="niii";
    const char TaxiPathNodeEntryfmt[]="diiifffiiii";
    const char TeamContributionPointsfmt[]="df";
    const char TotemCategoryEntryfmt[]="nxii";
    const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx";
    const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx";
    const char WMOAreaTableEntryfmt[]="niiixxxxxiixxxx";
    const char WorldMapAreaEntryfmt[]="xinxffffixxxxx";
    const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxx";
    const char WorldSafeLocsEntryfmt[]="nifffx";
    
    #endif


    These Code goes to src/server/game/Entities/Player






    Status : i don't even sure if this is a fix or not, yah namanya juga usaha , maafkan kalau saya salah total dan sok tahu heheheh
    Quote Originally Posted by Aluna Sagita
    Having Crush On Me Isn't Categorized As Pedophilia
    Spoiler untuk Warcraft Books :

  2. Hot Ad
  3. #47

    Join Date
    Feb 2012
    Posts
    86
    Points
    146.21
    Thanks: 3 / 7 / 4

    Default [c++] soul swap

    Description : gw gk tau script ny di ampm gmn.. jd ane coba posting aj script soul swap yg gw lupa dpt darimana (yg ane modif dikit).. klo jalan syukur, klo gk jalan tar gw nyoba pake wl liat error ny dmn trus nyoba fix script ny..

    Reference : dont know

    Code :
    Spoiler untuk soul swap :
    Code:
    case 86121:
    {
         m_caster->CastSpell(m_caster,86211,true)
         std::list<AuraEffect const*> dotsList = unitTarget->GetAuraDoTsByCaster(m_caster->GetGUID());
         std::list<uint32> lst;
         if(!dotsList.empty())
         {
              for(std::list<AuraEffect const*>::iterator itr = dotsList.begin(); itr != dotsList.end(); ++itr)
              {
                   lst.push_back((*itr)->GetId());
                   if(!m_caster->HasAura(56226)) //Glyph of Soul Swap
                        unitTarget->RemoveAurasDueToSpell((*itr)->GetId());
              }
          }
    
          m_caster->StoreSoulSwapDoTs(lst);
          break;
    }
    Spoiler untuk Soul Swap: Exhale :
    Code:
    case 86213:
    {
          std::list<uint32> dotsList = m_caster->GetSoulSwapDots();
          if(!dotsList.empty() && dotsList.size() >= 1)
          {
               if(m_caster->HasAura(56226)) //Glyph of Soul Swap
                    m_caster->CastSpell(m_caster,94229,true); //The cooldown marker
    
               for(std::list<uint32>::iterator itr = dotsList.begin(); itr != dotsList.end(); ++itr)
               {
                    if(!(*itr))
                         break;
                    m_caster->CastSpell(unitTarget,(*itr),true);
               }
          }
          else
               sLog->outError("Player (GUID %u) tried to release Soul Swap stored dots without having any previously stored dot",m_caster->GetGUIDLow());
                            
          m_caster->RemoveAurasDueToSpell(86211);
          break;
    }


    Status : gk tau work ato gk.. klo gk, setidakny gw bisa tau error ny ada dmn.. bisa tau mau fix yg mana nnti
    Last edited by bloodyx; 02-06-13 at 13:16.

  4. #48
    heaven1st's Avatar
    Join Date
    Aug 2007
    Location
    Bandung
    Posts
    635
    Points
    795.13
    Thanks: 31 / 139 / 54

    Default

    moved to Dropbox.
    Last edited by heaven1st; 25-06-13 at 00:50.
    If mood>0 Then open=notepad+,sqlyog,chrome,dbceditor Else sleep EndIf

  5. #49
    Mindbender's Avatar
    Join Date
    Oct 2012
    Posts
    190
    Points
    479.27
    Thanks: 13 / 97 / 31

    Default

    Silakan ramaikan thread ini lagi bagi siapapun juga yang berkemampuan dan concern terhadap server ini

    kami membutuhkan masukan dari berbagai pihak demi server yang lebih baik

    Mari jadikan thread ini sebagai mini Trinity kita bersama

    Cheating and Fair Play? Actions speak louder than words.

  6. #50

    Join Date
    Feb 2010
    Posts
    20
    Points
    11.45
    Thanks: 8 / 0 / 0

    Default [Core/Spell] Judgement Paladin Fix

    Description : gw blom ngerti masalah codding di game cuman ane nyari2 dapet ini mungkin bisa di implementasikan di AMPM
    klo gak jalan maaf karena ane nubie dalam masalah codding ...

    Reference : http://wowsource.info/index.php?/top...t-paladin-fix/


    Code :
    Spoiler untuk :
    DELETE FROM `spell_script_names` WHERE `spell_id`=20271;
    INSERT INTO `spell_script_names` VALUES
    (20271,'spell_pal_judgement');


    gak tau di sambung gak tau gak
    mohon maklum bukan codding master...

    Spoiler untuk :
    @@ -52,7 +52,11 @@ enum PaladinSpells
    SPELL_PALADIN_HAND_OF_SACRIFICE = 6940,
    SPELL_PALADIN_DIVINE_SACRIFICE = 64205,

    - SPELL_PALADIN_DIVINE_PURPOSE_PROC = 90174
    + SPELL_PALADIN_DIVINE_PURPOSE_PROC = 90174,
    +
    + SPELL_PALADIN_SEAL_OF_JUSTICE = 20164,
    + SPELL_PALADIN_SEAL_OF_INSIGHT = 20165,
    + SPELL_PALADIN_JUDGEMENT_DAMAGE = 54158
    };

    // 31850 - Ardent Defender


    @@ -789,6 +793,81 @@ class spell_pal_templar_s_verdict : public SpellScriptLoader
    }
    };

    +// 20271 - Judgement
    +/// Updated 4.3.4
    +class spell_pal_judgement : public SpellScriptLoader
    +{
    + public:
    + spell_pal_judgement() : SpellScriptLoader("spell_pal_judgement") { }
    +
    + class spell_pal_judgement_SpellScript : public SpellScript
    + {
    + PrepareSpellScript(spell_pal_judgement_SpellScript );
    +
    + bool Validate(SpellInfo const* /*spellEntry*/)
    + {
    + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PURPOSE_PROC) )
    + return false;
    +
    + return true;
    + }
    +
    + void SwitchSpell()
    + {
    + if(Unit* target = GetExplTargetUnit())
    + {
    + Unit* caster = GetCaster();
    + uint32 spellId = 0;
    +
    + // Seal of Truth and Seal of Righteousness have a dummy aura on effect 2
    + Unit::AuraApplicationMap & sealAuras = caster->GetAppliedAuras();
    + for (Unit::AuraApplicationMap::iterator iter = sealAuras.begin(); iter != sealAuras.end()<img src='http://wow.amgi-it.ro/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt='' />
    + {
    + Aura* aura = iter->second->GetBase();
    + if (aura->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL)
    + {
    + if (AuraEffect* aureff = aura->GetEffect(2))
    + {
    + if (aureff->GetAuraType() == SPELL_AURA_DUMMY)
    + {
    + if (sSpellMgr->GetSpellInfo(aureff->GetAmount()))
    + spellId = aureff->GetAmount();
    + break;
    + }
    + }
    + if (!spellId)
    + {
    + switch (iter->first)
    + {
    + // Seal of Insight, Seal of Justice
    + case SPELL_PALADIN_SEAL_OF_JUSTICE:
    + case SPELL_PALADIN_SEAL_OF_INSIGHT:
    + spellId = SPELL_PALADIN_JUDGEMENT_DAMAGE;
    + }
    + }
    + break;
    + }
    + else
    + ++iter;
    + }
    + // Cast Judgement
    + if (spellId)
    + caster->CastSpell(target, spellId, true);
    + }
    + }
    +
    + void Register()
    + {
    + OnCast += SpellCastFn(spell_pal_judgement_SpellScript::Switc hSpell);
    + }
    + };
    +
    + SpellScript* GetSpellScript() const
    + {
    + return new spell_pal_judgement_SpellScript();
    + }
    +};
    +
    void AddSC_paladin_spell_scripts()
    {
    //new spell_pal_ardent_defender();
    @@ -804,4 +883,5 @@ void AddSC_paladin_spell_scripts()
    new spell_pal_righteous_defense();
    new spell_pal_sacred_shield();
    new spell_pal_templar_s_verdict();
    + new spell_pal_judgement();
    }


    Spoiler untuk :
    + // Seal of Insight, Seal of Justice
    + case SPELL_PALADIN_SEAL_OF_JUSTICE:
    + case SPELL_PALADIN_SEAL_OF_INSIGHT:
    + spellId = SPELL_PALADIN_JUDGEMENT_DAMAGE;
    + }
    + }
    + break;
    + }
    + else
    + ++iter; ---------> not the correct code
    + }


    Spoiler untuk :
    + // Seal of Insight, Seal of Justice
    + case SPELL_PALADIN_SEAL_OF_JUSTICE:
    + case SPELL_PALADIN_SEAL_OF_INSIGHT:
    + spellId = SPELL_PALADIN_JUDGEMENT_DAMAGE;
    + }
    + }
    + break;
    + }
    + else
    + iter++;
    + }


    ini cuman copas dari web di atas ...
    Last edited by aladin_tank; 04-07-13 at 17:21.

  7. #51
    AdyaMaulana's Avatar
    Join Date
    Mar 2012
    Location
    Yogyakarta
    Posts
    141
    Points
    74.51
    Thanks: 7 / 8 / 5

    Default Stat System (Attack Power)

    Maaf sebelumnya karena saya tidak terlalu bisa coding. Tetapi saya menemukan ini di web. Mengingat damage druid dan hunter yang masih unyu unyu. Mungkin script formula ini bisa diterapkan di AMPM.

    Patch untuk src/server/game/Entities/Unit/StatSystem.cpp

    Referensi


    StatSystem.cpp nya ada yang harus tambahin dikit karena agak tidak sesuai dengan http://www.wowpedia.org/Attack_power .

    Spoiler untuk statsystem.cpp :

    https://github.com/TrinityCore/Trini...StatSystem.cpp

    Line 324

    case FORM_CAT:
    val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 40.0f;

    dan 328

    case FORM_DIREBEAR:
    val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 40.0f;

    Seharusnya formulanya [(Level x 3) + (Strength x 2 - 20) + (Agility x 2 - 20)] x 125% (Cat dan Bear sama)
    Karena sudah saya hitung menggunakan stat agi dan str saya sekarang jika tidak memakai x 125%, attack power akan masih sangat kecil. Bahkan tidak lebih besar dari AP saya sewaktu WotLK dulu.

    kurang lebih mungkin seperti ini:
    val2 = level * 3.0f * 125.0f / 100.0f + GetStat(STAT_STRENGTH) * 2.0f * 125.0f / 100.0f + GetStat(STAT_AGILITY) * 2.0f * 125.0f / 100.0f - 40.0f * 125.0f / 100.0f;



    Sekian dan terima kasih
    Last edited by AdyaMaulana; 19-07-13 at 11:06.

  8. #52

    Join Date
    Nov 2008
    Posts
    24
    Points
    28.66
    Thanks: 0 / 0 / 0

    Default

    buat yg diatas,

    sorry tadi iseng2 liat, tapi itu yg dijadiin referensi bener code buat 4.3.4 ? soalnya itu beda sama code yg ada di branch 4.3.4 yg dipake buat server cataclysm. setelah saya liat2 itu codenya malah mirip sama yg di branch master, yang sekarang dipake buat 3.3.5a

    CMIIW

  9. #53
    AdyaMaulana's Avatar
    Join Date
    Mar 2012
    Location
    Yogyakarta
    Posts
    141
    Points
    74.51
    Thanks: 7 / 8 / 5

    Default

    Quote Originally Posted by Nezu View Post
    buat yg diatas,

    sorry tadi iseng2 liat, tapi itu yg dijadiin referensi bener code buat 4.3.4 ? soalnya itu beda sama code yg ada di branch 4.3.4 yg dipake buat server cataclysm. setelah saya liat2 itu codenya malah mirip sama yg di branch master, yang sekarang dipake buat 3.3.5a

    CMIIW
    Wah, itu mungkin WotLKnya yang ngikutin formula Cata Gan. Tapi entahlah. Biarlah GM kita yang menentukan layak diimplementasikan atau tidak. Saya hanya membantu mencari referensi.

  10. #54

    Join Date
    Feb 2012
    Posts
    86
    Points
    146.21
    Thanks: 3 / 7 / 4

    Default

    --- SOUL SWAP ---

    di database
    Spoiler untuk database :
    Code:
    DELETE FROM spell_script_names WHERE spell_id IN (86121, 86211, 92795, 86213);
    INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
    (86121, "spell_warlock_soul_swap"),
    (86211, "spell_warlock_soul_swap_override"),
    (92795, "spell_warlock_soul_swap_dot_marker"),
    (86213, "spell_warlock_soul_swap_exhale");


    kemudian di spell_warlock.cpp
    Spoiler untuk spell_warlock.cpp :
    di bagian enum WarlockSpells tambahin
    Spoiler untuk enumWarlockSpells :
    Code:
    SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP                = 56226,
    SPELL_WARLOCK_SOUL_SWAP_CD_MARKER               = 94229,
    SPELL_WARLOCK_SOUL_SWAP_OVERRIDE                = 86211,
    SPELL_WARLOCK_SOUL_SWAP_MOD_COST                = 92794,
    SPELL_WARLOCK_SOUL_SWAP_DOT_MARKER              = 92795


    terus tambahin ini
    Code:
    // 86121 - Soul Swap
    class spell_warl_soul_swap : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap() : SpellScriptLoader("spell_warl_soul_swap") { }
    
        class spell_warl_soul_swap_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_warl_soul_swap_SpellScript);
    
            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
            {
                if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP)
                    || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_CD_MARKER)
                    || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    return false;
                return true;
            }
    
            void HandleHit(SpellEffIndex /*effIndex*/)
            {
                GetCaster()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_OVERRIDE, true);
                GetHitUnit()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_DOT_MARKER, true);
            }
    
            void Register() OVERRIDE
            {
                OnEffectHitTarget += SpellEffectFn(spell_warl_soul_swap_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
            }
        };
    
        SpellScript* GetSpellScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_SpellScript();
        }
    };
    
    // 86211 - Soul Swap Override
    class spell_warl_soul_swap_override : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap_override() : SpellScriptLoader("spell_warl_soul_swap_override") { }
    
        class spell_warl_soul_swap_override_AuraScript : public AuraScript
        {
            PrepareAuraScript(spell_warl_soul_swap_override_AuraScript);
    
            bool Load() OVERRIDE
            {
                swapCaster = NULL;
                return true;
            }
    
            //! Forced to, pure virtual functions must have a body when linking
            void Register() OVERRIDE { }
    
        public:
            void AddDot(uint32 id)                          { dotList.push_back(id); }
            std::list<uint32> const GetDotList() const      { return dotList; }
            Unit* GetOriginalSwapSource() const             { return swapCaster; }
            void SetOriginalSwapSource(Unit* victim)        { swapCaster = victim; }
    
        private:
            std::list<uint32> dotList;
            Unit* swapCaster;
        };
    
        AuraScript* GetAuraScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_override_AuraScript();
        }
    };
    
    typedef spell_warl_soul_swap_override::spell_warl_soul_swap_override_AuraScript SoulSwapOverrideAuraScript;
    
    //Soul Swap Copy Spells - 92795
    class spell_warl_soul_swap_dot_marker : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap_dot_marker() : SpellScriptLoader("spell_warl_soul_swap_dot_marker") { }
    
        class spell_warl_soul_swap_dot_marker_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_warl_soul_swap_dot_marker_SpellScript);
    
            void HandleHit(SpellEffIndex effIndex)
            {
                Unit* swapVictim = GetCaster();
                Unit* warlock    = GetHitUnit();
                if (!warlock || !swapVictim)
                    return;
    
                flag96 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask;
    
                Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras();
                SoulSwapOverrideAuraScript* swapSpellScript = NULL;
                if (Aura* swapOverrideAura = warlock->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    swapSpellScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverrideAura->GetScriptByName("spell_warlock_soul_swap_override"));
    
                if (swapSpellScript == NULL)
                    return;
    
                for (Unit::AuraApplicationMap::const_iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
                {
                    SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
                    if (itr->second->GetBase()->GetCaster() == warlock)
                        if (spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && (spellProto->SpellFamilyFlags & classMask))
                            swapSpellScript->AddDot(itr->first);
                }
    
                swapSpellScript->SetOriginalSwapSource(swapVictim);
            }
    
            void Register() OVERRIDE
            {
                OnEffectHitTarget += SpellEffectFn(spell_warl_soul_swap_dot_marker_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
            }
        };
    
        SpellScript* GetSpellScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_dot_marker_SpellScript();
        }
    };
    
    // 86213 - Soul Swap Exhale
    class spell_warl_soul_swap_exhale : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap_exhale() : SpellScriptLoader("spell_warl_soul_swap_exhale") { }
    
        class spell_warl_soul_swap_exhale_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_warl_soul_swap_exhale_SpellScript);
    
            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
            {
                if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_MOD_COST) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    return false;
                return true;
            }
    
            SpellCastResult CheckCast()
            {
                Unit* currentTarget = GetExplTargetUnit();
                Unit* swapTarget = NULL;
                if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    if (SoulSwapOverrideAuraScript* swapScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverride->GetScriptByName("spell_warlock_soul_swap_override")))
                        swapTarget = swapScript->GetOriginalSwapSource();
    
                // Soul Swap Exhale can't be cast on the same target than Soul Swap
                if (swapTarget && currentTarget && swapTarget == currentTarget)
                    return SPELL_FAILED_BAD_TARGETS;
    
                return SPELL_CAST_OK;
            }
    
            void OnEffectHit(SpellEffIndex /*effIndex*/)
            {
                GetCaster()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_MOD_COST, true);
                bool hasGlyph = GetCaster()->HasAura(SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP);
    
                std::list<uint32> dotList;
                Unit* swapSource = NULL;
                if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                {
                    SoulSwapOverrideAuraScript* swapScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverride->GetScriptByName("spell_warlock_soul_swap_override"));
                    if (!swapScript)
                        return;
                    dotList = swapScript->GetDotList();
                    swapSource = swapScript->GetOriginalSwapSource();
                }
    
                if (dotList.empty())
                    return;
    
                for (std::list<uint32>::const_iterator itr = dotList.begin(); itr != dotList.end(); ++itr)
                {
                    GetCaster()->AddAura(*itr, GetHitUnit());
                    if (!hasGlyph && swapSource)
                        swapSource->RemoveAurasDueToSpell(*itr);
                }
    
                // Remove Soul Swap Exhale buff
                GetCaster()->RemoveAurasDueToSpell(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE);
    
                if (hasGlyph) // Add a cooldown on Soul Swap if caster has the glyph
                    GetCaster()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_CD_MARKER, false);
            }
    
            void Register() OVERRIDE
            {
                OnCheckCast += SpellCheckCastFn(spell_warl_soul_swap_exhale_SpellScript::CheckCast);
                OnEffectHitTarget += SpellEffectFn(spell_warl_soul_swap_exhale_SpellScript::OnEffectHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
            }
        };
    
        SpellScript* GetSpellScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_exhale_SpellScript();
        }
    };

    terus di bagian AddSC_warlock_spell_scripts tambahin
    Spoiler untuk AddSC_warlock_spell_scripts :
    Code:
    new spell_warl_soul_swap();
    new spell_warl_soul_swap_dot_marker();
    new spell_warl_soul_swap_exhale();
    new spell_warl_soul_swap_override();

  11. #55
    secreal's Avatar
    Join Date
    Oct 2006
    Location
    bogor
    Posts
    1,533
    Points
    36,503.74
    Thanks: 322 / 346 / 156

    Default

    ada yg bisa ngerangkum ga, yg mana yg kira2 uda apply dan yg blom apply...
    saya baru buat virtual test server, jd baru mau coba2

  12. #56
    beesinv's Avatar
    Join Date
    Jan 2007
    Location
    Somewhere
    Posts
    713
    Points
    373.48
    Thanks: 25 / 14 / 11

    Default

    Quote Originally Posted by bloodyx View Post
    --- SOUL SWAP ---

    di database
    Spoiler untuk database :
    Code:
    DELETE FROM spell_script_names WHERE spell_id IN (86121, 86211, 92795, 86213);
    INSERT INTO spell_script_names (spell_id, ScriptName) VALUES
    (86121, "spell_warlock_soul_swap"),
    (86211, "spell_warlock_soul_swap_override"),
    (92795, "spell_warlock_soul_swap_dot_marker"),
    (86213, "spell_warlock_soul_swap_exhale");


    kemudian di spell_warlock.cpp
    Spoiler untuk spell_warlock.cpp :
    di bagian enum WarlockSpells tambahin
    Spoiler untuk enumWarlockSpells :
    Code:
    SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP                = 56226,
    SPELL_WARLOCK_SOUL_SWAP_CD_MARKER               = 94229,
    SPELL_WARLOCK_SOUL_SWAP_OVERRIDE                = 86211,
    SPELL_WARLOCK_SOUL_SWAP_MOD_COST                = 92794,
    SPELL_WARLOCK_SOUL_SWAP_DOT_MARKER              = 92795


    terus tambahin ini
    Code:
    // 86121 - Soul Swap
    class spell_warl_soul_swap : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap() : SpellScriptLoader("spell_warl_soul_swap") { }
    
        class spell_warl_soul_swap_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_warl_soul_swap_SpellScript);
    
            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
            {
                if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP)
                    || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_CD_MARKER)
                    || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    return false;
                return true;
            }
    
            void HandleHit(SpellEffIndex /*effIndex*/)
            {
                GetCaster()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_OVERRIDE, true);
                GetHitUnit()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_DOT_MARKER, true);
            }
    
            void Register() OVERRIDE
            {
                OnEffectHitTarget += SpellEffectFn(spell_warl_soul_swap_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
            }
        };
    
        SpellScript* GetSpellScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_SpellScript();
        }
    };
    
    // 86211 - Soul Swap Override
    class spell_warl_soul_swap_override : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap_override() : SpellScriptLoader("spell_warl_soul_swap_override") { }
    
        class spell_warl_soul_swap_override_AuraScript : public AuraScript
        {
            PrepareAuraScript(spell_warl_soul_swap_override_AuraScript);
    
            bool Load() OVERRIDE
            {
                swapCaster = NULL;
                return true;
            }
    
            //! Forced to, pure virtual functions must have a body when linking
            void Register() OVERRIDE { }
    
        public:
            void AddDot(uint32 id)                          { dotList.push_back(id); }
            std::list<uint32> const GetDotList() const      { return dotList; }
            Unit* GetOriginalSwapSource() const             { return swapCaster; }
            void SetOriginalSwapSource(Unit* victim)        { swapCaster = victim; }
    
        private:
            std::list<uint32> dotList;
            Unit* swapCaster;
        };
    
        AuraScript* GetAuraScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_override_AuraScript();
        }
    };
    
    typedef spell_warl_soul_swap_override::spell_warl_soul_swap_override_AuraScript SoulSwapOverrideAuraScript;
    
    //Soul Swap Copy Spells - 92795
    class spell_warl_soul_swap_dot_marker : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap_dot_marker() : SpellScriptLoader("spell_warl_soul_swap_dot_marker") { }
    
        class spell_warl_soul_swap_dot_marker_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_warl_soul_swap_dot_marker_SpellScript);
    
            void HandleHit(SpellEffIndex effIndex)
            {
                Unit* swapVictim = GetCaster();
                Unit* warlock    = GetHitUnit();
                if (!warlock || !swapVictim)
                    return;
    
                flag96 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask;
    
                Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras();
                SoulSwapOverrideAuraScript* swapSpellScript = NULL;
                if (Aura* swapOverrideAura = warlock->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    swapSpellScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverrideAura->GetScriptByName("spell_warlock_soul_swap_override"));
    
                if (swapSpellScript == NULL)
                    return;
    
                for (Unit::AuraApplicationMap::const_iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
                {
                    SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
                    if (itr->second->GetBase()->GetCaster() == warlock)
                        if (spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && (spellProto->SpellFamilyFlags & classMask))
                            swapSpellScript->AddDot(itr->first);
                }
    
                swapSpellScript->SetOriginalSwapSource(swapVictim);
            }
    
            void Register() OVERRIDE
            {
                OnEffectHitTarget += SpellEffectFn(spell_warl_soul_swap_dot_marker_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
            }
        };
    
        SpellScript* GetSpellScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_dot_marker_SpellScript();
        }
    };
    
    // 86213 - Soul Swap Exhale
    class spell_warl_soul_swap_exhale : public SpellScriptLoader
    {
    public:
        spell_warl_soul_swap_exhale() : SpellScriptLoader("spell_warl_soul_swap_exhale") { }
    
        class spell_warl_soul_swap_exhale_SpellScript : public SpellScript
        {
            PrepareSpellScript(spell_warl_soul_swap_exhale_SpellScript);
    
            bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
            {
                if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_MOD_COST) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    return false;
                return true;
            }
    
            SpellCastResult CheckCast()
            {
                Unit* currentTarget = GetExplTargetUnit();
                Unit* swapTarget = NULL;
                if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                    if (SoulSwapOverrideAuraScript* swapScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverride->GetScriptByName("spell_warlock_soul_swap_override")))
                        swapTarget = swapScript->GetOriginalSwapSource();
    
                // Soul Swap Exhale can't be cast on the same target than Soul Swap
                if (swapTarget && currentTarget && swapTarget == currentTarget)
                    return SPELL_FAILED_BAD_TARGETS;
    
                return SPELL_CAST_OK;
            }
    
            void OnEffectHit(SpellEffIndex /*effIndex*/)
            {
                GetCaster()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_MOD_COST, true);
                bool hasGlyph = GetCaster()->HasAura(SPELL_WARLOCK_GLYPH_OF_SOUL_SWAP);
    
                std::list<uint32> dotList;
                Unit* swapSource = NULL;
                if (Aura const* swapOverride = GetCaster()->GetAura(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE))
                {
                    SoulSwapOverrideAuraScript* swapScript = dynamic_cast<SoulSwapOverrideAuraScript*>(swapOverride->GetScriptByName("spell_warlock_soul_swap_override"));
                    if (!swapScript)
                        return;
                    dotList = swapScript->GetDotList();
                    swapSource = swapScript->GetOriginalSwapSource();
                }
    
                if (dotList.empty())
                    return;
    
                for (std::list<uint32>::const_iterator itr = dotList.begin(); itr != dotList.end(); ++itr)
                {
                    GetCaster()->AddAura(*itr, GetHitUnit());
                    if (!hasGlyph && swapSource)
                        swapSource->RemoveAurasDueToSpell(*itr);
                }
    
                // Remove Soul Swap Exhale buff
                GetCaster()->RemoveAurasDueToSpell(SPELL_WARLOCK_SOUL_SWAP_OVERRIDE);
    
                if (hasGlyph) // Add a cooldown on Soul Swap if caster has the glyph
                    GetCaster()->CastSpell(GetCaster(), SPELL_WARLOCK_SOUL_SWAP_CD_MARKER, false);
            }
    
            void Register() OVERRIDE
            {
                OnCheckCast += SpellCheckCastFn(spell_warl_soul_swap_exhale_SpellScript::CheckCast);
                OnEffectHitTarget += SpellEffectFn(spell_warl_soul_swap_exhale_SpellScript::OnEffectHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
            }
        };
    
        SpellScript* GetSpellScript() const OVERRIDE
        {
            return new spell_warl_soul_swap_exhale_SpellScript();
        }
    };

    terus di bagian AddSC_warlock_spell_scripts tambahin
    Spoiler untuk AddSC_warlock_spell_scripts :
    Code:
    new spell_warl_soul_swap();
    new spell_warl_soul_swap_dot_marker();
    new spell_warl_soul_swap_exhale();
    new spell_warl_soul_swap_override();
    Quote Originally Posted by secreal View Post
    ada yg bisa ngerangkum ga, yg mana yg kira2 uda apply dan yg blom apply...
    saya baru buat virtual test server, jd baru mau coba2
    Yang gw quote belum di tes long..
    mending fokus fix skill ama talent dulu long major bug nya udah parah
    apa lagi hunter

  13. #57
    secreal's Avatar
    Join Date
    Oct 2006
    Location
    bogor
    Posts
    1,533
    Points
    36,503.74
    Thanks: 322 / 346 / 156

    Default

    Quote Originally Posted by beesinv View Post
    Yang gw quote belum di tes long..
    mending fokus fix skill ama talent dulu long major bug nya udah parah
    apa lagi hunter
    OVERRIDE blom bisa dipake di server kita, karena 1 atau lain hal...

  14. #58
    beesinv's Avatar
    Join Date
    Jan 2007
    Location
    Somewhere
    Posts
    713
    Points
    373.48
    Thanks: 25 / 14 / 11

    Default

    Quote Originally Posted by secreal View Post
    OVERRIDE blom bisa dipake di server kita, karena 1 atau lain hal...
    ow begitu
    kalo di biarin seh ya suram ini talent skill ada yg ga jalan
    ada yg proc trus padahal bukan trigger ga sesuai tooltip talent/skillnya
    kalo bisa seh prioritasin skill/talent dulu fix
    good luck

  15. #59
    secreal's Avatar
    Join Date
    Oct 2006
    Location
    bogor
    Posts
    1,533
    Points
    36,503.74
    Thanks: 322 / 346 / 156

    Default

    uda ditambahin di db, di spell_warlock...
    tapi nda proc...

  16. #60

    Join Date
    Feb 2012
    Posts
    86
    Points
    146.21
    Thanks: 3 / 7 / 4

    Default

    Quote Originally Posted by secreal View Post
    OVERRIDE blom bisa dipake di server kita, karena 1 atau lain hal...
    1 atau lain halny gmn ?? kan bs lebi cepet tinggal override2,,

    Quote Originally Posted by secreal View Post
    uda ditambahin di db, di spell_warlock...
    tapi nda proc...
    nda proc ny gmn?? pas soul swap ngga ada buff ny?? ato pas exhale gk ada dot dari wl ny?
    Last edited by bloodyx; 13-08-13 at 18:09.

Page 4 of 7 FirstFirst 1234567 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •