mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
fix more quest stuff
This commit is contained in:
parent
68eaee2d1c
commit
d776d2adc3
5 changed files with 8268 additions and 8033 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,6 @@
|
|||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HISP.Game.Horse
|
||||
{
|
||||
|
||||
|
@ -20,6 +15,8 @@ namespace HISP.Game.Horse
|
|||
return false;
|
||||
if (World.InSpecialTile(x, y))
|
||||
return false;
|
||||
if (!World.InIsle(x, y))
|
||||
return false;
|
||||
|
||||
// Check area
|
||||
if(checkSpawnLocationValid)
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace HISP.Game
|
|||
}
|
||||
}
|
||||
|
||||
throw new KeyNotFoundException("Npc chatpoint id: " + chatpointId + " not found!");
|
||||
return npc.Chatpoints[0];
|
||||
}
|
||||
|
||||
public static int GetDefaultChatpoint(User user, NpcEntry npc)
|
||||
|
|
|
@ -279,7 +279,15 @@ namespace HISP.Game
|
|||
else
|
||||
{
|
||||
if(quest.FailNpcChat != null)
|
||||
res.NpcChat = quest.FailNpcChat;
|
||||
{
|
||||
if(npcActivation)
|
||||
{
|
||||
if (quest.FailNpcChat != "")
|
||||
{
|
||||
res.NpcChat = quest.FailNpcChat;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
@ -322,23 +330,48 @@ namespace HISP.Game
|
|||
}
|
||||
public static bool UseTool(User user, string tool, int x, int y)
|
||||
{
|
||||
foreach(QuestEntry quest in QuestList)
|
||||
|
||||
if (tool == Quest.Shovel)
|
||||
{
|
||||
if (quest.AltActivation.Type == tool && quest.AltActivation.ActivateX == x && quest.AltActivation.ActivateY == y)
|
||||
// check Treasures
|
||||
if (Treasure.IsTileTreasure(x, y))
|
||||
{
|
||||
ActivateQuest(user, quest);
|
||||
Treasure.GetTreasureAt(x, y).CollectTreasure(user);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(tool == Quest.Shovel)
|
||||
QuestResult result = null;
|
||||
|
||||
foreach (QuestEntry quest in QuestList)
|
||||
{
|
||||
// Also check Treasures
|
||||
if (Treasure.IsTileTreasure(x, y))
|
||||
Treasure.GetTreasureAt(x, y).CollectTreasure(user);
|
||||
|
||||
|
||||
if (quest.AltActivation.Type == tool && quest.AltActivation.ActivateX == x && quest.AltActivation.ActivateY == y)
|
||||
{
|
||||
result = ActivateQuest(user, quest, true, result);
|
||||
if(result.QuestCompleted)
|
||||
{
|
||||
if(result.NpcChat != null)
|
||||
{
|
||||
byte[] ChatPacket = PacketBuilder.CreateChat(result.NpcChat, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
user.LoggedinClient.SendPacket(ChatPacket);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(result != null)
|
||||
{
|
||||
if (result.NpcChat != null)
|
||||
{
|
||||
byte[] ChatPacket = PacketBuilder.CreateChat(result.NpcChat, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
user.LoggedinClient.SendPacket(ChatPacket);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2749,6 +2749,7 @@ namespace HISP.Server
|
|||
Npc.NpcEntry entry = Npc.GetNpcById(chatId);
|
||||
|
||||
int defaultChatpointId = Npc.GetDefaultChatpoint(sender.LoggedinUser, entry);
|
||||
|
||||
Npc.NpcChat startingChatpoint = Npc.GetNpcChatpoint(entry, defaultChatpointId);
|
||||
|
||||
string metaInfo = Meta.BuildNpcChatpoint(sender.LoggedinUser, entry, startingChatpoint);
|
||||
|
|
Loading…
Add table
Reference in a new issue