Beispiel #1
0
        // first hack erekose
        private void brutalConversationAddOnQuestEnd(Quest quest)
        {
            if (ActorSNO.Id == 4580) // for now only leah is concerned :p
            {
                Logger.Debug(" (brutalCOnversationAssOnQuestEnd) called on quest {0} for actor with dynamic ID {1} ", quest.SNOHandle.Id, DynamicID);
                if (quest.IsDone())
                {
                    // check if NPC has the conversation in its inherited ConversationList
                    if ((ConversationList != null))
                        if (ConversationList.ConversationListEntries != null)
                            if (ConversationList.ConversationListEntries.Count > 0)
                            {
                                var convlistentries = ConversationList.ConversationListEntries;
                                bool l_found = false;
                                foreach (var convlistentry in convlistentries)
                                {
                                    if (convlistentry.SNOConv == 198541)
                                    {
                                        Logger.Debug(" (brutalCOnversationAssOnQuestEnd) NPC has the conversation 198541 in it inherited ConversationList ");
                                        l_found = true;
                                        break;
                                    }
                                }
                                if (!l_found)
                                    Logger.Debug(" (brutalCOnversationAssOnQuestEnd) NPC DOES NOT HAVE THE conversation 198541 in it inherited ConversationList !! THIS IS BAD !!");
                            }
                    //else
                    //{
                    //    Logger.Debug(" (brutalCOnversationAssOnQuestEnd) the inherited ConversationList IS NULL OR EMPTY WTF ????");
                    //}

                    Logger.Debug(" (brutalCOnversationAssOnQuestEnd) quest is marked as done trying to get the conversation lists ");
                    // looking for conversation in the whole conversation set !!! 
                    var conv_assets = Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation];
                    var convs = from conv_asset in conv_assets.Values
                                where (conv_asset.Data as Mooege.Common.MPQ.FileFormats.Conversation).SNOQuest == quest.SNOHandle.Id
                                select (conv_asset.Data as Mooege.Common.MPQ.FileFormats.Conversation);
                    foreach (var conv in convs)
                    {
                        int[] tab = { conv.SNOAltNpc1, conv.SNOAltNpc2, conv.SNOAltNpc3, conv.SNOAltNpc4, conv.SNOPrimaryNpc };
                        if (tab.Contains(ActorSNO.Id))
                        {
                            Logger.Debug(" (brutalCOnversationAssOnQuestEnd) Trying to add conversation : INTERACTIVE NPC {0} is present in Conversation {1} SNO alt NPC where : {2}", ActorSNO.Id, conv.Header.SNOId, tab);
                            if (Conversations.Exists(x => x.ConversationSNO == conv.Header.SNOId))
                            {
                                //RAS 
                                Logger.Debug(" (brutalCOnversationAssOnQuestEnd) already present doing nothing ");
                            }
                            else
                            {
                                Logger.Debug(" (brutalCOnversationAssOnQuestEnd) added !!");
                                Conversations.Add(new ConversationInteraction(conv.Header.SNOId));
                            }
                        }
                    }

                }
            }

        }
Beispiel #2
0
 /// <summary>
 /// Rewrite the quest handling event
 /// </summary>
 /// <param name="quest"></param>
 protected override void quest_OnQuestProgress(Quest quest)
 {
     //Spawn if this is spawner
     if (World.Game.Quests.IsInQuestRange(_questRange))
     {
         this.Spawn();
     }
 }
Beispiel #3
0
        protected override void quest_OnQuestProgress(Quest quest) // shadows Actors'Mooege.Core.GS.Actors.InteractiveNPC.quest_OnQuestProgress(Mooege.Core.GS.Games.Quest)'
        {
            // call base classe update range stuff            

            UpdateQuestRangeVisbility();
            // Logger.Debug(" (quesy_OnQuestProgress) has been called -> updatin conversaton list ");
            UpdateConversationList();
            UpdateConversationQuestList(quest);
            // brutalConversationAddOnQuestEnd(quest);
        }
Beispiel #4
0
 void quest_OnQuestProgress(Quest quest)
 {
     UpdateConversationList();
 }
Beispiel #5
0
            public QuestStep(Mooege.Common.MPQ.FileFormats.IQuestStep assetQuestStep, Quest quest)
            {
                _questStep = assetQuestStep;
                _quest = quest;
                int c = 0;

                foreach (var objectiveSet in assetQuestStep.StepObjectiveSets)
                    ObjectivesSets.Add(new ObjectiveSet()
                    {
                        FollowUpStepID = objectiveSet.FollowUpStepID,
                        Objectives = new List<QuestObjective>(from objective in objectiveSet.StepObjectives select new QuestObjective(objective, this, c++))
                    });
                c = 0;

                if (assetQuestStep is Mooege.Common.MPQ.FileFormats.QuestStep)
                {
                    var step = assetQuestStep as Mooege.Common.MPQ.FileFormats.QuestStep;

                    if (step.StepBonusObjectiveSets != null)
                        foreach (var objectiveSet in step.StepBonusObjectiveSets)
                            bonusObjectives.Add(new List<QuestObjective>(from objective in objectiveSet.StepBonusObjectives select new QuestObjective(objective, this, c++)));
                }
            }
Beispiel #6
0
            public QuestStep(Mooege.Common.MPQ.FileFormats.IQuestStep assetQuestStep, Quest quest)
            {
                _questStep = assetQuestStep;
                _quest = quest;
                int c = 0;

                foreach (var objectiveSet in assetQuestStep.StepObjectiveSets)
                {
                    ObjectivesSets.Add(new ObjectiveSet()
                    {
                        FollowUpStepID = objectiveSet.FollowUpStepID,
                        Objectives = new List<QuestObjective>(from objective in objectiveSet.StepObjectives select new QuestObjective(objective, this, c++))
                    });                                        
                }
                c = 0;

                if (assetQuestStep is Mooege.Common.MPQ.FileFormats.QuestStep)
                {
                    var step = assetQuestStep as Mooege.Common.MPQ.FileFormats.QuestStep;

                    if (step.StepBonusObjectiveSets != null)
                        foreach (var objectiveSet in step.StepBonusObjectiveSets)
                        {                            
                            bonusObjectives.Add(new List<QuestObjective>(from objective in objectiveSet.StepBonusObjectives select new QuestObjective(objective, this, c++)));                            
                        }

                }

                if (quest.SNOHandle.Id == 72095)
                {
                    Logger.Debug(" (questStep ctor) Displaying objectives sets for quest {0}-{1}  in step {2} (if any) ", quest.SNOHandle.Id, quest.SNOHandle.Name, quest.CurrentStep);

                    int i = 0;
                    foreach (var objective_set in ObjectivesSets)
                    {
                        Logger.Debug(" ObjectiveSet number {0}", i++);
                        foreach (var objective in objective_set.Objectives)
                        {
                            Logger.Debug("(questStep ctor) % objective has ID {0}, type {1}, value {2}, counter {4}, sub quest step {3} ", objective.ID, objective.ObjectiveType, objective.ObjectiveValue, objective.questStep.QuestStepID, objective.Counter);
                            Logger.Debug("(questStep ctor) % objective in string is {0}", objective.ToString());
                        }
                    }

                    Logger.Debug(" (questStep ctor) Displaying bonus objectives for quest {0} in step {1} (if any) ", quest.SNOHandle, quest.CurrentStep);

                    i = 0;
                    foreach (var bonus_objective_set in bonusObjectives)
                    {
                        Logger.Debug(" Bonus Objective list number {0}", i++);
                        foreach (var bonus_objective in bonus_objective_set)
                        {
                            Logger.Debug("(questStep ctor) % bonus objective has ID {0}, type {1}, value {2}, counter {4}, sub quest step {3} ", bonus_objective.ID, bonus_objective.ObjectiveType, bonus_objective.ObjectiveValue, bonus_objective.questStep.QuestStepID, bonus_objective.Counter);
                            Logger.Debug("(questStep ctor) % bonus objective in string is {0}", bonus_objective.ToString());
                        }
                    }
                    Logger.Debug("(questStep ctor)  _questStep ID{0} ", _questStep.ID);
                    //Logger.Debug("(questStep ctor)  _quest SNOHandle{0} CurrentStep Q", _quest.SNOHandle, _quest.CurrentStep.QuestStepID);
                }
            }
Beispiel #7
0
        private void UpdateConversationQuestList(Quest quest)
        {
            if ((ActorSNO.Id == 4580) && DynamicID == 83) // for now only the Leah near the stash
            {
                if (quest.IsDone())
                {
                    if (ConversationList != null) // this is from Actor
                    {
                        var ConversationsNew = new List<int>();
                        foreach (var entry in ConversationList.ConversationListEntries) // again on actor
                        {                        
                            if (entry.SNOQuestComplete == quest.SNOHandle.Id)   // we'll refine later...
                                ConversationsNew.Add(entry.SNOConv);
                        }

                        // remove outdates conversation options and add new ones
                        Conversations = Conversations.Where(x => ConversationsNew.Contains(x.ConversationSNO)).ToList(); // this is in the InteractiveNPC
                        foreach (var sno in ConversationsNew)
                            if (!Conversations.Select(x => x.ConversationSNO).Contains(sno))
                                Conversations.Add(new ConversationInteraction(sno));

                        // search for an unread questconversation
                        bool questConversation = false;
                        foreach (var conversation in Conversations) // this is in the InteractiveNPC
                            if (Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation].ContainsKey(conversation.ConversationSNO))
                                if ((Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Conversation][conversation.ConversationSNO].Data as Mooege.Common.MPQ.FileFormats.Conversation).I0 == 1)
                                    if (conversation.Read == false)
                                    {
                                        // Logger.Debug(" (UpdateConversationList) for actor {0}-{1} has unread quest conversation no {2}: ", ActorSNO.Id, ActorSNO.Name, conversation.ConversationSNO);
                                        questConversation = true;
                                    }

                        // show the exclamation mark if actor has an unread quest conversation
                        Attributes[GameAttribute.Conversation_Icon, 0] = questConversation ? 1 : 0;
                        Attributes.BroadcastChangedIfRevealed();
                    }
                }
            }
        }