Giter Club home page Giter Club logo

forked-deathnotificationlib's Introduction

Death Notification Lib

Including this library in your addon will automatically

  • Have the player join the unified death notification channel
  • Register the player for death notifications. The addon which includes this library needs to implement a function to handle death notifications

Only for classic era and Hardcore servers.

Requirements

  • ChatThrottleLib

How to add to your addon

  1. Copy this repo into your addons directory. Something like <youraddonroot>/Libs/DeathNotificationLib/

  2. In <youraddon>.toc, include DeathNotificationLib.lua somewhere early in file loading. Note, this requires ChatThrottleLib and the included npc_to_id_classic./lua/id_to_npc_classic.lua. E.g.

Libs/ChatThrottleLib.lua Libs/DeathNotificationLib/npc_to_id_classic.lua Libs/DeathNotificationLib/id_to_npc_classic.lua Libs/DeathNotificationLib/DeathNotificationLib.lua <youraddon>.lua

  1. Register a function to hook onto death notification events (use DeathNotificationLib_HookOnNewEntry). Here are the fields
-- DeathNotificationLib_HookOnNewEntry(function(_player_data, _checksum, _peer_report, _in_guild) ... end)
-- @param _player_data metadata for player entry.
-- 	@field name Player's name
-- 	@field guild Player's guild
-- 	@field source_id ID of creature that killed the player
-- 	@field class_id Class ID of the player
-- 	@field level Player's level
-- 	@field instance_id Instance that player died in. Nil if player did not die in an instance
-- 	@field map_id Zone ID that player died in. Nil if player died in an instance instead
-- 	@field map_pos Map coordinates within zone specified by map_id, nil if player died in an instance instead
-- 	@field date Date that the player died.  Unix Epoch.
-- 	@field last_words Player's last words.
-- @param _checksum A checksum for the player data
-- @param _peer_report Number of guildmates that verified the death
-- @param _in_guild Whether the player is in your guild

You can register DeathNotificationLib_HookOnNewEntrySecure instead, which will only notify when 2 guildmates to whomever died, acknowledge the death.

Some notes

  • Use the _peer_report field for added verification. This number is the number of guildmates that verify the death within 5 seconds of the initial alert. I recommend not using this to block alerts unless fake notifications become an issue.
  • There is a 5 second delay between death and notification. This is a grace period to transmit last words.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.