Exemplo n.º 1
0
 static List<QuestStartCondition> GetConditions(Quest quest, string name)
 {
     List<String> conds = new List<string>();
     Utility<Quest>.Instance.Export(quest, name, conds);
     List<QuestStartCondition> startConditions = new List<QuestStartCondition>();
     if (conds.Count > 0) {
         foreach (string cond in conds) {
             string[] parseString = cond.Split(new string[] { " ", "," },
                                               StringSplitOptions.RemoveEmptyEntries);
             var finalConds = new Dictionary<int, QuestStep>();
             var condition = new QuestStartCondition();
             condition.questSteps = new List<QuestStep>();
             foreach (string c in parseString) {
                 string[] condData = c.Split('_');
                 string questIdStep = (condData.Length > 1 ? condData[1] : condData[0]).TrimStart('q', 'Q');
                 condData = questIdStep.Split(':');
                 int questId = Int32.Parse(condData[0]);
                 int rewardNo = 0;
                 if (condData.Length > 1)
                     rewardNo = Int32.Parse(condData[1]);
                 QuestStep qs = new QuestStep(questId, rewardNo);
                 if (finalConds.ContainsKey(questId)) {
                     QuestStep qsOld = finalConds[questId];
                 } else {
                     finalConds.Add(questId, qs);
                 }
             }
             condition.questSteps = finalConds.OrderBy(p => p.Key).Select(p => p.Value).ToList();
             startConditions.Add(condition);
         }
     }
     return startConditions;
 }
Exemplo n.º 2
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     //Logger.Debug(" (QuestObjective ctor) creating an objective with ID {0}, QuestStepObjective {1} and QuestStep ID {2}", id, objective.Group1Name, questStep.QuestStepID);
     ID = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Exemplo n.º 3
0
 public QuestStepData(QuestData questData, QuestStep questStep)
 {
     StepId = questStep.StepId;
     Name = questStep.Name;
     Objectives = new List<QuestStepObjectiveData>();
     foreach (var stepObjective in questStep.QuestStepObjectiveSet.QuestStepObjectives)
     {
         Objectives.Add(new QuestStepObjectiveData(questData, this, stepObjective));
     }
 }
Exemplo n.º 4
0
 public static bool AddQuestStep(string target,QuestStep questStep)
 {
     int i = getQuest (target);
     if (i < questLog2.Length && i>-1) {
         questLog2 [i].AppendQuestStep (questStep);
         return true;
     }
     else
         return false;
 }
Exemplo n.º 5
0
	public void LoadQuestStep(QuestStep step, int totalSteps, int thisStep)
	{
		activeQuestStep = step;
		isItemTask = false;
		for (int i = 0; i < step.Tasks.Count; i++) {
			if(step.Tasks[i].TaskType == TaskTypeEnum.BringItem)
				isItemTask = true;
		}
		questStepNumberLabel.text = thisStep + "/" + totalSteps;
		LoadQuestPage();
	}
Exemplo n.º 6
0
                public QuestObjective(Game game, Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
                {
                    ID = id;
                    this.objective = objective;
                    this.questStep = questStep;
                    this.game = game;

                    //TODO: Rewrite all this as quests should subscribe to events and not objects notify quests
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillGroup)
                    {
                        logger.Debug("KillGroup objective");
                        foreach( var world in game._worlds.Values)
                        {
                            //subscribe to each actor in group destroy/kill event
                            var spawnerGroupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            //
                            foreach (var actor in spawnerGroupActors)
                            {
                                if (actor is Spawner)
                                {
                                    (actor as Spawner).Spawn();
                                }

                            }

                            var groupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            foreach (var actor in groupActors)
                            {
                                actor.ActorKilled += new EventHandler(actor_ActorKilled);
                            }
                        }                        
                    }
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster)
                    {
                    }
                }
Exemplo n.º 7
0
        private void QuestComposite(GameClient client)
        {
            var quest = client.Aisling.Quests.FirstOrDefault(i => i.Name == Mundane.Template.QuestKey);

            if (quest == null)
            {
                quest = new Quest {
                    Name = Mundane.Template.QuestKey
                };
                quest.LegendRewards.Add(new Legend.LegendItem
                {
                    Category = "Quest",
                    Color    = (byte)LegendColor.Blue,
                    Icon     = (byte)LegendIcon.Victory,
                    Value    = "Scratched Delta's Back."
                });
                quest.ExpRewards.Add(1000);
                quest.ExpRewards.Add(2000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);

                quest.SpellRewards.Add("beag ioc fein");

                client.Aisling.Quests.Add(quest);
            }

            quest.QuestStages = new List <QuestStep <Template> >();

            var q1 = new QuestStep <Template> {
                Type = QuestType.Accept
            };
            var q2 = new QuestStep <Template> {
                Type = QuestType.HasItem
            };

            q2.Prerequisites.Add(new QuestRequirement
            {
                Type   = QuestType.KillCount,
                Amount = 5,
                Value  = "Undead"
            });

            quest.QuestStages.Add(q1);
            quest.QuestStages.Add(q2);

            if (!quest.Started)
            {
                SequenceMenu.Invoke(client);
            }
            else if (quest.Started && !quest.Completed && !quest.Rewarded)
            {
                client.SendOptionsDialog(Mundane, "So your still alive?.. Look more zombies!!");
                quest.HandleQuest(client, SequenceMenu);
            }
            else if (quest.Completed)
            {
                client.SendOptionsDialog(Mundane, "Please, Don't ever come back here.....");
                client.TransitionToMap(client.Aisling.Map, new Position(56, 42));
            }
            else
            {
                SequenceMenu.Invoke(client);
            }
        }
Exemplo n.º 8
0
 public QueuedQuest(QuestStep p_quest, QuestChangedEventArgs.Type p_changeType)
 {
     m_quest      = p_quest;
     m_changeType = p_changeType;
 }
Exemplo n.º 9
0
 //most likely never used
 public void AddQuestStep(QuestStep target,int location)
 {
     questChain [location] = target;
 }
Exemplo n.º 10
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     ID = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Exemplo n.º 11
0
        private List<int> completedSteps = new List<int>();           // this list has to be saved if quest progress should be saved. It is required to keep track of questranges

        public Quest(Game game, int SNOQuest)
        {
            this.game = game;
            //SNOId = SNOQuest;
            SNOName = new SNOName() { SNOId = SNOQuest, Group = SNOGroup.Quest };
            asset = MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Quest][SNOQuest].Data as Mooege.Common.MPQ.FileFormats.Quest;
            CurrentStep = new QuestStep(asset.QuestUnassignedStep, this);
        }
Exemplo n.º 12
0
 string StepContextString(QuestStep qs)
 {
     string str = "";
     switch (qs.CompType)
     {
         case QuestStep.CompletionType.KillMonster:
         case QuestStep.CompletionType.GoToLocation:
         case QuestStep.CompletionType.CollectItem:
             str = qs.CompTargetID.ToString();
             break;
         case QuestStep.CompletionType.ReachLevel:
             break;  // Empty
         case QuestStep.CompletionType.TalkToNPC:
             str = _npcs.ContainsKey(qs.CompTargetID) ? _npcs[qs.CompTargetID].ToString() : "Unknown";
             break;
         case QuestStep.CompletionType.WearItem:
             if (_items.ContainsKey(qs.CompTargetID))
             {
                 NamedItemTemplate nit = _items[qs.CompTargetID];
                 str = nit.ToString();
             }
             else
                 str = qs.CompTargetID.ToString();
             break;
     }
     return str;
 }
	//display the first quest step of an unstarted quest
	public void DisplayQuestOutline(int questID)
	{
		activeQuest = GeneralData.GetQuestByID(questID);
		Debug.Log("active quest: " + activeQuest.ID);
		activeQuestStep = activeQuest.CurrentStep;
		DisplayQuestInfo(true);
	}
        private void QuestComposite(GameClient client)
        {
            var quest = client.Aisling.Quests.FirstOrDefault(i => i.Name == Mundane.Template.QuestKey);

            if (quest == null)
            {
                quest = new Quest {
                    Name = Mundane.Template.QuestKey
                };
                quest.LegendRewards.Add(new Legend.LegendItem
                {
                    Category = "Quest",
                    Color    = (byte)LegendColor.Brown,
                    Icon     = (byte)LegendIcon.Victory,
                    Value    = "Slaughtered some helpless cows."
                });
                quest.ExpRewards.Add(1000);
                quest.ExpRewards.Add(2000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);

                client.Aisling.Quests.Add(quest);
            }
            quest.QuestStages = new List <QuestStep <Template> >();


            var q1 = new QuestStep <Template> {
                Type = QuestType.Accept
            };
            var q2 = new QuestStep <Template> {
                Type = QuestType.HasItem
            };

            q2.Prerequisites.Add(new QuestRequirement
            {
                Type   = QuestType.KillCount,
                Amount = 3,
                Value  = "Helpless Animal"
            });

            quest.QuestStages.Add(q1);
            quest.QuestStages.Add(q2);


            if (!quest.Started)
            {
                SequenceMenu.Invoke(client);
            }
            else if (quest.Started && !quest.Completed && !quest.Rewarded)
            {
                client.SendOptionsDialog(Mundane, "Murder them f**k'n cows.");
                quest.HandleQuest(client, SequenceMenu);
            }
            else if (quest.Completed)
            {
                client.SendOptionsDialog(Mundane, "Remember don't tell anyone i gave you that stuff. or it will be my ass that gets sodomized next.");
            }
            else
            {
                SequenceMenu.Invoke(client);
            }
        }
Exemplo n.º 15
0
	protected override void EditPart()
	{
		RPGQuest s = (RPGQuest)currentItem;

		s.isLogged = EditorUtils.Toggle (s.isLogged, "logged");
		s.repeatable = EditorUtils.Toggle(s.repeatable, "Repeatable");
		s.timed = EditorUtils.Toggle(s.timed, "timed");
		if(s.timed)
			s.timeLimit = EditorUtils.FloatField(s.timeLimit, "time limit");

		s.initialQuestLog = EditorUtils.TextField(s.initialQuestLog, "Initial quest log");
		
		s.finalQuestLog = EditorUtils.TextField(s.finalQuestLog, "Final quest log");

		EditorGUILayout.BeginHorizontal();
		EditorGUILayout.PrefixLabel("quest type:");
		s.questType = (QuestType)EditorGUILayout.EnumPopup(s.questType, GUILayout.Width(300));
		EditorGUILayout.EndHorizontal();
		if(s.questType == QuestType.collection)
		{
			if (GUILayout.Button("Add task", GUILayout.Width(400))) 
			{
				s.allTasks.Add(new Task());
			}
			
			foreach(Task task in s.allTasks)
			{
				DisplayTask(task);
				if (GUILayout.Button("Remove Task", GUILayout.Width(200)))
				{
					s.allTasks.Remove(task);
					break;
				}
		}
		}
		ConditionsUtils.Conditions(s.Conditions, Data);
		
		/*if (GUILayout.Button("Add reward", GUILayout.Width(400)))
		{
			Reward reward = new Reward();
			s.Rewards.Add(reward);
		}
		if (s.Rewards != null && s.Rewards.Count >0)
		{
			foreach(Reward reward in s.Rewards)
			{
				AddReward(reward);	
			}
		}*/
		EditorUtils.Separator();
		
		foreach(QuestStep questStep in s.questSteps)
		{
			EditorGUILayout.BeginVertical(skin.box);
			EditorGUILayout.LabelField("quest step:" + questStep.StepNumber.ToString());

			questStep.isMainStep = EditorUtils.Toggle(questStep.isMainStep, "is main step");
			questStep.overrideNPC = EditorUtils.Toggle(questStep.overrideNPC, "has override NPC");
			if(questStep.overrideNPC)
			{
				questStep.overrideNPCID = EditorUtils.IntPopup(questStep.overrideNPCID, Data.npcEditor.items, FieldTypeEnum.Middle);
				questStep.overrideNPCConversationID = EditorUtils.IntPopup(questStep.overrideNPCConversationID, Data.conversationEditor.items, FieldTypeEnum.Middle);
			}

			questStep.QuestLogNote = EditorUtils.TextField(questStep.QuestLogNote, "Quest log note");
			
			AddQuestStep(questStep);
			EditorGUILayout.EndVertical();
			if (GUILayout.Button("Remove Quest Step", GUILayout.Width(200)))
			{
				s.questSteps.Remove(questStep);
                break;
            }
		}
		
		if (GUILayout.Button("Add quest step", GUILayout.Width(400)))
		{
			QuestStep questStep = new QuestStep();
			s.questSteps.Add(questStep);
			questStep.StepNumber = s.questSteps.Count;
		}
		EditorUtils.Separator();

		foreach(LootItem item in s.allLoots)
		{
			DisplayLootItem( item );
			EditorGUILayout.BeginHorizontal();
			if (GUILayout.Button("Delete Loot", GUILayout.Width(200)))
			{
				s.allLoots.Remove(item);
				break;
			}
			EditorGUILayout.EndHorizontal();
		}

		EditorGUILayout.Separator();
		
		if (GUILayout.Button("Add Loot", GUILayout.Width(200)))
		{
			s.allLoots.Add(new LootItem());
		}
		
		currentItem = s;
	}
Exemplo n.º 16
0
	void AddQuestStep(QuestStep questStep)
	{
		if (GUILayout.Button("Add task", GUILayout.Width(400))) 
		{
			questStep.Tasks.Add(new Task());
		}
		
		foreach(Task task in questStep.Tasks)
		{
			DisplayTask(task);
			if (GUILayout.Button("Remove Task", GUILayout.Width(200)))
			{
				questStep.Tasks.Remove(task);
				break;
			}
		}
		
		EditorUtils.Separator();
	}
Exemplo n.º 17
0
        void SelectCompTarget(QuestStep qs)
        {
            tbCompletionTarget.Enabled = false;
            cbCompTarget.Visible = false;
            tbCompletionCount.Enabled = false;

            tbCompletionCount.Text = qs.CompCount.ToString();
            switch (qs.CompType)
            {
                case QuestStep.CompletionType.KillMonster:
                    // TODO: Monsters
                    tbCompletionCount.Enabled = true;
                    tbCompletionTarget.Enabled = true;
                    tbCompletionTarget.Text = qs.CompTargetID.ToString();
                    break;
                case QuestStep.CompletionType.GoToLocation:
                    // TODO: Locations
                    tbCompletionTarget.Enabled = true;
                    tbCompletionTarget.Text = qs.CompTargetID.ToString();
                    break;
                case QuestStep.CompletionType.CollectItem:
                    // TODO: Items
                    tbCompletionCount.Enabled = true;
                    tbCompletionTarget.Enabled = true;
                    tbCompletionTarget.Text = qs.CompTargetID.ToString();
                    break;
                case QuestStep.CompletionType.ReachLevel:
                    tbCompletionCount.Enabled = true;
                    break;
                case QuestStep.CompletionType.TalkToNPC:
                    cbCompTarget.Visible = true;
                    cbCompTarget.Items.Clear();
                    foreach (NPC npc in _npcs.Values)
                        cbCompTarget.Items.Add(npc);
                    cbCompTarget.SelectedItem = _npcs.ContainsKey(qs.CompTargetID) ? _npcs[qs.CompTargetID] : null;
                    break;
                case QuestStep.CompletionType.WearItem:
                    cbCompTarget.Visible = true;
                    cbCompTarget.Items.Clear();
                    foreach (NamedItemTemplate nit in _items.Values)
                    {
                        cbCompTarget.Items.Add(nit);
                    }
                    cbCompTarget.SelectedItem = null;
                    if (_items.ContainsKey(qs.CompTargetID))
                    {
                        NamedItemTemplate nit = _items[qs.CompTargetID];
                        cbCompTarget.SelectedItem = nit;
                    }
                    break;
            }
        }
Exemplo n.º 18
0
 void FixStepButtons(QuestStep qs)
 {
     btnStepUp.Enabled = false;
     btnStepDown.Enabled = false;
     int index = _selectedQuest.Steps.IndexOf(qs);
     btnStepUp.Enabled = (index > 0);
     btnStepDown.Enabled = (index < (_selectedQuest.Steps.Count - 1));
 }
Exemplo n.º 19
0
        private void btnNewStep_Click(object sender, EventArgs e)
        {
            // Create a new step
            QuestStep step = new QuestStep((byte)_selectedQuest.Steps.Count, QuestStep.CompletionType.TalkToNPC, 0, 0, 0, 0);
            step.New = true;

            // Add it to the quest
            _selectedQuest.Steps.Add(step);

            // Add it to the display
            SelectQuest(_selectedQuest);
        }
Exemplo n.º 20
0
        private List<int> completedSteps = new List<int>();           // this list has to be saved if quest progress should be saved. It is required to keep track of questranges

        public Quest(Game game, int SNOQuest)
        {
            this.game = game;
            SNOHandle = new SNOHandle(SNOGroup.Quest, SNOQuest);
            asset = SNOHandle.Target as Mooege.Common.MPQ.FileFormats.Quest;
            CurrentStep = new QuestStep(asset.QuestUnassignedStep, this);
        }
Exemplo n.º 21
0
 public void AddStep(QuestStep step)
 {
     m_stepById.Add(step.Id, step);
 }
Exemplo n.º 22
0
        private void QuestComposite(GameClient client)
        {
            var quest = client.Aisling.Quests.FirstOrDefault(i => i.Name == Mundane.Template.QuestKey);

            if (quest == null)
            {
                quest = new Quest {
                    Name = Mundane.Template.QuestKey
                };
                quest.LegendRewards.Add(new Legend.LegendItem
                {
                    Category = "Quest",
                    Color    = (byte)LegendColor.Blue,
                    Icon     = (byte)LegendIcon.Victory,
                    Value    = "Helped Gos kill some rats."
                });

                if (client.Aisling.Path == Class.Monk)
                {
                    quest.SkillRewards.Add(ServerContext.GlobalSkillTemplateCache["Wolf Fang Fist"]);
                }
                if (client.Aisling.Path == Class.Warrior)
                {
                    quest.SkillRewards.Add(ServerContext.GlobalSkillTemplateCache["Crasher"]);
                }

                client.Aisling.Quests.Add(quest);
            }

            quest.QuestStages = new List <QuestStep <Template> >();

            var q1 = new QuestStep <Template> {
                Type = QuestType.Accept
            };
            var q2 = new QuestStep <Template> {
                Type = QuestType.ItemHandIn
            };

            q2.Prerequisites.Add(new QuestRequirement
            {
                Type            = QuestType.ItemHandIn,
                Amount          = 10,
                TemplateContext = ServerContext.GlobalItemTemplateCache["rat shit"]
            });

            quest.QuestStages.Add(q1);
            quest.QuestStages.Add(q2);

            if (!quest.Started)
            {
                SequenceMenu.Invoke(client);
            }
            else if (quest.Started && !quest.Completed && !quest.Rewarded)
            {
                client.SendOptionsDialog(Mundane, "Where is the rat shit i need?");
                quest.HandleQuest(client, SequenceMenu);
            }
            else if (quest.Completed)
            {
                client.SendOptionsDialog(Mundane, "What a legend!");
            }
            else
            {
                SequenceMenu.Invoke(client);
            }
        }
	public void DisplayQuestStatus(int questID)
	{
		activeQuest = PlayerManager.Instance.Hero.questLog.GetCurrentQuestByID(questID);
		if(activeQuest != null)
		{
			activeQuestStep = activeQuest.CurrentStep;
			DisplayQuestInfo(false);
		}
	}
Exemplo n.º 24
0
                public QuestObjective(Game game, Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
                {
                    ID             = id;
                    this.objective = objective;
                    this.questStep = questStep;
                    this.game      = game;

                    //TODO: Rewrite all this as quests should subscribe to events and not objects notify quests
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillGroup)
                    {
                        logger.Debug("KillGroup objective");
                        foreach (var world in game._worlds.Values)
                        {
                            //subscribe to each actor in group destroy/kill event
                            var spawnerGroupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            //
                            foreach (var actor in spawnerGroupActors)
                            {
                                if (actor is Spawner)
                                {
                                    (actor as Spawner).Spawn();
                                }
                            }

                            var groupActors = world.GetActorsInGroup(this.objective.Group1Name);
                            foreach (var actor in groupActors)
                            {
                                actor.ActorKilled += new EventHandler(actor_ActorKilled);
                            }
                        }
                    }
                    if (this.objective.ObjectiveType == Mooege.Common.MPQ.FileFormats.QuestStepObjectiveType.KillMonster)
                    {
                    }
                }
Exemplo n.º 25
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     Logger.Debug(" (QuestObjective ctor) creating an objective with ID {0}, QuestStepObjective {1} and QuestStep ID {2}", id, objective.Group1Name, questStep.QuestStepID);
     ID             = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Exemplo n.º 26
0
        private void QuestComposite(GameClient client)
        {
            var quest = client.Aisling.Quests.FirstOrDefault(i => i.Name == Mundane.Template.QuestKey);

            if (quest == null)
            {
                quest = new Quest {
                    Name = Mundane.Template.QuestKey
                };
                quest.LegendRewards.Add(new Legend.LegendItem
                {
                    Category = "Quest",
                    Color    = (byte)LegendColor.Blue,
                    Icon     = (byte)LegendIcon.Victory,
                    Value    = "Helped Gos kill some rats."
                });

                if (client.Aisling.Path == Class.Monk)
                {
                    quest.SkillRewards.Add(ServerContext.GlobalSkillTemplateCache["Wolf Fang Fist"]);
                }
                if (client.Aisling.Path == Class.Warrior)
                {
                    quest.SkillRewards.Add(ServerContext.GlobalSkillTemplateCache["Crasher"]);
                }

                client.Aisling.Quests.Add(quest);
            }

            quest.QuestStages = new List <QuestStep <Template> >();
            var q1 = new QuestStep <Template> {
                Type = QuestType.Accept
            };
            var q2 = new QuestStep <Template> {
                Type = QuestType.ItemHandIn
            };

            q1.RequirementsToProgress.Add(i => true);                                                                                       // no reqs to start quest.
            q2.RequirementsToProgress.Add(i => true);                                                                                       // no reqs
            q2.RequirementsToProgress.Add(i =>
                                          client.Aisling.Inventory.Get(o => o.Template.Name == "rat shit").FirstOrDefault()?.Stacks >= 10); // to finish, also reqs two shirts.

            quest.QuestStages.Add(q1);
            quest.QuestStages.Add(q2);

            if (!quest.Started)
            {
                SequenceMenu.Invoke(client);
            }
            else if (quest.Started && !quest.Completed && !quest.Rewarded)
            {
                client.SendOptionsDialog(Mundane, "Where is the rat shit i need?");
                quest.HandleQuest(SequenceMenu, Mundane, client);
            }
            else if (quest.Completed)
            {
                client.SendOptionsDialog(Mundane, "What a legend!");
            }
            else
            {
                SequenceMenu.Invoke(client);
            }
        }
Exemplo n.º 27
0
        public Quest(Game game, int SNOQuest)
        {
            this.game = game;
            SNOHandle = new SNOHandle(SNOGroup.Quest, SNOQuest);
            asset = SNOHandle.Target as Mooege.Common.MPQ.FileFormats.Quest;
            CurrentStep = new QuestStep(asset.QuestUnassignedStep, this);

            //erekose
            foreach (var QCSasset in asset.QuestCompletionSteps)
            {
                if (QCSasset != null)
                {
                    var nQCS = new QuestCompletionStep(QCSasset);
                    QuestCompletionSteps.Add(nQCS);
                    // Logger.Debug(" (quest ctor)  adding a completion step {0}, {1}, {2} ", nQCS.Name, nQCS.StepId, nQCS.I2);
                }
                else
                {
                    // Logger.Debug(" (quest ctor)  asset null problem in QCS ");
                }

            }

            //foreach (var aQuestStep in asset.QuestSteps)
            //{
            //     Logger.Debug(" (quest ctor) steps ID contained in quest is : {0} ", aQuestStep.ID);
            //}


            // Logger.Debug(" (quest ctor)  SNOHandle ID {0} Name {1}  Group {2} isValid ?{3} ", SNOHandle.Id, SNOHandle.Name, SNOHandle.Group, SNOHandle.IsValid);
            // Logger.Debug(" (quest ctor)  from assets  numSteps {0}, SNO ID {1} num od completion step  ", asset.NumberOfSteps, asset.Header.SNOId, asset.NumberOfCompletionSteps);
            // Logger.Debug(" (quest ctor)  CurrentStep ID ", CurrentStep.QuestStepID);
            
        }
Exemplo n.º 28
0
 public QuestChangedEventArgs(Type p_Type, QuestStep p_QuestStep)
 {
     m_Type      = p_Type;
     m_QuestStep = p_QuestStep;
 }
Exemplo n.º 29
0
        private void QuestComposite(GameClient client)
        {
            var quest = client.Aisling.Quests.FirstOrDefault(i => i.Name == Mundane.Template.QuestKey);

            if (quest == null)
            {
                quest = new Quest {
                    Name = Mundane.Template.QuestKey
                };
                quest.LegendRewards.Add(new Legend.LegendItem
                {
                    Category = "Quest",
                    Color    = (byte)LegendColor.Blue,
                    Icon     = (byte)LegendIcon.Victory,
                    Value    = "Aided Sunup at the Refugee Camp"
                });

                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(5000);
                quest.ExpRewards.Add(10000);
                quest.ExpRewards.Add(15000);
                quest.ExpRewards.Add(15000);
                quest.ExpRewards.Add(15000);
                quest.GoldReward = 10000;

                client.Aisling.Quests.Add(quest);
            }

            quest.QuestStages = new List <QuestStep <Template> >();

            var q1 = new QuestStep <Template> {
                Type = QuestType.Accept
            };
            var q2 = new QuestStep <Template> {
                Type = QuestType.SingleItemHandIn
            };

            q2.Prerequisites.Add(new QuestRequirement
            {
                Type            = QuestType.SingleItemHandIn,
                Amount          = 1,
                TemplateContext = ServerContextBase.GlobalItemTemplateCache["Sunup's Lost Sachel"]
            });

            quest.QuestStages.Add(q1);
            quest.QuestStages.Add(q2);

            if (!quest.Started)
            {
                SequenceMenu.Invoke(client);
            }
            else if (quest.Started && !quest.Completed && !quest.Rewarded)
            {
                client.SendOptionsDialog(Mundane, "Have you found my {=uLost Sachel?");
                quest.HandleQuest(client, SequenceMenu);
            }
            else if (quest.Completed)
            {
                client.TransitionToMap(client.Aisling.Map, new Position(17, 20));
            }
            else
            {
                SequenceMenu.Invoke(client);
            }
        }
Exemplo n.º 30
0
 public QuestLootEntryEventArgs(QuestStep p_quest)
 {
     Quest = p_quest;
 }
Exemplo n.º 31
0
 public void StepCompleted(int FollowUpStepID)
 {
     foreach (var player in game.Players.Values)
         player.InGameClient.SendMessage(new QuestUpdateMessage()
         {
             snoQuest = SNOName.SNOId,
             snoLevelArea = -1,
             StepID = FollowUpStepID,
             Field3 = true,
             Failed = false
         });
     completedSteps.Add(CurrentStep.QuestStepID);
     CurrentStep = (from step in asset.QuestSteps where step.ID == FollowUpStepID select new QuestStep(step, this)).FirstOrDefault();
 }
Exemplo n.º 32
0
 public void SetCurrentStep(string s)
 {
     currentStep = steps[s];
 }
Exemplo n.º 33
0
 public QuestObjective(Mooege.Common.MPQ.FileFormats.QuestStepObjective objective, QuestStep questStep, int id)
 {
     ID             = id;
     this.objective = objective;
     this.questStep = questStep;
 }
Exemplo n.º 34
0
 public Quest(QuestStep step)
 {
     startStep   = step;
     currentStep = startStep;
     steps       = new Dictionary <string, QuestStep>();
 }
Exemplo n.º 35
0
 //use this to add quest
 public void AppendQuestStep(QuestStep target)
 {
     questChain [nextFree] = target;
     nextFree ++;
     incrementQuest ();
 }
Exemplo n.º 36
0
        private Int32 UpdateQuestList(EQuestType p_type)
        {
            CleanupPageableList();
            m_questType = p_type;
            Boolean          flag = false;
            List <QuestStep> stepsByState;

            if (m_showFinished.isChecked)
            {
                stepsByState = LegacyLogic.Instance.WorldManager.QuestHandler.GetStepsByState(EQuestState.ACTIVE);
                stepsByState.AddRange(LegacyLogic.Instance.WorldManager.QuestHandler.GetStepsByState(EQuestState.SOLVED));
            }
            else
            {
                stepsByState = LegacyLogic.Instance.WorldManager.QuestHandler.GetStepsByState(EQuestState.ACTIVE);
            }
            List <QuestStep> list = new List <QuestStep>();

            foreach (QuestStep questStep in stepsByState)
            {
                Boolean flag2 = false;
                if (p_type == EQuestType.ALL)
                {
                    flag2 = true;
                }
                else if (p_type == EQuestType.QUEST_TYPE_MAIN && questStep.StaticData.Type == p_type)
                {
                    flag2 = true;
                }
                else if (p_type == EQuestType.QUEST_TYPE_ONGOING && questStep.StaticData.Type == p_type)
                {
                    flag2 = true;
                }
                else if (p_type == EQuestType.QUEST_TYPE_SIDE && (questStep.StaticData.Type == EQuestType.QUEST_TYPE_GRANDMASTER || questStep.StaticData.Type == EQuestType.QUEST_TYPE_PROMOTION || questStep.StaticData.Type == EQuestType.QUEST_TYPE_REPEATABLE || questStep.StaticData.Type == EQuestType.QUEST_TYPE_SIDE))
                {
                    flag2 = true;
                }
                if (flag2)
                {
                    if (m_selectedQuestStep != null && m_selectedQuestStep == questStep)
                    {
                        flag = true;
                    }
                    list.Add(questStep);
                }
            }
            for (Int32 i = m_pageableList.CurrentIndex; i < m_pageableList.EndIndex; i++)
            {
                if (i < list.Count)
                {
                    QuestStep questStep2 = list[i];
                    BookEntry entry      = m_pageableList.GetEntry();
                    entry.Init(questStep2.StaticData.StaticID, questStep2.StaticData.Name);
                    QuestEntry questEntry  = entry;
                    QuestEntry questEntry2 = questEntry;
                    questEntry2.OnQuestClicked = (EventHandler)Delegate.Combine(questEntry2.OnQuestClicked, new EventHandler(QuestClick));
                    questEntry.RestorePositions();
                    questEntry.SetQuestStep(questStep2);
                }
                else
                {
                    BookEntry entry2 = m_pageableList.GetEntry();
                    entry2.Init(0, String.Empty);
                }
            }
            if (list.Count > 0)
            {
                if (flag)
                {
                    QuestClick(m_selectedQuestStep, EventArgs.Empty);
                }
                else
                {
                    m_selectedQuestStep = null;
                    QuestClick(m_pageableList.EntryList[0].GetQuestStep(), EventArgs.Empty);
                }
            }
            else
            {
                ClearDetails();
            }
            return(list.Count);
        }