< 魔兽世界百科 >
您尚未注册/登录
搜索帮助
搜索提示已开启 输入搜索关键词时将自动出现其他玩家的同类搜索词 开启搜索提示 搜索关键词时仍按普通搜索提交框方式输入 什么是智能搜索提示
职业技能 (1199)专业技能 (423)
武器 (2209)防具 (15620)药品 (0)任务道具 (1677)材料 (0)其它 (10399)
商人NPC (981)任务NPC (952)怪物 (7220)其他NPC (10639)
1-10级11-20级21-30级31-40级41-50级50级以上
全部地图 (10091)
WOW动态 (267)WOW学院 (778)职业研究 (27159)副本心得 (1319)天赋交流 (559)任务攻略 (1885)专业技能心得 (740)战场PVP (803)宏与插件交流 (222)
游戏百科 > 魔兽世界 > WOW手册 > 宏与插件交流 > 宏函数大全 > 百科资料
资源苗 基于游戏百科共建计划 - 了解 | 加入
在魔兽世界中已有97,734项百科条目,如果你有任何可以分享的请
魔兽世界API函数汇总-商业技能,交易,技能训练,对象等
好东西!投票支持(3)
匿名投票,确认投票给dailytoy
资料版本 1.0,更新时间:2005年8月28日 来源地址

(编者注:魔兽世界的API接口函数库相当庞大,本类的整理将是一个长期的编辑过程,逐步汉化,同时欢迎对魔兽世界宏与UI有兴趣的各路高手加入本项百科计划!)

编译自:WOWWIKI

魔兽世界API

魔兽世界API是一整套由暴雪提供的,允许玩家通过插件与宏改善魔兽世界游戏用户界面的函数接口功能.
以下是几近完整的函数接口列表,由暴雪开放提供,您可以使用它们创建你自己的插件或者宏.
我们欢迎您将自己了解的更多知识与我们共享,将自己的心得发布上来

TradeSkill Functions (商业技能函数) 

CloseTradeSkill() - Closes an open trade skill window.
CollapseTradeSkillSubClass(index) - Collapses the specified subclass header row.
DoTradeSkill(index{,repeat}) - Performs the tradeskill a specified # of times.
ExpandTradeSkillSubClass(index) - Expands the specified subclass header row.
GetFirstTradeSkill() - Returns the index of the first non-header trade skill entry.
GetNumTradeSkills() - Get the number of trade skill entries (including headers).
GetTradeSkillCooldown(index) - Returns the number of seconds left for a skill to cooldown.
GetTradeSkillIcon(index) - Returns the texture name of a tradeskill’s icon.
GetTradeSkillInfo(index) - Retrieves information about a specific trade skill.
GetTradeSkillInvSlotFilter(slotIndex) - ?.
GetTradeSkillInvSlots() - Returns a list of the available inventory slot types.
GetTradeSkillItemLink(index) - Gets the link string for a trade skill item.
GetTradeSkillItemStats() - ?
GetTradeSkillLine() - Returns information about the selected skill line.
GetTradeSkillNumMade(index) - Gets the number of items made in a single use of a skill.
GetTradeSkillNumReagents(tradeSkillRecipeId) - Returns the number of different reagents required.
GetTradeSkillReagentInfo(tradeSkillRecipeId, reagentId) - Returns data on the reagent, including a count of the player’s inventory.
GetTradeSkillReagentItemLink(index, reagentId) - Gets the link string for a trade skill reagent.
GetTradeSkillSelectionIndex() - Returns the Id of the currently selected trade skill, 0 if none selected.
GetTradeSkillSubClassFilter - ?.
GetTradeSkillSubClasses() - Returns a list of the valid subclasses.
GetTradeSkillTools(index) - Returns information about the tools needed for a tradeskill.
GetTradeskillRepeatCount() - ?.
IsTradeskillTrainer() - Returns 1 if trainer is for a tradeskill.
IsTrainerServiceTradeSkill() - ?.
SelectTradeSkill(index) - Select a specific trade skill in the list.
SetTradeSkillInvSlotFilter(slotIndex,onOff{,exclusive} ) - Set the inventory slot type filter.
SetTradeSkillSubClassFilter(slotIndex,onOff{,exclusive} ) - Set the subclass filter.
发现不支持的代码:

Trading Functions (交易功能函数)

AcceptTrade() - A pending trade will be accepted.
AddTradeMoney() - Adds the money dropped into the player’s trade frame.
BeginTrade() - Begins the trade with the target.
CancelTrade() - Declines the offer to trade with the other player.
CancelTradeAccept - Cancels the trade attempt which required an accept.
ClickTargetTradeButton(index)
ClickTradeButton(index)
CloseTrade - Closes the trade.
GetPlayerTradeMoney - Returns the amount of money the player has in the trade window.
GetTargetTradeMoney - Returns the amount of money in the trade frame of the target player.
GetTradePlayerItemInfo(id) - Returns information about a trade item.
GetTradePlayerItemLink(id) - Returns link to a trade item.
GetTradeTargetItemInfo(id) - Returns information about a trade item.
GetTradeTargetItemLink(id) - Returns link to a trade item.
InitiateTrade(UnitId) - Asks the specified unit to trade.
PickupPlayerMoney - Picks up an amount of money from the player.
PickupTradeMoney(amount)
ReplaceTradeEnchant - Confirm the replacement of an enchantment via trade.
SetTradeMoney(amount)
发现不支持的代码:

Training Functions (技能训练功能函数)

BuyTrainerService - ?.
CloseTrainer - ?.
CollapseTrainerSkillLine - ?.
ExpandTrainerSkillLine - ?.
GetNumTrainerServices() - Get the number of the trainer services.
GetTrainerGreetingText() - Get the trainer’s greeting text.
GetTrainerSelectionIndex() - Get the index of the selected trainer service.
GetTrainerServiceAbilityReq - ?.
GetTrainerServiceCost(index) - Returns the cost of a specific trainer service.
发现不支持的代码:GetTrainerServiceDescription(index) - Returns the description of a specific trainer service.
GetTrainerServiceIcon - ?.
GetTrainerServiceInfo - ?.
GetTrainerServiceLevelReq - ?.
GetTrainerServiceNumAbilityReq - ?.
GetTrainerServiceSkillLine - ?.
GetTrainerServiceSkillReq(index) - Returns a String and Variable for the requirements of a specific trainer service.
GetTrainerServiceStepIncrease() - ?.
GetTrainerServiceStepReq - ?.
GetTrainerServiceTypeFilter - Returns the status of a skill filter in the trainer window.
GetTrainerSkillLineFilter() - ?;
GetTrainerSkillLines() - ?;
IsTalentTrainer - ?.
IsTradeskillTrainer() - Returns 1 if trainer is for a tradeskill.
IsTrainerServiceLearnSpell(index)
IsTrainerServiceSkillStep() - ?.
IsTrainerServiceTradeSkill() - ?.
OpenTrainer() - ?.
SelectTrainerService - ?.
SetTrainerServiceTypeFilter - ?.
SetTrainerSkillLineFilter() - ?.
发现不支持的代码:

Unit Functions (玩家/对象 功能函数)

These are functions which act on one or more units. Units are identified by UnitIds.

AssistUnit("unit") - Instructs your character to assist the specified unit.
CheckInteractDistance("unit",distIndex)
DropItemOnUnit("unit") - Drops an item from the cursor onto a unit.
FollowUnit("unit")
InviteToParty("unit") - Invite a unit to a party.
IsUnotOnQuest(questIndex, "unit") - Determine if the a specific unit is on a given quest (NEW IN 1300).
SpellCanTargetUnit("unit") - Returns true if the spell awaiting target selection can be cast on the specified unit.
SpellTargetUnit("unit") - Casts the spell awaiting target selection on the specified unit.
StartDuelUnit("unit") - Challenge a unit to a duel.
TargetUnit("unit") - Selects the specified id as the current target.
REMOVED TargetUnitsPet("unit") - Targets the specified unit’s pet, if one exists. (Removed in 1.6 -- Flickering 14:12, 17 Jul 2005 (EDT))
UnitAffectingCombat("unit") - Returns 1 if unit is in combat or has aggro. Turns nil otherwise or on death.
UnitArmor("unit") - Returns the armor statistics relevant to the specified unit.
UnitAttackBothHands("unit") - Returns information about the unit’s melee attacks.
UnitAttackPower("unit") - Returns the Unit’s melee attack power and modifiers.
UnitAttackSpeed("unit") - Returns the unit’s melee attack speed for each hand.
UnitBuff("unit", index) - Retrieves info about a buff of a certain unit.
UnitCanAssist("unit", "otherUnit") - Returns true if the first unit can assist the second, false otherwise.
UnitCanAttack("unit", "otherUnit") - Returns true if the first unit can attack the second, false otherwise.
UnitCanCooperate("unit", "otherUnit") - Returns true if the first unit can cooperate with the second, false otherwise.
UnitCharacterPoints("unit") - ?.
UnitClass("unit") - Returns the class name of the specified unit (e.g., "Warrior" or "Shaman").
UnitClassification("unit") - Returns the classification of the specified unit (e.g., "elite" or "worldboss").
UnitCreatureFamily("unit") - Returns the type of creature of the specified unit (e.g., "Crab").
UnitCreatureType("unit") - Returns the classification type of creature of the specified unit (e.g., "Beast").
UnitDamage("unit") - Returns the damage statistics relevant to the specified unit.
UnitDebuff("unit", index) - Retrieves info about a debuff of a certain unit.
UnitDefense("unit") - ?.
UnitExists("unit") - Returns true if the specified unit exists, false otherwise.
REMOVED UnitFacing("unit") - Returns the direction in which the unit is facing (Counterclockwise radians, from North) - REMOVED IN 1300 -- Flickering 16:51, 22 Mar 2005 (EST)
UnitFactionGroup("unit") - Returns the faction group id and name of the specified unit. (eg. "Alliance") - string returned is localization-independent (used in filepath) -~~
UnitHealth("unit") - Returns the current health, in points, of the specified unit.
UnitHealthMax("unit") - Returns the maximum health, in points, of the specified unit.
UnitInParty("unit") - Returns true if the unit is a member of your party.
UnitInRaid - ?.
UnitIsCharmed("unit") - Returns true if the specified unit is charmed, false otherwise.
UnitIsCivilian("unit") - Returns true if the "unit" is a civilian.
UnitIsConnected("unit") - Returns 1 if the specified unit is connected or npc, nil if offline or not a valid unit.
UnitIsCorpse("unit") - Returns true if the specified unit is a corpse, false otherwise.
UnitIsDead("unit") - Returns true if the specified unit is dead, nil otherwise.
UnitIsDeadOrGhost("unit") - Returns true if the specified unit is dead or a ghost, nil otherwise.
UnitIsEnemy("unit", "otherUnit") - Returns true if the specified units are enemies, false otherwise.
UnitIsFriend("unit", "otherUnit") - Returns true if the specified units are friends (PC of same faction or friendly NPC), false otherwise.
UnitIsGhost("unit") - Returns true if the specified unit is a ghost, false otherwise.
UnitIsPVP("unit") - Returns true if the specified unit is flagged for PVP, false otherwise.
UnitIsPVPFreeForAll("unit") - Returns true if the specified unit is flagged for free-for-all PVP, false otherwise.
UnitIsPartyLeader("unit") - Returns true if the unit is the leader of its party.
UnitIsPlayer("unit") - Returns true if the specified unit is a player character, false otherwise.
UnitIsPlusMob("unit") - Returns true if the specified unit is a mob, more powerful than its nominal level, false otherwise (e.g., "elite" mobs)
UnitIsTapped("unit") - Returns true if the specified unit is tapped, false otherwise.
UnitIsTappedByPlayer("unit") - Returns true if the specified unit is tapped by a player, false otherwise.
UnitIsTrivial("unit") - Returns true if the specified unit is trivial (Trivial means the unit is "grey" to the player. --Antiarc 16:02, 30 Jan 2005 (EST)), false otherwise.
UnitIsUnit("unit", "otherUnit") - Returns true if the two specified units refer to the same unit (e.g., "player" and "target" can refer to the same unit), false otherwise.
UnitIsVisible("unit") - true/false
UnitLevel("unit") - Returns the level of the unit referred to by the local naming schema.
UnitMana("unit") - Returns the current mana (or energy,rage,etc), in points, of the specified unit.
UnitManaMax("unit") - Returns the maximum mana (or energy,rage,etc), in points, of the specified unit.
UnitName("unit") - Returns the name of the unit referred to by the local naming schema.
UnitOnTaxi("unit") - Returns 1 if unit is on a taxi.
UnitPVPName("unit") - Returns unit’s name with PvP rank prefix (e.g., "Corporal Allianceguy").
UnitPVPRank("unit") - Get PvP rank information for requested unit.
UnitPlayerControlled("unit") - Returns true if the specified unit is controlled by a player, false otherwise.
UnitPowerType("unit") - Returns a number corresponding to the power type (e.g., mana, rage or energy) of the specified unit.
UnitRace("unit") - Returns the race name of the specified unit (e.g., "Human" or "Troll").
UnitRangedAttack("unit") - Returns the ranged attack number of the unit.
UnitRangedAttackPower("unit") - Returns the ranged attack power of the unit.
UnitRangedDamage("unit") - Returns the ranged attack speed and damage of the unit.
UnitReaction("unit", "otherUnit") - Returns a number corresponding to the reaction (aggressive, neutral or friendly) of the first unit towards the second unit.
UnitResistance("unit", "resistanceIndex") - Returns the resistance statistics relevant to the specified unit and resistance type.
UnitSex("unit") - Returns a code indicating the gender of the specified unit, if known.
UnitStat("unit", statIndex) - Returns the statistics relevant to the specified unit and basic attribute (e.g., strength or intellect).
UnitXP("unit") - Returns the number of experience points the specified unit has in their current level.
UnitXPMax("unit") - Returns the number of experience points the specified unit needs to reach their next level.
发现不支持的代码:

Who Functions (玩家查询功能函数)

GetNumWhoResults()
GetWhoInfo(index)
SendWho("filter") - Send a who request to the server.
SetWhoToUI(toUIFlag) - Indicate that who request results should be delivered as WHO_LIST_UPDATE instead of to chat.
SortWho(sortType)
发现不支持的代码:

UI Provided Functions

These functions are not part of the basic API, but instead are provided in the standard FrameXML UI code. They’re considered important enough to appear here.

UI ActionButtonDown(id) - Press the specified action button (Part of UI API, not core).
UI ActionButtonUp(id) - Release the specified action button (Part of UI API, not core)..
UI BonusActionButtonDown - Trigger the specified bonus(pet or minion) action button. (Part of UI API, not core).
UI BonusActionButtonUp - Release the specified bonus(pet or minion) action button. (Part of UI API, not core).
UI GetText()
UI message("text") - Displays a message box with your text message and an "Okay" button.
UI MouseIsOver - Determines whether or not the mouse is over the specified frame.
UI SetItemRef(itemLink) - Displays an item link box.
UI SetPortraitTexture(texture,"unit") - Paint a Texture object with the specified unit’s portrait.
UI SetPortraitToTexture(x,x)
UI TakeScreenshot - Takes a screenshot.
UI ToggleBackpack - Toggles your backpack open/closed.
UI ToggleBag - Opens or closes the specified bag.
UI ToggleCharacter - Toggles the character pane to the specified frame.
UI ToggleCombatLog - Opens/closes the combat log.
UI ToggleFramerate - Show/Hide the FPS.
UI ToggleFriendsFrame - Opens/closes the friends pane.
UI ToggleGameMenu - Opens/closes the game menu.
UI ToggleMinimap - Turns the minimap display on/off.
UI ToggleQuestLog - Opens/closes the quest log.
UI ToggleSpellBook("bookType") - Shows the spellbook. Can show your spells or your pet’s.
UI ToggleWorldMap - Turns the world map on/off.
UI _ERRORMESSAGE(value) - Displays the script error dialog with optional text
发现不支持的代码:

Removed Functions (已经移除的功能函数)

These functions have been removed from the API in a previous patch.

REMOVED AddSendMailCOD() - This does not appear to exist any longer. --Bug 18:43, 4 Feb 2005 (EST)
REMOVED AddSendMailMoney() - This does not appear to exist any longer. --Bug 18:54, 4 Feb 2005 (EST)
REMOVED Duel - Duels a specified user by name. (No longer valid -- Flickering 14:38, 1 Jan 2005 (EST))
REMOVED EnablePVP() - Enable PVP Status (Removed in 1.4.0 patch -- Flickering 23:12, 19 Apr 2005 (EDT))
REMOVED GetDate - Returns date of last (major) patch to World of Warcraft as a string. - Removed in 1.3.0..
REMOVED PickupSendMailCOD(amount) - This does not appear to exist any longer. --Bug 15:45, 6 Feb 2005 (EST)
REMOVED PickupSendMailMoney(amount) - This does not appear to exist any longer. --Bug 15:45, 6 Feb 2005 (EST)
REMOVED PlayVocalCategory("category") - REMOVED IN 1300 -- Flickering 16:43, 22 Mar 2005 (EST)
REMOVED ReportBug("text") - REMOVED IN 1300 -- Flickering
REMOVED ReportNote("text") - REMOVED IN 1300 -- Flickering
REMOVED ReportSuggestion("text","category") - REMOVED IN 1300 -- Flickering
REMOVED RunMacro - This does not appear to exist anymore Flickering 18:41, 1 Jan 2005 (EST).
REMOVED SaveMacros() - Save all macros to WTF/Account/user/macros-local.txt. (Removed in 1.6, macros are saved on exit -- Flickering 14:15, 17 Jul 2005 (EDT))
REMOVED SetInventoryPortraitTexture()
REMOVED TargetUnitsPet("unit") - Targets the specified unit’s pet, if one exists. (Removed in 1.6 -- Flickering 14:12, 17 Jul 2005 (EDT))
REMOVED UnitFacing("unit") - Returns the direction in which the unit is facing (Counterclockwise radians, from North) - REMOVED IN 1300 -- Flickering 16:51, 22 Mar 2005 (EST)
发现不支持的代码:

Unknown Functions

Add functions whose group is not clear to this section, please remember to follow the Example Function template!

GetActiveLevel(index)
GetActiveTitle(index)
GetAvailableLevel(index)
GetAvailableTitle(index)
发现不支持的代码:

User Defined Functions

- added by VelvetPaw -

Place your user defined functions here to enhance MODs. Please follow the Example Function template for a clear layout. (I didn’t find a better place to add this...I hope some users will find this a good idea and will add some of their own functions. So please feel free to add...)

Lore Functions:
SetLang(Lang, ToParty, ShowParty) - This allows you to handle the different settings in Lore.


发现不支持的代码:发现不支持的代码:

暂时没有补充内容 您可以第一个补充内容


引用百科资源:多种方式引用本页 | 浏览引用了本页的网站/网页(717)
关闭
百科引用链使您能方便地在其他网页插入本资源的引用链接,让优秀的百科资源通过引用链对更多玩家造成帮助。
越多的玩家通过您的引用链访问百科将为您带来更多的百科威望!

引用本页地址(点击复制到粘贴板) 粘贴到你想引用的网页。
HTML形式的传播:

论坛形式的传播:

关闭
本页有下列读者,字体越大、颜色越深的玩家阅读本页的次数越多。
*如果您的玩家名称未刊载于此,因为只有百科成员才能记录阅读体验。
在魔兽世界中已有97,734项百科条目,如果你有任何可以分享的请

本页由 dailytoy 创建,希望能用你我的开放思维帮助下得到不断完善。
共有 0 条评论 浏览全部评论
匿名发表,您可以马上注册/登录成为百科玩家后用属于自己个性名称发表。

《魔兽世界API函数汇总-商业技能,交易,技能训练,对象等》的任何感想和见解请发于此。

热门资料推荐
请和我们一起建造全球最大的人工游戏百科
在本目录提交一笔资料 - 我们的计划 - 成为目录编辑
搜游的搜索内容将在 游戏百科共建计划 的基础上不断完善与加强。
当前目录下还没有目录编辑负责管理。
 

想把自己的网站也加上搜索功能?来这里获得免费的魔兽世界搜索条

搜游大全 - 免责声明 - 投放广告 - 商务合作

© 2005 - 2007 搜友游戏百科 SOUYO.com