Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 01:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] command $AddMonster debug

Discussion on [Release] command $AddMonster debug within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
[Release] command $AddMonster debug

In a lot of servers, you'll have a lot of monsters to add on your server. especially those who use open source ciapa know what i'm talking about
when I say it's really shit to add monsters on the db with the command. Reboot mandatory, command bug.... Here is the code that will change your life the monster will appear without restarting your server and the command is absolutely not bug

ps: This code does not come from me but from the source I used.
so you may have to adapt the codes to your source to repair the errors.




Code:
////<auto-generated <- Codemaid exclusion for now (PacketIndex Order is important for maintenance)

using OpenNos.Core;
using OpenNos.Domain;

namespace OpenNos.GameObject.CommandPackets
{
    [PacketHeader("$AddMonster", PassNonParseablePacket = true, Authority = AuthorityType.GameMaster)]
    public class AddMonsterPacket : PacketDefinition
    {
        #region Properties

        [PacketIndex(0)]
        public short MonsterVNum { get; set; }

        [PacketIndex(1)]
        public bool IsMoving { get; set; }

        public static string ReturnHelp()
        {
            return "$AddMonster VNUM MOVE";
        }

        #endregion
    }
}
Code:
        /// <summary>
        /// $AddMonster Command
        /// </summary>
        /// <param name="addMonsterPacket"></param>
        public void AddMonster(AddMonsterPacket addMonsterPacket)
        {
            if (addMonsterPacket != null)
            {
                Logger.LogUserEvent("GMCOMMAND", Session.GenerateIdentity(),
                    $"[AddMonster]NpcMonsterVNum: {addMonsterPacket.MonsterVNum} IsMoving: {addMonsterPacket.IsMoving}");

                if (ServerManager.Instance.Configuration.UseLogService)
                {
                    LogServiceClient.Instance.LogPacket(new PacketLogEntry()
                    {
                        Sender = Session.Character.Name,
                        SenderId = Session.Character.CharacterId,
                        PacketType = LogType.GMCommand,
                        Packet = $"[AddMonster]NpcMonsterVNum: {addMonsterPacket.MonsterVNum} IsMoving: {addMonsterPacket.IsMoving}"
                    });
                }

                if (!Session.HasCurrentMapInstance)
                {
                    return;
                }

                NpcMonster npcmonster = ServerManager.GetNpcMonster(addMonsterPacket.MonsterVNum);
                if (npcmonster == null)
                {
                    return;
                }

                MapMonsterDTO monst = new MapMonsterDTO
                {
                    MonsterVNum = addMonsterPacket.MonsterVNum,
                    MapY = Session.Character.PositionY,
                    MapX = Session.Character.PositionX,
                    MapId = Session.Character.MapInstance.Map.MapId,
                    Position = Session.Character.Direction,
                    IsMoving = addMonsterPacket.IsMoving,
                    MapMonsterId = ServerManager.Instance.GetNextMobId()
                };
                if (!DAOFactory.MapMonsterDAO.DoesMonsterExist(monst.MapMonsterId))
                {
                    DAOFactory.MapMonsterDAO.Insert(monst);
                    if (DAOFactory.MapMonsterDAO.LoadById(monst.MapMonsterId) is MapMonsterDTO monsterDTO)
                    {
                        MapMonster monster = new MapMonster(monsterDTO);
                        monster.Initialize(Session.CurrentMapInstance);
                        Session.CurrentMapInstance.AddMonster(monster);
                        Session.CurrentMapInstance?.Broadcast(monster.GenerateIn());
                    }
                }

                Session.SendPacket(Session.Character.GenerateSay(Language.Instance.GetMessageFromKey("DONE"), 10));
            }
            else
            {
                Session.SendPacket(Session.Character.GenerateSay(AddMonsterPacket.ReturnHelp(), 10));
            }
        }
redbull2905 is offline  
Thanks
1 User
Old 07/07/2019, 16:18   #2
 
Cryless~'s Avatar
 
elite*gold: 0
Join Date: Sep 2015
Posts: 482
Received Thanks: 532
It totally changed my life ~ another dream become reality. Thank you.
Cryless~ is offline  
Thanks
2 Users
Old 07/08/2019, 05:39   #3
 
0Lucifer0's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,005
Received Thanks: 1,018
That’s an awesome release are you gonna do a thread for all commands of ?

Seriously except increasing the amount of dumb thread what are you trying to get by releasing already existing code from official opennos repo ?
0Lucifer0 is offline  
Thanks
1 User
Old 07/08/2019, 06:25   #4
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60


this code I did not take it at all on your opennos
redbull2905 is offline  
Old 07/08/2019, 08:10   #5
 
0Lucifer0's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,005
Received Thanks: 1,018
Quote:
Originally Posted by redbull2905 View Post


this code I did not take it at all on your opennos
Yes but this code is log... you don’t even understand what the code does... this is just printing info inside the log the function is already on opennos

You could also do Console.Writeline(123); everywhere and said this code is not a copy... if you copy an exam on someone else and replace your name by your actual name it’s still a copy pasta. This here is the same. Or you could edit your title to this one which would match what you are releasing:
[release] add logs to a command
0Lucifer0 is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
Need help to add $Restart and Fix $AddMonster
04/18/2018 - Nostale - 0 Replies
Hey guys as the Titel says i need help to Add the Command "$Restart" and Fix the Command $AddMonster...
Wie behebe ich Fehler bei Befehl $AddMonster
11/24/2017 - Nostale - 6 Replies
Guten Tag Liebe ElitePvP Member Ich habe folgendes Problem und zwar... Ich möchte gerne Mobbs auf einer Map erstellen. Das Problem dabei ist $AddMonster funktioniert nur ein Mal und danach werden keine weiteren Mobs gespawnt.. Im InGame Chat steht "Erledigt" aber es Passiert nichts weiteres, in der Datenbank wird auch nur das eine Mob angezeigt. Fehler werden mir dabei auch nicht angezeigt. Ich weiß nicht woran das liegen kann.. Ich Hoffe ihr könnte mir weiter Helfen, bin für jeden Tipp...
Command line interface working command
08/05/2012 - DarkOrbit - 27 Replies
I found only one working command: Enter "J" when you are in teleport Anyone know other commands?



All times are GMT +1. The time now is 01:12.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.