mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 05:05:40 +12:00
no message
This commit is contained in:
parent
7a8cc2c2a6
commit
ea96a0e74f
4 changed files with 33 additions and 26 deletions
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
{
|
||||
"messages":{
|
||||
"welcome_format":"Welcome to the land of Horse Isle, %USERNAME%!!",
|
||||
"motd_format":"<FONT COLOR='#FF0000'><B>Today's Note:</B> %MOTD%</FONT>",
|
||||
|
@ -12,9 +12,13 @@
|
|||
"grab_all_message":"You grabbed all objects off the ground.",
|
||||
"dropped_item_message":"You dropped an item on the ground.",
|
||||
"npc":{
|
||||
"start_chat_format":"^I%ICONID%^T8%NAME%, %DESCRIPTION%^BA%ID%^R1",
|
||||
|
||||
"start_chat_format":"^I%ICONID%^T8%NAME%, %DESCRIPTION%",
|
||||
"chatpoint_format":" <I>Conversation with %NAME%, %DESCRIPTION%</I><BR><BR><B>%NAME%:</B> %TEXT%",
|
||||
"reply_format":"^N%TEXT%^BHB%ID%^R2"
|
||||
"reply_format":"^N%TEXT%^BHB%ID%^R2",
|
||||
"npc_information_button":"^B4LC%ID%",
|
||||
"npc_talk_button":"^BA%ID%",
|
||||
"npc_end":"^R1"
|
||||
},
|
||||
"transport":{
|
||||
"not_enough_money":"You cannot afford this trip!",
|
||||
|
|
|
@ -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
Reference in a new issue