/***********************************************
* Name: SAIC.cpp (Simple Ascent Item Creator)
* Author: Silent
* Email: saadnaveed487@gmail.com
* Date: 1/15/08
************************************************/
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
void DisplayInfo(); // Function Prototype
/* void GenerateSQL(int entry, int Class, int subclass, int field4, char name[], int displayid, int quality,
int flags, long buyprice, long sellprice, int inventorytype, int allowableclass, int allowablerace,
int itemlevel, int requiredlevel, int requiredSkill, int requiredSkillRank, int requiredSkillSubRank,
int requiredPlayerRank1, int requiredPlayerRank2, int requiredFaction, int requiredFactionStanding,
int unique, int maxcount, int ContainerSlots, int stat_type1, int stat_value1, int stat_type2, int stat_value2,
int stat_type3, int stat_value3, int stat_type4, int stat_value4, int stat_type5, int stat_value5, int stat_type6, int stat_value6,
int stat_type7, int stat_value7, int stat_type8, int stat_value8, int stat_type9, int stat_value9, int stat_type10, int stat_value10,
float dmg_min1, float dmg_max1, int dmg_type1, float dmg_min2, float dmg_max2, int dmg_type2, float dmg_min3, float dmg_max3, int dmg_type3,
float dmg_min4, float dmg_max4, int dmg_type4, float dmg_min5, float dmg_max5, int dmg_type5, int armor, int holy_res, int fire_res, int nature_res,
int frost_res, int shadow_res, int arcane_res, int delay, int ammo_type, float range); */
// Global Vars
string itemName;
const int strsize = 60;
// Item Information
struct WTF
{
int entry;
int Class;
int subclass;
int field4;
char name[4][25];
int displayid;
int quality;
int flags;
long buyprice;
long sellprice;
int inventorytype;
int allowableclass;
int allowablerace;
int itemlevel;
int requiredlevel;
int requiredSkill;
int requiredSkillRank;
int requiredSkillSubRank;
int requiredPlayerRank1;
int requiredPlayerRank2;
int requiredFaction;
int requiredFactionStanding;
int unique;
int maxcount;
int ContainerSlots;
int stat_type[10];
int stat_value[10];
float dmg_min[5];
float dmg_max[5];
float dmg_type[5];
int armor;
int holy_res;
int fire_res;
int nature_res;
int frost_res;
int shadow_res;
int arcane_res;
int delay;
int ammo_type;
float range;
int spellid[5];
int spelltrigger[5];
int spellcharges[5];
int spellcooldown[5];
int spellcategory[5];
int spellcategorycooldown[5];
int bonding;
char * description;
int page_id;
int page_language;
int page_material;
int QuestId;
int LockId;
int LockMaterial;
int sheathID;
int RandomPropId;
int unk203_1;
int Block;
int ItemSet;
int MaxDurability;
int ZoneNameID;
int MapID;
int BagFamily;
int TotemCategory;
int socket_color[3];
int unk203[3];
int SocketBonus;
int GemProperties;
int ItemExtendedCost;
int ArenaRankRequirement;
int DisenchantReqSkill;
int unk2;
} ItemInfo;
int main()
{
DisplayInfo();
// Open file to write to it
ofstream fout;
char fileName[strsize];
cout << "Please enter a name for the item file (Ex: Item.sql): ";
cin.getline(fileName, strsize);
fout.open(fileName);
// Check for error
if (!fout.is_open())
{
cout << "An unexpected error has occurred!";
cout << "Terminating...";
exit(EXIT_FAILURE);
}
// Get Data
cout << "Item Name: ";
cin.get(ItemInfo.name[0], 25).get();
// Write to File
fout << "INSERT INTO `items` VALUES (" << ItemInfo.name[0] << ");" << endl;
cin.get();
return 0;
}
void DisplayInfo()
{
cout << "\t\tSilent's SAIC (Simple Ascent Item Creator)\n\n";
cout << "###############################################\n"
<< "# Author: Silent\n"
<< "# Email: saadnaveed487@gmail.com\n"
<< "# Date: 1/18/08\n"
<< "###############################################\n\n\n";
}