mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-09 05:54:50 +02:00
Fixed a bunch of bugs Jorge found. Readded tutorial quests back.
This commit is contained in:
parent
c240096eb8
commit
bbbab356af
10 changed files with 104 additions and 23 deletions
|
@ -1574,9 +1574,9 @@ namespace Meteor.Map.Actors
|
|||
|
||||
#region Quests - Debug/Misc Related
|
||||
// Force-Add a quest by Id. Called be debug scripts.
|
||||
public void AddQuest(uint id, bool isSilent = false)
|
||||
public void AddQuest(int id, bool isSilent = false)
|
||||
{
|
||||
Actor actor = Server.GetStaticActors((0xA0F00000 | id));
|
||||
Actor actor = Server.GetStaticActors((0xA0F00000 | (uint)id));
|
||||
AddQuest(actor.Name, isSilent);
|
||||
}
|
||||
|
||||
|
@ -1596,8 +1596,7 @@ namespace Meteor.Map.Actors
|
|||
|
||||
if (activeQuest == null)
|
||||
questStateManager.ForceAddActiveQuest(questScenario[freeSlot]);
|
||||
|
||||
Database.SaveQuest(this, questScenario[freeSlot], freeSlot);
|
||||
|
||||
SendQuestClientUpdate(freeSlot);
|
||||
|
||||
if (!isSilent)
|
||||
|
@ -1606,9 +1605,11 @@ namespace Meteor.Map.Actors
|
|||
}
|
||||
|
||||
questScenario[freeSlot].OnAccept();
|
||||
|
||||
Database.SaveQuest(this, questScenario[freeSlot], freeSlot);
|
||||
}
|
||||
|
||||
public void RemoveQuest(uint id)
|
||||
public void RemoveQuest(int id)
|
||||
{
|
||||
for (int i = 0; i < questScenario.Length; i++)
|
||||
{
|
||||
|
|
|
@ -123,7 +123,7 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
|
||||
public void UpdateENPCs()
|
||||
{
|
||||
if (data.Dirty)
|
||||
if (data != null && data.Dirty)
|
||||
{
|
||||
if (questState != null)
|
||||
questState.UpdateState();
|
||||
|
@ -186,7 +186,7 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
{
|
||||
List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(caller, this, "IsQuestENPC", true, npc, this);
|
||||
bool scriptReturned = returned != null && returned.Count != 0 && returned[0].typeID == 3;
|
||||
return scriptReturned || questState.HasENpc(npc.GetActorClassId());
|
||||
return scriptReturned || (questState?.HasENpc(npc.GetActorClassId()) ?? false);
|
||||
}
|
||||
|
||||
public void StartSequence(ushort sequence)
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace Meteor.Map.Actors.QuestNS
|
|||
|
||||
public void UpdateQuestCompleted(Quest quest)
|
||||
{
|
||||
CompletedQuestsBitfield.Set(quest.Id - SCENARIO_START);
|
||||
CompletedQuestsBitfield.Set(quest.GetQuestId() - SCENARIO_START);
|
||||
QuestGameData[] updated = Server.GetQuestGamedataByPrerequisite(quest.GetQuestId());
|
||||
foreach (var questData in updated)
|
||||
PrereqBitfield.Set(questData.Id - SCENARIO_START);
|
||||
|
|
|
@ -274,9 +274,7 @@ namespace Meteor.Map.packets.send.actor
|
|||
|
||||
CloseStreams();
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
packet.DebugPrintSubPacket();
|
||||
return packet;
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue