Add this code below in NRunHandler.cs
and add this code in MapNpc.cs
in navicat in MapNpc ( put the PNJ in dialog 18 )
A little one I like?
case 2:
switch (packet.NpcId)
{//dialog 18
case 19419:
if (packet.Type >= 0 && Session.Character.Gold >= 500000 * (1 + packet.Type))
{
Session.Character.Gold -= 500000 * (1 + packet.Type);
Session.SendPacket(Session.Character.GenerateGold());
int Random = ServerManager.RandomNumber(0, 100);
int rnd = ServerManager.RandomNumber(0, 1000);
if (rnd < 970)
{
if (Random < 80)
{
short[] vnums =
{
1246, 1247, 1248, 1249, 1244, 2332
};
byte[] counts =
{
5, 5, 5, 2, 10, 2
};
int item = ServerManager.RandomNumber(0, 5);
Session.Character.GiftAdd(vnums[item], counts[item]);
}
else
{
short[] vnums =
{
1366, 1904, 5061, 1244, 1218
};
byte[] counts =
{
1, 1, 1, 50, 3
};
int item = ServerManager.RandomNumber(0, 4);
Session.Character.GiftAdd(vnums[item], counts[item]);
}
}
else
{
short[] vnums =
{
4126, 5432, 5431
};
byte[] counts =
{
1, 1, 1
};
int item = ServerManager.RandomNumber(0, 2);
Session.Character.GiftAdd(vnums[item], counts[item]);
CommunicationServiceClient.Instance.SendMessageToCharacter(new SCSCharacterMessage
{
DestinationCharacterId = null,
SourceCharacterId = 0,
SourceWorldId = ServerManager.Instance.WorldId,
Message = $"Player {Session.Character.Name} Obtain Big Reward!",
Type = MessageType.Shout
});
}
}
else
{
Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("NOT_ENOUGH_MONEY"), 10));
}
break;
and add this code in MapNpc.cs
private void Messages()
{
Observable.Interval(TimeSpan.FromSeconds(5)).Subscribe(onNext: s =>
{
if (MapNpcId == 19419)
{
MapInstance.Broadcast($"say 2 {MapNpcId} 0 Random Chest (5KK)!");
}
});
in navicat in MapNpc ( put the PNJ in dialog 18 )
A little one I like?