コード例 #1
0
ファイル: BaseQuest.cs プロジェクト: mywebext/DOL
        /// <summary>
        /// Add an interact item associated with a step for this quest
        /// </summary>
        /// <param name="step">What step is this item valid for</param>
        /// <param name="staticObjectName">the name of the static item to interact with</param>
        /// <param name="numRequired">How many times to interact before this step is complete</param>
        /// <param name="itemResult">What item is given to the player when interacting</param>
        /// <param name="interactText">Text presented to player when interacting with the object</param>
        protected void AddInteractStep(int step, string objectName, int numRequired, ItemTemplate itemResult, string interactText)
        {
            try
            {
                QuestStepInteraction info = new QuestStepInteraction();
                info.objectName   = objectName;
                info.numRequired  = numRequired;
                info.itemResult   = itemResult;
                info.interactText = interactText;

                m_interactions.Add(step, info);
            }
            catch (Exception ex)
            {
                log.Error("Error adding Interact Step, possible duplicate?", ex);
            }
        }
コード例 #2
0
ファイル: BaseQuest.cs プロジェクト: Los-Ojos/DOLSharp-1127
        /// <summary>
        /// We are interacting with an object, check to see if this quest and step needs to respond
        /// </summary>
        /// <param name="player"></param>
        /// <param name="staticItem"></param>
        protected void InteractWithObject(GamePlayer player, GameStaticItem staticItem)
        {
            if (_interactions.Count > 0)
            {
                if (_interactions.ContainsKey(Step))
                {
                    QuestStepInteraction info = _interactions[Step];

                    if (staticItem.Name == info.ObjectName)
                    {
                        if (GiveItem(player, info.ItemResult, false))
                        {
                            player.Out.SendMessage(info.InteractText, eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            staticItem.RemoveFromWorld(InteractItemRespawnSeconds);
                            OnObjectInteract(info);
                        }
                    }
                }
            }
        }
コード例 #3
0
ファイル: BaseQuest.cs プロジェクト: mywebext/DOL
        /// <summary>
        /// We are interacting with an object, check to see if this quest and step needs to respond
        /// </summary>
        /// <param name="player"></param>
        /// <param name="staticItem"></param>
        protected void InteractWithObject(GamePlayer player, GameStaticItem staticItem)
        {
            if (m_interactions.Count > 0)
            {
                if (m_interactions.ContainsKey(Step))
                {
                    QuestStepInteraction info = m_interactions[Step];

                    if (staticItem.Name == info.objectName)
                    {
                        if (GiveItem(player, info.itemResult, false))
                        {
                            player.Out.SendMessage(info.interactText, eChatType.CT_System, eChatLoc.CL_SystemWindow);
                            staticItem.RemoveFromWorld(INTERACT_ITEM_RESPAWN_SECONDS);
                            OnObjectInteract(info);
                        }
                    }
                }
            }
        }
コード例 #4
0
ファイル: BaseQuest.cs プロジェクト: mynew4/DAoC
 /// <summary>
 /// When an object is interacted with this message is sent after world item is removed and inventory item added
 /// </summary>
 /// <param name="info"></param>
 protected virtual void OnObjectInteract(QuestStepInteraction info)
 {
     // this is needed in order to support both Base and Reward quests
     log.Error("Override OnObjectInteract to advance goal progress");
 }
コード例 #5
0
ファイル: BaseQuest.cs プロジェクト: mynew4/DAoC
        /// <summary>
        /// Add an interact item associated with a step for this quest
        /// </summary>
        /// <param name="step">What step is this item valid for</param>
        /// <param name="staticObjectName">the name of the static item to interact with</param>
        /// <param name="numRequired">How many times to interact before this step is complete</param>
        /// <param name="itemResult">What item is given to the player when interacting</param>
        /// <param name="interactText">Text presented to player when interacting with the object</param>
        protected void AddInteractStep(int step, string objectName, int numRequired, ItemTemplate itemResult, string interactText)
        {
            try
            {
                QuestStepInteraction info = new QuestStepInteraction();
                info.objectName = objectName;
                info.numRequired = numRequired;
                info.itemResult = itemResult;
                info.interactText = interactText;

                m_interactions.Add(step, info);
            }
            catch (Exception ex)
            {
                log.Error("Error adding Interact Step, possible duplicate?", ex);
            }
        }
コード例 #6
0
ファイル: BaseQuest.cs プロジェクト: Los-Ojos/DOLSharp-1127
 /// <summary>
 /// When an object is interacted with this message is sent after world item is removed and inventory item added
 /// </summary>
 /// <param name="info"></param>
 protected virtual void OnObjectInteract(QuestStepInteraction info)
 {
     // this is needed in order to support both Base and Reward quests
     Log.Error("Override OnObjectInteract to advance goal progress");
 }