#include "stdafx.h"
using namespace std;
double entry;
int Class;
int subclass;
int SoundOverrideSubclass;
char name;
int displayid;
int Quality;
int Flags;
int FlagsExtra;
int BuyCount;
int BuyPrice;
int SellPrice;
int InventoryType;
int AllowableClass;
int AllowableRace;
double ItemLevel;
int RequiredLevel;
int RequiredSkill;
int RequiredSkillRank;
int requiredspell;
int requiredhonorrank;
int RequiredCityRank;
int RequiredReputationFaction;
int RequiredReputationRank;
int maxcount;
int stackable;
int ContainerSlots;
int StatsCount;
int stat_type1;
double stat_value1;
int stat_type2;
double stat_value2;
int stat_type3;
double stat_value3;
int stat_type4;
double stat_value4;
int stat_type5;
double stat_value5;
int stat_type6;
double stat_value6;
int stat_type7;
double stat_value7;
int stat_type8;
double stat_value8;
int stat_type9;
double stat_value9;
int stat_type10;
double stat_value10;
int ScalingStatDistribution;
int ScalingStatValue;
double dmg_min1;
double dmg_max1;
int dmg_type1;
double dmg_min2;
double dmg_max2;
int dmg_type2;
double armor;
int holy_res;
int fire_res;
int nature_res;
int frost_res;
int shadow_res;
int arcane_res;
int delay;
int ammo_type;
int RangedModRange;
int spellid_1;
int spelltrigger_1;
int spellcharges_1;
int spellppmRate_1;
int spellcooldown_1;
int spellcategory_1;
int spellcategorycooldown_1;
int spellid_2;
int spelltrigger_2;
int spellcharges_2;
int spellppmRate_2;
int spellcooldown_2;
int spellcategory_2;
int spellcategorycooldown_2;
int spellid_3;
int spelltrigger_3;
int spellcharges_3;
int spellppmRate_3;
int spellcooldown_3;
int spellcategory_3;
int spellcategorycooldown_3;
int spellid_4;
int spelltrigger_4;
int spellcharges_4;
int spellppmRate_4;
int spellcooldown_4;
int spellcategory_4;
int spellcategorycooldown_4;
int spellid_5;
int spelltrigger_5;
int spellcharges_5;
int spellppmRate_5;
int spellcooldown_5;
int spellcategory_5;
int spellcategorycooldown_5;
int bonding;
char description;
int PageText;
int LanguageID;
int PageMaterial;
int startquest;
int lockid;
int Material;
int sheath;
int RandomProperty;
int RandomSuffix;
double block;
int itemset;
int MaxDurability;
int area;
int Map;
int BagFamily;
int TotemCategory;
int socketColor_1;
int socketContent_1;
int socketColor_2;
int socketContent_2;
int socketColor_3;
int socketContent_3;
int socketBonus;
int GemProperties;
int RequiredDisenchantSkill;
int ArmorDamageModifier;
int duration;
int ItemLimitCategory;
int HolidayId;
char ScriptName;
int DisenchantID;
int FoodType;
int minMoneyLoot;
int maxMoneyLoot;
int flagsCustom;
int WDBVerified;
void WriteToFile(double Enter, double ItemL, double stat1, double stat2, double stat3, double stat4, double stat5, double stat6, double stat7, double stat8, double stat9, double stat10, double dmgmin1, double dmgmax1, double dmgmin2, double dmgmax2, double arm, double blk)
{
ofstream fout;
fout.open("Output.sql", ios::out, ios::app);
fout << "INSERT INTO `item_template` " << "("<< Enter << ", " << Class << ", " << subclass << ", ";
fout << SoundOverrideSubclass << ", `" << name << "`, " << displayid << ", " << Quality << ", ";
fout << Flags << ", " << FlagsExtra << ", " << BuyCount << ", " << BuyPrice << ", ";
fout << SellPrice << ", " << InventoryType << ", " << AllowableClass << ", " << AllowableRace << ", ";
fout << ItemL << ", " << RequiredLevel << ", " << RequiredSkill << ", " << RequiredSkillRank << ", ";
fout << requiredspell << ", " << requiredhonorrank << ", " << RequiredCityRank << ", ";
fout << RequiredReputationFaction << ", " << RequiredReputationRank << ", " << maxcount << ", ";
fout << stackable << ", " << ContainerSlots << ", " << StatsCount << ", " << stat_type1 << ", ";
fout << stat1 << ", " << stat_type2 << ", " << stat2 << ", " << stat_type3 << ", ";
fout << stat3 << ", " << stat_type4 << ", " << stat4 << ", " << stat_type5 << ", ";
fout << stat5 << ", " << stat_type6 << ", " << stat6 << ", " << stat_type7 << ", ";
fout << stat7 << ", " << stat_type8 << ", " << stat8 << ", " << stat_type9 << ", ";
fout << stat9 << ", " << stat_type10 << ", " << stat10 << ", ";
fout << ScalingStatDistribution << ", " << ScalingStatValue << ", " << dmgmin1 << ", ";
fout << dmgmax1 << ", " << dmg_type1 << ", " << dmgmin2 << ", " << dmgmax2 << ", ";
fout << dmg_type2 << ", " << arm << ", " << holy_res << ", " << fire_res << ", ";
fout << nature_res << ", " << frost_res << ", " << shadow_res << ", " << arcane_res << ", ";
fout << delay << ", " << ammo_type << ", " << RangedModRange << ", " << spellid_1 << ", ";
fout << spelltrigger_1 << ", " << spellcharges_1 << ", " << spellppmRate_1 << ", ";
fout << spellcooldown_1 << ", " << spellcategory_1 << ", " << spellcategorycooldown_1 << ", ";
fout << spellid_2 << spelltrigger_2 << ", " << spellcharges_2 << ", " << spellppmRate_2 << ", ";
fout << spellcooldown_2 << ", " << spellcategory_2 << ", " << spellcategorycooldown_2 << ", ";
fout << spellid_3 << spelltrigger_3 << ", " << spellcharges_3 << ", " << spellppmRate_3 << ", ";
fout << spellcooldown_3 << ", " << spellcategory_3 << ", " << spellcategorycooldown_3 << ", ";
fout << spellid_4 << spelltrigger_4 << ", " << spellcharges_4 << ", " << spellppmRate_4 << ", ";
fout << spellcooldown_4 << ", " << spellcategory_4 << ", " << spellcategorycooldown_4 << ", ";
fout << spellid_5 << spelltrigger_5 << ", " << spellcharges_5 << ", " << spellppmRate_5 << ", ";
fout << spellcooldown_5 << ", " << spellcategory_5 << ", " << spellcategorycooldown_5 << ", ";
fout << bonding << ", `" << description << "`, " << PageText << ", " << LanguageID << ", ";
fout << PageMaterial << ", " << startquest << ", " << lockid << ", " << Material << ", " << sheath << ", ";
fout << RandomProperty << ", " << RandomSuffix << ", " << blk << ", " << itemset << ", ";
fout << MaxDurability << ", " << area << ", " << Map << ", " << BagFamily << ", ";
fout << TotemCategory << ", " << socketColor_1 << ", " << socketContent_1 << ", ";
fout << socketColor_2 << ", " << socketContent_2 << ", " << socketColor_3 << ", ";
fout << socketContent_3 << ", " << socketBonus << ", " << GemProperties << ", ";
fout << RequiredDisenchantSkill << ", " << ArmorDamageModifier << ", " << duration << ", ";
fout << ItemLimitCategory << ", " << HolidayId << ", `" << ScriptName << "`, ";
fout << DisenchantID << ", " << FoodType << ", " << minMoneyLoot << ", " << maxMoneyLoot << ", ";
fout << flagsCustom << ", " << WDBVerified << ");";
fout << endl << endl << endl;
}
void Calculate()
{
double increase;
double generate;
cout << "What are we increasing the stats by? ";
cin >> increase;
cout << "How many items should be generated? ";
cin >> generate;
for (generate; generate >= 0; generate--)
{
double ItemL = (ItemLevel * increase);
double stat1 = (stat_value1 * pow(increase, generate--));
double stat2 = (stat_value2 * pow(increase, generate--));
double stat3 = (stat_value3 * pow(increase, generate--));
double stat4 = (stat_value4 * pow(increase, generate--));
double stat5 = (stat_value5 * pow(increase, generate--));
double stat6 = (stat_value6 * pow(increase, generate--));
double stat7 = (stat_value7 * pow(increase, generate--));
double stat8 = (stat_value8 * pow(increase, generate--));
double stat9 = (stat_value9 * pow(increase, generate--));
double stat10 = (stat_value10 * pow(increase, generate--));
double dmgmin1 = (dmg_min1 * pow(increase, generate--));
double dmgmax1 = (dmg_max1 * pow(increase, generate--));
double dmgmin2 = (dmg_min2 * pow(increase, generate--));
double dmgmax2 = (dmg_max2 * pow(increase, generate--));
double arm = (armor * pow(increase, generate--));
double blk = (block * pow(increase, generate--));
double Enter = (entry + (1 + generate--));
WriteToFile(Enter, ItemL, stat1, stat2, stat3, stat4, stat5, stat6, stat7, stat8, stat9, stat10, dmgmin1, dmgmax1, dmgmin2, dmgmax2, arm, blk);
}
}
void GetIncrease()
{
ofstream read;
read.open("Base.txt", ios::in);
if (read.fail())
cout << "Could not read Base.txt\n";
if (read.is_open())
cout << "File Is Open!\n";
read << entry;
read << Class;
read << subclass;
read << SoundOverrideSubclass;
read << name;
read << displayid;
read << Quality;
read << Flags;
read << FlagsExtra;
read << BuyCount;
read << BuyPrice;
read << SellPrice;
read << InventoryType;
read << AllowableClass;
read << AllowableRace;
read << ItemLevel;
read << RequiredLevel;
read << RequiredSkill;
read << RequiredSkillRank;
read << requiredspell;
read << requiredhonorrank;
read << RequiredCityRank;
read << RequiredReputationFaction;
read << RequiredReputationRank;
read << maxcount;
read << stackable;
read << ContainerSlots;
read << StatsCount;
read << stat_type1;
read << stat_value1;
read << stat_type2;
read << stat_value2;
read << stat_type3;
read << stat_value3;
read << stat_type4;
read << stat_value4;
read << stat_type5;
read << stat_value5;
read << stat_type6;
read << stat_value6;
read << stat_type7;
read << stat_value7;
read << stat_type8;
read << stat_value8;
read << stat_type9;
read << stat_value9;
read << stat_type10;
read << stat_value10;
read << ScalingStatDistribution;
read << ScalingStatValue;
read << dmg_min1;
read << dmg_max1;
read << dmg_type1;
read << dmg_min2;
read << dmg_max2;
read << dmg_type2;
read << armor;
read << holy_res;
read << fire_res;
read << nature_res;
read << frost_res;
read << shadow_res;
read << arcane_res;
read << delay;
read << ammo_type;
read << RangedModRange;
read << spellid_1;
read << spelltrigger_1;
read << spellcharges_1;
read << spellppmRate_1;
read << spellcooldown_1;
read << spellcategory_1;
read << spellcategorycooldown_1;
read << spellid_2;
read << spelltrigger_2;
read << spellcharges_2;
read << spellppmRate_2;
read << spellcooldown_2;
read << spellcategory_2;
read << spellcategorycooldown_2;
read << spellid_3;
read << spelltrigger_3;
read << spellcharges_3;
read << spellppmRate_3;
read << spellcooldown_3;
read << spellcategory_3;
read << spellcategorycooldown_3;
read << spellid_4;
read << spelltrigger_4;
read << spellcharges_4;
read << spellppmRate_4;
read << spellcooldown_4;
read << spellcategory_4;
read << spellcategorycooldown_4;
read << spellid_5;
read << spelltrigger_5;
read << spellcharges_5;
read << spellppmRate_5;
read << spellcooldown_5;
read << spellcategory_5;
read << spellcategorycooldown_5;
read << bonding;
read << description;
read << PageText;
read << LanguageID;
read << PageMaterial;
read << startquest;
read << lockid;
read << Material;
read << sheath;
read << RandomProperty;
read << RandomSuffix;
read << block;
read << itemset;
read << MaxDurability;
read << area;
read << Map;
read << BagFamily;
read << TotemCategory;
read << socketColor_1;
read << socketContent_1;
read << socketColor_2;
read << socketContent_2;
read << socketColor_3;
read << socketContent_3;
read << socketBonus;
read << GemProperties;
read << RequiredDisenchantSkill;
read << ArmorDamageModifier;
read << duration;
read << ItemLimitCategory;
read << HolidayId;
read << ScriptName;
read << DisenchantID;
read << FoodType;
read << minMoneyLoot;
read << maxMoneyLoot;
read << flagsCustom;
read << WDBVerified;
if (read.eof())
cout << "The Base Data has been read successfully" << endl;
read.close();
Calculate();
}
int main()
{
GetIncrease();
system("Pause");
return 0;
}