本帖最后由 1580 于 2023-8-23 11:10 编辑
可自行使用LUA回调完成以上功能
[+]增加:心灵启示可输出目标属性信息(Lua脚本)
【init.lua】
s.event.bind(const.ebind_MagAttackTarge, "on_MagAttackTarge")--受技能攻击时回调
【BindEvent.lua】
--受技能攻击时回调
--参数:攻击对像,受击对像,技能ID
function on_MagAttackTarge(TagActor, Actor, MagicID)
if (MagicID == 28) and (TagActor:getRace() == 0) then--心灵启示可输出目标属性信息
local SkillLv = TagActor:getSkillLevel(28)--技能等级
local myLv = TagActor:getLevel() --攻击者等级
local TagLv = Actor:getLevel() --受击者等级
--判断双方等级是否达到提示条件
local CanHint = false
if SkillLv == 0 then
if myLv - 2 >= TagLv then
CanHint = true
end
elseif SkillLv == 1 then
if myLv >= TagLv then
CanHint = true
end
elseif SkillLv == 2 then
if myLv + 2 >= TagLv then
CanHint = true
end
else
if myLv + 6 >= TagLv then
CanHint = true
end
end
if CanHint == true then
local RaceId = Actor:getRace()--受击者种族ID
local sName = ""--名字
if (RaceId == 0) or (RaceId == 66) then
sName = Actor:getCharName()
else
sName = Actor:getCharName(1)
end
local sHp = " 生命:"..tostring(Actor:getHp()).."-"..tostring(Actor:getMaxHp())
local sDc = " 攻击:"..tostring(Actor:getDc()).."-"..tostring(Actor:getMaxDc())
local sMc = " 魔法:"..tostring(Actor:getMc()).."-"..tostring(Actor:getMaxMc())
local sSc = " 道术:"..tostring(Actor:getSc()).."-"..tostring(Actor:getMaxSc())
local sAc = " 防御:"..tostring(Actor:getAc()).."-"..tostring(Actor:getMaxAc())
local sMac =" 魔御:"..tostring(Actor:getMac()).."-"..tostring(Actor:getMaxMac())
if (RaceId == 0) or (RaceId == 66) or (RaceId == 150) then--人物、英雄、人形
TagActor:sendMsg(3,"名字:"..sName..sHp..sDc..sMc..sSc..sAc..sMac, -1, -1)
else--其它怪
TagActor:sendMsg(3,"名字:"..sName..sHp..sDc..sAc..sMac, -1, -1)
end
end
end
end
|