mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 05:05:53 +12:00
no message
This commit is contained in:
parent
7a8cc2c2a6
commit
ea96a0e74f
4 changed files with 33 additions and 26 deletions
|
@ -49,7 +49,7 @@ namespace Horse_Isle_Server
|
|||
|
||||
public static List<NpcEntry> NpcList = new List<NpcEntry>();
|
||||
|
||||
public NpcReply GetNpcReply(NpcEntry npc, int id)
|
||||
public static NpcReply GetNpcReply(NpcEntry npc, int id)
|
||||
{
|
||||
|
||||
foreach (NpcChat chatpoint in npc.Chatpoints)
|
||||
|
|
|
@ -330,6 +330,8 @@ namespace Horse_Isle_Server
|
|||
string metaInfo = Meta.BuildChatpoint(entry, entry.Chatpoints[0]);
|
||||
byte[] metaPacket = PacketBuilder.CreateMetaPacket(metaInfo);
|
||||
sender.SendPacket(metaPacket);
|
||||
|
||||
sender.LoggedinUser.LastTalkedToNpc = entry;
|
||||
}
|
||||
else if (action == PacketBuilder.NPC_CONTINUE_CHAT)
|
||||
{
|
||||
|
@ -346,30 +348,30 @@ namespace Horse_Isle_Server
|
|||
return;
|
||||
}
|
||||
|
||||
foreach (Npc.NpcEntry npc in Npc.NpcList)
|
||||
Npc.NpcEntry lastNpc = sender.LoggedinUser.LastTalkedToNpc;
|
||||
Npc.NpcReply reply;
|
||||
try
|
||||
{
|
||||
foreach (Npc.NpcChat chatpoint in npc.Chatpoints)
|
||||
{
|
||||
foreach (Npc.NpcReply reply in chatpoint.Replies)
|
||||
{
|
||||
if (reply.Id == replyId)
|
||||
{
|
||||
if (reply.GotoChatpoint == -1)
|
||||
{
|
||||
UpdateArea(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
string metaInfo = Meta.BuildChatpoint(npc,Npc.GetNpcChatpoint(npc, reply.GotoChatpoint));
|
||||
byte[] metaPacket = PacketBuilder.CreateMetaPacket(metaInfo);
|
||||
sender.SendPacket(metaPacket);
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
reply = Npc.GetNpcReply(lastNpc, replyId);
|
||||
}
|
||||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to reply with replyid that does not exist.");
|
||||
catch(KeyNotFoundException)
|
||||
{
|
||||
Logger.ErrorPrint(sender.LoggedinUser.Username + " Tried to reply with replyid that does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (reply.GotoChatpoint == -1)
|
||||
{
|
||||
UpdateArea(sender,true);
|
||||
return;
|
||||
}
|
||||
|
||||
string metaInfo = Meta.BuildChatpoint(npc,Npc.GetNpcChatpoint(lastNpc, reply.GotoChatpoint));
|
||||
byte[] metaPacket = PacketBuilder.CreateMetaPacket(metaInfo);
|
||||
sender.SendPacket(metaPacket);
|
||||
return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ namespace Horse_Isle_Server
|
|||
public Friends Friends;
|
||||
public string Password; // For chat filter.
|
||||
public PlayerInventory Inventory;
|
||||
public Npc.NpcEntry LastTalkedToNpc;
|
||||
public int ChatViolations
|
||||
{
|
||||
get
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue