Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Modified and improved HardcoreMode for AzerothCore LUA based on https://github.com/HellionOP/Lua-HardcoreMode/blob/main/hardcoreMode.lua
- --Credit to FOE from Azerothcore Discord
- --Item that designates that character is a hardcore character.
- local hardCoreItem = 90000
- --NPC id
- local hcNPC = 90000
- --This is how long the character is locked for - default is 32 years.
- local banTimer = 999999999
- --on death function - checks if player has token and bans character if it does.
- local function PlayerDeath(event, killer, killed)
- if(killed:HasItem(hardCoreItem, 1)) then
- print(killed:GetName() .. " was killed by " .. killer:GetName())
- SendWorldMessage(killed:GetName() .. " was killed by " .. killer:GetName())
- Ban(1, killed:GetName(), banTimer)
- end
- end
- --First Gossip Screen for NPC
- local function OnFirstTalk(event, player, unit)
- player:GossipMenuAddItem(0, "Looking for a challenge??? Click here to try hardcore mode!", 0, 1, false, "Just making sure that you want to turn on hardcore mode?? This will lock the character after death and you will no longer be able to play the character!!!")
- player:GossipSendMenu(1, unit)
- end
- --Selection for NPC gossip
- local function OnSelect(event, player, unit, sender, intid, code)
- if (intid == 1) then
- player:AddItem(hardCoreItem, 1)
- end
- end
- RegisterCreatureGossipEvent(hcNPC, 1, OnFirstTalk)
- RegisterCreatureGossipEvent(hcNPC, 2, OnSelect)
- RegisterPlayerEvent(8, PlayerDeath)
Advertisement
Add Comment
Please, Sign In to add comment