public override void Notify(DOLEvent e, object sender, EventArgs args)
        {
            if (e == AreaEvent.PlayerEnter)
            {
                AreaEventArgs kargs = args as AreaEventArgs;

                if (m_owner is GamePlayer && kargs.GameObject != m_owner)
                {
                    return;
                }

                foreach (AbstractArea area in kargs.GameObject.CurrentAreas)
                {
                    if (area is KeepArea && (area as KeepArea).Keep == m_keep)
                    {
                        FinishMission();
                        break;
                    }
                }
            }
            else if (e == KeepEvent.KeepTaken)
            {
                KeepEventArgs kargs = args as KeepEventArgs;

                if (kargs.Keep != m_keep)
                {
                    return;
                }

                ExpireMission();
            }
        }
Example #2
0
        protected virtual void OnAreaOpened(object sender, AreaEventArgs e)
        {
            EventHandler <AreaEventArgs> handler = AreaOpened;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
Example #3
0
        protected static void PlayerEnterThirdFieldArea(DOLEvent e, object sender, EventArgs args)
        {
            AreaEventArgs   aargs  = args as AreaEventArgs;
            GamePlayer      player = aargs.GameObject as GamePlayer;
            GreenerPastures quest  = player.IsDoingQuest(typeof(GreenerPastures)) as GreenerPastures;

            if (quest != null && quest.Step == 3)
            {
                player.Out.SendDialogBox(eDialogCode.SimpleWarning, 0x00, 0x00, 0x00, 0x00, eDialogType.Ok, true, "You've located the last field on Asma's \nMap. Turning over the map, you jot down \na few notes about your impressions. \nYour quest journal has been updated.");
                quest.Step = 4;
            }
        }
Example #4
0
        // MOUSE CLICK => Execute JScript code in "MetaData" Property

        void areaMap1_AreaMouseClick(object sender, AreaEventArgs data)
        {
            /*
             * object Args = (object)(new object[]{_modelName});
             * try
             * {
             *  Base.GetXSI().ExecuteScriptCode("function TK_Execute(SelfModelName){" + data.Area.MetaData + "}", "JScript", "TK_Execute", ref Args);
             * }
             * catch (Exception)
             * {
             * }
             * */
        }
        /// <summary>
        /// Checks the trigger, this method is called whenever a event associated with this questparts quest
        /// or a manualy associated eventhandler is notified.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public override bool Check(DOLEvent e, object sender, EventArgs args)
        {
            bool       result = false;
            GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args);

            if (e == AreaEvent.PlayerLeave)
            {
                AreaEventArgs aArgs = (AreaEventArgs)args;
                result |= aArgs.GameObject == player && I == aArgs.Area;
            }

            return(result);
        }
        private void Editor_AreaSelected(object sender, AreaEventArgs e)
        {
            // 这个事件会在创建选区时触发
            if (toolPanel.Visible)
            {
                toolPanel.Hide();
            }
            FixToolbarPosition(e.Rect, toolbarMask);

            if (!toolbarMask.Visible)
            {
                toolbarMask.Show();
            }
        }
Example #7
0
        private void Editor_AreaSelected(object sender, AreaEventArgs e)
        {
            // 这个事件会在创建选区时触发
            if (toolPanel.Visible)
            {
                toolPanel.Hide();
            }

            toolbarMask.Left = e.Rect.X;
            // 2: 边框大小
            toolbarMask.Top = e.Rect.Y + e.Rect.Height + 2;

            if (!toolbarMask.Visible)
            {
                toolbarMask.Show();
            }
        }
Example #8
0
        private void Editor_AreaSelected(object sender, AreaEventArgs e)
        {
            selectedArea = e.Rect;
            //TopMost = false;
            //this.ShowInTaskbar = true;
            // 这个事件会在创建选区时触发
            if (toolPanel.Visible)
            {
                toolPanel.Hide();
            }
            FixToolbarPosition(e.Rect, toolbarMask);

            if (!toolbarMask.Visible)
            {
                toolbarMask.Show();
            }
        }
Example #9
0
        protected static void PlayerEnterAskefruerArea(DOLEvent e, object sender, EventArgs args)
        {
            AreaEventArgs aargs  = args as AreaEventArgs;
            GamePlayer    player = aargs.GameObject as GamePlayer;
            Nuisances     quest  = player.IsDoingQuest(typeof(Nuisances)) as Nuisances;

            if (quest != null && quest.askefruer == null && quest.Step == 1)
            {
                // player near grove
                SendSystemMessage(player, "It's Fallen Askefruer! Quickly now, /use your box to capture the Askefruer! To USE an item, right click on the item and type /use.");
                quest.CreateAskefruer();

                foreach (GamePlayer visPlayer in quest.askefruer.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    visPlayer.Out.SendSpellCastAnimation(quest.askefruer, 1, 20);
                }
            }
        }
Example #10
0
        protected static void PlayerEnterSluaghArea(DOLEvent e, object sender, EventArgs args)
        {
            AreaEventArgs aargs  = args as AreaEventArgs;
            GamePlayer    player = aargs.GameObject as GamePlayer;
            Nuisances     quest  = player.IsDoingQuest(typeof(Nuisances)) as Nuisances;

            if (quest != null && quest.sluagh == null && quest.Step == 1)
            {
                // player near grove
                SendSystemMessage(player, "Sluaghs! Quick! USE your Magical Wooden Box to capture the sluagh footsoldier! To USE an item, right click on the item and type /use.");
                quest.CreateSluagh();

                foreach (GamePlayer visPlayer in quest.sluagh.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
                {
                    visPlayer.Out.SendSpellCastAnimation(quest.sluagh, 1, 20);
                }
            }
        }
Example #11
0
        protected void EventHandler(DOLEvent e, Object sender, EventArgs arguments)
        {
            AreaEventArgs args = arguments as AreaEventArgs;

            if (args == null)
            {
                return;
            }
            GameLiving living = args.GameObject as GameLiving;

            if (living == null)
            {
                return;
            }
            if (!GameServer.ServerRules.IsAllowedToAttack(owner, living, true))
            {
                return;
            }
            getTargets();
        }
Example #12
0
        // MOUSE CLICK => Execute code in "MetaData" Property

        void areaMap1_AreaMouseClick(object sender, AreaEventArgs data)
        {
            if (!string.IsNullOrEmpty(data.Area.MetaData))
            {
                int mode = 0;
                if (ModifierKeys == Keys.Shift)
                {
                    mode = 1;
                }
                else if (ModifierKeys == Keys.Control)
                {
                    mode = 2;
                }
                else if (ModifierKeys == Keys.Alt)
                {
                    mode = 3;
                }

                _handler.ExecuteCode(data.Area.MetaData, mode);
            }
        }
Example #13
0
        protected static void PlayerEnterDemonBreachArea(DOLEvent e, object sender, EventArgs args)
        {
            AreaEventArgs aargs  = args as AreaEventArgs;
            GamePlayer    player = aargs.GameObject as GamePlayer;

            if (player == null)
            {
                return;
            }
            if (player.IsDoingQuest(typeof(ToReachTheBreach)) == null)
            {
                return;
            }

            ToReachTheBreach quest = player.IsDoingQuest(typeof(ToReachTheBreach)) as ToReachTheBreach;

            if (quest.Step == 1 && quest.FoundBreach.IsAchieved == false)
            {
                quest.FoundBreach.Advance();
                return;
            }
        }
Example #14
0
        protected static void PlayerEnterBurialTombArea(DOLEvent e, object sender, EventArgs args)
        {
            AreaEventArgs aargs  = args as AreaEventArgs;
            GamePlayer    player = aargs.GameObject as GamePlayer;

            if (player == null)
            {
                return;
            }
            if (player.IsDoingQuest(typeof(TombWithAView)) == null)
            {
                return;
            }

            TombWithAView quest = player.IsDoingQuest(typeof(TombWithAView)) as TombWithAView;

            if (quest.Step == 1 && !quest.FoundTomb.IsAchieved)
            {
                quest.FoundTomb.Advance();
                return;
            }
        }
Example #15
0
        public static GamePlayer GuessGamePlayerFromNotify(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = null;

            if (sender is GamePlayer)
            {
                player = sender as GamePlayer;
            }
            else if (e == GameLivingEvent.WhisperReceive || e == GameObjectEvent.Interact)
            {
                player = ((SourceEventArgs)args).Source as GamePlayer;
            }
            else if (e == GameLivingEvent.ReceiveItem || e == GameObjectEvent.ReceiveMoney)
            {
                player = ((SourceEventArgs)args).Source as GamePlayer;
            }
            else if (e == AreaEvent.PlayerEnter || e == AreaEvent.PlayerLeave)
            {
                AreaEventArgs aArgs = (AreaEventArgs)args;
                player = aArgs.GameObject as GamePlayer;
            }

            return(player);
        }