예제 #1
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            base.Notify(e, sender, args);
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

            AbstractQuest quest = player.IsDoingQuest(typeof(BonesToBlades));

            if (quest == null)
            {
                return;
            }

            if (Step > 0 && e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                for (int i = 0; i < mobTypes.Length; i++)
                {
                    if (gArgs.Target.Name.IndexOf(mobTypes[i]) >= 0)
                    {
                        InventoryItemRequirement requirement = new InventoryItemRequirement(null, armBone, 2, eComparator.Less);
                        if (requirement.Check(e, player, args))
                        {
                            GiveItemAction action = new GiveItemAction(null, armBone, null);
                            action.Perform(e, sender, args);
                        }

                        if (!requirement.Check(e, player, args))
                        {
                            if (quest.Step == 1)
                            {
                                quest.Step = 2;
                            }
                        }

                        return;
                    }
                }
            }
        }
예제 #2
0
        public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            base.Notify(e, sender, args);
            GamePlayer player = sender as GamePlayer;

            if (player == null)
                return;

            AbstractQuest quest = player.IsDoingQuest(typeof(BonesToBlades));
            if (quest == null)
                return;

            if (Step > 0 && e == GameLivingEvent.EnemyKilled)
            {
                EnemyKilledEventArgs gArgs = (EnemyKilledEventArgs)args;
                for (int i = 0; i < mobTypes.Length; i++)
                {
                    if (gArgs.Target.Name.IndexOf(mobTypes[i]) >= 0)
                    {
                        InventoryItemRequirement requirement = new InventoryItemRequirement(null, armBone, 2, eComparator.Less);
                        if (requirement.Check(e, player, args))
                        {
                            GiveItemAction action = new GiveItemAction(null, armBone, null);
                            action.Perform(e, sender, args);
                        }

                        if (!requirement.Check(e, player, args))
                        {
                            if (quest.Step == 1)
                            {
                                quest.Step = 2;
                            }
                        }

                        return;
                    }
                }
            }
        }