mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-23 19:10:28 +02:00
Added callbacks to help with quest management. Abandoning a quest now works.
This commit is contained in:
parent
9d63be52e3
commit
7fa4a1eb80
4 changed files with 78 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue