基础版内置显血,站里有A佬的一个ui很完善的,但是缺少锁怪机制,会显示所有怪物的血量和状态,遮挡视线,我做了个简单的锁怪机制,只显示自己打中的怪的血量
function run ()
local mapId = Game_World_GetMapId()
if mapId ~= 305
and mapId ~= 303
and mapId ~= 306
and mapId ~= 301
and mapId ~= 302
and mapId ~= 503
and mapId ~= 506
then
local AttackMonster = Game_Player_Weapon_GetAttackMonster()
local addr1 = string.format("%016s", AttackMonster)
local monsterList = Game_Monster_GetAllMonsterHealthInTargetPointRange(xx,yy,zz,0,100)
local monsterList = Game_Monster_GetAllMonsterHealth()
for _, monsetr in pairs(monsterList) do
local addr2 = string.format("%016s", monsetr.Ptr)
if addr1 == addr2 and monsetr.Health~=0
then
System_UI_DrawText('health',monsetr.Health,0.9,0.5,3,1,1,1,1)
end
end
else System_UI_RemoveText('health')
end
end
