Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 36.93 KB | None | 0 0
  1. ::FULL COMMAND LISTING::
  2.  
  3. :Global
  4. PerformIngameSpawn(type,entry,map,x,y,z,o,facOrScale,dur [,eq1,eq2,eq3,instanceId,save]) +- Fixed to work correctly, added new arguments.
  5.  
  6. GetLuaEngine()                                                    +- Returns what engine the server is using. Should be LuaHypArc.
  7. GetLuaEngineVersion()                                             +- Returns what version LuaHypArc on the server is.
  8. GetGameTime()                             +- Returns server time in seconds.
  9. ReloadTable(tablename)                        +- Reloads table tablename.
  10. Rehash()                              +- Rehashes server config files.
  11. RegisterServerHook(event, functionName)               +- Registers a server hook event. Further documentation included.
  12. logcol(colourVal)                         +- Sets the colour of the next print() message:
  13.   FOREGROUND_BLUE      = 1 // text color contains blue.
  14.   FOREGROUND_GREEN     = 2 // text color contains green.
  15.   FOREGROUND_RED       = 4 // text color contains red.
  16.   FOREGROUND_INTENSITY = 8 // text color is intensified (brightened).
  17.   //these can be added together, for example 1+8 = bright blue.
  18. GetPlayersInWorld()                       +- Returns a table containing all the players in the world.
  19. GetPlayersInMap(mapId)                        +- Returns a table containing all the players in map mapId.
  20. GetPlayersInZone(zoneId)                      +- Returns a table containing all the players in zone zoneId.
  21. RegisterTimedEvent(funcName, delay, repeats, ...)         +- Registers funcName to occur repeatedly. delay is in milliseconds. repeats can be 0 for infinite repeats.
  22.                                                                      The ... arguments are passed on to the registered function as arguments.
  23.                                                                      (Returns a unique reference that can be used later.)
  24. RemoveTimedEvents()                       +- Removes all events registered with RegisterTimedEvent.
  25. RemoveTimedEvent(reference)                   +- Removes the specific timed event. reference is returned by RegisterTimedEvent.
  26. RemoveTimedEventsWithName(name)                   +- Removes all timed events with the specified name.
  27. RemoveTimedEventsInTable(table)                   +- Removes all timed events from the specified table (string).
  28. HasTimedEvents()                          +- Returns true if any timed events are registered.
  29. HasTimedEvent(reference)                      +- Returns true if the specific event is still registered. reference is as above.
  30. HasTimedEventsWithName(name)                      +- Returns true if an event with the specified name is registered.
  31. HasTimedEventsInTable(table)                      +- Returns true if an event with the specified table is registered.
  32. GetArcemuRevision()                       +- Returns the server's ArcEmu revision number.
  33. SendPvPCaptureMessage(zoneId, message)                +- Sends a PvP-capture style message to zoneId.
  34. WorldDBQuery(query)                       +- Performs a query on the world database. Returns a "QueryResult" object.
  35. CharDBQuery(query)                            +- Performs a query on the character database. Returns a "QueryResult" object.
  36.  
  37. SendMail(type,senderGuid,receivrGuid,subject,body,money,codAmt,itemRawGuid,stationeryId)   +- Sends a mail message with specified parameters.
  38.   type can be:
  39.    NORMAL  = 0
  40.    COD     = 1
  41.    AUCTION = 2
  42.   stationery:
  43.     MAIL_STATIONERY_TEST1       = 1,
  44.     MAIL_STATIONERY_TEST2       = 41,
  45.     MAIL_STATIONERY_GM          = 61,
  46.     MAIL_STATIONERY_AUCTION     = 62,
  47.     MAIL_STATIONERY_VALENTINES      = 64,
  48.     MAIL_STATIONERY_XMAS        = 65
  49.  
  50. GetTaxiPath(path_id)                +- Returns the Taxi object for a path from the DBCs, with id path_id.
  51. RegisterDummySpell(entry, funcName)     +- entry must be a spell id with a "dummy", "script effect" or "send events" effect. funcName is the function
  52.                                                   that will trigger when that spell is cast.
  53. SetDBCSpellVar(entry, var [,subindex], value)   +- Similar to Spell:SetVar, but this sets vars by entry id, rather than by individual spell objects.
  54. GetDBCSpellVar(entry, var [,subindex])      +- Retrieves a spell var based on spell entry id.
  55.  
  56. The following functions were added to perform C++ bit operations on Lua values. They evaluate and return the value.
  57. bit_and(...)
  58. bit_or(...)
  59. bit_xor(...)
  60. bit_shiftleft(op,shift_number)
  61. bit_shiftright(op,shift_number)
  62. bit_not(op1)
  63.  
  64. NumberToGUID(n)                 +- Turns a number into a GUID object.
  65. SendPacketToZone(packet,zone_id)            +- Sends the packet to Zone zone_id.
  66. SendPacketToInstance(packet,instance_id)    +- Sends the packet to Instance instance_id.
  67. SendPacketToWorld(packet)                   +- Sends the packet to the world.
  68. SendPacketToChannel(packet,name,team)       +- Sends the packet to the channel with the specified name and team (0 = alliance).
  69. GetInstanceCreature(mapId, instanceId, id)  +- Returns a creature from the specified instance. <<id can only be a spawn id or a GUID.>>
  70. GetInstancePlayerCount(mapId, instanceId)   +- Returns the number of players in the specified instance.
  71. GetPlayersInInstance(mapId, instanceId)     +- Returns a table containing all of the players in the instance.
  72. RegisterInstanceEvent(map, event, func)     +- Registers an instance event. See below for more info.
  73. GetGuildByName(name)                +- Returns the guild id of the guild with the specified name, or -1 on error.
  74. GetGuildByLeaderGuid(guid)          +- Returns the guild id of the guild with the specified leader's guid, or -1 on error.
  75.  
  76. :Items
  77. Item:GetEntryId()                       *- Now fixed and working correctly.
  78. Item:GetName()                          +- Returns Item's name.
  79. Item:GetSpellId(index)                  +- Returns Item's index'th spell Id. 0 means the first spell on the item.
  80. Item:GetSpellTrigger(index)             +- Returns Item's index'th spell's trigger type. 0 means the first spell on the item.
  81.    USE = 0
  82.    ON_EQUIP = 1
  83.    CHANCE_ON_HIT = 2
  84.    SOULSTONE = 4
  85.    LEARNING = 6
  86. Item:GetGUID()                      +- Gets Item's GUID.
  87.  
  88. Item:AddLoot(itemid,mincount,maxcount,ffa_loot[,bPerm, chance]) +- Adds loot with described parameters to Item. Good to use with SendLootWindow. If bPerm is true,
  89.                                                                   chance must then also be provided, and the new loot will save in the DB.
  90.  
  91. Item:GetItemLink()              +- Returns a string containing Item's item link.
  92. Item:SetByteValue(index,index1,value)       +- Modifies the specified byte value of Item.
  93. Item:GetByteValue(index,index1)         +- Gets the specified byte value of Item.
  94. Item:GetItemLevel()             +- Returns the item level.
  95. Item:GetRequiredLevel()             +- Returns the required level.
  96. Item:GetBuyPrice()              +- Returns the buy price.
  97. Item:GetSellPrice()             +- Returns the sell price.
  98. Item:RepairItem()               +- Repairs Item.
  99. Item:GetMaxDurability()             +- Returns Item's max durability.
  100. Item:GetDurability()                +- Returns Item's current durability.
  101. Item:HasEnchantment()               +- Returns true if Item has an enchantment.
  102. Item:ModifyEnchantmentTime(slot,duration)   +- Modifies Item's enchantment in slot to duration.
  103. Item:SetStackCount(count)           +- Sets the number of stacked Items to count.
  104. Item:IsContainer()              +- Returns true if Item is a bag.
  105. Item:GetContainerItemCount(id)          +- Returns how many items with the specified id are within Item. Item must be a bag.
  106. Item:GetEquippedSlot()              +- Returns the slot that Item is equipped in, or -1 if not equipped. See Plyr:GetEquippedItemBySlot.
  107. Item:GetObjectType()                +- Returns "Item".
  108. Item:Remove()                   +- Removes the item from the world.
  109. Item:Create(entry_id, stackcount)       +- Creates a new item with the specified ID and stack count, and returns it. This is like LuaPacket:Create,
  110.                                                   you are creating a new object to use. Eg: "local myItem = Item:Create(1234, 1); print(myItem:GetEntryId())"
  111.  
  112. :GameObjects
  113. THE FOLLOWING UNIT FUNCTIONS HAVE BEEN PORTED FOR GAMEOBJECT USE:
  114. GetLandHeight
  115. SetZoneWeather
  116. GetDistanceYards
  117. PhaseSet
  118. PhaseAdd
  119. PhaseDelete
  120. GetPhase
  121. CastSpellOnTarget
  122. SendPacketToSet
  123. AddLoot
  124. GetInstanceOwner
  125. GetDungeonDifficulty
  126. SetDungeonDifficulty
  127. SetByteValue
  128. GetByteValue
  129. GetSpawnId
  130. GetAreaId
  131. GetInRangeUnits
  132. GetClosestUnit
  133. PLEASE SEE THEIR USAGE IN ":Units" SECTION.
  134. GObj:Update()                   +- Despawns and respawns Gobj.
  135. GObj:SetPosition(x,y,z,o[,save])        +- Moves GObj to the specified position. If save is 1, it will save the new position to the DB.
  136. GObj:GetObjectType()                +- Returns "GameObject".
  137. GObj:SetScale(scale)                +- Sets the scale of GObj (1.0 is 100%). Remember to GObj:Update() for visual changes.
  138. GObj:GetScale()                 +- Returns GObj's scale.
  139.  
  140. :Units
  141. Unit:SendPacket(packet, self)                   +- Sends the packet to the nearby units. if self is true, the packet will also be sent to Unit.
  142. Plyr:SendPacketToGroup(packet)          +- Sends the packet to Plyr's group.
  143. Plyr:SendPacketToGuild(packet [,guildId])   +- Sends the packet to Plyr's guild, or the guildId if specified.
  144. Plyr:SendPacketToPlayer(packet)                 +- Sends the packet to Plyr.
  145. Unit:PhaseSet(newphase [,save])                 +- Sets the phase of Unit to newphase. save is optional, if 1 and Unit is not a player, it will save to DB.
  146. Unit:PhaseAdd(newphase [,save])                 +- Unit becomes a member of newphase. save is as above.
  147. Unit:PhaseDelete(phase [,save])                 +- Removes phase from Unit. save is as above.
  148.  
  149. Also mapped to SetPhase, AddToPhase and DeletePhase respectively.
  150.  
  151. Unit:GetPhase()                                 +- Returns Unit's current phase.
  152. Plyr:PlaySoundToPlayer(sound_id)                +- Plays sound_id to Plyr only.
  153. Plyr:GetDuelState()                             +- Returns the player's duel state:
  154.    DUEL_STATE_REQUESTED = 0
  155.    DUEL_STATE_STARTED = 1
  156.    DUEL_STATE_FINISHED = 2 (Default)
  157. Unit:SetPosition(x,y,z [,o])                    +- Instantly relocates the Unit to the specified x,y,z, optional orientation.
  158. Unit:GetLandHeight(x,y)                         +- Get the Z of the land at (x,y). Requires V-Maps to work correctly.
  159. Unit:QuestAddStarter(quest_id)                  +- Makes Unit a quest starter for quest_id.
  160. Unit:QuestAddFinisher(quest_id)                 +- Makes Unit a quest finisher for quest_id.
  161. Plyr:SetPlayerSpeed(speed)                      +- Sets the speed of Plyr (0-255).
  162. Plyr:GiveHonor(amount)                          +- Adds amount of honour to Plyr.
  163. Plyr:SetBindPoint(x,y,z,map_id,zone_id)         +- Sets Plyr's Hearthstone to x,y,z in zone_id, map_id.
  164. Plyr:SoftDisconnect()                           +- Logs out Plyr.
  165. Unit:SetZoneWeather(zone_id,type,density)       +- Sets the weather of zone_id to type, and density (0.3-2.0).
  166.   WEATHER_TYPE_NORMAL            = 0, // NORMAL (SUNNY)
  167.   WEATHER_TYPE_FOG               = 1, // FOG
  168.   WEATHER_TYPE_RAIN              = 2, // RAIN
  169.   WEATHER_TYPE_HEAVY_RAIN        = 4, // HEAVY_RAIN
  170.   WEATHER_TYPE_SNOW              = 8, // SNOW
  171.   WEATHER_TYPE_SANDSTORM         = 16 // SANDSTORM
  172. Plyr:SetPlayerWeather(type,density)             +- Sets the weather for Plyr ONLY. See above for other arguments.
  173. Plyr:PlayerSendChatMessage(type,lang,msg)       +- Forces Plyr to send a chat message. See existing SendChatMessage function for other arguments.
  174. Unit:GetDistanceYards(target)                   +- Gets the distance between Unit and target in yards.
  175. Unit:VendorAddItem(item_id,amount,extcost)      +- Adds amount items with entry item_id and extended cost extcost to Unit.
  176. Unit:VendorRemoveItem(item_guid)                +- Removes the item item_guid from the vendor. Note this is NOT entry id. Recommend function below.
  177. Unit:VendorRemoveAllItems()                     +- Removes all the items from the vendor Unit.
  178. Unit:CreatureHasQuest(quest_id)                 +- Returns true if Unit has quest quest_id.
  179. Plyr:SendBattlegroundWindow(bg_id)              +- Sends a battleground window for bg_id to Plyr.
  180.    BATTLEGROUND_ALTERAC_VALLEY      = 1,
  181.    BATTLEGROUND_WARSONG_GULCH       = 2,
  182.    BATTLEGROUND_ARATHI_BASIN        = 3,
  183.    BATTLEGROUND_ARENA_2V2       = 4,
  184.    BATTLEGROUND_ARENA_3V3       = 5,
  185.    BATTLEGROUND_ARENA_5V5       = 6,
  186.    BATTLEGROUND_EYE_OF_THE_STORM    = 7,
  187.    BATTLEGROUND_STRAND_OF_THE_ANCIENT   = 9,
  188.    BATTLEGROUND_ISLE_OF_CONQUEST    = 30
  189. Plyr:SendVendorWindow(unit)                     +- Sends Plyr unit's vendor window. Note that this isn't an entry id.
  190. Plyr:SendTrainerWindow(unit)                    +- Same as above, except with a Trainer window.
  191. Plyr:SendInnkeeperWindow(unit)                  +- Same as above, except with an innkeeper bind.
  192. Plyr:SendBankWindow(unit)                       +- Same as above, except with a bank window.
  193. Plyr:SendAuctionWindow(unit)                    +- Same as above, except with an auction house window.
  194. Plyr:GetInventoryItem(bag_slot,slot)            +- Returns the item object in Plyr's bag bag_slot and slot number slot.
  195. Plyr:GetInventoryItemById(item_id)              +- Returns the item object in Plyr's inventory with entry item_id.
  196. Plyr:GetPrimaryCombatTarget()           +- Returns Plyr's combat target. Should use instead of old GetTarget.
  197. Unit:MoveRandomArea(x1,y1,z1,x2,y2,z2,o2)   +- Moves Unit to a random point in the area.
  198. Plyr:SendLootWindow(GUID, loot_type)        +- Sends Plyr the loot window of the object identified by GUID.
  199.    Loot type MUST be
  200.     1-creature, regular
  201.     2-creature, skinning
  202.     3-creature, pickpocketing
  203.     4-go, regular (includes fishing schools)
  204.     5-go, herbalism/mining
  205.     6-item, regular/milling/prospecting/disenchanting
  206.  
  207. Unit:AddLoot(itemid,mincount,maxcount,ffa_loot[,bPerm,chance]) +- Adds a loot item with the described parameters to Unit. Good to use for SendLootWindow.
  208.                                   If bPerm is true, chance must then also be provided, and the new loot will save in the DB.
  209.  
  210. Unit:SetPacified(true)              +- Set true to 1 to pacify the Unit. 0 to un-pacify. Good for players.
  211. Plyr:SetPlayerLock(Yes)             +- Locks the player from all control. Yes should be true or false. False unlocks the player.
  212. Plyr:MovePlayerTo(x,y,z,o,type [,speed])    +- Forces a player to move to x,y,z,o. Speed is optional.
  213.    type must be:
  214.     0 - walk
  215.     256 - teleport
  216.     4096 - run
  217.     12288 - fly
  218. Plyr:IsGm()                 +- Returns true if Plyr is a GM.
  219. Plyr:GetGroupPlayers()              +- Returns a table similar to GetInRangePlayers() but containing Plyr's group members.
  220. Unit:GetDungeonDifficulty()         +- Returns the Unit's current dungeon difficulty:
  221. Unit:SetDungeonDifficulty(difficulty)       +- Sets the Unit's dungeon difficulty:
  222.   MODE_NORMAL_10MEN = 0,
  223.   MODE_NORMAL_25MEN = 1,
  224.   MODE_HEROIC_10MEN = 2,
  225.   MODE_HEROIC_25MEN = 3
  226. Plyr:GetGroupLeader()               +- Returns Plyr's group's leader.
  227. Plyr:SetGroupLeader(player, silent)     +- Set's Plyr's group's leader to player. Set silent to true if you don't want the usual announcement.
  228. Plyr:AddGroupMember(player [,subgroup])     +- Adds player to Plyr's group, subgroup is optional.
  229. Plyr:IsGroupFull()              +- Returns true if Plyr's group is full.
  230. Plyr:IsGroupedWith(target)          +- Returns true if target is in Plyr's group.
  231. Plyr:GetTotalHonor()                +- Returns Plyr's total honor.
  232. Plyr:GetHonorToday()                +- Returns Plyr's honor today.
  233. Plyr:GetHonorYesterday()            +- Returns Plyr's honor for yesterday.
  234. Plyr:GetArenaPoints()               +- Returns Plyr's arena points.
  235. Plyr:AddArenaPoints(amt)            +- Adds amt of arena points to Plyr.
  236. Plyr:AddLifetimeKills(amt)          +- Adds amt of lifetime kills to Plyr.
  237. Plyr:GetInRangePlayersWithAura(spellId)     +- Returns a table of in range players with spellId as an aura.
  238. Unit:GetGender()                +- Returns 0-male or 1-female.
  239. Unit:SetGender(gender)              +- Sets the gender of unit. Works on players - requires relog to take effect.
  240. Plyr:GetGroupType()             +- Returns Plyr's group type:
  241.   GROUP_TYPE_PARTY = 0,
  242.   GROUP_TYPE_RAID  = 1,
  243. Plyr:ExpandToRaid()             +- Expands Plyr's group to a raid.
  244. Plyr:GetGuildId()               +- Returns Plyr's guild id.
  245. Plyr:GetGuildRank()             +- Returns Plyr's rank in his guild.
  246. Plyr:SetGuildRank(rank)             +- Set's Plyr's rank in his guild to rank.
  247. Plyr:IsInGuild()                +- Returns true if Plyr is in a guild, false otherwise.
  248. Plyr:SendGuildInvite(recipient)         +- Makes Plyr send recipient an invite to their guild.
  249. Plyr:DemoteGuildMember(target)          +- Makes Plyr demote target.
  250. Plyr:PromoteGuildMember(target)         +- Makes Plyr promote target.
  251. Plyr:SetGuildMotd(newMotd)          +- Makes Plyr set the guild message of the day.
  252. Plyr:GetGuildMotd([guildId])            +- Returns Plyr's (or the specified guild Id's) guild message of the day.
  253. Plyr:SetGuildInformation(newInfo)       +- Makes Plyr set the guild information to newInfo.
  254. Plyr:AddGuildMember(guildId, [,rank])       +- Adds Plyr to the guild with the specified guildId. rank will be the rank forced on the new member.
  255. Plyr:RemoveGuildMember(target)          +- Removes target from Plyr's guild.
  256. Plyr:SetPublicNote(target, note)        +- Makes Plyr set the public note of target to note.
  257. Plyr:SetOfficerNote(target, note)       +- Makes Plyr set the officer note of target to note.
  258. Plyr:DisbandGuild([guildId])            +- Disbands Plyr's (or the specified guild ID's) guild.
  259. Plyr:ChangeGuildMaster(target)          +- Changes Plyr's guild leader to target.
  260. Plyr:SendGuildChatMessage(message,isOfficerChat)+- Plyr sends a guild chat message. Set isOfficerChat to true to make it an officer chat message.
  261. Plyr:SendGuildLog(target)           +- Sends Plyr's guild log to target.
  262. Plyr:GuildBankDepositMoney(amount)      +- Makes Plyr deposit an amount of money into the guild bank.
  263. Plyr:GuildBankWithdrawMoney(amount)     +- Makes Plyr withdraw an amount of money from the guild bank.
  264. Unit:GetInstanceOwner()             +- Returns the owner of the instance Unit is currently in.
  265. Plyr:GetGmRank()                +- Returns Plyr's GM rank as a string, eg. 'z' or 'az'.
  266. Unit:SetByteValue(index,index1,value)       +- Modifies the specified byte value of Unit.
  267. Unit:GetByteValue(index,index1)         +- Gets the specified byte value of Unit.
  268. Plyr:IsPvPFlagged()             +- Returns true if Plyr is PvP flagged.
  269. Plyr:IsFFAPvPFlagged()              +- Returns true if Plyr is free-for-all PvP flagged.
  270. Plyr:FlagFFA(bool)                  + Pass in true to flag the player for ffa pvp and false to unflag.
  271. Plyr:GetGuildLeader()               +- Returns the name of Plyr's guild's leader.
  272. Plyr:GetGuildMemberCount()          +- Returns the number of people in Plyr's guild.
  273. Unit:CanAttack(target)              +- Returns true if Unit can attack target.
  274. Unit:GetInRangeFriends()            *- Now working as intended.
  275. Unit:GetInRangeEnemies()            +- Returns Unit's in range enemies.
  276. Unit:GetInRangeUnits()              +- Returns all units near Unit.
  277. Unit:IsFriendly(obj)                +- Returns true if Unit is friendly to obj, false otherwise.
  278. Unit:IsInPhase(phase)               +- Returns true if Unit is in phase.
  279. Unit:HasFlag(index, flag)           +- Returns true if the Unit has UInt32Value at index and flag.
  280. Plyr:GetPlayerMovementVector()          +- Returns Plyr's movement vector in table x,y,z,o. Experimental.
  281. Plyr:UnsetKnownTitle(id)            +- Removes the title with id from Plyr.
  282. Unit:SetMovementFlags(flag)         +- Sets the way the unit moves.
  283.   flag must be:
  284.    0 - walk
  285.    1 - run
  286.    2 - fly
  287. Plyr:Repop()                    +- Forces the player to spirit release to the nearest graveyard.
  288. Plyr:GetEquippedItemBySlot(slot)        +- Gets the item Plyr has equipped in the specified slot.
  289.   slot must be:
  290.    HEAD 0
  291.    NECK 1
  292.    SHOULDERS 2
  293.    BODY 3
  294.    CHEST 4
  295.    WAIST 5
  296.    LEGS 6
  297.    FEET 7
  298.    WRISTS 8
  299.    HANDS 9
  300.    FINGER1 10
  301.    FINGER2 11
  302.    TRINKET1 12
  303.    TRINKET2 13
  304.    BACK 14
  305.    MAINHAND 15
  306.    OFFHAND 16
  307.    RANGED 17
  308.    TABARD 18
  309. Unit:EventChat(type,language,message,delay) +- Makes the Unit send a chat message in delay milliseconds.
  310. Plyr:ResetTalents()             +- Resets Plyr's talent points.
  311. Plyr:SetTalentPoints(spec, newValue)        +- Sets Plyr's talent points to newValue. spec must be 0 or 1, identifying which spec to modify.
  312. Plyr:GetTalentPoints(spec)          +- Returns how many talent points Plyr has. spec must be 0 or 1, identifying which spec to modify.
  313. Unit:GetSpawnId()               +- Returns the Unit's spawn id ("Sql id" from .npc info).
  314. Plyr:GetGuildMembers()              +- Returns a table containing the names of the players in Plyr's guild.
  315. Plyr:TakeHonor(amt)             +- Removes amt of honor from Plyr.
  316. Plyr:RemoveArenaPoints(amt)         +- Removes amt of arena points from Plyr.
  317. Unit:GetAreaId()                +- Returns Unit's current area (subzone) id. Requires V-Maps.
  318. Plyr:ResetPetTalents()              +- Resets Plyr's pet's talents.
  319. Unit:IsDazed()                  +- Returns true if Unit is dazed/ensnared.
  320. Unit:GetAura(slot)              +- Returns the ID of the aura on Unit in the specified slot.
  321. Unit:IsRooted()                 +- Returns true if Unit us rooted.
  322. Unit:HasAuraWithMechanic(id)            +- Returns true if Unit has an aura containing the specified mechanic.
  323. Unit:HasNegativeAura()              +- Returns true if Unit has a negative aura.
  324. Unit:HasPositiveAura()              +- Returns true if Unit has a positive aura.
  325. Unit:GetClosestEnemy()              +- Returns the closest enemy to Unit.
  326. Unit:GetClosestFriend()             +- Returns the closest friend to Unit.
  327. Plyr:StartTaxi(Taxi, mount_id)          *- Modified to use the Taxi system, and mounts them on the set display id.
  328. Plyr:IsOnTaxi()                 +- Returns true if Plyr is on a taxi.
  329. Plyr:GetTaxi()                  +- Returns the Taxi object that Plyr is currently on, or nil if not on a taxi.
  330. Unit:GetObjectType()                +- Returns "Player" if Unit is a player, "Unit" for NPCs.
  331. Unit:GetPower([type])               +- Returns the amount of power Unit has of type. If type is left out, it uses the Unit's current power type.
  332.    POWER_TYPE_MANA         = 0,
  333.    POWER_TYPE_RAGE         = 1,
  334.    POWER_TYPE_FOCUS        = 2,
  335.    POWER_TYPE_ENERGY       = 3,
  336.    POWER_TYPE_HAPPINESS    = 4,
  337.    POWER_TYPE_RUNES        = 5,
  338.    POWER_TYPE_RUNIC_POWER  = 6
  339. Unit:GetMaxPower([type])            +- Returns the amount of max power Unit can have. type is as above.
  340. Unit:GetPowerPct([type])            +- Returns percentage of power unit has. type is as above.
  341. Unit:SetMaxPower(amount, [type])        +- Sets Unit's max power. type is as above. This MUST be set when using a non-default power type.
  342.                            (Note: Rage and Runic power's default internal maximum is 1000, displays as 100 in-game)
  343. Unit:SetPowerPct(amount, [type])        +- Sets Unit's power as a percentage of its max. type is as above.
  344. Unit:SetPower(amount, [type])           +- Sets Unit's power. type is as above.
  345.  
  346. Unit:CreateCustomWaypoint(id,x,y,z,o,waittime,movementflags,modelid) +- Same as CreateWaypoint, but allows for set ID instead of incremental.
  347. Unit:DeleteWaypoints()              +- Erases all waypoints that Unit has.
  348. Plyr:LearnSpells(lua_table)             +- lua_table must be an array of spell ids. The function will teach Plyr each of those spells.
  349. ex.
  350.   function LearnSpellz(player)
  351.    local spellz = {1,2,3,4,5,6,7}
  352.    player:LearnSpells(spellz)
  353.   end
  354. Plyr:AddAchievement(ID)             +- Makes Plyr complete an achievement with the specified ID. Returns true on success, false on failure.
  355. Plyr:RemoveAchievement(ID)          +- Removes the achievement with the specified ID from Plyr.
  356. Plyr:HasAchievement(ID)             +- Returns true if Plyr has completed the specified achievement, false otherwise.
  357. Plyr:GetPlayerMovementFlags()           +- Returns Plyr's movement flags. See enum MovementFlags from WorldSession.h for possible values.
  358.  
  359. Unit/Plyr:IsInDungeon()             +- return true if the creature/plr is in a dungeon.
  360. Unit/Plyr:IsInRaid()                +- returns true if the creature/plr is in a raid.
  361. Unit:TeleportCreature(x,y,z)            +- Teleports the creature x,y,z (Mostly used for teleportation spells and such.)
  362. Unit:IsAttackable(obj)              +- Returns true if Unit can attack Obj.
  363. Unit:IsHostile(obj)             +- Returns true if Unit is hostile to Obj.
  364. Unit:GetMovementType()              +- Returns the movement type of Unit. Can be:
  365.    MOVEMENTTYPE_NONE = 0
  366.    MOVEMENTTYPE_RANDOMWP = 1
  367.    MOVEMENTTYPE_CIRCLEWP = 2
  368.    MOVEMENTTYPE_WANTEDWP = 3
  369.    MOVEMENTTYPE_DONTMOVEWP = 4
  370.    MOVEMENTTYPE_QUEST = 10
  371.    MOVEMENTTYPE_FORWARDTHANSTOP = 11
  372. Unit:GetNumWaypoints()              +- Returns the number of waypoints Unit has.
  373. Plyr:GetQuestLogSlot(entry)         +- Returns the slot of Plyr's quest log that has quest with the specified entry, or -1 on error.
  374. Plyr:IsInChannel(channel_name)          +- Returns true if Plyr is in the channel: "channel_name" (channel_name is a string).
  375. Plyr:JoinChannel(channel_name)          +- Makes Plyr join the channel: "channel_name".
  376. Plyr:LeaveChannel(channel_name)         +- Makes Plyr leave the channel: "channel_name".
  377. Plyr:SetChannelName(channel_name, new_name) +- Sets the name of the channel to new_name.
  378. Plyr:SetChannelPassword(channel_name, password) +- Sets the password of the channel to password.
  379. Plyr:GetChannelPassword(channel_name)       +- Returns the channel's password.
  380. Plyr:KickFromChannel(channel_name)      +- Kicks Plyr from the channel.
  381. Plyr:BanFromChannel(channel_name)       +- Kicks and bans Plyr from the channel.
  382. Plyr:UnbanFromChannel(channel_name)     +- Unbans Plyr from the channel.
  383. Plyr:GetChannelMemberCount(channel_name)    +- Returns the amount of members in the channel.
  384. Unit:GetAuraObject(slot)            +- Returns the aura object at the specified slot. See GetAura.
  385. Unit:GetAuraStackCount(id)          +- Returns how many stacks of the aura with specified entry id Unit has.
  386. Unit:AddAuraObject(aura)            +- Adds the specified aura object to Unit.
  387. Unit:GetAuraObjectById(id)          +- Returns the aura object with the specified spell id.
  388. Unit:GetNativeFaction()             +- Returns Unit's native faction.
  389. Plyr:StopPlayerAttack()             +- Makes Plyr stop attacking (melee only).
  390. Plyr:GetQuestObjectiveCompletion(quest,obj) +- Returns how many mobs killed for the specified quest and objective.
  391. Unit:FullCastSpellAoF(x,y,z,sp)         +- Just like CastSpellAoF with cast times and power costs.
  392. Unit:GetClosestUnit()               +- Returns the closest unit.
  393. Plyr:SetSelectedGO(GObj)            +- Sets the player's selected GO used with the GM command.
  394.  
  395. :Packets
  396. LuaPacket:CreatePacket(opcode, size)        +- Returns a new packet object with the specified opcode and size.
  397. Pakt:GetOpcode()                +- Returns Pakt's opcode.
  398. Pakt:GetSize()                  +- Returns Pakt's size.
  399.  
  400. Pakt:ReadByte()                 +- Reads an int8 from Pakt.
  401. Pakt:ReadUByte()                +- Reads an uint8 from Pakt.
  402. Pakt:ReadShort()                +- Reads an int16 from Pakt.
  403. Pakt:ReadUShort()               +- Reads an uint16 from Pakt.
  404. Pakt:ReadLong()                 +- Reads an int32 from Pakt.
  405. Pakt:ReadULong()                +- Reads an uint32 from Pakt.
  406. Pakt:ReadFloat()                +- Reads a float from Pakt.
  407. Pakt:ReadDouble()               +- Reads a double from Pakt.
  408. Pakt:ReadGUID()                 +- Reads an uint64 from Pakt.
  409. Pakt:ReadWoWGuid()              +- Reads the WoWGuid.
  410.  
  411. Pakt:WriteByte(val)             +- Writes an int8 to Pakt.
  412. Pakt:WriteUByte(val)                +- Writes an uint8 to Pakt.
  413. Pakt:WriteShort(val)                +- Writes an int16 to Pakt.
  414. Pakt:WriteUShort(val)               +- Writes an uint16 to Pakt.
  415. Pakt:WriteLong(val)             +- Writes an int32 to Pakt.
  416. Pakt:WriteULong(val)                +- Writes an uint32 to Pakt.
  417. Pakt:WriteFloat(val)                +- Writes a float to Pakt.
  418. Pakt:WriteDouble(val)               +- Writes a double to Pakt.
  419. Pakt:WriteGUID(val)             +- Writes an uint64 to Pakt.
  420. Pakt:WriteWoWGuid(object)           +- Writes the WoWGuid of the object passed in.
  421. Pakt:GetObjectType()                +- Returns "Packet".
  422.  
  423. :TAXI
  424. LuaTaxi:CreateTaxi()                +- Returns a new Taxi object.
  425. Taxi:GetNodeCount()             +- Returns the number of nodes in the path Taxi.
  426. Taxi:AddPathNode(mapid,x,y,z[,index])       +- Adds a node to Taxi, with set coords. When index is removed the node is appended to the path, otherwise
  427.                            inserted at the given index.
  428. Taxi:GetId()                    +- Returns the ID of a Taxi path. Note custom paths have no ID.
  429. Taxi:GetObjectType()                +- Returns "TaxiPath".
  430.  
  431. :SPELLS
  432. Spell:GetCaster()               +- Returns the caster of the spell. Can return a Unit, Item or GObj.
  433. Spell:GetEntry()                +- Returns the entry ID of the spell.
  434. Spell:IsDuelSpell()             +- Returns true if the spell was cast in a duel.
  435. Spell:GetSpellType()                +- Returns the type of the spell:
  436.    SPELL_DMG_TYPE_NONE   = 0,
  437.    SPELL_DMG_TYPE_MAGIC  = 1,
  438.    SPELL_DMG_TYPE_MELEE  = 2,
  439.    SPELL_DMG_TYPE_RANGED = 3
  440. Spell:GetSpellState()               +- Returns the state of the spell:
  441.    SPELL_STATE_NULL      = 0,
  442.    SPELL_STATE_PREPARING = 1,
  443.    SPELL_STATE_CASTING   = 2,
  444.    SPELL_STATE_FINISHED  = 3,
  445.    SPELL_STATE_IDLE      = 4
  446. Spell:Cancel()                  +- Cancels the spell.
  447. Spell:Cast(check)               +- Casts the spell. Set check to true if you want to check if the spell is castable, or false to force cast.
  448. Spell:CanCast()                 +- Returns true if the spell is castable.
  449. Spell:Finish()                  +- Finishes the spell, used post-casting.
  450. Spell:GetTarget()               +- Returns the target of the spell. Can return a Unit, Item or GObj.
  451. Spell:IsStealthSpell()              +- Returns true if the spell grants some kind of stealth.
  452. Spell:IsInvisibilitySpell()         +- Like IsStealthSpell but for invisibility.
  453. Spell:GetPossibleEnemy([range])         +- Returns the GUID of a possible unit enemy of the spell. range is optional.
  454. Spell:GetPossibleFriend([range])        +- Same as above but for a friendly target.
  455. Spell:HasPower()                +- Returns true if the caster has enough power to cast the spell.
  456. Spell:IsAspect()                +- Returns true if the spell is a hunter Aspect spell.
  457. Spell:IsSeal()                  +- Returns true if the spell is a paladin Seal spell.
  458. Spell:GetObjectType()               +- Returns "Spell".
  459. Spell:SetVar(var [,subindex], value)        +- var is a string referring to a parameter of Spell. subindex is optional; used when the variable you are
  460.                            setting has sub indexes. value is what you want to set it to. Returns true on success, false on failure.
  461. Spell:GetVar(var [,subindex])           +- See above, but returns the value on success or nil on failure.
  462. Spell:ResetVar(var)             +- Resets the specified var to the DBC original. Returns true on success, false on failure.
  463. Spell:ResetAllVars()                +- Resets all of Spell's vars to the DBC originals. Returns true on success, false on failure.
  464. Spell:GetCastedItemId()             +- Returns what item ID cast the spell.
  465.  
  466. :QUERYRESULT
  467. QResult:GetColumn(colNum)           +- Returns a field object (see below) based on the column number given. Errors if colNum is greater than max columns
  468. e.x Usage:
  469.   local qres = WorldDBQuery(...)
  470.   local field = qres:GetColumn(0)
  471.   print(field:GetString())
  472. QResult:NextRow()               +- Makes QResult fetch the next row of the result set. Returns true on success, false otherwise.
  473. QResult:GetColumnCount()            +- Returns the number of columns in QResult.
  474. QResult:GetRowCount()               +- Returns the number of rows in QResult.
  475.  
  476. :FIELD
  477. Field:GetString()               +- Returns the cstring data that this field holds.
  478. Field:GetByte()                 +- Returns the signed byte that this field holds
  479. Field:GetUByte()                +- Returns the unsigned byte that this field holds.
  480. Field:GetBool()                 +- Returns the boolean that this field holds.
  481. Field:GetShort()                +- Returns the signed short that this field holds.
  482. Field:GetUShort()               +- Returns the unsigned short that this field holds.
  483. Field:GetLong()                 +- Returns the signed long that this field holds.
  484. Field:GetULong()                +- Returns the unsigned long that this field holds.
  485. Field:GetGUID()                 +- Returns the guid number that this field holds.
  486.  
  487. :AURA
  488. Aura:GetObjectType()                +- Returns "Aura".
  489. Aura:GetSpellID()               +- Gets the spell Id of Aura.
  490. Aura:GetCaster()                +- Returns the caster of Aura.
  491. Aura:GetTarget()                +- Returns the target of the aura, as in, the unit who is currently affected by it.
  492. Aura:GetDuration()              +- Returns the overall duration of the aura in milliseconds.
  493. Aura:SetDuration(dur)               +- Sets a new duration of the aura.
  494. Aura:GetTimeLeft()              +- Returns how long until the aura is removed. In milliseconds.
  495. Aura:SetNegative([amt])             +- Sets the aura specified as negative, amt is optional; the number of "points" to take away.
  496.                                                   (Some spells need more "points" to be removed to make it negative, generally unneeded though)
  497. Aura:SetPositive([amt])             +- Sets the aura specified as positive, amt is optional; the number of points to add.
  498. Aura:Remove()                   +- Removes the aura.
  499. Aura:SetVar(var [,subindex], value)     +- See Spell:SetVar
  500. Aura:GetVar(var [,subindex])            +- See Spell:GetVar
  501. Aura:GetAuraSlot()              +- Returns the aura's slot, see Unit.h for slot meanings.
  502. Aura:SetAuraSlot(slot)              +- Sets the aura's slot, see Unit.h for slot meanings.
  503.  
  504. RegisterInstanceEvent documentation
  505.  Format: NAME_OF_EVENT = event_id, (arguments given to registered function) {additional notes}
  506.  
  507.  INSTANCE_EVENT_ON_PLAYER_DEATH = 1,   (nInstanceId, pPlayer, pKiller)
  508.  INSTANCE_EVENT_ON_PLAYER_ENTER = 2,   (nInstanceId, pPlayer)
  509.  INSTANCE_EVENT_ON_AREA_TRIGGER = 3,   (nInstanceId, pPlayer, nAreaId)
  510.  INSTANCE_EVENT_ON_ZONE_CHANGE = 4,    (nInstanceId, pPlayer, nNewZone, nOldZone)
  511.  INSTANCE_EVENT_ON_CREATURE_DEATH = 5, (nInstanceId, pVictim, pKiller)
  512.  INSTANCE_EVENT_ON_CREATURE_PUSH = 6,  (nInstanceId, pUnit) {AKA "OnSpawn" but for within an instance}
  513.  INSTANCE_EVENT_ON_GO_ACTIVATE = 7,    (nInstanceId, pGO, pPlayer)
  514.  INSTANCE_EVENT_ON_GO_PUSH = 8,        (nInstanceId, pGO) {AKA "OnSpawn" but for within an instance}
  515.  INSTANCE_EVENT_ONLOAD = 9,            (nInstanceId) {When the instance is created}
  516.  INSTANCE_EVENT_DESTROY = 10,          (nInstanceId) {When the instance is destroyed, happens when the instance resets.}
  517.  
  518. LCF's function documentation
  519.  Creature :
  520.     SpawnLocalCreature(entry,faction,duration) -  simply spawns the creature entry at the current unit's position.
  521.     SpawnLocalGameObject(entry,duration) - same as above
  522.     MonsterSay(msg) - takes in the message to send and the current unit calls SendChatMessage with CHAT_MSG_MONSTER_SAY
  523.     MonsterYell(msg) - save as above except calls SendChatMessage with CHAT_MSG_MONSTER_YELL
  524.     MonsterEmote(msg) - same as above but with CHAT_MSG_MONSTER_EMOTE
  525.     MonsterYellToPlayer(plr,msg) - sends the yell packet to the plr only(as opposed to all inrange players)
  526.     MonsterSayToPlayer(plr,msg) - sends a say to the plr
  527.     MonsterWhisperToPlayer(plr,msg) - sends a whisper to the plr.
  528.     MoveToUnit(target) - simply moves the current unit to the target unit's location.
  529.     RegisterLuaEvent(func,delay,repeats,extra_args_go_here) - registers the lua function(not string) func to be called with the specified delay and repeats(0 for unlimited.) Any extra args given will be passed to func when its called.
  530.         - Note : if you want to register a Lua METHOD, then you will have to pass in LCF:BindMethod(method_name,methods_table) for func. method being the lua function and methods_table being the TABLE, method is located in. This goes for the other classes as well.
  531.         - Note : You can still pass in self w/o calling LCF:BindMethod() by simply passing in the table as the 1st of the extra args.
  532.     RemoveLuaEvent(func) --  deprecated, use obj:RemoveEvents()  to remove events
  533.     FaceUnit(tar) - makes the Creature face the target specified.
  534.     GetNearestUnitWithEntry(entry) - returns the nearest unit to the creature with the specified entry.
  535.     GetLocalCreature(creature_entry) - simply calls GetCreatureNearestCoords with the unit's position.
  536.     GetLocalGameObject(go_entry)
  537.     GetCreator() - returns the unit whos guid is stored in UNIT_FIELD_CREATEDBY/SUMMONEDBY
  538.     SetCreator(creator_obj) - sets UNIT_FIELD_CREATEDBY/SUMMONEDBY to creator_obj:GetGUID()
  539.     IsCasting() - returns true if the creature is casting a spell.
  540. Player:
  541.     GetStrength()
  542.     GetStamina()
  543.     GetAgility()
  544.     GetSpirit()
  545.     GetIntellect()
  546.     IsAlliance()
  547.     IsHorde()
  548.     IsHeroic() - returns true if the player is a heroic dungeon or raid.
  549.     SpawnLocalCreature(entry,faction,duration)
  550.     SpawnLocalGameObject(entry,faction,duration)
  551.     RegisterLuaEvent(func,delay,repeats,extra_args_go_here) - same as creature
  552.     RemoveLuaEvent(func) - deprecated, use obj:RemoveEvents()  to remove events
  553.    GetNearestUnitWithEntry(entry) - same as creature
  554.     GetLocalCreature(creature_entry) - simply calls GetCreatureNearestCoords with the player's position.
  555.     GetLocalGameObject(go_entry)
  556.     IsCasting() - returns true if the player is casting a spell.
  557.  GameObject:
  558.     SetClickable()
  559.     SetUnclickable()
  560.     IsClickable()
  561.     IsUnclickable()
  562.     Respawn() - simply despawns and respawns the go instantly.
  563.     IsOpen()
  564.     IsClosed()
  565.     Close()
  566.     Open()
  567.     RegisterLuaEvent(func,delay,repeats,extra_args_go_here) - same as creature.
  568.     RemoveLuaEvent(func) -  deprecated, use obj:RemoveEvents()  to remove events
  569.     RemoveEvents() - used to remove any events registered through RegisterLuaEvent
  570.     GetCreator() - returns the unit whos guid is stored in OBJECT_FIELD_CREATEDBY
  571.     SetCreator(creator_obj) - sets OBJECT_FIELD_CREATEDBY to creator_obj:GetGUID()
  572.     GetLocalCreature(creature_entry) - simply calls GetCreatureNearestCoords with the go's position.
  573.     GetLocalGameObject(go_entry)
  574. EXTRA METHODS
  575.     LCF:RegisterZoneHook(zone_id,func) - this takes the desired zone id and a lua function value(not a string unlike RegisterUnitEvent...) It will then call this function when the server hook with the zone id triggers
  576.     LCF:RegisterAreaTrigger(area_id,func) - same as above except for area triggers
  577.         - Note, if your registering a Lua METHOD, then you have to pass in LCF:BindMethod(method,methods_table) for func for both RegisterZoneHook and RegisterAreaTrigger
  578.     LCF:RemoveZoneHook(zone_id,func) - removes the lua function from the list of hooked functions.
  579.     LCF:RemoveAreaTrigger(area_trig,func) - does the same as above except for area triggers
  580.     LCF:RegisterLuaEvent(event_type,func,delay,repeats,extra_args_go_here) - this is the main function that go,player,and creature's registerluaevent call, they all use tostring(unit) as the event type. Use this when you want to customize the event type.
  581.     LCF:RemoveLuaEvent(event_type,func,delay,repeats,extra_args_go_here) - this removes the event type registered in the events, SPECIFY func only if you want to delete the events that were registered with func.
  582.    
  583. LCF will expand further but feel free to write and contribute your own helper functions.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement