函数名称:LuaFnSetPetLife
注册函数:LuaFnSetPetLife
参数说明:sceneId(场景编号),selfId(调用者ID),petGUID_H(宠物GUID高位),petGUID_L(宠物GUID低位),life(寿命值)
功能说明:设置宠物寿命值
示例说明:
案例脚本:M:\武侠世界醉江湖\xwxsj\Public\Data\Script\event\petskill\petcommon.lua
-- 增加珍兽寿命
function x335000_IncPetLife( sceneId, selfId, value )
if value <= 0 then
return 0
end
petGUID_H = LuaFnGetHighSectionOfTargetPetGuid( sceneId, selfId )
petGUID_L = LuaFnGetLowSectionOfTargetPetGuid( sceneId, selfId )
value = value + LuaFnGetPetLife( sceneId, selfId, petGUID_H, petGUID_L )
LuaFnSetPetLife( sceneId, selfId, petGUID_H, petGUID_L, value )
LuaFnSendSpecificImpactToUnit(sceneId, selfId, selfId, selfId, 18, 0);
return 1
end
|