我的做法是在LUA里,受伤害触发段,每次受伤害都触发,检测当前HP低于MAXHP,切包裹里没有疗伤药和疗伤药包,打捆疗伤药包有1,就收走打捆疗伤药包,给与6包疗伤药包。前提是要先检测空间足够。应该算解决这个问题吧!
脚本如下:
内挂吃药解包,必备脚本:
if Actor:getAIType() == 0 and in_array(Actor:getRace(), {0,66}) then
local KG = Actor:getBagFree()
local YP1 = Actor:getBagCount("疗伤药")
local YPB1 = Actor:getBagCount("打捆疗伤药")
local YPB2 = Actor:getBagCount("打捆疗伤药包")
local YP2 = Actor:getBagCount("万年雪霜")
local YPB3 = Actor:getBagCount("万年雪霜包")
local YPB4 = Actor:getBagCount("万年雪霜捆")
if KG > 5 and YP1 < 1 and YPB1 < 1 and YPB2 > 0 then
Actor:takeBagItemEx("打捆疗伤药包", 1, 0)
Actor:giveItem("打捆疗伤药", 0, "", "", "", "", 6)
end
if KG > 5 and YP2 < 1 and YPB3 < 1 and YPB4 > 0 then
Actor:takeBagItemEx("万年雪霜捆", 1, 0)
Actor:giveItem("万年雪霜包", 0, "", "", "", "", 6)
end
end
|