Ejemplo n.º 1
0
 public static void OnKilledBy(OnKilledByEventArgs e)
 {
     if (e.KilledBy is PlayerMobile)
     {
         CheckCreature((PlayerMobile)e.KilledBy, e.Killed);
     }
 }
        private void EventSink_OnKilledBy(OnKilledByEventArgs e)
        {
            var player = e.KilledBy as PlayerMobile;

            if (player != null && e.Killed.GetType() == m_Mobile)
            {
                AchievmentSystem.SetAchievementStatus(player, this, 1);
            }
        }
Ejemplo n.º 3
0
        public static void OnKilledBy(OnKilledByEventArgs e)
        {
            if (e.KilledBy is PlayerMobile && e.Killed is BaseCreature)
            {
                var qs = ((PlayerMobile)e.KilledBy).Quest;

                if (qs != null)
                {
                    qs.OnKill((BaseCreature)e.Killed, e.Killed.Corpse);
                }
            }
        }
Ejemplo n.º 4
0
        public static void OnKilledBy(OnKilledByEventArgs e)
        {
            if (e.KilledBy is PlayerMobile pm && e.Killed is BaseCreature bc)
            {
                QuestSystem qs = pm.Quest;

                if (qs != null)
                {
                    qs.OnKill(bc, bc.Corpse);
                }
            }
        }
Ejemplo n.º 5
0
 public static void OnKilledBy(OnKilledByEventArgs e)
 {
     OnKilledBy(e.Killed, e.KilledBy);
 }
Ejemplo n.º 6
0
 public static void OnKilledBy(OnKilledByEventArgs e)
 {
     HandleKill(e.Killed, e.KilledBy);
 }
Ejemplo n.º 7
0
        private void EventSink_OnKilledBy(OnKilledByEventArgs e)
        {
            if (!this.Enabled)
            {
                return;
            }

            BaseCreature creature = null;
            PlayerMobile player   = null;

            if (e.Killed is BaseCreature)
            {
                creature = (BaseCreature)e.Killed;
            }

            if (e.KilledBy is PlayerMobile)
            {
                player = (PlayerMobile)e.KilledBy;
            }

            SlayerModule module = player.GetModule(typeof(SlayerModule)) as SlayerModule;

            if (module == null)
            {
                module = new SlayerModule(player);
            }

            if (m_CrossReference.ContainsKey(creature.GetType()))
            {
                foreach (Int32 index in m_CrossReference[creature.GetType()])
                {
                    if (index < m_TitleDefinitions.Count && m_TitleDefinitions[index].CreatureRegistry.Contains(creature.GetType()))
                    {
                        TitleDefinition def = m_TitleDefinitions[index];

                        module.IncrementCounter(def.DefinitionName);

                        Int32      value      = module.GetSlayerCount(def.DefinitionName);
                        TitleEntry titleToSet = null;

                        foreach (TitleEntry entry in def.TitleRegistry)
                        {
                            if (entry.CountNeeded == value)
                            {
                                titleToSet = entry;
                            }
                        }

                        if (titleToSet != null)
                        {
                            foreach (TitleEntry entry in def.TitleRegistry)
                            {
                                if (player.CollectionTitles.Contains(entry.Title) && entry != titleToSet)
                                {
                                    player.CollectionTitles.Remove(entry.Title);
                                }
                            }

                            player.AddCollectionTitle(titleToSet.Title);
                            player.SendSound(0x3D);
                            player.SendMessage(0xC8, String.Format("Your have been awarded the title of '{0}' for {1} kills.", titleToSet.Title, value));

                            if (TitleAwarded != null)
                            {
                                TitleAwarded(player, def.DefinitionName, titleToSet.Title);
                            }

                            if (IsMaxTitle(titleToSet.Title, def.TitleRegistry) && MaximumTitleAchieved != null)
                            {
                                MaximumTitleAchieved(player, def.DefinitionName, titleToSet.Title);
                            }
                        }
                    }
                }
            }
        }