public override void DoAction(Command p_command)
        {
            CastSpellCommand castSpellCommand = (CastSpellCommand)p_command;

            m_spell = castSpellCommand.Spell;
            m_targets.Clear();
            if (castSpellCommand.TargetCharacter != null)
            {
                m_targets.Add(castSpellCommand.TargetCharacter);
            }
            else
            {
                m_spell.GetTargets(m_targets);
            }
            if (castSpellCommand.Scroll != null)
            {
                castSpellCommand.Spell.CastSpell(Character, true, castSpellCommand.Scroll.ScrollTier, m_targets);
                Party.Inventory.ConsumeSuccess(castSpellCommand.Scroll);
                Party.MuleInventory.ConsumeSuccess(castSpellCommand.Scroll);
            }
            else
            {
                castSpellCommand.Spell.CastSpell(Character, false, 0, m_targets);
            }
        }
Beispiel #2
0
        public bool CanLaunchSpell(CharacterSpell spell, long target)
        {
            if (spell.LevelModel.TurnNumber > 0)
            {
                if (myCooldown.ContainsKey(spell.ID) && myCooldown[spell.ID].Cooldown > 0)
                {
                    return(false);
                }
            }

            if (spell.LevelModel.MaxPerTurn > 0)
            {
                if (myTargets.ContainsKey(spell.ID) && myTargets[spell.ID].Count >= spell.LevelModel.MaxPerTurn)
                {
                    return(false);
                }
            }

            if (spell.LevelModel.MaxPerPlayer > 0)
            {
                if (myTargets.ContainsKey(spell.ID) && myTargets[spell.ID].Count(x => x.Target == target) >= spell.LevelModel.MaxPerPlayer)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #3
0
        public bool CanLaunchSpell(Fighter fighter, CharacterSpell spell, int spellCell, long target)
        {
            if (fighter != myCurrentFighter)
            {
                return(false);
            }

            //if (!myMap.RushablesCells.Contains(spellCell))
            //    return false;

            if (fighter.AP < spell.LevelModel.Cost)
            {
                return(false);
            }

            int distance = Pathfinding.GetDistanceBetween(myMap, fighter.Cell, spellCell);
            int maxPO    = spell.LevelModel.MaxRP + (spell.LevelModel.isAlterablePO ? fighter.Stats.GetStat(StatEnum.PO).Total : 0);

            if (maxPO < spell.LevelModel.MinRP)
            {
                maxPO = spell.LevelModel.MinRP;
            }

            if (distance > maxPO || distance < spell.LevelModel.MinRP)
            {
                return(false);
            }

            return(fighter.SpellController.CanLaunchSpell(spell, target));
        }
Beispiel #4
0
 private void InitPropertyDescription()
 {
     if (SpellID > 0)
     {
         CharacterSpell characterSpell = SpellFactory.CreateCharacterSpell((ECharacterSpell)SpellID);
         if (characterSpell != null)
         {
             GameConfig game = ConfigManager.Instance.Game;
             Single     p_magicFactor;
             if (ScrollTier == 1)
             {
                 p_magicFactor = game.ScrollNoviceMagicFactor;
             }
             else if (ScrollTier == 2)
             {
                 p_magicFactor = game.ScrollExpertMagicFactor;
             }
             else if (ScrollTier == 3)
             {
                 p_magicFactor = game.ScrollMasterMagicFactor;
             }
             else
             {
                 p_magicFactor = game.ScrollGrandmasterMagicFactor;
             }
             m_properties["SCROLL_EFFECT"]            = characterSpell.NameKey;
             m_properties["SCROLL_SPELL_DESCRIPTION"] = characterSpell.GetDescription(p_magicFactor);
         }
     }
 }
Beispiel #5
0
        public override void Execute(TriggerBase trigger)
        {
            MonsterTemplate monsterTemplate = trigger.Get <MonsterTemplate>("monster");
            Character       target          = base.GetTarget(trigger);

            foreach (MonsterSpell current in monsterTemplate.Grades.FirstOrDefault <MonsterGrade>().SpellsTemplates)
            {
                CharacterSpell characterSpell = target.Spells.LearnSpell(current.SpellId);
                if (characterSpell != null)
                {
                    trigger.Reply("'{0}' learned the spell '{1}'", new object[]
                    {
                        trigger.Bold(target),
                        trigger.Bold(characterSpell.Template.Name)
                    });
                }
                else
                {
                    trigger.ReplyError("Spell {0} not learned. Unknow reason", new object[]
                    {
                        trigger.Bold(current.SpellId)
                    });
                }
            }
        }
Beispiel #6
0
        public void OnLaunchSpell(CharacterSpell spell, long target)
        {
            if (spell.LevelModel.TurnNumber > 0)
            {
                if (myCooldown.ContainsKey(spell.ID))
                {
                    myCooldown[spell.ID].Cooldown = spell.LevelModel.TurnNumber;
                }
                else
                {
                    myCooldown.Add(spell.ID, new SpellCooldown(spell.LevelModel.TurnNumber));
                }
            }

            if (spell.LevelModel.MaxPerTurn > 0 || spell.LevelModel.MaxPerPlayer > 0)
            {
                if (myTargets.ContainsKey(spell.ID))
                {
                    myTargets[spell.ID].Add(new SpellTarget(target));
                }
                else
                {
                    myTargets.Add(spell.ID, new List <SpellTarget> {
                        new SpellTarget(target)
                    });
                }
            }
        }
        public void TrackSpellLearned(CharacterSpell p_spell, Character p_character)
        {
            TrackingData trackingData = new TrackingData("SPELL_LEARNED");

            trackingData.AddAttribute("SpellId", p_spell.StaticID);
            trackingData.AddAttribute("Class", p_character.Class.StaticData.StaticID);
            SendTrackingData(trackingData);
        }
 public QuickActionDragObject(ActionButtonView p_view)
 {
     m_view       = p_view;
     m_type       = p_view.Type;
     m_item       = p_view.Item;
     m_spell      = p_view.Spell;
     m_spritename = p_view.Icon;
 }
Beispiel #9
0
 private void AddSpell(CharacterSpell spell, Boolean p_canLearn)
 {
     if (m_spellSlots.Count <= m_spellCounter)
     {
         AddSpellSlot();
     }
     m_spellSlots[m_spellCounter].SetSpell(spell, p_canLearn);
     NGUITools.SetActiveSelf(m_spellSlots[m_spellCounter].gameObject, true);
     m_spellCounter++;
 }
 public override void Finish()
 {
     foreach (Monster monster in m_finishedMonsters)
     {
         monster.HitAnimationDone.Reset();
     }
     m_finishedMonsters.Clear();
     m_targets.Clear();
     m_spell = null;
 }
Beispiel #11
0
        public void Fill(CharacterSpell p_spell)
        {
            m_name.UpdateText(LocaManager.GetText(p_spell.NameKey));
            Single num = m_outerPadding + m_name.Size.y + m_innerPadding;

            m_itemSlot.SetSpell(p_spell.StaticData.Icon);
            m_itemSlot.HideItem();
            m_itemSlot.UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
            m_description.MinHeight     = m_itemSlot.Size.y;
            m_description.VerticalAlign = TooltipGroup.Align.CENTER;
            if (p_spell.StaticData.ManaCost > 0)
            {
                m_description.UpdateText(LocaManager.GetText("SPELLBOOK_SPELL_MANA", p_spell.StaticData.ManaCost));
            }
            else
            {
                m_description.UpdateText(LocaManager.GetText("SPELL_DESCRIPTION_MANA_ALL"));
            }
            m_description.UpdatePositionY(-num);
            num += m_description.Size.y + m_innerPadding;
            Character selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
            Single    magicFactor       = p_spell.GetMagicFactor(selectedCharacter, false, 0);

            m_details.UpdateText(p_spell.GetDescription(magicFactor));
            m_details.UpdatePositionY(-num);
            num += m_details.Size.y + m_innerPadding;
            m_requirements.SetVisible(true);
            SkillStaticData staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_spell.StaticData.SkillID);
            String          text       = LocaManager.GetText(staticData.Name);
            String          text2      = LocaManager.GetText("SKILL_TIER_" + (Int32)p_spell.StaticData.Tier);
            Boolean         flag;

            if (p_spell.StaticData.ClassOnly == EClass.NONE)
            {
                flag = IsSkillRequirementFulfilled((Int32)p_spell.StaticData.SkillID, p_spell.StaticData.Tier);
                m_requirements.UpdateText(LocaManager.GetText("SKILL_TIER_REQUIREMENT_TT", text, text2));
            }
            else
            {
                flag = selectedCharacter.Class.IsAdvanced;
                String str = (selectedCharacter.Gender != EGender.MALE) ? "_F" : "_M";
                if (p_spell.StaticData.SkillID == ESkillID.SKILL_WARFARE)
                {
                    m_requirements.UpdateText(LocaManager.GetText("ABILITY_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
                else
                {
                    m_requirements.UpdateText(LocaManager.GetText("SPELL_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
            }
            m_requirements.UpdatePositionY(-num);
            m_requirements.Label.color = ((!flag) ? Color.red : Color.white);
            num += m_requirements.Size.y + m_innerPadding;
            m_background.Scale(m_name.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Beispiel #12
0
        private void InitSpellView(CharacterSpell p_spell)
        {
            Character selectedCharacter = m_party.SelectedCharacter;

            if (m_currentViewNr >= m_page * 11 && m_currentViewNr < (m_page + 1) * 11)
            {
                Int32 num = m_currentViewNr - m_page * 11;
                m_spellViews[num].SetSpell(p_spell, selectedCharacter);
            }
            m_currentViewNr++;
        }
Beispiel #13
0
        public void Show(MonoBehaviour p_caller, CharacterSpell p_spell, Vector3 p_position, Vector3 p_offset)
        {
            m_tooltipCaller = p_caller;
            m_spellTooltip.Fill(p_spell);
            m_position = UICamera.currentCamera.WorldToScreenPoint(p_position);
            Single p_xOffset = m_tooltipOffset + 0.5f * m_spellTooltip.Scale.x + p_offset.x;
            Single p_yOffset = m_tooltipOffset + p_offset.y;

            AdjustAlignment(p_xOffset, p_yOffset, m_spellTooltip.Scale.x + p_offset.x, m_spellTooltip.Scale.y, EVerticalAlignmentType.MIDDLE);
            AdjustPosition();
            m_spellTooltip.Show();
        }
Beispiel #14
0
        public static void HandleGameActionFightSpellCastRequest(GameActionFightCastRequestMessage message, WorldClient client)
        {
            if (client.Character.Fighting)
            {
                CharacterSpell spell = client.Character.Fighter.GetSpell(message.spellId);

                if (spell != null)
                {
                    client.Character.Fighter.CastSpell(spell.Template, spell.Grade, message.cellId);
                }
            }
        }
Beispiel #15
0
        protected override void DoExecute()
        {
            CharacterSpell characterSpell = SpellFactory.CreateCharacterSpell((ECharacterSpell)m_spellID);

            if (characterSpell != null)
            {
                characterSpell.CastSpellByInteractiveObject(m_magicFactor);
                FinishExecution();
                return;
            }
            throw new Exception("Invalid spell ID " + m_spellID);
        }
 public Boolean CouldLearnSpell(CharacterSpell p_spell)
 {
     if (p_spell != null && p_spell.StaticData != null && GetSpell(p_spell.SpellType) == null)
     {
         Skill skill = m_character.SkillHandler.FindSkill((Int32)p_spell.StaticData.SkillID);
         if (skill != null && skill.MaxTier >= p_spell.StaticData.Tier)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #17
0
        private static int DoSpellAttack(Character attacker, Character opponent, CharacterSpell characterSpell)
        {
            int damage = characterSpell.Spell.Damage + (new Random().Next(attacker.Intelligence));

            damage -= new Random().Next(opponent.Defense);

            if (damage > 0)
            {
                opponent.HitPoint -= damage;
            }

            return(damage);
        }
 public void UpdateSpells()
 {
     m_spells.Clear();
     foreach (TradingSpellOffer tradingSpellOffer in m_offers)
     {
         if (tradingSpellOffer.CheckConditions(m_npc) == EDialogState.NORMAL)
         {
             foreach (Int32 p_spellType in tradingSpellOffer.OfferData.SpellIDs)
             {
                 CharacterSpell item = SpellFactory.CreateCharacterSpell((ECharacterSpell)p_spellType);
                 m_spells.Add(item);
             }
         }
     }
 }
Beispiel #19
0
 public static void HandleGameActionFightCastOnTargetRequestMessage(WorldClient client, GameActionFightCastOnTargetRequestMessage message)
 {
     if (client.Character.IsFighting())
     {
         CharacterSpell spell = client.Character.Spells.GetSpell((int)message.spellId);
         if (spell != null)
         {
             FightActor oneFighter = client.Character.Fight.GetOneFighter(message.targetId);
             if (oneFighter != null)
             {
                 client.Character.Fighter.CastSpell(spell, oneFighter.Cell);
             }
         }
     }
 }
Beispiel #20
0
        public void BuySpell()
        {
            Party          party = LegacyLogic.Instance.WorldManager.Party;
            CharacterSpell spell = m_selectedSpell.Spell;

            if (party.Gold >= spell.GetCalculatedCosts())
            {
                Character selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
                selectedCharacter.SpellHandler.AddSpell((ECharacterSpell)spell.StaticID);
                party.ChangeGold(-spell.GetCalculatedCosts());
                UpdateSpells();
                SelectSpellSlot(null);
                UpdateScrollBar();
            }
        }
Beispiel #21
0
 public void SetSpell(CharacterSpell p_spell, Character p_character)
 {
     NGUITools.SetActive(gameObject, true);
     m_isForStandardAction = false;
     m_isForPassiveAbility = false;
     m_visible             = true;
     m_spell           = p_spell;
     m_character       = p_character;
     m_labelName.text  = LocaManager.GetText(m_spell.StaticData.NameKey);
     m_labelMana.text  = LocaManager.GetText("SPELLBOOK_SPELL_MANA", p_spell.StaticData.ManaCost);
     m_icon.atlas      = m_spellsAtlas;
     m_hasSpell        = m_character.SpellHandler.HasSpell(p_spell.SpellType);
     m_icon.spriteName = m_spell.StaticData.Icon;
     NGUITools.SetActiveSelf(m_iconItem.gameObject, false);
     UpdateData();
 }
Beispiel #22
0
        public static void HandleClientSummonVanityPet(WorldSession session, ClientSummonVanityPet summonVanityPet)
        {
            CharacterSpell spell = session.Player.SpellManager.GetSpell(summonVanityPet.Spell4BaseId);

            if (spell == null)
            {
                throw new InvalidPacketValueException();
            }

            byte tier = session.Player.SpellManager.GetSpellTier(spell.BaseInfo.Entry.Id);

            session.Player.CastSpell(new SpellParameters
            {
                SpellInfo = spell.BaseInfo.GetSpellInfo(tier)
            });
        }
Beispiel #23
0
        public static void HandleCastSpell(WorldSession session, ClientCastSpell castSpell)
        {
            Item item = session.Player.Inventory.GetItem(InventoryLocation.Ability, castSpell.BagIndex);

            if (item == null)
            {
                throw new InvalidPacketValueException();
            }

            CharacterSpell characterSpell = session.Player.SpellManager.GetSpell(item.Id);

            if (characterSpell == null)
            {
                throw new InvalidPacketValueException();
            }

            characterSpell.Cast();
        }
        public void AddSpell(ECharacterSpell p_spell, Boolean p_track)
        {
            if (HasSpell(p_spell))
            {
                return;
            }
            CharacterSpell characterSpell = SpellFactory.CreateCharacterSpell(p_spell);

            if (CanLearnSpell(characterSpell))
            {
                m_spells.Add(characterSpell);
                if (p_track)
                {
                    LegacyLogic.Instance.TrackingManager.TrackSpellLearned(characterSpell, m_character);
                    LegacyLogic.Instance.EventManager.InvokeEvent(m_character, EEventType.CHARACTER_LEARNED_SPELL, EventArgs.Empty);
                }
            }
        }
Beispiel #25
0
        public static void HandleGameActionFightCastOnTargetRequest(GameActionFightCastOnTargetRequestMessage message, WorldClient client)
        {
            if (client.Character.Fighting)
            {
                CharacterSpell spell   = client.Character.Fighter.GetSpell(message.spellId);
                Fighter        fighter = client.Character.Fighter.Fight.GetFighter((int)message.targetId);

                if (spell != null && fighter != null)
                {
                    if (fighter.CanBeTargeted(client.Character))
                    {
                        client.Character.Fighter.CastSpell(spell.Template, spell.Grade, fighter.CellId, fighter.Id);
                    }
                }
                else
                {
                    client.Character.ReplyError("Fatal error while casting spell!!");
                }
            }
        }
Beispiel #26
0
 public static void HandleGameActionFightCastRequestMessage(WorldClient client, GameActionFightCastRequestMessage message)
 {
     if (client.Character.IsFighting())
     {
         CharacterSpell spell = client.Character.Spells.GetSpell((int)message.spellId);
         if (spell != null)
         {
             client.Character.Fighter.CastSpell(spell, client.Character.Fight.Map.Cells[(int)message.cellId]);
         }
         else
         {
             var summons = client.Character.Fighter.GetSummons();
             var caster  = summons.Where(x => x.GetSpell((int)message.spellId) != null).FirstOrDefault();
             if (caster != null)
             {
                 Spell sp = caster.GetSpell(message.spellId);
                 caster.CastSpell(sp, client.Character.Fight.Map.Cells[(int)message.cellId]);
             }
         }
     }
 }
Beispiel #27
0
        public override void Execute(TriggerBase trigger)
        {
            SpellTemplate  spellTemplate  = trigger.Get <SpellTemplate>("spell");
            Character      target         = base.GetTarget(trigger);
            CharacterSpell characterSpell = target.Spells.LearnSpell(spellTemplate);

            if (characterSpell != null)
            {
                trigger.Reply("'{0}' learned the spell '{1}'", new object[]
                {
                    trigger.Bold(target),
                    trigger.Bold(spellTemplate.Name)
                });
            }
            else
            {
                trigger.ReplyError("Spell {0} not learned. Unknow reason", new object[]
                {
                    trigger.Bold(spellTemplate.Name)
                });
            }
        }
        public override Boolean CanDoAction(Command p_command)
        {
            CastSpellCommand castSpellCommand = (CastSpellCommand)p_command;
            CharacterSpell   spell            = castSpellCommand.Spell;

            m_spell = spell;
            Boolean flag = Character.ConditionHandler.HasCondition(ECondition.CONFUSED) && spell.StaticData.SkillID != ESkillID.SKILL_WARFARE;

            if (flag)
            {
                return(false);
            }
            Boolean flag2 = !Character.Equipment.IsMeleeAttackWeaponEquiped() && spell.StaticData.SkillID == ESkillID.SKILL_WARFARE;

            if (flag2)
            {
                return(false);
            }
            Boolean flag3 = spell.CheckSpellConditions(Character);

            if (flag3 && m_spell.TargetType == ETargetType.SUMMON && m_spell.HasResources(Character))
            {
                return(true);
            }
            List <Object> targets = spell.GetTargets();

            if (targets != null && targets.Count == 1 && targets[0] is Monster)
            {
                if (LegacyLogic.Instance.WorldManager.Party.SelectedMonster != null && !LegacyLogic.Instance.WorldManager.Party.SelectedMonster.IsAttackable)
                {
                    return(false);
                }
                if (!((Monster)targets[0]).IsAttackable)
                {
                    return(false);
                }
            }
            return((spell.TargetType == ETargetType.SINGLE_PARTY_MEMBER || targets.Count > 0) && (spell.HasResources(Character) || castSpellCommand.Scroll != null) && flag3);
        }
Beispiel #29
0
        public async Task <CharacterSpell> UpdateCharacterSpell(CharacterSpell characterSpell)
        {
            var cs = _context.CharacterSpells.Find(characterSpell.CharacterSpellId);

            if (cs == null)
            {
                return(characterSpell);
            }
            try
            {
                cs.CharacterId = characterSpell.CharacterId;
                cs.IsMemorized = characterSpell.IsMemorized;
                cs.SpellId     = characterSpell.SpellId;
                _context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(cs);
        }
 private void CastSpell()
 {
     if (Scroll != null)
     {
         CharacterSpell   p_spell   = SpellFactory.CreateCharacterSpell((ECharacterSpell)Scroll.SpellID);
         CastSpellCommand p_command = new CastSpellCommand(p_spell, null, Scroll);
         LegacyLogic.Instance.CommandManager.AddCommand(p_command);
     }
     else
     {
         CastSpellCommand p_command2 = new CastSpellCommand(Spell, null, null);
         LegacyLogic.Instance.CommandManager.AddCommand(p_command2);
     }
     if (Result == SpiritBeaconEventArgs.EResult.SET_POINT)
     {
         LegacyLogic.Instance.WorldManager.SpiritBeaconController.Action = ESpiritBeaconAction.SET_POINT;
     }
     else if (Result == SpiritBeaconEventArgs.EResult.TRAVEL)
     {
         LegacyLogic.Instance.WorldManager.SpiritBeaconController.Action = ESpiritBeaconAction.TRAVEL;
     }
 }
        /// <summary>
        /// 
        /// </summary>
        internal bool SaveNewCreature()
        {
            XPQuery<CharacterBase> characters = new XPQuery<CharacterBase>( OneDatabase.Session );

            var characterList = from character in characters
                                where character.Oid == m_CharacterAccountGuid
                                select character;

            if ( characterList.Count() > WOW_MAX_CHARACTER_COUNT ) // 人物过多
                return false;

            CharacterBase newCharacter = new CharacterBase( OneDatabase.Session );
            this.Serial = newCharacter.Oid;
            newCharacter.CharacterName = this.Name;
            //newCharacter.Account = this.AccountGuid;
            newCharacter.Gender = (byte)this.Gender;
            newCharacter.Skin = (byte)this.Skin;
            newCharacter.Face = (byte)this.Face;
            newCharacter.HairStyle = (byte)this.HairColor;
            newCharacter.HairColor = (byte)this.HairColor;
            newCharacter.FacialHair = (byte)this.FacialHair;
            newCharacter.Race = (byte)this.Race;
            newCharacter.Class = (int)this.Class;
            newCharacter.Level = (int)this.Level;
            newCharacter.MapId = (int)this.MapId;
            newCharacter.ZoneId = (int)this.ZoneId;
            newCharacter.PositionX = this.X;
            newCharacter.PositionY = this.Y;
            newCharacter.PositionZ = this.Z;
            newCharacter.Orientation = this.O;
            newCharacter.Guild = null;
            // 人物的坐骑航线标记点 32位值|32位值|32位值|32位值
            // 00000000000000000000000000000000|...|...|...
            // 以位域标示 1~TaxiId~32| 32~TaxiId~64|65~TaxiId~96|96~TaxiId~128
            newCharacter.TaxiMask = this.TaxiMask;
            newCharacter.IsGhost = false;
            newCharacter.IsCinematic = false;
            newCharacter.IsNeedRename = false;
            newCharacter.TotalTime = 0;
            newCharacter.LevelTime = 0;
            newCharacter.LogoutTime = DateTime.Now;
            newCharacter.CreatingTime = DateTime.Now;
            newCharacter.IsBanned = false;
            newCharacter.IsDelete = false;
            newCharacter.DeleteTime = DateTime.Now;

            CharacterHomeBind newCharacterHomeBind = new CharacterHomeBind( OneDatabase.Session );
            //newCharacterHomeBind.Owner = newCharacter.Oid;
            newCharacterHomeBind.MapId = (int)this.BindMapId;
            newCharacterHomeBind.ZoneId = (int)this.BindZoneId;
            newCharacterHomeBind.PositionX = this.BindX;
            newCharacterHomeBind.PositionY = this.BindY;
            newCharacterHomeBind.PositionZ = this.BindZ;

            foreach ( BaseSkill baseSkill in SkillManager.ToArray() )
            {
                WowSkill wowSkill = baseSkill as WowSkill;
                if ( wowSkill == null )
                    continue;

                if ( wowSkill.Serial != 0 )
                    continue;

                WowSkillTemplate wowSkillTemplate = wowSkill.SkillTemplate as WowSkillTemplate;
                if ( wowSkillTemplate == null )
                    continue;

                CharacterSkill newCharactersSkill = new CharacterSkill( OneDatabase.Session );
                wowSkill.Serial = newCharactersSkill.Oid;

                //newCharactersSkill.Owner = newCharacter.Oid;
                newCharactersSkill.SkillId = wowSkillTemplate.Serial;
                newCharactersSkill.Value = wowSkill.Level;
            }

            foreach ( BaseSpell baseSpell in SpellManager.ToArray() )
            {
                WowSpell wowSpell = baseSpell as WowSpell;
                if ( wowSpell == null )
                    continue;

                if ( wowSpell.Serial != 0 )
                    continue;

                WowSpellTemplate wowSpellTemplate = baseSpell.SpellTemplate as WowSpellTemplate;
                if ( wowSpellTemplate == null )
                    continue;

                CharacterSpell newCharacterSpell = new CharacterSpell( OneDatabase.Session );
                wowSpell.Serial = newCharacterSpell.Oid;

                //newCharacterSpell.Owner = newCharacter.Oid;
                newCharacterSpell.SpellId = wowSpellTemplate.Serial;
                //newCharacterSpell.Slot = baseSpell.Slot;
            }

            foreach ( WowActionBar baseActionBar in ActionBarManager.ToArray() )
            {
                WowActionBar wowActionBar = baseActionBar as WowActionBar;
                if ( baseActionBar == null )
                    continue;

                if ( wowActionBar.Serial != 0 )
                    continue;

                CharacterActionBar newCharactersAction = new CharacterActionBar( OneDatabase.Session );
                wowActionBar.Serial = newCharactersAction.Oid;

                //newCharactersAction.Owner= newCharacter.Oid;
                newCharactersAction.Slot = wowActionBar.ActionBarSlotId;
                newCharactersAction.ActionId = wowActionBar.Action;
                newCharactersAction.ActionType = wowActionBar.Type;
            }

            foreach ( BaseItem baseItem in BagManager.EquipmentBag.SubItemsToArray() )
            {
                WowItem wowItem = baseItem as WowItem;
                if ( wowItem == null )
                    continue;

                if ( wowItem.Serial != 0 )
                    continue;

                WowItemTemplate wowItemTemplate = wowItem.ItemTemplate as WowItemTemplate;
                if ( wowItemTemplate == null )
                    continue;

                CharacterItem newCharactersItem = new CharacterItem( OneDatabase.Session );
                wowItem.Serial = newCharactersItem.Oid;

                //newCharactersItem.Owner = newCharacter.Oid;
                newCharactersItem.ItemTemplateGuid = (ulong)wowItemTemplate.Serial;
                newCharactersItem.Amount = (int)wowItem.Amount;
                newCharactersItem.BagId = (int)BagManager.EquipmentBag.Item.SlotId;
                newCharactersItem.SlotId = (int)wowItem.SlotId;
            }

            foreach ( WowReputation baseReputation in ReputationManager.ToArray() )
            {
                WowReputation wowReputation = baseReputation as WowReputation;
                if ( wowReputation == null )
                    continue;

                if ( wowReputation.Serial != 0 )
                    continue;

                CharacterReputation newCharacterReputation = new CharacterReputation( OneDatabase.Session );
                wowReputation.Serial = newCharacterReputation.Oid;

                //newCharacterReputation.Owner = newCharacter.Oid;
                newCharacterReputation.FactionId = wowReputation.FactionId;
                newCharacterReputation.Reputation = wowReputation.Reputation;
                newCharacterReputation.Flag = wowReputation.Flag;
            }

            return true;
        }