bayuMIR/Mirserver/Mir200/Envir/QuestDiary/系统类/死亡触发.lua
2026-06-24 21:00:14 +08:00

75 lines
2.1 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

DieOBJ = {}
---* 人物死亡之前触发
---* actor obj 玩家对象
---* hitter obj 击杀者对象
---* isplayer int 0=击杀者非玩家1=击杀者是玩家
---@param actor obj
---@param hitter obj
---@param isplayer int
function nextdie(actor, hitter, isplayer)
GameEvent.push(EventCfg.onNextdie, actor, hitter, isplayer)
end
---* 玩家死亡触发
---* actor 玩家对象
---* killed 死亡对象
---@param actor any
---@param killed any
---@diagnostic disable-next-line: lowercase-global
function killplay(actor, killed)
local Info = {}
Info.Mapid = getbaseinfo(actor,ConstCfg.gbase.mapid)
Info.self_name = Player.getname(actor)
Info.killed_name = Player.getname(killed)
GameEvent.push(EventCfg.onkillplay, actor, killed,Info)
end
---* 玩家被杀触发
---* 参数一 死亡者
---* 参数二 击杀者
---@param actor any
---@param hitter any
---@diagnostic disable-next-line: lowercase-global
function playdie(actor, hitter)
local Info = {}
Info.self_Name = Player.getname(actor)
Info.map = getbaseinfo(actor, ConstCfg.gbase.mapid)
Info.x = getbaseinfo(actor, ConstCfg.gbase.x)
Info.y = getbaseinfo(actor, ConstCfg.gbase.y)
Info.hitter_Name = Player.getname(hitter)
Info.isplayer = isplayer(hitter) and "玩家" or "怪物"
sendmail(getbaseinfo(actor, ConstCfg.gbase.id), 99, "系统提示",
string.format("您被<[%s(%s)]/FCOLOR=70>在<【%s:%d:%d】/FCOLOR=215>杀害了... ", Info.isplayer, Info.hitter_Name,
Info.map, Info.x, Info.y))
showprogressbardlg(actor, 2, "@hum_readlive", "正在复活...进度%d%", 0, "@hum_readlive")
end
---@diagnostic disable-next-line: lowercase-global
function hum_readlive(actor)
realive(actor)
addhpper(actor, "=", 100)
addmpper(actor, "=", 100)
local mapinfo = ConstCfg.newhuman_map
MapCfg.gotomap(actor, mapinfo[1], mapinfo[2], mapinfo[3], 8)
end
---* 人物复活时触发
function revival(actor)
GameEvent.push(EventCfg.onRevive, actor)
if checkitemw(actor, "东皇钟", 1) then
changemode(actor, 1, 2)
playeffect(actor, 50025, 0, 0, 1, 0, 0)
Func.sendmsg(actor, "[至宝]东皇钟触发复活后无敌2秒!")
end
end
return DieOBJ