Fixed #102 - Logging into a Act/Quest/Step doesn't work on Act I

This commit is contained in:
Lucca Faria Ferri 2023-01-26 22:54:22 -08:00
parent 3e7a4f033d
commit ebd1a7c855
3 changed files with 32 additions and 1 deletions

View File

@ -10,6 +10,7 @@ using DiIiS_NA.GameServer.MessageSystem;
using Gibbed.IO;
//Blizzless Project 2022
using DiIiS_NA.Core.Storage;
using System;
namespace DiIiS_NA.GameServer.Core.Types.Math
{
@ -193,5 +194,13 @@ namespace DiIiS_NA.GameServer.Core.Types.Math
{
return string.Format("x:{0} y:{1} z:{2}", X, Y, Z);
}
public Vector3D Around2D(float f)
{
var angle = (float)(System.Math.PI * 2 * f);
var x = (float)(System.Math.Cos(angle) * X - System.Math.Sin(angle) * Y);
var y = (float)(System.Math.Sin(angle) * X + System.Math.Cos(angle) * Y);
return new Vector3D(x, y, Z);
}
}
}

View File

@ -941,14 +941,24 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
CurrentQuest = QuestsOrder[0];
CurrentStep = -1;
if (CurrentAct is 3000 or 0)
if (CurrentAct is 3000)
{
QuestManager.Quests[CurrentQuest].Steps[-1].OnAdvance.Invoke();
return;
}
if (!(currQuest == QuestsOrder[0] && step == -1))
{
if (currQuest == -1 && step == -1)
{
currQuest = CurrentQuest;
QuestManager.Quests[currQuest].Steps[-1].OnAdvance.Invoke();
return;
}
QuestManager.AdvanceTo(currQuest, step);
return;
}
if (CurrentQuest == QuestsOrder[0] && CurrentStep == -1)
QuestManager.Quests[CurrentQuest].Steps[-1].OnAdvance.Invoke();

View File

@ -412,6 +412,18 @@ namespace DiIiS_NA.GameServer.GSSystem.GameSystem
if (cycle > 200) break;
}
}
public void AdvanceToFirstStep(int snoQuest)
{
var quest = Quests[snoQuest].Steps.OrderBy(s => s.Key).FirstOrDefault();
if (quest.Value != null)
{
AdvanceTo(snoQuest, quest.Key == -1 ? quest.Value.NextStep : quest.Key);
}
else
{
Logger.Error("AdvanceToNext: quest {0} not found", snoQuest);
}
}
public float QuestTimerEstimate = 0f;