LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
查看: 324|回复: 10

[wowbee] 飞升计划人物三个能量条怎么控制怒气写法

[复制链接]
发表于 2022-6-27 15:01:20 | 显示全部楼层 |阅读模式
最近在玩飞升计划,但是人物法力值,怒气,和能量条都有,共存的。然后下面条件并不能控制怒气大于50释放英勇打击

local RAGE = UnitPower("player")
if BeeUnitAffectingCombat() and BeeUnitMana("player","%")>=50 and BeeIsRun("Heroic Strike")
then   
    BeeRun("/cast Heroic Strike")
end


哪位大佬能指点下怎么写吗
回复

使用道具 举报

发表于 2022-6-27 15:55:31 | 显示全部楼层
这个就麻烦,只能获取默认的能量数值
local p = "player"
UnitPower(p,type)
print(type)
看看游戏默认用的是哪个类型的能量先,
回复 支持 反对

使用道具 举报

发表于 2022-6-27 15:59:53 | 显示全部楼层
[Lua] 纯文本查看 复制代码
UnitPowerType

Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit.

powerType, powerToken, altR, altG, altB = UnitPowerType(unit[,index])
Arguments
unit 
String (unitId) - The unit whose power type to query.
index 
number - Optional value for classes with multiple powerTypes. If not specified, information about the first (currently active) power type will be returned.
Returns
powerType 
Enum.PowerType - the ID corresponding the the unit's queried power type.
powerToken 
string - also the power type:
"MANA"
"RAGE"
"FOCUS"
"ENERGY"
"HAPPINESS"
"RUNES"
"RUNIC_POWER"
"SOUL_SHARDS"
"ECLIPSE"
"HOLY_POWER"
"AMMOSLOT" (vehicles, 3.1)
"FUEL" (vehicles, 3.1)
"STAGGER" (vehicles, 5.1)
"CHI"
"INSANITY"
"ARCANE_CHARGES"
"FURY"
"PAIN"
altR 
number - Alternative red component for this power type, see details. Nil for most of the standard power types.
altG 
number - Alternative green component for this power type, see details. Nil for most of the standard power types.
altB 
number - Alternative blue component for this power type, see details. Nil for most of the standard power types.
Example
The following snippet displays the player's current mana/rage/energy/etc in the default chat frame.

local t = {[0] = "mana", [1] = "rage", [2] = "focus", [3] = "energy", [4] = "happiness", [5] = "runes", [6] = "runic power", [7] = "soul shards", [8] = "eclipse", [9] = "holy power"}
print(UnitName("player") .. "'s " .. t[UnitPowerType("player")] .. ": " .. UnitPower("player"))

Details
Colors of all typical power types are stored in the PowerBarColor global table. Some special types may implement their own color as returned by the 3rd to 5th return values of UnitPowerType. For most of the standard power types they return nil however. FrameXML implements it the following way (with a fallback to "MANA"):
local powerType, powerToken, altR, altG, altB = UnitPowerType(UnitId);
local info = PowerBarColor[powerToken];

if ( info ) then
 --The PowerBarColor takes priority
 r, g, b = info.r, info.g, info.b;
else
 if ( not altR) then
 -- Couldn't find a power token entry. Default to indexing by power type or just mana if  we don't have that either.
 info = PowerBarColor[powerType] or PowerBarColor["MANA"];
 r, g, b = info.r, info.g, info.b;
else
 r, g, b = altR, altG, altB;
end
Also See:
UnitPower
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-6-27 16:05:56 | 显示全部楼层
显示 function 4BDFA940
回复 支持 反对

使用道具 举报

发表于 2022-6-27 16:11:00 | 显示全部楼层

不是应该显示 mana 或者 energy 或者 Fury这些么
回复 支持 反对

使用道具 举报

发表于 2022-6-27 16:16:11 | 显示全部楼层


UnitPowerType可以获取职业使用多能量类型的类型.

但仅限知道哪些类型,
获取每种能量的数值, 我还不知道,
用UnitMana或者UnitPower只能获取当前使用的能量,
例如 小德变身前 是蓝 "mana" 变身豹形态后是 "energy"
回复 支持 反对

使用道具 举报

发表于 2022-6-27 16:25:12 | 显示全部楼层

你可以尝试, 用UnitPower函数指定能量类型 或许能行我没有



指定蓝条
local a = UnitPower("player","mana") ---蓝量
local b = UnitPower("player","energy") ---盗贼能量
local c = UnitPower("player","rage") --战士怒气
print("蓝:"..a.."能量:"..b.."怒气:"..c)
根据你有的3个对应数值条改, 然后print一下每个数值 是否有相对应的数值
测试所有可能

回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-6-27 18:27:35 | 显示全部楼层
有的,显示蓝3011 能量3011 怒气3011
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-6-27 18:58:55 | 显示全部楼层
if UnitPower("player","1")>=45 then
    BeeRun("/cast Heroic Strike","target")
end

这么写成功了,谢谢哈
回复 支持 反对

使用道具 举报

发表于 2022-6-27 23:23:38 | 显示全部楼层
本帖最后由 idlng 于 2022-6-27 11:25 PM 编辑
zyhhll1988 发表于 2022-6-27 06:58 PM
if UnitPower("player","1")>=45 then
    BeeRun("/cast Heroic Strike","target")
end

那么恭喜你,,

就是按照这个格式来,


我也算是学到了,哈
3.02之后 UnitMana 被UnitPower替换.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2024-4-26 11:32 AM , Processed in 0.065518 second(s), 32 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表