Comando para su uso:
/addnpc id name type lookface temporal(true/false)
Abren la solucion de WorldConquer y se van al fichero 1004 - MsgTalk.cs (Del proyecto MsgServer)
En el siguiente switch
switch (command[0])
Añaden este case
#region AddNPC
case "/addnpc":
{
if (commandFullParameters.Length >= 4)
{
uint.TryParse(commandFullParameters[1], out uint NpcId);
string NpcName = commandFullParameters[2];
ushort.TryParse(commandFullParameters[3], out ushort NpcType);
ushort.TryParse(commandFullParameters[4], out ushort NpcLookface);
bool.TryParse(commandFullParameters[5], out bool NpcTemporal);
DbNpc npc = new DbNpc
{
Id = NpcId,
Name = commandFullParameters[2],
Mapid = pRole.Map.Identity,
Cellx = pRole.MapX,
Celly = pRole.MapY,
Type = NpcType,
Lookface = NpcLookface
};
GameNpc gameNPC = new GameNpc(npc);
if (pRole.Map.GameObjects.TryAdd(gameNPC.Identity, gameNPC))
{
if (NpcTemporal)
{
pRole.Send("NPC Added (Temporal)");
} else
{
Database.NpcRepository.SaveOrUpdate(npc);
pRole.Send("NPC Added and saved in Database");
}
} else
{
pRole.Send("NPC Cannot added. Error");
}
} else
{
pRole.Send("Command need parameters: /addnpc id name type lookface temporal(true/false)");
}
break;
}
#endregion
No funciona el guardado en database tira error en consola. Si lo logro reparar lo modificare