/// <summary>Sends the complete inventory to the client. Used during login.</summary> internal void SendInventoryBulk(Client client, Character toon) { // First let's see if we need to clear any norent items bool noRentExpired = DateTime.Now.Subtract(toon.LastSeenDate ?? DateTime.MinValue).TotalSeconds >= Item.NORENT_EXPIRATION; if (noRentExpired) client.ZonePlayer.InvMgr.ClearNoRent(); StringBuilder serItems = new StringBuilder(); // Old emu checks for validity of an item for the slot here, not sure if that's necessary... validation is when placing in a slot foreach (InventoryItem invItem in client.ZonePlayer.InvMgr.PersonalSlotItems()) { //_log.DebugFormat("During bulk inv send, found {0} in personal inv items at slot {1} ====> {2}", invItem.Item.Name, invItem.SlotID, invItem.Serialize()); serItems = serItems.Append(invItem.Serialize() + '\0'); } foreach (InventoryItem invItem in client.ZonePlayer.InvMgr.BankSlotItems()) { //_log.DebugFormat("During bulk inv send, found {0} in bank items at slot {1}.", invItem.Item.Name, invItem.SlotID); serItems = serItems.Append(invItem.Serialize() + '\0'); } foreach (InventoryItem invItem in client.ZonePlayer.InvMgr.SharedBankSlotItems()) { //_log.DebugFormat("During bulk inv send, found {0} in shared bank items at slot {1}.", invItem.Item.Name, invItem.SlotID); serItems = serItems.Append(invItem.Serialize() + '\0'); } //_log.DebugFormat("Serialized Inventory Dump: {0}", serItems.ToString()); EQRawApplicationPacket invPack = new EQRawApplicationPacket(AppOpCode.CharInventory, client.IPEndPoint, Encoding.ASCII.GetBytes(serItems.ToString())); client.SendApplicationPacket(invPack); }
private static void SetRacialStartingAbilities(ref Character toon) { byte[] langs = new byte[MAX_LANGUAGE]; byte[] skills = new byte[MAX_SKILL]; //skills[(byte)Skill.SenseHeading] = 100; // This could be toggled for "classic" feel. switch ((CharRaces)toon.Race) { case CharRaces.Human: langs[(byte)Language.CommonTongue] = 100; break; case CharRaces.Barbarian: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Barbarian] = 100; break; case CharRaces.Erudite: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Erudian] = 100; break; case CharRaces.WoodElf: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Elvish] = 100; skills[(byte)Skill.Forage] = 50; skills[(byte)Skill.Hide] = 50; break; case CharRaces.HighElf: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.DarkElvish] = 25; langs[(byte)Language.ElderElvish] = 25; langs[(byte)Language.Elvish] = 100; break; case CharRaces.DarkElf: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.DarkElvish] = 100; langs[(byte)Language.DarkSpeech] = 100; langs[(byte)Language.ElderElvish] = 100; langs[(byte)Language.Elvish] = 25; skills[(byte)Skill.Hide] = 50; break; case CharRaces.HalfElf: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Elvish] = 100; break; case CharRaces.Dwarf: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Dwarvish] = 100; langs[(byte)Language.Gnomish] = 25; break; case CharRaces.Troll: langs[(byte)Language.CommonTongue] = 95; langs[(byte)Language.DarkSpeech] = 100; langs[(byte)Language.Troll] = 100; break; case CharRaces.Ogre: langs[(byte)Language.CommonTongue] = 95; langs[(byte)Language.DarkSpeech] = 100; langs[(byte)Language.Ogre] = 100; break; case CharRaces.Halfling: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Halfling] = 100; skills[(byte)Skill.Hide] = 50; skills[(byte)Skill.Sneak] = 50; break; case CharRaces.Gnome: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Dwarvish] = 25; langs[(byte)Language.Gnomish] = 100; skills[(byte)Skill.Tinkering] = 50; break; case CharRaces.Iksar: langs[(byte)Language.CommonTongue] = 95; langs[(byte)Language.DarkSpeech] = 100; langs[(byte)Language.LizardMan] = 100; skills[(byte)Skill.Forage] = 50; skills[(byte)Skill.Swimming] = 100; break; case CharRaces.Vahshir: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Combine] = 100; langs[(byte)Language.Erudian] = 25; langs[(byte)Language.VahShir] = 100; skills[(byte)Skill.SafeFall] = 50; skills[(byte)Skill.Sneak] = 50; break; case CharRaces.Froglok: langs[(byte)Language.CommonTongue] = 100; langs[(byte)Language.Froglock] = 100; langs[(byte)Language.Troll] = 25; skills[(byte)Skill.Swimming] = 125; break; default: throw new Exception("race found not set in racial skill determination during char init."); } toon.Languages = Encoding.ASCII.GetString(langs); toon.Skills = Encoding.ASCII.GetString(skills); }
private static void SetDefaultStartZone(uint startZoneId, ref Character toon, ref CharacterBind cb) { switch (startZoneId) { case 0: toon.ZoneID = 24; // erudnext cb.ZoneID = 38; // tox break; case 1: toon.ZoneID = 2; // north qeynos cb.ZoneID = 2; // north qeynos break; case 2: toon.ZoneID = 29; // halas cb.ZoneID = 30; // everfrost break; case 3: toon.ZoneID = 19; // rivervale cb.ZoneID = 20; // kithicor break; case 4: toon.ZoneID = 9; // freeportw cb.ZoneID = 9; // freeportw break; case 5: toon.ZoneID = 40; // neriaka cb.ZoneID = 25; // nektulos break; case 6: toon.ZoneID = 52; // gukta cb.ZoneID = 46; // innothule break; case 7: toon.ZoneID = 49; // oggok cb.ZoneID = 47; // feerrott break; case 8: toon.ZoneID = 60; // kaladima cb.ZoneID = 68; // butcher break; case 9: toon.ZoneID = 54; // gfaydark cb.ZoneID = 54; // gfaydark break; case 10: toon.ZoneID = 61; // felwithea cb.ZoneID = 54; // gfaydark break; case 11: toon.ZoneID = 55; // akanon cb.ZoneID = 56; // steamfont break; case 12: toon.ZoneID = 82; // cabwest cb.ZoneID = 78; // fieldofbone break; case 13: toon.ZoneID = 155; // sharvahl cb.ZoneID = 155; // sharvahl break; default: throw new ArgumentException("Invalid start zone: must be between 0 - 13", "startZoneId"); } }
private static void SetClassStartingAbilities(ref Character toon) { byte[] langs = Encoding.ASCII.GetBytes(toon.Languages); byte[] skills = Encoding.ASCII.GetBytes(toon.Skills); switch ((CharClasses)toon.Class) { case CharClasses.Druid: case CharClasses.Cleric: case CharClasses.Shaman: skills[(byte)Skill.OneHandBlunt] = 5; break; case CharClasses.Paladin: case CharClasses.Ranger: case CharClasses.ShadowKnight: case CharClasses.Warrior: skills[(byte)Skill.OneHandSlashing] = 5; break; case CharClasses.Monk: skills[(byte)Skill.Dodge] = 5; skills[(byte)Skill.DualWield] = 5; skills[(byte)Skill.HandToHand] = 5; break; case CharClasses.Bard: skills[(byte)Skill.OneHandSlashing] = 5; skills[(byte)Skill.Singing] = 5; break; case CharClasses.Rogue: skills[(byte)Skill.Piercing] = 5; langs[(byte)Language.ThievesCant] = 100; break; case CharClasses.Necromancer: case CharClasses.Wizard: case CharClasses.Magician: case CharClasses.Enchanter: skills[(byte)Skill.Piercing] = 5; break; case CharClasses.BeastLord: skills[(byte)Skill.HandToHand] = 5; break; case CharClasses.Berserker: // might need confirmation from live skills[(byte)Skill.TwoHandSlashing] = 5; break; default: throw new Exception("class found not set in racial skill determination during char init."); } toon.Languages = Encoding.ASCII.GetString(langs); toon.Skills = Encoding.ASCII.GetString(skills); }
internal static bool ReserveName(int acctId, string name) { using (EmuDataContext dbCtx = new EmuDataContext()) { if (dbCtx.Characters.Count(c => c.Name == name) > 0) return false; Character toon = new Character(); toon.AccountID = acctId; toon.Name = name; toon.CreatedDate = DateTime.Now; dbCtx.Characters.InsertOnSubmit(toon); dbCtx.SubmitChanges(); } return true; }
partial void DeleteCharacter(Character instance);
partial void UpdateCharacter(Character instance);
partial void InsertCharacter(Character instance);
private void detach_Characters(Character entity) { this.SendPropertyChanging(); entity.Zone = null; }
private void attach_Characters(Character entity) { this.SendPropertyChanging(); entity.Zone = this; }