mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
Added callbacks to help with quest management. Abandoning a quest now works.
This commit is contained in:
@@ -894,6 +894,17 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
|
||||
}
|
||||
|
||||
public int GetHighestLevel()
|
||||
{
|
||||
int max = 0;
|
||||
foreach (short level in charaWork.battleSave.skillLevel)
|
||||
{
|
||||
if (level > max)
|
||||
max = level;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
||||
public InventoryItem[] GetGearset(ushort classId)
|
||||
{
|
||||
return Database.GetEquipment(this, classId);
|
||||
@@ -1113,6 +1124,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Add checks for you being in an instance or main scenario
|
||||
public void AbandonQuest(uint id)
|
||||
{
|
||||
Quest quest = GetQuest(id);
|
||||
RemoveQuestByQuestId(id);
|
||||
quest.DoAbandon();
|
||||
}
|
||||
|
||||
public void RemoveQuestByQuestId(uint id)
|
||||
{
|
||||
RemoveQuest((0xA0F00000 | id));
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -79,7 +80,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
else
|
||||
questFlags &= (uint)~(1 << bitIndex);
|
||||
|
||||
//Inform update
|
||||
DoCompletionCheck();
|
||||
}
|
||||
|
||||
public bool GetQuestFlag(int bitIndex)
|
||||
@@ -103,6 +104,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
currentPhase = phaseNumber;
|
||||
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId());
|
||||
SaveData();
|
||||
|
||||
DoCompletionCheck();
|
||||
}
|
||||
|
||||
public uint GetQuestFlags()
|
||||
@@ -120,5 +123,21 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||
Database.SaveQuest(owner, this);
|
||||
}
|
||||
|
||||
public void DoCompletionCheck()
|
||||
{
|
||||
List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(owner, this, "isObjectivesComplete");
|
||||
if (returned.Count >= 1 && returned[0].typeID == 3)
|
||||
{
|
||||
owner.SendDataPacket("attention", Server.GetWorldManager().GetActor(), "", 25225, GetQuestId());
|
||||
owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25225, 0x20, (object)GetQuestId());
|
||||
}
|
||||
}
|
||||
|
||||
public void DoAbandon()
|
||||
{
|
||||
List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(owner, this, "onAbandonQuest");
|
||||
owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user