Added the PGL200 quest The House Always Wins. Fixed quest instances not being set on spawn. Fixed PrivateAreaPast. Added You have left the instance messages when leaving a PrivateArea. Fixed EmoteEvents. DefaultTalk has been disabled temporarily to speed up warps.

This commit is contained in:
Filip Maj 2022-03-03 01:59:13 -05:00
parent f491c63b98
commit b773098abf
9 changed files with 383 additions and 53 deletions

View file

@ -149,19 +149,19 @@ namespace Meteor.Map.Actors.QuestNS
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onTalk", true, npc);
}
public void OnEmote(Player caller, Npc npc, Command command)
public void OnEmote(Player caller, Npc npc, string triggerName)
{
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onEmote", true, npc, command);
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onEmote", true, npc, triggerName);
}
public void OnPush(Player caller, Npc npc)
public void OnPush(Player caller, Npc npc, string triggerName)
{
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onPush", true, npc);
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onPush", true, npc, triggerName);
}
public void OnNotice(Player caller)
public void OnNotice(Player caller, string triggerName)
{
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onNotice", true);
LuaEngine.GetInstance().CallLuaFunction(caller, this, "onNotice", true, triggerName);
}
public void OnNpcLS(Player caller, uint npcLSId)
@ -190,9 +190,9 @@ namespace Meteor.Map.Actors.QuestNS
public bool IsQuestENPC(Player caller, Npc npc)
{
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()) ?? false);
//List<LuaParam> returned = LuaEngine.GetInstance().CallLuaFunctionForReturn(caller, this, "IsQuestENPC", true, npc, this);
//bool scriptReturned = returned != null && returned.Count != 0 && returned[0].typeID == 3;
return (questState?.HasENpc(npc.GetActorClassId()) ?? false);
}
public void StartSequence(ushort sequence)

View file

@ -169,7 +169,7 @@ namespace Meteor.Map.DataObjects
if (quests.Length != 0)
{
QuestENpc questInstance = quests[0].GetQuestState().GetENpc(npc.GetActorClassId());
QueuePacket(npc.GetSetEventStatusPackets());
QueuePacket(npc.GetSetEventStatusPackets(questInstance.isTalkEnabled, questInstance.isEmoteEnabled, questInstance.isPushEnabled));
QueuePacket(SetActorQuestGraphicPacket.BuildPacket(npc.Id, questInstance.questFlagType));
}
}

View file

@ -45,7 +45,7 @@ namespace Meteor.Map.packets.send.actor.events
binWriter.Write((UInt32)0x44533088);
binWriter.Write((Single)100.0f);
binWriter.Seek(4, SeekOrigin.Current);
binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x1)); //If == 0x10, Inverted Bounding Box
binWriter.Write((Byte)(condition.outwards ? 0x10 : 0x1)); //If == 0x10, Inverted Bounding Box
binWriter.Write((Byte)0);
binWriter.Write((Byte)(condition.silent ? 0x1 : 0x0)); //Silent Trigger
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));

View file

@ -878,6 +878,10 @@ namespace Meteor.Map
player.playerSession.LockUpdates(false);
//Send "You have left the instance" if old area is a Private Area
if (oldArea is PrivateArea)
player.SendGameMessage(GetActor(), 34110, 0x20);
//Send "You have entered an instance" if it's a Private Area
if (newArea is PrivateArea)
player.SendGameMessage(GetActor(), 34108, 0x20);