DeathNotes

Moved

Total Downloads: 66,140 - First Release: Feb 14, 2015 - Last Update: May 13, 2018

4.98519/5, 270 likes
  1. Guessing it is not possible since it has been asked numerous times and not implemented.
     
  2. Wulf

    Wulf Community Admin

    It is, it just hasn't been updated for that. I may take a look if @LaserHydra isn't able to.
     
  3. I added the line

    Code:
     if (type == AttackerType.Murderer)
                        return "Zombie";
    But it didn't work. Returned,

    Code:
    Error while compiling: DeathNotes.cs(272,30): error CS0117: `Oxide.Plugins.DeathNotes.AttackerType' does not contain a definition for `Murderer'
     
  4. Pretty sure it IS possible - hopefully an update on the way.

    Please do, I've had a play to get a rough idea of what's going on. Some notes:

    Code:
    if (entity.ToPlayer() != null)
        return AttackerType.Player;
    Is returning truthy, meaning that

    Code:
    TryGetName()
    ...
    if (type == VictimType.Animal)
    ...
    if (entity.name.Contains("zombie"))
        return "Zombie";
    
    Won't be catching zombies. Meaning that

    Code:
    return entity.ToPlayer().displayName;
    
    Is likely the culprit. However, I'm not familiar enough with the Oxide API to extend this to replace the empty string with Zombie/Blaster :D or to see if they're defined as something other than displayName.
    [DOUBLEPOST=1509175830][/DOUBLEPOST]

    From line 511, you'll need to define the enum for Murderer, see below:
    Code:
    enum VictimType
            {
                Player,
                Helicopter,
                Animal,
                Invalid,
                Murderer
            }        enum AttackerType
            {
                Player,
                Helicopter,
                Animal,
                Turret,
                Structure,
                Trap,
                Self,
                Invalid,
                Murderer
            }
    However, as the Zombies aren't type of Animal - as far as I can tell - this will never run.
     
    Last edited by a moderator: Oct 28, 2017
  5. Thank you, I did that and it compiled at least. Now I just need to log into server and see if it works.
     
  6. You might want to add handling for Murderer. I tweaked a copy of the code and now it identifies them rather than leaving it blank (at line 357):

    if (entity.ToPlayer().displayName == null)
    {
    if (entity.name.Contains("murderer"))
    return "Murderer";
    }
    else
    {
    return entity.ToPlayer().displayName;
    }
     
  7. Wulf

    Wulf Community Admin

    Would probably be better to check for the type rather than name.
     
  8. What are all these messages?
    A Boar followed until it finally
     
  9. The following seems to work:

    Within Victim class

    Code:
    if (type == VictimType.Player)
                    {
                      if (entity.ToPlayer().displayName == null)
                      {
                        if (entity is NPCMurderer)
                        return "Zombie";
                      } else
                      {
                        return entity.ToPlayer().displayName;
                      }
                    }
    And within Attacker class


    Code:
    if (type == AttackerType.Player)
                    {
                      if (entity.ToPlayer().displayName == null)
                      {
                        if (entity is NPCMurderer)
                        return "Zombie";
                      } else
                      {
                        return entity.ToPlayer().displayName;
                      }
                    }
    EDIT:

    I've further improved this with the following:

    Line 110:
    Code:
    string ZombieColor;
    Line 268:
    Code:
    if (type == AttackerType.Player)                {
                      if (entity.ToPlayer().displayName == null)
                      {
                        if (entity is NPCMurderer)
                          return "ZombieNPCMurderer";
                      } else
                      {
                        return entity.ToPlayer().displayName;
                      }
                    }

    Line 362:
    Code:
     if (type == VictimType.Player)
                    {
                      if (entity.ToPlayer().displayName == null)
                      {
                        if (entity is NPCMurderer)
                          return "ZombieNPCMurderer";
                      } else
                      {
                        return entity.ToPlayer().displayName;
                      }
                    }
    Line 808:
    Code:
    ZombieColor = GetConfig("#FF0000 ", "Settings", "Zombie Color");
    Line 1280 (ish):
    Replace the message string formatting for attacker/victim if name matches ZombieNPCMurderer - or whatever you defined the zombie name as


    Code:
    if (data.victim.name == "ZombieNPCMurderer")
                    message = message.Replace("{victim}", $"A <color={ZombieColor}>Zombie</color>");
                else
                    message = message.Replace("{victim}", $"<color={VictimColor}>{data.victim.name}</color>");            if (data.attacker.name == "ZombieNPCMurderer")
                    message = message.Replace("{attacker}", $"A <color={ZombieColor}>Zombie</color>");
                else
                    message = message.Replace("{attacker}", $"<color={AttackerColor}>{data.attacker.name}</color>");
    Then don't forget to define the zomie color in the config, line 295:
    Code:
    "Zombie Color": "#ff0000",
    This should now replace all the empty Zombie strings with "A [red]Zombie[/red]".

    It's not the most graceful way of hacking this plugin, ideally a new type would be implemented, instead of hooking into player - but that's as much to do with how FacePunch have created NPC's I think. Either way, works for now and is better than empty strings all over the place.
     
    Last edited by a moderator: Oct 28, 2017
  10. No worries!
     
  11. How to change all this. Is this normal?

    ([Death Notes] A Boar followed until it finally caught him.)
     

    Attached Files:

  12. Use @myles. code or wait for an update. Works fine on my server.
     
  13. add this to line 724
    SetConfig("Settings", "Zombie Color", "#FF0000");
     
  14. hi
    How to make that when killing 3 persons, 3 reports about the murder are displayed?
     

    Attached Files:

  15. English
    ----------------
    If you put CustomAI together with Death Notes
    on the server begins Bacchanalia, in the chat displays that animals are killing zombies
    and the FPS drops to 10, without the CustomAI plugin everything is fine, or without the Death Notes
    I did not understand exactly what it gives on the server

    Russian
    ----------------
    Если поставить CustomAI вместе с Death Notes
    на сервере начинается вакханалия, в чате отображает что животные убивают зомби
    а ФПС падает до 10, без плагина CustomAI все нормально, или же без Death Notes
    я так и не понял какой именно дает такое на сервере
     
  16. Waiting for fix, since player that is killed is not shown and animal kills apparently are not all shown either.
     
  17. Can you give me the config that would be easier thank you
     
  18. Sorry @albator4242 , I can´t do that. My previous post was deleted; it´s against the forum rules. But it shouldn´t take too long for an update, I guess..
     
  19. I am not experiencing any issues other than NPCs being registered as blanks and they usually kill with "NoWeapon".I would probably try adding them on my own if update does not come out anytime soon.