--命令治疗 Global_Reg.RegTalkEvent("zl2_TalkEvent") --全局注册对话事件函数 function zl2_TalkEvent (player,msg,color,range,size) if(msg=="P|/zl2") then --治疗命令 local Gold = Char.GetData(player, %对象_金币%) --获取魔币数据 local Injury = Char.GetData(player, %对象_受伤%) --获取受伤数据 local Lv = Char.GetData(player, %对象_等级%) --获取等级数据 local bai = Lv*Lv*1 --白伤价格(官方1倍) local huang = Lv*Lv*1.25 --黄伤价格(官方2.25倍) local fen = Lv*Lv*1.5 --粉伤价格(官方4倍) local hong = Lv*Lv*1.75 --红伤价格(官方6.25倍) if(Injury >= 1 and Injury <= 25 and Gold >= bai)then Char.SetData(player, %对象_受伤%,Injury-Injury) --受伤状态恢复0(未受伤状态) Char.SetData(player, %对象_金币% ,Gold-bai) --扣除白伤魔币(等级平方*1倍) NLG.UpChar(player, %对象_受伤%) --更新角色受伤数据 NLG.SystemMessage(player, "已经恢复健康了") end if(Injury >= 26 and Injury <= 50 and Gold >= huang)then Char.SetData(player, %对象_受伤%,Injury-Injury) --受伤状态恢复0(未受伤状态) Char.SetData(player, %对象_金币% ,Gold-huang) --扣除黄伤魔币(等级平方*1.25倍) NLG.UpChar(player, %对象_受伤%) --更新角色受伤数据 NLG.SystemMessage(player, "已经恢复健康了") end if(Injury >= 51 and Injury <= 75 and Gold >= fen)then Char.SetData(player, %对象_受伤%,Injury-Injury) --受伤状态恢复0(未受伤状态) Char.SetData(player, %对象_金币% ,Gold-fen) --扣除粉伤魔币(等级平方*1.5倍) NLG.UpChar(player, %对象_受伤%) --更新角色受伤数据 NLG.SystemMessage(player, "已经恢复健康了") end if(Injury >= 76 and Injury <= 100 and Gold >= hong)then Char.SetData(player, %对象_受伤%,Injury-Injury) --受伤状态恢复0(未受伤状态) Char.SetData(player, %对象_金币% ,Gold-hong) --扣除白伤魔币(等级平方*1.75倍) NLG.UpChar(player, %对象_受伤%) --更新角色受伤数据 NLG.SystemMessage(player, "已经恢复健康了") end if(Injury >= 1 and Injury <= 25 and Gold < bai)then --受伤了但是钱不够 NLG.SystemMessage(player, "你的钱不够。") end if(Injury >= 26 and Injury <= 50 and Gold < huang)then --受伤了但是钱不够 NLG.SystemMessage(player, "你的钱不够。") end if(Injury >= 51 and Injury <= 75 and Gold < fen)then --受伤了但是钱不够 NLG.SystemMessage(player, "你的钱不够。") end if(Injury >= 76 and Injury <= 100 and Gold < hong)then --受伤了但是钱不够 NLG.SystemMessage(player, "你的钱不够。") end if(Injury <= 0)then --健康状态 NLG.SystemMessage(player, "你不需要治疗。") end end end