public static void Convert_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Converting all players to PlayerMobile. You will be disconnected. Please Restart the server after the world has finished saving." ); List<Mobile> mobs = new List<Mobile>( World.Mobiles.Values ); int count = 0; foreach ( Mobile m in mobs ) { if ( m.Player && !(m is PlayerMobile ) ) { count++; if ( m.NetState != null ) m.NetState.Dispose(); PlayerMobile pm = new PlayerMobile( m.Serial ); pm.DefaultMobileInit(); List<Item> copy = new List<Item>( m.Items ); for (int i=0;i<copy.Count;i++) pm.AddItem( copy[i] ); CopyProps( pm, m ); for (int i=0;i<m.Skills.Length;i++) { pm.Skills[i].Base = m.Skills[i].Base; pm.Skills[i].SetLockNoRelay( m.Skills[i].Lock ); } World.Mobiles[m.Serial] = pm; } } if ( count > 0 ) { NetState.ProcessDisposedQueue(); World.Save(); Console.WriteLine( "{0} players have been converted to PlayerMobile. {1}.", count, Core.Service ? "The server is now restarting" : "Press any key to restart the server" ); if ( !Core.Service ) Console.ReadKey( true ); Core.Kill( true ); } else { e.Mobile.SendMessage( "Couldn't find any Players to convert." ); } }
public static void Convert_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Converting all players to PlayerMobile. You will be disconnected. Please Restart the server after the world has finished saving." ); ArrayList mobs = new ArrayList( World.Mobiles.Values ); int count = 0; foreach ( Mobile m in mobs ) { if ( m.Player && !(m is PlayerMobile ) ) { count++; if ( m.NetState != null ) m.NetState.Dispose(); PlayerMobile pm = new PlayerMobile( m.Serial ); pm.DefaultMobileInit(); ArrayList copy = new ArrayList( m.Items ); for (int i=0;i<copy.Count;i++) pm.AddItem( (Item)copy[i] ); CopyProps( pm, m ); for (int i=0;i<m.Skills.Length;i++) { pm.Skills[i].Base = m.Skills[i].Base; pm.Skills[i].SetLockNoRelay( m.Skills[i].Lock ); } World.Mobiles[m.Serial] = pm; } } if ( count > 0 ) { NetState.ProcessDisposedQueue(); World.Save(); log.InfoFormat("{0} players have been converted to PlayerMobile. Restarting the server.", count); Core.Shutdown(true); } else { log.Info( "Couldn't find any Players to convert." ); } }
public static void RestoreState( PlayerMobile m, bool moveExisting, bool logging, out int created, out int deleted, out int ignored, out int moved) { var pack = m.Backpack; if (pack == null || pack.Deleted) { m.AddItem( pack = new Backpack { Movable = false }); } var bank = m.BankBox; if (bank == null || bank.Deleted) { m.AddItem( bank = new BankBox(m) { Movable = false }); } var root = VitaNexCore.DataDirectory + "/PlayerBackup/" + m.Account.Username + "/" + m.Serial; var idxFile = IOUtility.EnsureFile(root + ".idx"); var binFile = IOUtility.EnsureFile(root + ".bin"); var logFile = logging ? IOUtility.EnsureFile(root + ".log") : null; var log = logging ? new StringBuilder() : null; if (log != null) { log.AppendLine(); log.AppendLine(new String('*', 10)); log.AppendLine(); log.AppendLine("RESTORE:\tDate[{0}]\tMobile[{1}]", DateTime.UtcNow, m); log.AppendLine(); } int idxCreated = 0, idxDeleted = 0, idxIgnored = 0, idxMoved = 0; idxFile.Deserialize( idx => { idx.GetVersion(); var ser = idx.ReadInt(); if (ser != m.Serial) { if (log != null) { log.AppendLine("INVALID:\tSerial[{0}]", ser); } return; } long idxLength; int idxCount; ReadLength(idx, false, out idxLength, out idxCount); if (log != null) { log.AppendLine("INDEX:\tCount[{0}]\tLength[{1}]", idxCount, idxLength); } var items = new Tuple<Item, Serial, long, long, string>[idxCount]; binFile.Deserialize( bin => { bin.GetVersion(); var restored = new Dictionary<Item, Serial>(); Backpack oldPack = null; BankBox oldBank = null; for (var i = 0; i < idxCount; i++) { Type type; Serial serial, parent; long binIndex, binLength; ReadIndex(idx, out type, out serial, out parent, out binIndex, out binLength); var valid = serial.IsValid && serial.IsItem; var exists = World.Items.ContainsKey(serial); Item item = null; if (exists) { item = World.Items[serial]; if (item == null || item.Deleted) { World.Items.Remove(serial); exists = false; } } object logItem; string status; if (!exists && valid && type.IsEqualOrChildOf<Item>()) { item = type.CreateInstanceSafe<Item>(serial); if (item == null) { ++idxIgnored; logItem = serial; status = "NULL"; } else if (item.Deleted) { ++idxDeleted; item = null; logItem = serial; status = "DELETED"; } else { ++idxCreated; World.AddItem(item); logItem = item; status = "CREATED"; } } else if (exists && valid && moveExisting && item.RootParent != m) { ++idxMoved; logItem = item; status = "MOVE"; } else { ++idxIgnored; item = null; logItem = serial; status = exists ? "EXISTS" : "INVALID"; } if (log != null) { log.AppendLine( "DATA:\tIndex[{0}]\t\tLength[{1}]\tStatus[{2}]\tItem[{3}]\t\t\tParent[{4}]", // binIndex, binLength, status, logItem, parent); } items[i] = Tuple.Create(item, parent, binIndex, binLength, status); } foreach (var t in items) { var item = t.Item1; var parent = t.Item2; var index = t.Item3; var length = t.Item4; var status = t.Item5; bin.Seek(index, SeekOrigin.Begin); if (item == null) { bin.Seek(index + length, SeekOrigin.Begin); continue; } Exception x = null; if (status == "MOVE") { bin.Seek(index + length, SeekOrigin.Begin); status = "IGNORED"; } else { try { item.Deserialize(bin); status = "LOADED"; } catch (Exception e) { --idxCreated; ++idxDeleted; item.Delete(); x = e; status = "ERROR"; } } if (log != null) { log.AppendLine( "READ:\tIndex[{0}]\tLength[{1}]\tStatus[{2}]\tItem[{3}]\t\t\tParent[{4}]", index, length, status, item, parent); if (x != null) { log.AppendLine(); log.AppendLine(new String('*', 10)); log.AppendLine(x.ToString()); log.AppendLine(new String('*', 10)); log.AppendLine(); } } if (parent == m.Serial) { if (item is BankBox) { oldBank = (BankBox)item; } else if (item is Backpack) { oldPack = (Backpack)item; } } restored.Add(item, parent); } if (log != null) { log.AppendLine(); } Point3D p; foreach (var kv in restored.Where(kv => !kv.Key.Deleted).OrderBy(kv => kv.Value)) { var item = kv.Key; if ((item == oldPack || item == oldBank) && item != pack && item != bank) { if (item.Parent is Item) { ((Item)item.Parent).RemoveItem(item); } else if (item.Parent is Mobile) { ((Mobile)item.Parent).RemoveItem(item); } item.Parent = null; continue; } var parent = World.FindEntity(kv.Value); if (item != pack && item != bank && (item.Parent == oldPack || item.Parent == oldBank)) { ((Item)item.Parent).RemoveItem(item); } if (parent != null) { if (item == pack || item == bank) { m.AddItem(item); } else if (parent == pack || parent == oldPack) { p = item.Location; pack.DropItem(item); item.Location = p; } else if (parent == bank || parent == oldBank) { p = item.Location; bank.DropItem(item); item.Location = p; } else if (parent is Container) { if (parent.Deleted) { bank.DropItem(item); } else { p = item.Location; ((Container)parent).DropItem(item); item.Location = p; } } else if (parent is Mobile) { if (!m.EquipItem(item)) { pack.DropItem(item); } } else { bank.DropItem(item); } item.SetLastMoved(); item.UpdateTotals(); item.Delta(ItemDelta.Update); } else if (Cleanup.IsBuggable(item)) { --idxCreated; ++idxDeleted; item.Delete(); } else { item.Internalize(); } } if (oldPack != null && oldPack != pack && !restored.ContainsKey(oldPack)) { oldPack.Delete(); } if (oldBank != null && oldBank != bank && !restored.ContainsKey(oldBank)) { oldBank.Delete(); } if (log != null) { log.AppendLine(); } foreach (var kv in restored) { if (kv.Key.Deleted) { if (log != null) { log.AppendLine("DELETED:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Value); } } else if (kv.Key.RootParent == m && kv.Key.Map == Map.Internal && kv.Key.Location == Point3D.Zero) { if (log != null) { log.AppendLine("INTERNAL:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Value); } } else if (kv.Key.RootParent != m) { if (log != null) { log.AppendLine("IGNORED:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Value); } } else { if (log != null) { log.AppendLine("RESTORED:\tItem[{0}]\t\tParent[{1}]", kv.Key, kv.Key.Parent); } } } restored.Clear(); m.SendEverything(); }); }); created = idxCreated; deleted = idxDeleted; ignored = idxIgnored; moved = idxMoved; if (log == null) { return; } log.AppendLine(); log.AppendLine( "RESULT:\tCreated[{0}]\t\tDeleted[{1}]\t\tIgnored[{2}]\t\tMoved[{3}]", created, deleted, ignored, moved); logFile.AppendText(false, log.ToString()); }
public static void JailThem( PlayerMobile player, JailOption option ) { if ( null == player || player.AccessLevel >= JailConfig.JailImmuneLevel ) return; if ( JailOption.Squelch == option ) player.Squelched = true; foreach ( Item item in player.Items ) { if ( item is JailHammer ) // Jailed while jailed gets them another load of rock to mine { if ( 0 > ( ((JailHammer)item).UsesRemaining += JailConfig.UsesRemaining ) ) // handle integer overflow ((JailHammer)item).UsesRemaining *= -1; Banker.Withdraw( player, JailConfig.FineAmount ); player.SendMessage( "Your remaining sentence has been increased!" ); player.SendMessage( "You have been fined {0} gold and are being kicked!", JailConfig.FineAmount ); // This gives a nice little delay for the message to be read s_KickProcessingQueue.Enqueue( player ); player.Squelched = true; Server.Timer.DelayCall( TimeSpan.FromSeconds( kSecondsTillKick ), new Server.TimerCallback( KickPlayerInQueue ) ); return; } } // If mounted, dismount them and stable mount if ( player.Mounted ) { if ( player.Mount is EtherealMount ) { EtherealMount pet = player.Mount as EtherealMount; pet.Internalize(); pet.Rider = null; } else if ( player.Mount is BaseMount ) { BaseMount pet = player.Mount as BaseMount; pet.Rider = null; Jail.StablePet( player, pet ); } } // Stable all other pets foreach ( Mobile mobile in World.Mobiles.Values ) { if ( mobile is BaseCreature ) { BaseCreature bc = mobile as BaseCreature; if ( null != bc && (bc.Controlled && bc.ControlMaster == player) || (bc.Summoned && bc.SummonMaster == player) ) Jail.StablePet( player, bc ); } } // Move all items to a bag and move that to the bank Container backpack = player.Backpack; Backpack bag = new Backpack(); bag.Hue = JailConfig.RobeHue; ArrayList equipedItems = new ArrayList( player.Items ); foreach ( Item item in equipedItems ) { if ( item.Layer == Layer.Bank || item.Layer == Layer.Backpack || item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || item is DeathShroud ) continue; bag.DropItem( item ); } ArrayList backpackItems = new ArrayList( backpack.Items ); foreach ( Item item in backpackItems ) { if ( item is JailRock ) item.Delete(); else if ( item.Movable ) // Non movable pack items must remain (i.e. skill balls) bag.DropItem( item ); } // Remember their access level and make them a player JailHammer hammer = new JailHammer(); hammer.PlayerAccessLevel = player.AccessLevel; player.AccessLevel = AccessLevel.Player; // Bank the bag of belongings, give them a hammer and welcome them player.BankBox.DropItem( bag ); player.AddItem( hammer ); // Explosively move player to jail player.BoltEffect( 0 ); player.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist ); player.PlaySound( 0x307 ); player.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot ); player.PlaySound( 0x225 ); // This gives a nice little delay for the effect to complete s_JailProcessingQueue.Enqueue( player ); Server.Timer.DelayCall( TimeSpan.FromSeconds( kSecondsTillJail ), new Server.TimerCallback( JailPlayerInQueue ) ); }
public static void EventSink_AccountLogin(AccountLoginEventArgs e) { try { IAccount a = Accounts.GetAccount(e.Username); if (a == null) return; // si pas de compte (bug xD) on sort Account acc = a as Account; if (a == null || a.Count > 0) return; // Si cast en compte est null ou s'il y a déjà des joueurs pour ce compte, on n'importe pas les joueurs de la save sphere else if (acc != null && acc.Comments != null && acc.Comments.Count > 0) return; // pareil s'il y a déjà un commentaire sur le compte //else if (acc != null && acc.TotalGameTime > TimeSpan.FromMinutes(15)) return; // Vérifions que les fichiers nécessaires existent bien if (!SphereFiles.checkDataFiles()) return; // Commencons par récupérer les SERIAL des personnages associés au compte List<string> charUIDs = new List<string>(); int totalTime = 0; // on récupère le temps en sec joué par le joueurs sur sphere bool found = false; string username = e.Username.ToLower(); foreach (string line in File.ReadAllLines(SphereFiles.accountFile)) { // On cherche d'abord à retrouver l'utilisateur if (line.ToLower() == "[" + username + "]") { found = true; continue; } // Ensuite une fois qu'on l'a trouvé on ajout les SERIAL de ses personnages // jusqu'à tombé sur un autre compte (ou la fin du fichier) if (found) { if (line.StartsWith("[")) break; if (line.StartsWith("TOTALCONNECTTIME=")) totalTime = Int32.Parse(line.Split('=')[1]); if (line.StartsWith("CHARUID")) charUIDs.Add(line.Split('=')[1]); } } // On traite chacun des SERIAL des personnages des joueurs foreach (string c in charUIDs) { Mobile pm = null; // Le mobile qui sera créé found = false; // on remet found à false car on ne l'a pas encore trouvé bool woman = false; // dans le cas on on serait sur une femme il faut s'en souvenir bool hasHouse = false; // On parcourt toutes les lignes du fichier contenant les personnages foreach (string line in File.ReadAllLines(SphereFiles.playerFile)) { // Si l'on recontre une femme on s'en souvient pour lui mettre des seins ! if (line.StartsWith("[WORLDCHAR")) woman = line.Contains("woman"); // Si l'on tombe sur le SERIAL du joueur que l'on cherche on peut passer au traitement if (line.StartsWith("SERIAL=")) { if (line.Split('=')[1] == c) { found = true; continue; } } // On est sur le bon joueur, il faut en extraire les informations if (found) { // Si le Mobile est encore null on l'instancie et on l'initialise if (pm == null) { pm = new PlayerMobile(); pm.Player = true; // !!! nécessaire pour lire le paperdoll pm.AccessLevel = AccessLevel.Player; pm.Map = Map.Internal; // pour que le joueur soit déconnecté pm.LogoutLocation = new Point3D(3503, 2574, 14); // endroit de départ des joueurs pm.LogoutMap = Map.Trammel; // map de départ des joueurs pm.BodyValue = (woman ? 401 : 400); pm.Female = woman; pm.SkillsCap = 7000; // skill cap de 700 pm.StatCap = 225; // stat cap de 225 // Ajoutons un backpack au joueur pour qu'il puisse y ranger ses affaires Container pack = pm.Backpack; if (pack == null) { pack = new Backpack(); pack.Movable = false; pm.AddItem(pack); } // Une cape pour les vétérans ! pm.Backpack.DropItem(new VeteranCloak()); } // Si l'on arrive sur un autre joueur on ajoute l'actuel et on continue de chercher // les éventuels autres joueurs du compte if (line.StartsWith("[")) { // Effectuons quelques petits trucs avant d'ajouter le joueur sur le compte getHair(c, pm); // on récupère et on remet les cheveux du joueur getGold(c, pm); // on récupère l'or du joueur dressPlayer(pm); // on habille le joueur // On remet au joueur un cheque s'il avait une maison if (hasHouse) { Container bank = pm.BankBox; if (bank != null) { BankCheck check = new BankCheck(50000); check.Name = "Rémunération Maison"; bank.DropItem(check); } } hasHouse = false; // On remet de l'argent au joueur en fonction du temps joué sur Sphere if (totalTime > 0) { Container bank = pm.BankBox; if (bank != null) { BankCheck check = new BankCheck((int)(totalTime / (charUIDs.Count * 1.0))); check.Name = "Temps joué"; bank.DropItem(check); } } // Et maintenant on ajoute le joueur au compte à la première place libre for (int i = 0; i < a.Length; ++i) { if (a[i] == null) { a[i] = pm; break; } } pm = null; break; } #region Traitement des différentes propriétés à importer // Nom if (line.StartsWith("NAME=")) pm.Name = line.Split('=')[1]; // Body Hue else if (line.StartsWith("COLOR=")) pm.Hue = Int32.Parse(line.Split('=')[1], NumberStyles.HexNumber); // Body Hue si corps différent else if (pm.Hue == 0 && line.StartsWith("OSKIN=")) pm.Hue = Int32.Parse(line.Split('=')[1], NumberStyles.HexNumber); // Description paperdoll else if (line.StartsWith("PROFILE=")) pm.Profile = line.Split('=')[1].Replace("\\r", "\r"); // Force else if (line.StartsWith("STR=")) pm.Str = Int32.Parse(line.Split('=')[1]); // Int else if (line.StartsWith("INT=")) pm.Int = Int32.Parse(line.Split('=')[1]); // Dex else if (line.StartsWith("DEX=")) pm.Dex = Int32.Parse(line.Split('=')[1]); // Karma else if (line.StartsWith("KARMA=")) pm.Karma = Int32.Parse(line.Split('=')[1]); // Fame else if (line.StartsWith("FAME=")) pm.Fame = Int32.Parse(line.Split('=')[1]); // Female else if (line.StartsWith("FAME=")) pm.Fame = Int32.Parse(line.Split('=')[1]); // Titre RP else if (line.StartsWith("TITLE=")) pm.Title = line.Split('=')[1]; // Pour la rémunération de la maison else if (line.StartsWith("HOME=")) hasHouse = true; /* Position X,Y,Z else if (line.StartsWith("P=")) { string[] location = line.Split('=')[1].Split(','); pm.Location = new Point3D(Int32.Parse(location[0]), Int32.Parse(location[1]), Int32.Parse(location[2])); } */ // Alchemy else if (line.StartsWith("Alchemy=")) pm.Skills[SkillName.Alchemy].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Anatomy else if (line.StartsWith("Anatomy=")) pm.Skills[SkillName.Anatomy].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Animal Lore else if (line.StartsWith("AnimalLore=")) pm.Skills[SkillName.AnimalLore].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Archery else if (line.StartsWith("Archery=")) pm.Skills[SkillName.Archery].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Arms Lore else if (line.StartsWith("ArmsLore=")) pm.Skills[SkillName.ArmsLore].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Begging else if (line.StartsWith("Begging=")) pm.Skills[SkillName.Begging].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Blacksmithing else if (line.StartsWith("Blacksmithing=")) pm.Skills[SkillName.Blacksmith].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Bowcraft else if (line.StartsWith("Bowcraft=")) pm.Skills[SkillName.Fletching].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Camping else if (line.StartsWith("Camping=")) pm.Skills[SkillName.Camping].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Carpentry else if (line.StartsWith("Carpentry=")) pm.Skills[SkillName.Carpentry].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Cartography else if (line.StartsWith("Cartography=")) pm.Skills[SkillName.Cartography].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Cooking else if (line.StartsWith("Cooking=")) pm.Skills[SkillName.Cooking].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //DetectingHidden else if (line.StartsWith("DetectingHidden=")) pm.Skills[SkillName.DetectHidden].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Enticement else if (line.StartsWith("Enticement=")) pm.Skills[SkillName.Discordance].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //EvaluatingIntel else if (line.StartsWith("EvaluatingIntel=")) pm.Skills[SkillName.EvalInt].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Fencing else if (line.StartsWith("Fencing=")) pm.Skills[SkillName.Fencing].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Fishing else if (line.StartsWith("Fishing=")) pm.Skills[SkillName.Fishing].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Forensics else if (line.StartsWith("Forensics=")) pm.Skills[SkillName.Forensics].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Healing else if (line.StartsWith("Healing=")) pm.Skills[SkillName.Healing].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Herding else if (line.StartsWith("Herding=")) pm.Skills[SkillName.Herding].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Hiding else if (line.StartsWith("Hiding=")) pm.Skills[SkillName.Hiding].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Inscription else if (line.StartsWith("Inscription=")) pm.Skills[SkillName.Inscribe].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //ItemID else if (line.StartsWith("ItemID=")) pm.Skills[SkillName.ItemID].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //LockPicking else if (line.StartsWith("LockPicking=")) pm.Skills[SkillName.Lockpicking].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Lumberjacking else if (line.StartsWith("Lumberjacking=")) pm.Skills[SkillName.Lumberjacking].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Macefighting else if (line.StartsWith("Macefighting=")) pm.Skills[SkillName.Macing].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Magery else if (line.StartsWith("Magery=")) pm.Skills[SkillName.Magery].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //MagicResistance else if (line.StartsWith("MagicResistance=")) pm.Skills[SkillName.MagicResist].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Meditation else if (line.StartsWith("Meditation=")) pm.Skills[SkillName.Meditation].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Mining else if (line.StartsWith("Mining=")) pm.Skills[SkillName.Mining].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Musicianship else if (line.StartsWith("Musicianship=")) pm.Skills[SkillName.Musicianship].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Necromancy else if (line.StartsWith("Necromancy=")) pm.Skills[SkillName.Necromancy].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Parrying else if (line.StartsWith("Parrying=")) pm.Skills[SkillName.Parry].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Peacemaking else if (line.StartsWith("Peacemaking=")) pm.Skills[SkillName.Peacemaking].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Poisoning else if (line.StartsWith("Poisoning=")) pm.Skills[SkillName.Poisoning].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Provocation else if (line.StartsWith("Provocation=")) pm.Skills[SkillName.Provocation].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //RemoveTrap else if (line.StartsWith("RemoveTrap=")) pm.Skills[SkillName.RemoveTrap].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //SpiritSpeak else if (line.StartsWith("SpiritSpeak=")) pm.Skills[SkillName.SpiritSpeak].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Stealth else if (line.StartsWith("Stealth=")) pm.Skills[SkillName.Stealth].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); // Swordsmanship else if (line.StartsWith("Swordsmanship=")) pm.Skills[SkillName.Swords].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Tactics else if (line.StartsWith("Tactics=")) pm.Skills[SkillName.Tactics].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Tailoring else if (line.StartsWith("Tailoring=")) pm.Skills[SkillName.Tailoring].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Taming else if (line.StartsWith("Taming=")) pm.Skills[SkillName.AnimalTaming].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //TasteID else if (line.StartsWith("TasteID=")) pm.Skills[SkillName.TasteID].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Tinkering else if (line.StartsWith("Tinkering=")) pm.Skills[SkillName.Tinkering].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Tracking else if (line.StartsWith("Tracking=")) pm.Skills[SkillName.Tracking].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Snooping else if (line.StartsWith("Snooping=")) pm.Skills[SkillName.Snooping].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Stealing else if (line.StartsWith("Stealing=")) pm.Skills[SkillName.Stealing].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Veterinary else if (line.StartsWith("Veterinary=")) pm.Skills[SkillName.Veterinary].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); //Wrestling else if (line.StartsWith("Wrestling=")) pm.Skills[SkillName.Wrestling].BaseFixedPoint = Int32.Parse(line.Split('=')[1]); #endregion // On cap les skills à 100 maxi ! for (int i = 0; i < pm.Skills.Length; i++) { Skill skill = pm.Skills[i]; if (skill.Base > 100) skill.Base = 100; } } } } // Ajoutons un commentaire pour indiquer l'importation des personnages à cette date if (a.Count > 0 && a is Account) ((Account)a).Comments.Add(new AccountComment("SphereImporter", a.Count + " players imported from Sphere save file.")); } catch (Exception ex) { Console.WriteLine("SpherePlayerMobileImporter.EventSink_AccountLogin : " + ex.Message); } }