魔兽世界API 全局函数1
(2010-01-15 09:23:14)
标签:
杂谈 |
分类: wow |
帐号游戏时间范围函数 (Account PlayTime Limit Functions)此类API函数是专门为防沉迷系统而设计的,能计算出当前玩家游戏时间等内容,当前只在亚洲地区有效。
GetBillingTimeRested() - 返回当前帐户已登陆时间。
PartialPlayTime() - 如果用户状态为“疲劳(tired)”则返回1:降低经验及掉落。
NoPlayTime() - 如果用户状态为“不健康的(unhealthy)”则返回1:无经验及掉落。
--------------------------------------------------------------------------------
动作函数 (Action Functions)这些函数对动作按钮进行操作(通常玩家的动作有可能通过下面列表中的函数执行)。
保护 界面 ActionButtonDown(id) - 按下指定动作按钮。
保护 界面 ActionButtonUp(id) - 释放指定动作按钮。
ActionHasRange(slot) - 检测指定动作按钮是否受距离限制 (是则返回 1,否则返回 nil) 。
界面 BonusActionButtonDown - 触发指定额外动作按钮 (宠物或仆从)。
界面 BonusActionButtonUp - 释放指定额外动作按钮 (宠物或仆从)。
保护 CameraOrSelectOrMoveStar
保护 CameraOrSelectOrMoveStop
ChangeActionBarPage() - 更改系统动作按钮页面为系统变量 CURRENT_ACTIONBAR_PAGE
指定页。
GetActionBarToggles() - 获取系统动作条显示状况。
GetActionCooldown(slot) - 获取指定动作按钮冷却状况。
GetActionCount(slot) - 获取动作按钮所需物品剩余量 (绷带/毒药/等),无物品或不可用时返回 0。
GetActionText(slot) - 获取动作按钮文本标签 (宏, 等),不存在则返回 nil。
GetActionTexture(slot) - 获取指定动作按钮材质路径。
GetBonusBarOffset() - 检测何种额外动作条已显示。
HasAction(slot) - 假如指定动作条按钮有技能执行,则返回 1,其他情况返回 nil。
IsActionInRange(slot) - 测试技能是否在施展距离内 (1=是, 0=否, nil=不可用)。
IsAttackAction(slot) - 技能为“攻击”动作则返回 1 (战斗中闪光), 其他情况返回 nil。
IsAutoRepeatAction(slot) - 技能可自动重复时返回 1,其他情况返回 nil。
IsCurrentAction(slot) - 技能动作正在执行时返回 1,其他情况返回 nil。
IsUsableAction(slot) - 技能可立即执行时返回 1,其他情况返回 nil。
IsConsumableAction(slot) - 技能有施展次数时返回 1 (例如:施法物品),其他情况返回 nil。
IsEquippedAction(slot) - 必须装备才能施展的技能返回 1 (例如:链接到必须装备的物品),其他情况返回
nil。
PetHasActionBar() - 检测玩家宠物是否有动作条。
PickupAction(slot) - 将指定动作按钮的技能提取并放置于光标上。
PickupPetAction(slot) - 将指定的宠物动作按钮的技能提取并放置于光标上。
PlaceAction(slot) - 将鼠标上的技能放置于指定动作按钮。
SetActionBarToggles(show1,show2,show3,show4[, alwaysShow]) -
设置指定系统动作条显示。 - 1.12 版本添加 'alwaysShow'。
保护 TurnOrActionStart() - 在 3D 界面开始 "右键单击" 动作。(1.10 - 保护)
保护 TurnOrActionStop() - 在 3D 界面结束 "右键单击" 动作。 (1.10 - 保护)
保护 UseAction(slot[, checkCursor[, onSelf]]) - 执行绑定到指定 ID
的动作按钮技能,可定向玩家 (与目标无关)。
--------------------------------------------------------------------------------
行为函数 (Activity Functions)这个部分的函数会引发玩家角色的动作(未在别处加以保护, 非简单确认步骤)
AcceptDuel() - 玩家同意接受决斗挑战.
保护 AttackTarget() - 攻击选定目标.
CancelDuel() - 拒绝决斗挑战.
CancelLogout()
CancelMeetingStoneReques
ClearTutorials()
ConfirmSummon()
保护 DescendStop() --增加于2.1
Dismount() --增加于2.0.3
FlagTutorial("tutotial")
保护 ForceLogout()
ForceQuit()
GetSummonConfirmAreaName
GetSummonConfirmSummoner
GetSummonConfirmTimeLeft
Logout - 注销当前玩家角色.
Quit - 退出应用程序(游戏), 而非 LUA 脚本.
RandomRoll(low, high) - 随机产生在两个(正整数)数值闭区间的整数.
保护 SitStandOrDescendStart() - 切换玩家坐下/站立姿势.
保护 StartDuel("name") - 向玩家发出决斗邀请(根据名字)
TogglePVP() - 切换 PVP 状态
ToggleSheath() - 拔出/收起武器.
UseSoulstone() - 使用激活的灵魂石复活自己.
--------------------------------------------------------------------------------
插件函数 (AddOn Functions)DisableAddOn(index or "AddOnName") -
禁止某插件下次载入.
DisableAllAddOns() - 禁止所有插件下次被载入..
EnableAddOn(index or "AddOnName") - 在下次进程开启指定插件.
EnableAllAddOns() - 在下次进程开启全部插件.
GetAddOnDependencies(index or "AddOnName") - 取得插件依赖列表.
GetAddOnInfo(index or "AddOnName") - 取得插件相关信息.
GetAddOnMetadata(index or "name", "variable") -
从插件的TOC文件中获取标签内容(值)。
GetNumAddOns() - 取得用户插件数量.
IsAddOnLoaded(index or "AddOnName") - 指定插件已读取则返回 true.
IsAddOnLoadOnDemand(index or "AddOnName") - 测试插件是否可动态载入.
LoadAddOn(index or "AddOnName") - 发出动态载入插件读取请求.
ResetDisabledAddOns() -
--------------------------------------------------------------------------------
竞技场函数(Arena Functions)ArenaTeamInviteByName(teamIndex, playerName)
- Invites the specified player to the specified arena team.
ArenaTeamLeave(teamIndex) - Leaves the specified arena team.
ArenaTeamRoster(teamIndex) - Sends a request to the server to
request the most recent information on a specific Arena Team that
you are in.
ArenaTeamUninviteByName(teamIndex, playerName) - Removes the
specified played from the specified arena team.
ArenaTeamDisband(teamIndex) - Disbands the arena team without any
warning! Requires you to be the leader of the team. (Known to be
implemented as of 2.1.3, but may have existed before).
GetArenaCurrency() - Gets the amount of arena points a player
currently has to spend.
GetArenaTeam(teamIndex) - Returns information regarding the players
arena team, nil if the player is not in the passed team
GetArenaTeamRosterInfo(teamIndex, playerIndex) - Returns
information regarding a player from the specified team, this
requires a call to ArenaTeamRoster you only need to do this when
the player logins in, UI reloads will not effect the return.
GetNumArenaTeamMembers(teamIndex[, showOffline]) - Gets the number
of arena team members, this requires a call to ArenaTeamRoster you
only need to do this when the player logins in, UI reloads will not
effect the return.
GetBattlefieldTeamInfo(index) - Gets info about a registered Arena
Team at the end of an arena match.
GetCurrentArenaSeason() - Gets the current Arena season.
IsActiveBattlefieldArena
IsArenaTeamCaptain(teamIndex) - Returns a value based on whether
the player is the arena team captain.
IsBattlefieldArena() - Returns true if the battlemaster you're
talking to can queue you for arenas
--------------------------------------------------------------------------------
拍卖函数 (Auction Functions)CalculateAuctionDeposit(runTime) -
返回当前指定持续时间拍卖物品的堆放信息 (单位:分钟).
CanSendAuctionQuery() - 拍卖行搜索按钮可用时返回 1, 否则为 nil.
CancelAuction(index) - 取消指定拍卖 (在物主列表).
ClickAuctionSellItemButt
CloseAuctionHouse() - 关闭 (打开的) 拍卖窗口.
GetAuctionHouseDepositRa
GetAuctionInvTypes(classIndex, subclassIndex) - 返回物品的子类.
GetAuctionItemClasses() - 返回拍卖物品的主分类.
GetAuctionItemInfo("type", index) - 返回指定拍卖物品细节.
GetAuctionItemLink("type", index) - 返回指定拍卖物品的 itemLink.
GetAuctionItemSubClasses
GetAuctionItemTimeLeft("type", index) - 返回指定拍卖物品剩余时间状态.
GetAuctionSellItemInfo() - 返回当前拍卖物品相关信息 (未选择为 nil).
GetBidderAuctionItems([page]) - (取得竞标人信息).
GetNumAuctionItems("type") - 返回指定拍卖物品列表大小.
GetOwnerAuctionItems([page]) - (取得拍卖人信息).
GetSelectedAuctionItem("type") - 返回选择的拍卖物品索引 (1-50), 未选择返回 0.
IsAuctionSortReversed("type", "sort") - 指定拍卖物品的排列类型逆序排列时返回 1, 否则为
nil.
PlaceAuctionBid("type", index, bid) - 对选择拍卖物品投标.
QueryAuctionItems("name", minLevel, maxLevel, invTypeIndex,
classIndex, subclassIndex, page, isUsable, qualityIndex) -
(请求检索符合条件的物品).
SetSelectedAuctionItem("type", index) - ?.
SortAuctionItems("type", "sort") - 根据指定分栏对指定拍卖列表进行排序.
StartAuction(minBid, buyoutPrice, runTime) - 开始拍卖 '创建拍卖'
面板内物品.
界面 AuctionFrameAuctions.duration - 设置拍卖持续总计时间.
--------------------------------------------------------------------------------
银行函数 (Bank Functions)BankButtonIDToInvSlotID(buttonID) - 以背包位置 ID
方式返回银行包裹位置 ID.
CloseBankFrame() - 关闭 (打开的) 银行窗口. --Ramble
GetBankSlotCost(numSlots) - 返回购买下个银行包裹位置的价格. --Ramble
GetNumBankSlots() - 返回已购买银行包裹位置数量, 如果已购完返回特定标志.
PurchaseSlot() - 购买一个空余的银行包裹位置.
--------------------------------------------------------------------------------
战场函数 (Battlefield Functions)AcceptAreaSpiritHeal() - 接受灵魂治疗.
CancelAreaSpiritHeal() - 取消灵魂治疗.
CanJoinBattlefieldAsGrou
AcceptBattlefieldPort(index[, acceptFlag]) - 接受或拒绝一个传送至战场的请求.
CheckSpiritHealerDist() - 死亡时如果你在精神医者复活的范围内,返回true.
CloseBattlefield() - 关闭候列战场窗口.
GetHonorCurrency() - 获取当前荣誉值
GetAreaSpiritHealerTime() - 返回距精神医者下一次释放复活的时间.
GetBattlefieldEstimatedW
GetBattlefieldFlagPositi
GetBattlefieldInfo(index) - 返回你最近打开队列窗口的战场的详细信息.
GetBattlefieldInstanceEx
GetBattlefieldInstanceIn
GetBattlefieldInstanceRu
GetBattlefieldMapIconSca
GetBattlefieldPortExpira
GetBattlefieldPosition(index) - 获取战场中与你不在同一小队或团队的玩家姓名与位置 .
GetBattlefieldScore(index) - 获得一个玩家的战场分数.
GetBattlefieldStatData(playerIndex, slotIndex) -
获取战场中某一个玩家某一分栏的详细信息 . (例如战歌峡谷的夺旗数)
GetBattlefieldStatInfo(index) - 从战场记分板的指定分栏获取信息 .
GetBattlefieldStatus(index) - 返回玩家所在或正在队列中的战场的状态 .
GetBattlefieldTimeWaited
GetBattlefieldWinner() - 获得战场中获胜者 .
GetNumBattlefieldFlagPos
GetNumBattlefieldPositio
GetNumBattlefieldScores() - Returns the number of scores(players)
listed in the battlefield scoreboard.
GetNumBattlefieldStats() - Get the number of battleground specific
columns.
GetNumBattlefields() - Get the number of running battlefields for
the last battleground queue window you opened.
GetNumWorldStateUI() - 获取世界状态的UI数量
GetSelectedBattlefield() - Get the selected battlefield to join
first.
GetWorldStateUIInfo(i) - Get score and flag status within a
battlefield.
JoinBattlefield(index[, joinAs]) - 加入战场队列 .
LeaveBattlefield() - 离开战场.
ReportPlayerIsPVPAFK("unit") - 获取当前战场中的一玩家是否AFK
RequestBattlefieldPositi
RequestBattlefieldScoreD
SetBattlefieldScoreFacti
SetSelectedBattlefield(index) - Select the battlefield instance you
want to join or the first one that becomes available.
ShowBattlefieldList(index) - Displays a queue window for the
specified battlefield. Only works if you are already in a queue for
the battlefield. Index corresponds to location in queue array.
--------------------------------------------------------------------------------
绑定函数(Binding Functions)移除 GetActionSelfCastKey() -
移除 GetAutoLootToggleKey() -
GetBinding(index) - 获取索引的动作和快捷键.
GetBindingAction("KEY" [,checkOverride]) - 获取绑定该键的动作.
GetBindingKey("command") - 获取该动作绑定的键.
界面 GetBindingText("key", "prefix", returnAbbr) - 获取键值字串.
GetCurrentBindingSet() - 查询当前快捷键设置是否为指定帐号/角色.
GetNumBindings() - 获取总快捷键数与标题.
LoadBindings(which) - 读取默认/帐号/角色的特定快捷键配置.
RunBinding("command"[, "up"]) - 运行名为 "command" 的快捷键
移除 SetActionSelfCastKey("SHIFT" or "CTRL" or "ALT") -
移除 SetAutoLootToggleKey("SHIFT" or "CTRL" or "ALT") -
SaveBindings(which) - 保存帐号或角色键配置.
SetBinding("key"[, "command"]) - 设置或取消键绑定. (2.0 - 不能在战斗中使用.)
SetBindingSpell("KEY", "Spell Name") - 设置绑定键到技能, 与 /cast
使用技能一样.
SetBindingClick("KEY", "ButtonName" [,"mouseButton"]) - 设置绑定键到按钮对象.
绑定鼠标时, 按键按下时发生鼠标点击事件, 释放时发生鼠标 up.
SetBindingItem("KEY", "itemname") -
SetBindingMacro("KEY", "macroname"|macroid) -
SetConsoleKey("key") - 设置控制台键 (通常 "`").
SetOverrideBinding(owner, isPriority, "KEY" [,"COMMAND"]) -
设置/清除重复绑定键.
SetOverrideBindingSpell(owner, isPriority, "KEY", "spellname")
-
SetOverrideBindingClick(owner, isPriority, "KEY",
"ButtoName"[,"mouseButton"]) -
SetOverrideBindingItem(owner, isPriority, "KEY", "itemname")
-
SetOverrideBindingMacro(owner, isPriority, "KEY",
"macroname"|macroid) -
ClearOverrideBindings(owner) - 重置全部重复值.
SetMouselookOverrideBind
IsModifierKeyDown() - 等价于 (IsShiftKeyDown() 或 IsControlKeyDown() 或
IsAltKeyDown()).
IsModifiedClick("action") - 绑定该动作按钮按下返回 1, 否则 nil.
IsMouseButtonDown([button or "button"]) -
--------------------------------------------------------------------------------
增减益函数 (Buff/Debuff Functions)请勿混淆 buffId 和 buffIndex, 这是不同概念!
CancelPlayerBuff(buffIndex) - 从玩家身上移除特定增益.
CancelTrackingBuff() - 取消当前追踪增益 (追踪矿物等.)
GetPlayerBuff(buffId, buffFilter) - 获取特定效果信息 (有益, 有害或被动)
GetPlayerBuffApplication
GetPlayerBuffDispelType(buffIndex) - 获取玩家身上指定减益类型 ("魔法", "诅咒",
"疾病", 或 "毒药")
GetPlayerBuffTexture(buffIndex) - 获取特定增益图标标识
GetPlayerBuffTimeLeft(buffIndex) - 获取增益持续剩余时间
GetWeaponEnchantInfo() - 返回主手和副手武器附魔信息.
UnitBuff("unit", index[, showCastable]) - 获取特定单位的增益信息.
UnitDebuff("unit", index[, showDispellable]) - 获取特定单位的减益信息.
--------------------------------------------------------------------------------
视角函数 (Camera Functions)下列 API 仅对鼠标观察模式提供的按下右键和控制移动方向功能.
不支持按下鼠标左键切换视角.
保护 CameraOrSelectOrMoveStar
保护 CameraOrSelectOrMoveStop
CameraZoomIn(increment) - Zooms the camera into the viewplane by
increment.
CameraZoomOut(increment) - Zooms the camera out of the viewplane by
increment.
FlipCameraYaw(degrees) - 在 Z 轴旋转指定角度.
IsMouselooking() - 鼠标观察激活时返回 1, 否则为 nil.
MouselookStart()
MouselookStop()
MoveViewDownStart() - 镜头向下旋转.
MoveViewDownStop() - 停止调用 MoveViewDownStart() 旋转的镜头.
MoveViewInStart() - Begins zooming the camera in.
MoveViewInStop() - Stops zooming the camera in after
MoveViewInStart() is called.
MoveViewLeftStart() - Begins rotating the camera to the Left.
MoveViewLeftStop() - Stops rotating the camera after
MoveViewLeftStart() is called.
MoveViewOutStart() - Begins zooming the camera out.
MoveViewOutStop() - Stops zooming the camera out after
MoveViewOutStart() is called.
MoveViewRightStart() - Begins rotating the camera to the
Right.
MoveViewRightStop() - Stops rotating the camera after
MoveViewRightStart() is called.
MoveViewUpStart() - 镜头向上旋转.
MoveViewUpStop() - 停止调用 MoveViewUpStart() 旋转的镜头.
保护 PitchDownStart() - Begins pitching the camera Downward.
保护 PitchDownStop() - Stops pitching the camera after
PitchDownStart() is called.
保护 PitchUpStart() - Begins pitching the camera Upward.
保护 PitchUpStop() - Stops pitching the camera after PitchUpStart()
is called.
NextView() - Cycles forward through the five predefined camera
positions.
PrevView() - Cycles backward through the five predefined camera
positions.
ResetView(index) - Resets the specified (1-5) predefined camera
position to it's default if it was changed using
SaveView(index).
SaveView(index) - Replaces the specified (1-5) predefined camera
positions with the current camera position.
SetView(index) - Sets camera position to a specified (1-5)
predefined camera position.
--------------------------------------------------------------------------------
频道函数 (Channel Functions)这些是针对聊天频道的函数. 同时参看聊天窗口函数 (Chat Window
Functions) 和通信函数 (Communication Functions) 部分.
AddChatWindowChannel(chatFrameIndex, "channel") -
在指定窗口打开频道.
ChannelBan("channel", "name") - 在指定频道屏蔽一名玩家.
ChannelInvite("channel", "name") - 邀请指定玩家到频道中.
ChannelKick("channel", "name") - 从频道中剔除指定玩家.
ChannelModerate("channel") - 开启频道管理指令, 如 ChannelKick/Ban 等.
ChannelModerator("channel", "name") - 设置指定玩家为频道管理员.
ChannelMute("channel", "name") - 禁止指定玩家在频道中发言.
ChannelToggleAnnouncemen
ChannelUnban("channel", "name") - 解除屏蔽玩家.
ChannelUnmoderator("channel", "name") - 解除频道管理员.
ChannelUnmute("channel", "name") - 允许指定玩家发言.
DisplayChannelOwner("channel") - 在默认聊天中显示特殊频道主人.
EnumerateServerChannels() - 获取全部有效的服务频道 (区域依赖).
GetChannelList() - 获取已加入的频道列表.
GetChannelName("channel" or index) - 获取指定频道名称.
GetChatWindowChannels(index) - 获取聊天窗口的频道名称列表.
JoinChannelByName("channel"[, "password"[, frameId]]) - 加入指定频道
(可选密码和框架标识) (更新于 1.9)
LeaveChannelByName("channel") - 离开指定频道.
ListChannelByName(channelMatch) - 在聊天窗口显示指定频道的成员.
ListChannels() - 在聊天窗口中列出全部频道.
RemoveChatWindowChannel(chatFrameIndex, "channel") - 创建隐藏频道
(不可见).
SendChatMessage("text"[, "type"[, language[, targetPlayer, ...]]])
- 发送聊天信息.
SetChannelOwner("channel", "name") - 设置频道主人.
SetChannelPassword("channel", "password") - 更改当前频道密码.
--------------------------------------------------------------------------------
角色函数 (Character Functions)AbandonSkill(index) - 玩家忘却技能.
AcceptResurrect() - 接受他人复活.
AcceptSkillUps()
AcceptXPLoss() - 接受灵魂使者复活时的损失.
AddSkillUp(index)
BuySkillTier(index)
CancelSkillUps()
CheckBinderDist() - 检测玩家是否在炉石绑定指令距离.
ConfirmBinder() - 确认炉石绑定请求.
DeclineResurrect() - 拒绝他人复活.
GetBindLocation() - 获取炉石绑定区域名称.
GetBlockChance() - 获取玩家格挡几率.
GetCombatRating() - 获取玩家战斗频度. TBC 新增
GetCombatRatingBonus() - 获取玩家战斗奖励频度. TBC 新增
GetComboPoints() - 获取当前连击点.
GetCorpseRecoveryDelay() - 玩家接受复活剩余时间.
GetCritChance() - 获取爆击率()
GetCurrentTitle() - 获取玩家当前头衔 ID.
GetDamageBonusStat() - 获取额外伤害奖励状态索引.
GetDodgeChance() - 获取玩家躲闪几率.
GetMoney() - 获取拥有的金钱额度 (铜币).
GetParryChance() - 获取玩家招架几率.
GetRangedCritChance() - 获取远程爆击率
GetReleaseTimeRemaining() - 获取玩家灵魂释放剩余时间.
GetResSicknessDuration() -
GetRestState() - 获取休息状态.
GetSpellBonusDamage(spellTreeID) -
GetSpellBonusHealing() -
GetSpellCritChance(school)-
GetTimeToWellRested() - Defunct.
GetTitleName(index) - 获取玩家当前标题名称.
GetXPExhaustion() - 获取角色当前休息经验奖励, 没有奖励返回 nil.
HasFullControl()
HasSoulstone() - (获取是否灵魂绑定.)
IsFlying() -
IsIndoors - 返回1为在室内.返回nil值则在室内,你可以使用坐骑.
IsMounted - 坐骑状态返回1 否则为nil值.
IsOutdoors - 返回1为室外,否则为nil.返回1为室内可以使用坐骑
IsResting() - (获取是否处在休息状态.)
IsStealthed() - 如果为潜行或影遁返回1,否则为nil
IsSwimming() -
IsTitleKnown(index) - 若玩家的称为是有效值返回1,否则为nil值
NotWhileDeadError() - 生成一个内容为“你已死亡,无法这样进行这项动作”的错误信息.
RemoveSkillUp(index)
ResurrectHasSickness() - Appears to be used when accepting a
resurrection will give you resurrection sickessness.
ResurrectHasTimer() - 返回玩家要接受复活是否要等待一段时间
RetrieveCorpse() - 在尸体附近时复活. e.g., 当玩家跑回自己尸体附近时显示的“接受复活”按钮.
SetCurrentTitle(index) - 设置玩家当前的称号ID
SetSelectedSkill(index)
GetPVPDesired() - 获取玩家当前是否为PVP标志