public MasterRewardItem(DataRow row) { this.ItemID = GetDataTypes.GetUshort(row["ItemID"]); this.Level = GetDataTypes.GetByte(row["Level"]); this.Job = (FiestaLib.Job)GetDataTypes.GetByte(row["Job"]); this.Count = GetDataTypes.GetByte(row["Count"]); }
private void Load() { DataTable AcademyData = null; DataTable MemberData = null; using (var DBClient = Program.DatabaseManager.GetClient()) { AcademyData = DBClient.ReadDataTable("SELECT * FROM GuildAcademy WHERE GuildID = " + Guild.ID + ""); MemberData = DBClient.ReadDataTable("SELECT * FROM GuildAcademyMembers WHERE GuildID = " + Guild.ID + ""); } foreach (DataRow row in AcademyData.Rows) { //load academy info Message = row["Message"].ToString(); Points = GetDataTypes.GetUshort(row["Points"]); } //members foreach (DataRow MemberRow in MemberData.Rows) { WorldCharacter character; if (!CharacterManager.Instance.GetCharacterByID(Convert.ToInt32(MemberRow["CharID"]), out character)) { continue; // maybe deleted } var member = new GuildAcademyMember(this, character, MemberRow); Members.Add(member); } }
/// <summary> /// Needs serious fixing in the reader, as it throws invalid casts (files all use uint, but f**k those) /// </summary> /// <param name="reader"></param> /// <returns></returns> public static ItemInfo Load(DataRow row) { var itemInfo = new ItemInfo { ItemID = GetDataTypes.GetUshort(row["id"]), Slot = (ItemSlot)GetDataTypes.GetByte(row["equip"]), InxName = (string)row["inxname"], MaxLot = GetDataTypes.GetInt(row["maxlot"]), AttackSpeed = GetDataTypes.GetUshort(row["atkspeed"]), Level = GetDataTypes.GetByte(row["demandlv"]), Type = (ItemType)GetDataTypes.GetByte(row["type"]), Class = (ItemClass)GetDataTypes.GetByte(row["class"]), UpgradeLimit = GetDataTypes.GetByte(row["uplimit"]), Jobs = UnpackWhoEquip(GetDataTypes.GetUint(row["whoequip"])), TwoHand = GetDataTypes.GetBool(row["TwoHand"]), MinMagic = GetDataTypes.GetUshort(row["minma"]), MaxMagic = GetDataTypes.GetUshort(row["maxma"]), MinMelee = GetDataTypes.GetUshort(row["minwc"]), MaxMelee = GetDataTypes.GetUshort(row["maxwc"]), WeaponDef = GetDataTypes.GetUshort(row["ac"]), MagicDef = GetDataTypes.GetUshort(row["mr"]), UpSucRation = GetDataTypes.GetUshort(row["UpSucRatio"]), UpResource = GetDataTypes.GetUshort(row["UpResource"]), SellPrice = GetDataTypes.GetUint(row["SellPrice"]), BuyPrice = GetDataTypes.GetUint(row["BuyPrice"]) }; itemInfo.Stats = new ItemStats(); return(itemInfo); }
public static ActiveSkillInfo Load(DataRow row) { ActiveSkillInfo inf = new ActiveSkillInfo { ID = GetDataTypes.GetUshort(row["ID"]), Name = (string)row["InxName"], Step = GetDataTypes.GetByte(row["Step"]), Required = (string)row["DemandSk"], SP = GetDataTypes.GetUshort(row["SP"]), HP = GetDataTypes.GetUshort(row["HP"]), Range = GetDataTypes.GetUshort(row["Range"]), CoolTime = GetDataTypes.GetUint(row["DlyTime"]), CastTime = GetDataTypes.GetUint(row["CastTime"]), DemandType = GetDataTypes.GetByte(row["DemandType"]), MaxTargets = GetDataTypes.GetByte(row["TargetNumber"]), }; uint maxdamage = GetDataTypes.GetUint(row["MaxWC"]); if (maxdamage == 0) { inf.IsMagic = true; inf.MinDamage = GetDataTypes.GetUshort(row["MinMA"]); inf.MaxDamage = GetDataTypes.GetUshort(row["MaxMA"]); } else { inf.MaxDamage = maxdamage; inf.MinDamage = GetDataTypes.GetUint(row["MinWC"]); } return(inf); }
public static Equip LoadEquip(DataRow row) { var uniqueId = GetDataTypes.GetUlong(row["ID"]); var owner = GetDataTypes.GetUint(row["Owner"]); var equipId = GetDataTypes.GetUshort(row["EquipID"]); var slot = GetDataTypes.GetSByte(row["Slot"]); var upgrade = GetDataTypes.GetByte(row["Upgrades"]); var strByte = GetDataTypes.GetUshort(row["iSTR"]); var endByte = GetDataTypes.GetUshort(row["iEND"]); var dexByte = GetDataTypes.GetUshort(row["iDEX"]); var sprByte = GetDataTypes.GetUshort(row["iSPR"]); var intByte = GetDataTypes.GetUshort(row["iINT"]); var equip = new Equip(owner, equipId, slot) { UniqueId = uniqueId, Upgrades = upgrade, Str = strByte, End = endByte, Dex = dexByte, Spr = sprByte, Int = intByte }; return(equip); }
public MasterRewardItem(DataRow row) { ItemID = GetDataTypes.GetUshort(row["ItemID"]); Level = GetDataTypes.GetByte(row["Level"]); Job = (Job)GetDataTypes.GetByte(row["Job"]); Count = GetDataTypes.GetByte(row["Count"]); }
private void Load() { //members DataTable MemberData = null; using (var DBClient = Program.DatabaseManager.GetClient()) { MemberData = DBClient.ReadDataTable("SELECT * FROM GuildMembers WHERE GuildID = " + ID + ""); } foreach (DataRow row in MemberData.Rows) { //get character WorldCharacter character; if (!CharacterManager.Instance.GetCharacterByID(Convert.ToInt32(row["CharID"]), out character)) { continue; } var member = new GuildMember(this, character, (GuildRank)GetDataTypes.GetByte(row["Rank"]), GetDataTypes.GetUshort(row["Korp"])); Members.Add(member); } //academy Academy = new GuildAcademy(this); }
public static Equip LoadEquip(DataRow row) { ulong uniqueID = GetDataTypes.GetUlong(row["ID"]); uint owner = GetDataTypes.GetUint(row["Owner"]); ushort equipID = GetDataTypes.GetUshort(row["EquipID"]); sbyte slot = GetDataTypes.GetSByte(row["Slot"]); byte upgrade = GetDataTypes.GetByte(row["Upgrades"]); ushort strByte = GetDataTypes.GetUshort(row["iSTR"]); ushort endByte = GetDataTypes.GetUshort(row["iEND"]); ushort dexByte = GetDataTypes.GetUshort(row["iDEX"]); ushort sprByte = GetDataTypes.GetUshort(row["iSPR"]); ushort intByte = GetDataTypes.GetUshort(row["iINT"]); Equip equip = new Equip(owner, equipID, slot) { UniqueID = uniqueID, Upgrades = upgrade, Str = strByte, End = endByte, Dex = dexByte, Spr = sprByte, Int = intByte }; return(equip); }
public MasterRewardState(DataRow row) { this.Str = GetDataTypes.GetUshort(row["Str"]); this.End = GetDataTypes.GetUshort(row["End"]); this.Dex = GetDataTypes.GetUshort(row["Dex"]); this.Int = GetDataTypes.GetUshort(row["Int"]); this.Spr = GetDataTypes.GetUshort(row["Spr"]); this.ItemID = GetDataTypes.GetUshort(row["ItemID"]); }
public MasterRewardState(DataRow row) { Str = GetDataTypes.GetUshort(row["Str"]); End = GetDataTypes.GetUshort(row["End"]); Dex = GetDataTypes.GetUshort(row["Dex"]); Int = GetDataTypes.GetUshort(row["Int"]); Spr = GetDataTypes.GetUshort(row["Spr"]); ItemID = GetDataTypes.GetUshort(row["ItemID"]); }
// public int Slot { get; set; } // No idea, only 5 or 10 // public string Name { get; set; } // Not needed for now // public ushort CastTime { get; set; } // Not needed for now public MiniHouseInfo(DataRow row) { ID = GetDataTypes.GetUshort(row["Handle"]); KeepTimeHour = GetDataTypes.GetUshort(row["KeepTime_Hour"]); HPTick = GetDataTypes.GetUshort(row["HPTick"]); SPTick = GetDataTypes.GetUshort(row["SPTick"]); HPRecovery = GetDataTypes.GetUshort(row["HPRecovery"]); SPRecovery = GetDataTypes.GetUshort(row["SPRecovery"]); }
public static AbStateInfo LoadFromDatabase(DataRow row) { var info = new AbStateInfo { ID = GetDataTypes.GetUshort(row["ID"]), InxName = (string)row["InxName"] }; return(info); }
public static MobInfoServer Load(DataRow row) { var info = new MobInfoServer { ID = GetDataTypes.GetUint(row["ID"]), InxName = (string)row["InxName"], Visible = GetDataTypes.GetByte(row["Visible"]), AC = GetDataTypes.GetUshort(row["AC"]), TB = GetDataTypes.GetUshort(row["TB"]), MR = GetDataTypes.GetUshort(row["MR"]), MB = GetDataTypes.GetUshort(row["MB"]), EnemyDetectType = GetDataTypes.GetUint(row["EnemyDetectType"]), MobKillInx = GetDataTypes.GetUint(row["MobKillInx"]), MonExp = GetDataTypes.GetUint(row["MonEXP"]), ExpRange = GetDataTypes.GetUshort(row["EXPRange"]), DetectCha = GetDataTypes.GetUshort(row["DetectCha"]), ResetInterval = GetDataTypes.GetByte(row["ResetInterval"]), CutInterval = GetDataTypes.GetUshort(row["CutInterval"]), CutNonAT = GetDataTypes.GetUint(row["CutNonAT"]), FollowCha = GetDataTypes.GetUint(row["FollowCha"]), PceHPRcvDly = GetDataTypes.GetUshort(row["PceHPRcvDly"]), PceHPRcv = GetDataTypes.GetUshort(row["PceHPRcv"]), AtkHPRcvDly = GetDataTypes.GetUshort(row["AtkHPRcvDly"]), AtkHPRcv = GetDataTypes.GetUshort(row["AtkHPRcv"]), Str = GetDataTypes.GetUshort(row["Str"]), Dex = GetDataTypes.GetUshort(row["Dex"]), Con = GetDataTypes.GetUshort(row["Con"]), Int = GetDataTypes.GetUshort(row["Int"]), Men = GetDataTypes.GetUshort(row["Men"]), MobRaceType = GetDataTypes.GetUint(row["MobRaceType"]), Rank = GetDataTypes.GetByte(row["Rank"]), FamilyArea = GetDataTypes.GetUint(row["FamilyArea"]), FamilyRescArea = GetDataTypes.GetUint(row["FamilyRescArea"]), FamilyRescCount = GetDataTypes.GetByte(row["FamilyRescCount"]), BloodingResi = GetDataTypes.GetUshort(row["BloodingResi"]), StunResi = GetDataTypes.GetUshort(row["StunResi"]), MoveSpeedResi = GetDataTypes.GetUshort(row["MoveSpeedResi"]), FearResi = GetDataTypes.GetUshort(row["FearResi"]), ResIndex = (string)row["ResIndex"], KQKillPoint = GetDataTypes.GetUshort(row["KQKillPoint"]), Return2Regen = GetDataTypes.GetByte(row["Return2Regen"]), IsRoaming = GetDataTypes.GetByte(row["IsRoaming"]), RoamingNumber = GetDataTypes.GetByte(row["RoamingNumber"]), RoamingDistance = GetDataTypes.GetUshort(row["RoamingDistance"]), MaxSP = GetDataTypes.GetUshort(row["MaxSP"]), BroadAtDead = GetDataTypes.GetByte(row["BroadAtDead"]), TurnSpeed = GetDataTypes.GetUshort(row["TurnSpeed"]), WalkChase = GetDataTypes.GetUshort(row["WalkChase"]), AllCanLoot = GetDataTypes.GetByte(row["AllCanLoot"]), DmgByHealMin = GetDataTypes.GetUshort(row["DmgByHealMin"]), DmgByHealMax = GetDataTypes.GetUshort(row["DmgByHealMax"]) }; return(info); }
public static RewardItem LoadFromDatabase(System.Data.DataRow row) { RewardItem ppItem = new RewardItem { Slot = GetDataTypes.GetSByte(row["Slot"]), ID = GetDataTypes.GetUshort(row["ItemID"]), CharID = GetDataTypes.GetInt(row["CharID"]), PageID = GetDataTypes.GetByte(row["PageID"]) }; return(ppItem); }
public static ItemStats LoadItemStatsFromDatabase(DataRow row) { var Stats = new ItemStats { Dex = GetDataTypes.GetUshort(row["Dex"]), End = GetDataTypes.GetUshort(row["con"]), Int = GetDataTypes.GetUshort(row["Int"]), Str = GetDataTypes.GetUshort(row["Str"]) }; return(Stats); }
public static PremiumItem LoadFromDatabase(DataRow row) { var ppItem = new PremiumItem { UniqueID = GetDataTypes.GetInt(row["UniqueID"]), Slot = GetDataTypes.GetByte(row["PageID"]), ShopID = GetDataTypes.GetInt(row["ShopID"]), CharID = GetDataTypes.GetInt(row["CharID"]), PageID = GetDataTypes.GetByte(row["PageID"]) }; return(ppItem); }
public static MapInfo Load(DataRow row) { var info = new MapInfo { ID = GetDataTypes.GetUshort(row["ID"]), ShortName = (string)row["MapName"], FullName = (string)row["Name"], RegenX = GetDataTypes.GetInt(row["RegenX"]), RegenY = GetDataTypes.GetInt(row["RegenY"]), Kingdom = GetDataTypes.GetByte(row["KingdomMap"]), ViewRange = GetDataTypes.GetUshort(row["Sight"]) }; return(info); }
public static Item LoadItem(DataRow Row) { ulong id = GetDataTypes.GetUlong(Row["ID"]); uint owner = GetDataTypes.GetUint(Row["Owner"]); sbyte slot = GetDataTypes.GetSByte(Row["Slot"]); ushort equipID = GetDataTypes.GetUshort(Row["ItemID"]); ushort amount = GetDataTypes.GetUshort(Row["Amount"]); Item item = new Item(id, owner, equipID, slot, amount) { Slot = slot, IsEquipped = GetDataTypes.GetBool(Row["Equipt"]), }; return(item); }
public static MasterMember LoadFromDatabase(DataRow row) { MasterMember Member = new MasterMember { pMemberName = row["MemberName"].ToString(), CharID = GetDataTypes.GetInt(row["CharID"]), Level = GetDataTypes.GetByte(row["Level"]), IsMaster = GetDataTypes.GetBool(row["isMaster"]), MasterID = GetDataTypes.GetInt(row["MasterID"]), RegisterDate = DateTime.ParseExact(row["RegisterDate"].ToString(), "dd.MM.yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture), }; Member.pMember = ClientManager.Instance.GetClientByCharname(Member.pMemberName); Member.IsOnline = ClientManager.Instance.IsOnline(Member.pMemberName); return(Member); }
public static Item LoadItem(DataRow Row) { var id = GetDataTypes.GetUlong(Row["ID"]); var owner = GetDataTypes.GetUint(Row["Owner"]); var slot = GetDataTypes.GetSByte(Row["Slot"]); var equipID = GetDataTypes.GetUshort(Row["ItemID"]); var amount = GetDataTypes.GetUshort(Row["Amount"]); var item = new Item(id, owner, equipID, slot, amount) { Slot = slot, IsEquipped = GetDataTypes.GetBool(Row["Equipt"]) }; return(item); }
public static Mount LoadMount(DataRow Data) { var Mouninf = new Mount { MinLevel = GetDataTypes.GetByte(Data["Level"]), ItemID = GetDataTypes.GetUshort(Data["ItemID"]), TickSpeed = GetDataTypes.GetInt(Data["Tickspeed"]), Handle = GetDataTypes.GetUshort(Data["Handle"]), Food = GetDataTypes.GetUshort(Data["Food"]), speed = GetDataTypes.GetUshort(Data["Speed"]), CastTime = GetDataTypes.GetInt(Data["CastTime"]), Cooldown = GetDataTypes.GetUshort(Data["Cooldown"]), permanent = GetDataTypes.GetBool(Data["permanent"]) }; return(Mouninf); }
public static MobInfo Load(DataRow row) { var inf = new MobInfo { Name = (string)row["InxName"], ID = GetDataTypes.GetUshort(row["ID"]), Level = GetDataTypes.GetByte(row["Level"]), MaxHP = GetDataTypes.GetUint(row["MaxHP"]), RunSpeed = GetDataTypes.GetUshort(row["RunSpeed"]), IsNpc = GetDataTypes.GetBool(row["IsNPC"]), Size = GetDataTypes.GetUshort(row["Size"]), Type = GetDataTypes.GetByte(row["Type"]), IsAggro = GetDataTypes.GetBool(row["IsPlayerSide"]), Drops = new List <DropInfo>() }; return(inf); }
private void LoadItemInfoServer() { try { DataTable itemDataInf = null; using (DatabaseClient dbClient = Program.DatabaseManager.GetClient()) { itemDataInf = dbClient.ReadDataTable("SELECT *FROM data_iteminfoserver"); } foreach (DataRow row in itemDataInf.Rows) { ushort itemid = GetDataTypes.GetUshort(row["ID"]); ItemInfo item; if (ItemsByID.TryGetValue(itemid, out item)) { for (int i = 0; i < 3; i++) { string groupname = (string)row[dropGroupNames[i]]; if (groupname.Length > 2) { DropGroupInfo group; if (DropGroups.TryGetValue(groupname, out group)) { group.Items.Add(item); } else { // Log.WriteLine(LogLevel.Warn, "{0} was assigned to unknown DropGroup {1}.", item.InxName, groupname); } } } } else { Log.WriteLine(LogLevel.Warn, "ItemInfoServer has obsolete item ID: {0}.", itemid); } } } catch (Exception ex) { Log.WriteLine(LogLevel.Exception, "Error loading ItemInfoServer.shn: {0}", ex); } }
private void LoadMobBreeds() { MobBreeds = new List <MobBreedLocation>(); DataTable data = null; using (var dbClient = Program.DatabaseManager.GetClient()) { data = dbClient.ReadDataTable("SELECT *FROM `" + Settings.Instance.zoneMysqlDatabase + "`.`Mobspawn` WHERE MapID='" + MapInfo.ID + "'"); } if (data != null) { if (data.Rows.Count > 0) { foreach (DataRow row in data.Rows) { var locationInfo = new MobBreedLocation { MapID = GetDataTypes.GetUshort(row["MapID"]), MobID = GetDataTypes.GetUshort(row["MobID"]), //InstanceID = GetDataTypes.Getshort(row["InstanceID"]), //NOTE from db throws; InstanceID = 0, Position = new Vector2() }; locationInfo.Position.X = GetDataTypes.GetInt(row["PosX"]); locationInfo.Position.Y = GetDataTypes.GetInt(row["PosY"]); MobBreeds.Add(locationInfo); } } else { MobBreeds = new List <MobBreedLocation>(); } } }
public bool LoadCharacters() { if (!Authenticated) { return(false); } Characters = new Dictionary <byte, WorldCharacter>(); try { DataTable charData = null; using (DatabaseClient dbClient = Program.DatabaseManager.GetClient()) { charData = dbClient.ReadDataTable("SELECT * FROM Characters WHERE AccountID='" + this.AccountID + "'"); } if (charData != null) { foreach (DataRow row in charData.Rows) { Database.Storage.Character ch = new Database.Storage.Character(); ch.PositionInfo.ReadFromDatabase(row); ch.LookInfo.ReadFromDatabase(row); ch.CharacterStats.ReadFromDatabase(row); ch.Slot = (byte)row["Slot"]; ch.CharLevel = (byte)row["Level"]; ch.AccountID = this.AccountID; ch.Name = (string)row["Name"]; ch.ID = GetDataTypes.GetInt(row["CharID"]); ch.Job = (byte)row["Job"]; ch.Money = GetDataTypes.GetLong(row["Money"].ToString()); ch.Exp = long.Parse(row["Exp"].ToString()); ch.HP = int.Parse(row["CurHP"].ToString()); ch.HPStones = 10; ch.MasterJoin = DateTime.Parse(row["MasterJoin"].ToString()); ch.SP = int.Parse(row["CurSP"].ToString()); ch.SPStones = 10; ch.StatPoints = (byte)row["StatPoints"]; ch.UsablePoints = (byte)row["UsablePoints"]; ch.Fame = 0; // TODO ch.GameSettings = Database.DataStore.ReadMethods.GetGameSettings(ch.ID, Program.DatabaseManager); ch.ClientSettings = Database.DataStore.ReadMethods.GetClientSettings(ch.ID, Program.DatabaseManager); ch.Shortcuts = Database.DataStore.ReadMethods.GetShortcuts(ch.ID, Program.DatabaseManager); ch.QuickBar = Database.DataStore.ReadMethods.GetQuickBar(ch.ID, Program.DatabaseManager); ch.QuickBarState = Database.DataStore.ReadMethods.GetQuickBarState(ch.ID, Program.DatabaseManager); ch.ReviveCoper = GetDataTypes.GetLong(row["MasterReciveMoney"]); if (row.IsNull("GroupID")) { ch.GroupId = -1; } else { ch.GroupId = long.Parse(row["GroupID"].ToString()); } if (ch.GroupId == -1 || row.IsNull("IsGroupMaster")) { ch.IsGroupMaster = false; } else { ch.IsGroupMaster = ReadMethods.EnumToBool(row["IsGroupMaster"].ToString()); } Characters.Add(ch.Slot, new WorldCharacter(ch, this)); } } } catch (Exception ex) { Log.WriteLine(LogLevel.Exception, "Error loading characters from {0}: {1}", Username, ex.InnerException.ToString()); return(false); } return(true); }