Ejemplo n.º 1
0
 /// <summary>
 /// Grants EoC for using a skill
 /// </summary>
 private static void OnSkillUsed(SkillUsedEventArgs args)
 {
     if (args.Mobile.Player)
     {
         ((Player)args.Mobile).EssenceOfCharacter++;
     }
 }
Ejemplo n.º 2
0
        private static void OnSkillUsed(SkillUsedEventArgs args)
        {
            try
            {
                Skill[] recentSkills;

                if (!(skillCache.ContainsKey(args.Mobile)))
                {
                    recentSkills    = new Skill[3];
                    recentSkills[0] = args.Skill;
                    recentSkills[1] = args.Skill;
                    recentSkills[2] = args.Skill;
                    skillCache.Add(args.Mobile, recentSkills);

                    if (args.Mobile is Player)
                    {
                        ((Player)args.Mobile).EssenceOfCharacter += 3;
                    }
                }

                else
                {
                    recentSkills = skillCache[args.Mobile];

                    bool repititionThreshold =
                        (recentSkills[0].ToString() == args.Skill.ToString() ||
                         recentSkills[1].ToString() == args.Skill.ToString() ||
                         recentSkills[2].ToString() == args.Skill.ToString());

                    if (!repititionThreshold)
                    {
                        if (recentSkills[1] != null)
                        {
                            recentSkills[2] = recentSkills[1];
                        }
                        if (recentSkills[0] != null)
                        {
                            recentSkills[1] = recentSkills[0];
                        }

                        recentSkills[0] = args.Skill;

                        if (args.Mobile is Player)
                        {
                            ((Player)args.Mobile).EssenceOfCharacter += 3;
                        }
                    }
                }
            }

            catch { }
        }
        private async void _skillUseService_SkillCountIncremented(object sender, SkillUsedEventArgs e)
        {
            AddSkillIfNotExists(e.UsedSkill);

            var skillCount = CurrentSkillCollection.FirstOrDefault(x => x.SkillName == e.UsedSkill.Name);

            if (skillCount != null)
            {
                skillCount.Increment();

                await UpdateSkillTextAsync();
            }

            SkillUseCollection.Add(new SkillUseEntity()
            {
                UseDate        = DateTime.Now,
                SkillName      = e.UsedSkill.Name,
                SkillShortName = e.UsedSkill.ShortName,
            });
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Grants EoC for using a skill
 /// </summary>
 private static void OnSkillUsed( SkillUsedEventArgs args )
 {
     if( args.Mobile.Player )
     {
         ((Player)args.Mobile).EssenceOfCharacter++;
     }
 }
Ejemplo n.º 5
0
        private static void OnSkillUsed( SkillUsedEventArgs args )
        {
            try
            {
                Skill[] recentSkills;

                if (!(skillCache.ContainsKey(args.Mobile)))
                {
                    recentSkills = new Skill[3];
                    recentSkills[0] = args.Skill;
                    recentSkills[1] = args.Skill;
                    recentSkills[2] = args.Skill;
                    skillCache.Add(args.Mobile, recentSkills);

                    if (args.Mobile is Player)
                    {
                        ((Player)args.Mobile).EssenceOfCharacter += 3;
                    }
                }

                else
                {
                    recentSkills = skillCache[args.Mobile];

                    bool repititionThreshold =
                        (recentSkills[0].ToString() == args.Skill.ToString()
                        || recentSkills[1].ToString() == args.Skill.ToString()
                        || recentSkills[2].ToString() == args.Skill.ToString());

                    if (!repititionThreshold)
                    {
                        if (recentSkills[1] != null) recentSkills[2] = recentSkills[1];
                        if (recentSkills[0] != null) recentSkills[1] = recentSkills[0];

                        recentSkills[0] = args.Skill;

                        if (args.Mobile is Player)
                        {
                            ((Player)args.Mobile).EssenceOfCharacter += 3;
                        }
                    }
                }
            }

            catch { }
        }