root/Trunk/LUA_ENGINE_COMMANDS.txt @ 1136

Revision 1136, 25.7 kB (checked in by Hypersniper, 7 months ago)

MODIFIED: Cleaned up some redundant functions, fixed some that weren't in the function tables.
MODIFIED: Made the documentation pretty~

Line 
1::FULL COMMAND LISTING::
2
3:Global
4PerformIngameSpawn(type,entry,map,x,y,z,o,facOrScale,dur [,eq1,eq2,eq3,instanceId]) *- Fixed to work correctly all round.
5
6GetPlayer(name)                                                   *- Fixed possible world crash.
7GetLuaEngine()                                                    +- Returns what engine the server is using. Should be LuaHypArc.
8GetLuaEngineVersion()                                             +- Returns what version LuaHypArc on the server is.
9GetGameTime()                                                     +- Returns server time in seconds.
10ReloadTable(tablename)                                            +- Reloads table tablename.
11Rehash()                                                          +- Rehashes server config files.
12ReloadLuaEngine()                                                 +- Reloads the Lua engine & scripts.
13RegisterServerHook(event, functionName)                           +- Registers a server hook event. Further documentation included.
14logcol(colourVal)                                                 +- Sets the colour of the next print() message:
15  FOREGROUND_BLUE      = 1 // text color contains blue.
16  FOREGROUND_GREEN     = 2 // text color contains green.
17  FOREGROUND_RED       = 4 // text color contains red.
18  FOREGROUND_INTENSITY = 8 // text color is intensified (brightened).
19  //these can be added together, for example 1+8 = bright blue.
20GetPlayersInWorld()                                                             +- Returns a table containing all the players in the world.
21GetPlayersInMap(mapId)                                                          +- Returns a table containing all the players in map mapId.
22GetPlayersInZone(zoneId)                                                        +- Returns a table containing all the players in zone zoneId.
23RegisterTimedEvent(funcName, delay, repeats)                                    +- Registers a world timed event, similar to RegisterEvent.
24GetArcemuRevision()                                                             +- Returns the server's ArcEmu revision number.
25SendPvPCaptureMessage(zoneId, message)                                          +- Sends a PvP-capture style message to zoneId.
26WorldDBQueryTable(query)                                                        +- Performs a query. Results are returned as a table in the form t[row][col].
27CharDBQueryTable(query)                                                         +- Same as above, but for the Char DB.
28WorldDBQuery(query [,colnum, rownum])                                           +- Performs a query. rownum and colnum are optional, should only be used to
29CharDBQuery(query [,colnum, rownum])                                               specify what col/row to get returned values from (SELECT statements)
30
31SendMail(type,senderGuid,receivrGuid,subject,body,money,codAmt,itemRawGuid,stationeryId)   +- Sends a mail message with specified parameters.
32   type can be:
33    NORMAL  = 0
34    COD     = 1
35    AUCTION = 2
36   stationery:
37    MAIL_STATIONERY_TEST1               = 1,
38    MAIL_STATIONERY_TEST2               = 41,
39    MAIL_STATIONERY_GM                  = 61,
40    MAIL_STATIONERY_AUCTION             = 62,
41    MAIL_STATIONERY_VALENTINES          = 64,
42    MAIL_STATIONERY_XMAS                = 65
43
44GetTaxiPath(path_id)                            +- Returns the Taxi object for a path from the DBCs, with id path_id.
45RegisterDummySpell(entry, funcName)             +- entry must be a spell id with a "dummy", "script effect" or "send events" effect. funcName is the function
46                                                   that will trigger when that spell is cast.
47SetDBCSpellVar(entry, var [,subindex], value)   +- Similar to Spell:SetVar, but this sets vars by entry id, rather than by individual spell objects.
48GetDBCSpellVar(entry, var [,subindex])          +- Retrieves a spell var based on spell entry id.
49
50:Items
51Item:GetEntryId()                               *- Now fixed and working correctly.
52Item:GetName()                                  +- Returns Item's name.
53Item:GetSpellId(index)                          +- Returns Item's index'th spell Id. 0 means the first spell on the item.
54Item:GetSpellTrigger(index)                     +- Returns Item's index'th spell's trigger type. 0 means the first spell on the item.
55   USE = 0
56   ON_EQUIP = 1
57   CHANCE_ON_HIT = 2
58   SOULSTONE = 4
59   LEARNING = 6
60Item:GetGUID()                                  +- Gets Item's GUID.
61Item:AddLoot(itemid,mincount,maxcount,ffa_loot) +- Adds loot with described parameters to Item. Good to use with SendLootWindow.
62Item:GetItemLink()                              +- Returns a string containing Item's item link.
63Item:SetByteValue(index,index1,value)           +- Modifies the specified byte value of Item.
64Item:GetByteValue(index,index1)                 +- Gets the specified byte value of Item.
65Item:GetItemLevel()                             +- Returns the item level.
66Item:GetRequiredLevel()                         +- Returns the required level.
67Item:GetBuyPrice()                              +- Returns the buy price.
68Item:GetSellPrice()                             +- Returns the sell price.
69Item:RepairItem()                               +- Repairs Item.
70Item:GetMaxDurability()                         +- Returns Item's max durability.
71Item:GetDurability()                            +- Returns Item's current durability.
72Item:HasEnchantment()                           +- Returns true if Item has an enchantment.
73Item:ModifyEnchantmentTime(slot,duration)       +- Modifies Item's enchantment in slot to duration.
74Item:SetStackCount(count)                       +- Sets the number of stacked Items to count.
75Item:IsContainer()                              +- Returns true if Item is a bag.
76Item:GetContainerItemCount(id)                  +- Returns how many items with the specified id are within Item. Item must be a bag.
77Item:GetEquippedSlot()                          +- Returns the slot that Item is equipped in, or -1 if not equipped. See Plyr:GetEquippedItemBySlot.
78Item:GetObjectType()                            +- Returns "Item".
79
80:GameObjects
81THE FOLLOWING UNIT FUNCTIONS HAVE BEEN PORTED FOR GAMEOBJECT USE:
82GetLandHeight
83SetZoneWeather
84GetDistanceYards
85PhaseSet
86PhaseAdd
87PhaseDelete
88GetPhase
89CastSpellOnTarget
90InitPacket
91AddDataToPacket
92SendPacketToSet
93SendPacketToZone
94SendPacketToInstance
95SendPacketToWorld
96AddLoot
97GetInstanceOwner
98GetDungeonDifficulty
99SetDungeonDifficulty
100SetByteValue
101GetByteValue
102GetSpawnId
103GetAreaId
104PLEASE SEE THEIR USAGE IN ":Units" SECTION.
105GObj:Update()                                   +- Despawns and respawns Gobj.
106GObj:SetPosition(x,y,z,o)                       +- Moves GObj to the specified position.
107GObj:GetObjectType()                            +- Returns "GameObject".
108
109:Units
110PACKETS - PLEASE SEE ABOVE FOR FURTHER INFORMATION.
111   Unit:SendPacket(packet, self)                        +- Sends the packet to the nearby units. if self is true, the packet will also be sent to Unit.
112   Plyr:SendPacketToGroup(packet)                       +- Sends the packet to Plyr's group. Please see above for full info.
113   Plyr:SendPacketToGuild(packet)                       +- Sends the packet stored in buffer_index to Plyr's guild. Please see above for full info.
114   Plyr:SendPacketToPlayer(packet)                      +- Sends the packet to Plyr. Please see above for full info.
115   Unit:SendPacketToZone(packet,zone_id)                +- Sends the packet to Zone zone_id. Please see above for full info.
116   Unit:SendPacketToInstance(packet,instance_id)        +- Sends the packet to Instance instance_id. Please see above for full info.
117   Unit:SendPacketToWorld(packet)                       +- Sends the packet to the world. Please see above for full info.
118PHASES - PLEASE SEE ABOVE FOR FURTHER INFORMATION.     
119   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.
120   Unit:PhaseAdd(newphase [,save])             +- Unit becomes a member of newphase. save is as above.
121   Unit:PhaseDelete(phase [,save])             +- Removes phase from Unit. save is as above.
122   +-Also mapped to SetPhase, AddToPhase and DeletePhase respectively.
123   Unit:GetPhase()                             +- Returns Unit's current phase.
124Plyr:PlaySoundToPlayer(sound_id)                +- Plays sound_id to Plyr only.
125Plyr:GetDuelState()                             +- Returns the player's duel state:
126   DUEL_STATE_REQUESTED = 0
127   DUEL_STATE_STARTED = 1
128   DUEL_STATE_FINISHED = 2 (Default)
129Unit:SetPosition(x,y,z [,o])                    +- Instantly relocates the Unit to the specified x,y,z, optional orientation.
130Unit:CastSpellOnTarget(spell_id,target)         *- Now working as intended, at long last. Just like CastSpell, with a target.
131Unit:GetLandHeight(x,y)                         +- Get the Z of the land at (x,y). Requires V-Maps to work correctly.
132Unit:QuestAddStarter(quest_id)                  +- Makes Unit a quest starter for quest_id.
133Unit:QuestAddFinisher(quest_id)                 +- Makes Unit a quest finisher for quest_id.
134Plyr:SetPlayerSpeed(speed)                      +- Sets the speed of Plyr (0-255).
135Plyr:GiveHonor(amount)                          +- Adds amount of honour to Plyr.
136Plyr:SetBindPoint(x,y,z,map_id,zone_id)         +- Sets Plyr's Hearthstone to x,y,z in zone_id, map_id.
137Plyr:SoftDisconnect()                           +- Logs out Plyr.
138Unit:SetZoneWeather(zone_id,type,density)       +- Sets the weather of zone_id to type, and density (0.3-2.0).
139   WEATHER_TYPE_NORMAL            = 0, // NORMAL (SUNNY)
140   WEATHER_TYPE_FOG               = 1, // FOG
141   WEATHER_TYPE_RAIN              = 2, // RAIN
142   WEATHER_TYPE_HEAVY_RAIN        = 4, // HEAVY_RAIN
143   WEATHER_TYPE_SNOW              = 8, // SNOW
144   WEATHER_TYPE_SANDSTORM         = 16 // SANDSTORM
145Plyr:SetPlayerWeather(type,density)             +- Sets the weather for Plyr ONLY. See above for other arguments.
146Plyr:PlayerSendChatMessage(type,lang,msg)       +- Forces Plyr to send a chat message. See existing SendChatMessage function for other arguments.
147Unit:GetDistanceYards(target)                   +- Gets the distance between Unit and target in yards.
148Unit:VendorAddItem(item_id,amount,extcost)      +- Adds amount items with entry item_id and extended cost extcost to Unit.
149Unit:VendorRemoveItem(item_guid)                +- Removes the item item_guid from the vendor. Note this is NOT entry id. Recommend function below.
150Unit:VendorRemoveAllItems()                     +- Removes all the items from the vendor Unit.
151Unit:CreatureHasQuest(quest_id)                 +- Returns true if Unit has quest quest_id.
152Plyr:SendBattlegroundWindow(bg_id)              +- Sends a battleground window for bg_id to Plyr.
153   BATTLEGROUND_ALTERAC_VALLEY          = 1,
154   BATTLEGROUND_WARSONG_GULCH           = 2,
155   BATTLEGROUND_ARATHI_BASIN            = 3,
156   BATTLEGROUND_ARENA_2V2               = 4,
157   BATTLEGROUND_ARENA_3V3               = 5,
158   BATTLEGROUND_ARENA_5V5               = 6,
159   BATTLEGROUND_EYE_OF_THE_STORM        = 7,
160   BATTLEGROUND_STRAND_OF_THE_ANCIENT   = 9,
161   BATTLEGROUND_ISLE_OF_CONQUEST        = 30
162Plyr:SendVendorWindow(unit)                     +- Sends Plyr unit's vendor window. Note that this isn't an entry id.
163Plyr:SendTrainerWindow(unit)                    +- Same as above, except with a Trainer window.
164Plyr:SendInnkeeperWindow(unit)                  +- Same as above, except with an innkeeper bind.
165Plyr:SendBankWindow(unit)                       +- Same as above, except with a bank window.
166Plyr:SendAuctionWindow(unit)                    +- Same as above, except with an auction house window.
167Plyr:GetInventoryItem(bag_slot,slot)            +- Returns the item object in Plyr's bag bag_slot and slot number slot.
168Plyr:GetInventoryItemById(item_id)              +- Returns the item object in Plyr's inventory with entry item_id.
169Plyr:GetPrimaryCombatTarget()                   +- Returns Plyr's combat target. Should use instead of old GetTarget.
170Unit:MoveRandomArea(x1,y1,z1,x2,y2,z2,o2)       +- Moves Unit to a random point in the area.
171Plyr:SendLootWindow(GUID, loot_type)            +- Sends Plyr the loot window of the object identified by GUID.
172   Loot type MUST be
173    1-creature, regular
174    2-creature, skinning
175    3-creature, pickpocketing
176    4-go, regular (includes fishing schools)
177    5-go, herbalism/mining
178    6-item, regular/milling/prospecting/disenchanting
179Unit:AddLoot(itemid,mincount,maxcount,ffa_loot) +- Adds a loot item with the described parameters to Unit. Good to use for SendLootWindow or dynamic loot.
180Unit:SetPacified(true)                          +- Set true to 1 to pacify the Unit. 0 to un-pacify. Good for players.
181VEHICLE FUNCTIONS - EXPERIMENTAL
182    Unit:SpawnVehicle(entry,x,y,z,o,faction,duration [,phase]) +- Spawns a creature as a vehicle with described parameters. Returns the vehicle spawned.
183    Plyr:SetVehicle(vehicle, seat)              +- Sets Plyr's vehicle, and their seat position - a number. Set to -1 for auto-choose.
184    Plyr:GetVehicle()                           +- Returns the Unit for Plyr's current vehicle.
185    Plyr:RemoveFromVehicle()                    +- Removes Plyr from their vehicle.
186    Plyr:GetVehicleSeat()                       +- Returns what seat Plyr is sitting in.
187    Unit:IsVehicle()                            +- Returns true if Unit is a vehicle, false otherwise.
188    Unit:GetPassengerCount()                    +- Returns the current amount of passengers in the vehicle Unit.
189    Unit:MoveVehicle(x,y,z,o)                   +- Moves the vehicle Unit (with all passengers) to defined position.
190Plyr:SetPlayerLock(Yes)                         +- Locks the player from all control. Yes should be true or false. False unlocks the player.
191Plyr:MovePlayerTo(x,y,z,o,type [,speed])        +- Forces a player to move to x,y,z,o. Speed is optional.
192   type must be:
193    0 - walk
194    256 - teleport
195    4096 - run
196    12288 - fly
197Plyr:IsGm()                                     +- Returns true if Plyr is a GM.
198Plyr:GetGroupPlayers()                          +- Returns a table similar to GetInRangePlayers() but containing Plyr's group members.
199Unit:GetDungeonDifficulty()                     +- Returns the Unit's current dungeon difficulty:
200Unit:SetDungeonDifficulty(difficulty)           +- Sets the Unit's dungeon difficulty:
201   MODE_NORMAL_10MEN = 0,
202   MODE_NORMAL_25MEN = 1,
203   MODE_HEROIC_10MEN = 2,
204   MODE_HEROIC_25MEN = 3
205Plyr:GetGroupLeader()                           +- Returns Plyr's group's leader.
206Plyr:SetGroupLeader(player, silent)             +- Set's Plyr's group's leader to player. Set silent to true if you don't want the usual announcement.
207Plyr:AddGroupMember(player [,subgroup])         +- Adds player to Plyr's group, subgroup is optional.
208Plyr:IsGroupFull()                              +- Returns true if Plyr's group is full.
209Plyr:IsGroupedWith(target)                      +- Returns true if target is in Plyr's group.
210Plyr:GetTotalHonor()                            +- Returns Plyr's total honor.
211Plyr:GetHonorToday()                            +- Returns Plyr's honor today.
212Plyr:GetHonorYesterday()                        +- Returns Plyr's honor for yesterday.
213Plyr:GetArenaPoints()                           +- Returns Plyr's arena points.
214Plyr:AddArenaPoints(amt)                        +- Adds amt of arena points to Plyr.
215Plyr:AddLifetimeKills(amt)                      +- Adds amt of lifetime kills to Plyr.
216Plyr:GetInRangePlayersWithAura(spellId)         +- Returns a table of in range players with spellId as an aura.
217Unit:GetGender()                                +- Returns 0-male or 1-female.
218Unit:SetGender(gender)                          +- Sets the gender of unit. Works on players - requires relog to take effect.
219Plyr:GetGroupType()                             +- Returns Plyr's group type:
220   GROUP_TYPE_PARTY = 0,
221   GROUP_TYPE_RAID  = 1,
222Plyr:ExpandToRaid()                             +- Expands Plyr's group to a raid.
223Plyr:GetGuildId()                               +- Returns Plyr's guild id.
224Plyr:GetGuildRank()                             +- Returns Plyr's rank in his guild.
225Plyr:SetGuildRank(rank)                         +- Set's Plyr's rank in his guild to rank.
226Plyr:IsInGuild()                                +- Returns true if Plyr is in a guild, false otherwise.
227Plyr:SendGuildInvite(recipient)                 +- Makes Plyr send recipient an invite to their guild.
228Plyr:DemoteGuildMember(target)                  +- Makes Plyr demote target.
229Plyr:PromoteGuildMember(target)                 +- Makes Plyr promote target.
230Plyr:SetGuildMotd(newMotd)                      +- Makes Plyr set the guild message of the day.
231Plyr:GetGuildMotd()                             +- Returns Plyr's guild's message of the day.
232Plyr:SetGuildInformation(newInfo)               +- Makes Plyr set the guild information to newInfo.
233Plyr:AddGuildMember(target)                     +- Adds target to Plyr's guild.
234Plyr:RemoveGuildMember(target)                  +- Removes target from Plyr's guild.
235Plyr:SetPublicNote(target, note)                +- Makes Plyr set the public note of target to note.
236Plyr:SetOfficerNote(target, note)               +- Makes Plyr set the officer note of target to note.
237Plyr:DisbandGuild()                             +- Disbands Plyr's guild.
238Plyr:ChangeGuildMaster(target)                  +- Changes Plyr's guild leader to target.
239Plyr:SendGuildChatMessage(message,isOfficerChat)+- Plyr sends a guild chat message. Set isOfficerChat to true to make it an officer chat message.
240Plyr:SendGuildLog(target)                       +- Sends Plyr's guild log to target.
241Plyr:GuildBankDepositMoney(amount)              +- Makes Plyr deposit an amount of money into the guild bank.
242Plyr:GuildBankWithdrawMoney(amount)             +- Makes Plyr withdraw an amount of money from the guild bank.
243Plyr:Jump(height)                               +- Makes Plyr jump with specified height. Experimental.
244Unit:GetInstanceOwner()                         +- Returns the owner of the instance Unit is currently in.
245Plyr:GetGmRank()                                +- Returns Plyr's GM rank as a string, eg. 'z' or 'az'.
246Unit:SetByteValue(index,index1,value)           +- Modifies the specified byte value of Unit.
247Unit:GetByteValue(index,index1)                 +- Gets the specified byte value of Unit.
248Plyr:IsPvPFlagged()                             +- Returns true if Plyr is PvP flagged.
249Plyr:IsFFAPvPFlagged()                          +- Returns true if Plyr is free-for-all PvP flagged.
250Plyr:GetGuildLeader()                           +- Returns the name of Plyr's guild's leader.
251Plyr:GetGuildMemberCount()                      +- Returns the number of people in Plyr's guild.
252Unit:CanAttack(target)                          +- Returns true if Unit can attack target.
253Unit:GetInRangeFriends()                        *- Now working as intended.
254Unit:GetInRangeEnemies()                        +- Returns Unit's in range enemies.
255Unit:GetInRangeUnits()                          +- Returns all units near Unit.
256Unit:IsFriendly(obj)                            +- Returns true if Unit is friendly to obj, false otherwise.
257Unit:IsInPhase(phase)                           +- Returns true if Unit is in phase.
258Unit:HasFlag(index, flag)                       +- Returns true if the Unit has UInt32Value at index and flag.
259Plyr:GetPlayerMovementVector()                  +- Returns Plyr's movement vector in table x,y,z,o. Experimental.
260Plyr:UnsetKnownTitle(id)                        +- Removes the title with id from Plyr.
261Unit:SetMovementFlags(flag)                     +- Sets the way the unit moves.
262   flag must be:
263    0 - walk
264    1 - run
265    2 - fly
266Plyr:Repop()                                    +- Forces the player to spirit release to the nearest graveyard.
267Plyr:GetEquippedItemBySlot(slot)                +- Gets the item Plyr has equipped in the specified slot.
268   slot must be:
269    HEAD 0
270    NECK 1
271    SHOULDERS 2
272    BODY 3
273    CHEST 4
274    WAIST 5
275    LEGS 6
276    FEET 7
277    WRISTS 8
278    HANDS 9
279    FINGER1 10
280    FINGER2 11
281    TRINKET1 12
282    TRINKET2 13
283    BACK 14
284    MAINHAND 15
285    OFFHAND 16
286    RANGED 17
287    TABARD 18
288Unit:EventChat(type,language,message,delay)     +- Makes the Unit send a chat message in delay milliseconds.
289Plyr:ResetTalents()                             +- Resets Plyr's talent points.
290Plyr:SetTalentPoints(spec, newValue)            +- Sets Plyr's talent points to newValue. spec must be 0 or 1, identifying which spec to modify.
291Plyr:GetTalentPoints(spec)                      +- Returns how many talent points Plyr has. spec must be 0 or 1, identifying which spec to modify.
292Unit:GetSpawnId()                               +- Returns the Unit's spawn id ("Sql id" from .npc info).
293Plyr:GetGuildMembers()                          +- Returns a table containing the names of the players in Plyr's guild.
294Plyr:TakeHonor(amt)                             +- Removes amt of honor from Plyr.
295Plyr:RemoveArenaPoints(amt)                     +- Removes amt of arena points from Plyr.
296Unit:GetAreaId()                                +- Returns Unit's current area (subzone) id. Requires V-Maps.
297Plyr:ResetPetTalents()                          +- Resets Plyr's pet's talents.
298Unit:IsDazed()                                  +- Returns true if Unit is dazed/ensnared.
299Unit:GetAura(slot)                              +- Returns the ID of the aura on Unit in the specified slot.
300Unit:IsRooted()                                 +- Returns true if Unit us rooted.
301Unit:HasAuraWithMechanic(id)                    +- Returns true if Unit has an aura containing the specified mechanic.
302Unit:HasNegativeAura()                          +- Returns true if Unit has a negative aura.
303Unit:HasPositiveAura()                          +- Returns true if Unit has a positive aura.
304Unit:GetClosestEnemy()                          +- Returns the closest enemy to Unit.
305Unit:GetClosestFriend()                         +- Returns the closest friend to Unit.
306Plyr:StartTaxi(Taxi, mount_id)                  *- Modified to use the Taxi system, and mounts them on the set display id.
307Plyr:IsOnTaxi()                                 +- Returns true if Plyr is on a taxi.
308Plyr:GetTaxi()                                  +- Returns the Taxi object that Plyr is currently on, or nil if not on a taxi.
309Unit:GetObjectType()                            +- Returns "Player" if Unit is a player, "Unit" for NPCs.
310Unit:GetPower([type])                           +- Returns the amount of power Unit has of type. If type is left out, it uses the Unit's current power type.
311    POWER_TYPE_MANA         = 0,
312    POWER_TYPE_RAGE         = 1,
313    POWER_TYPE_FOCUS        = 2,
314    POWER_TYPE_ENERGY       = 3,
315    POWER_TYPE_HAPPINESS    = 4,
316    POWER_TYPE_RUNES        = 5,
317    POWER_TYPE_RUNIC_POWER  = 6
318Unit:GetMaxPower([type])                        +- Returns the amount of max power Unit can have. type is as above.
319Unit:GetPowerPct([type])                        +- Returns percentage of power unit has. type is as above.
320Unit:SetMaxPower(amount, [type])                +- Sets Unit's max power. type is as above. This MUST be set when using a non-default power type.
321                                                   (Note: Rage and Runic power's default internal maximum is 1000, displays as 100 in-game)
322Unit:SetPowerPct(amount, [type])                +- Sets Unit's power as a percentage of its max. type is as above.
323Unit:SetPower(amount, [type])                   +- Sets Unit's power. type is as above.
324
325Unit:CreateCustomWaypoint(id,x,y,z,o,waittime,movementflags,modelid) +- This command creates waypoints for the creature GIVEN an id rather than generated one. movementflags are 0x0 for walk, 0x100 for run ... etc the rest is self explanatory
326Unit:DeleteWaypoints()                          +- Does just, erases all waypoints the unit has.
327Plyr:LearnSpells(lua_table)                     +- lua_table must be an array of spell ids. The function will teach Plyr each of those spells.
328 ex.
329   function LearnSpellz(player)
330    local spellz = {1,2,3,4,5,6,7}
331    player:LearnSpells(spellz)
332   end
333
334:Packets
335LuaPacket:CreatePacket(opcode, size)            +- Returns a new packet object with the specified opcode and size.
336Pakt:GetOpcode()                                +- Returns Pakt's opcode.
337Pakt:GetSize()                                  +- Returns Pakt's size.
338
339Pakt:ReadByte()                                 +- Reads an int8 from Pakt.
340Pakt:ReadUByte()                                +- Reads an uint8 from Pakt.
341Pakt:ReadShort()                                +- Reads an int16 from Pakt.
342Pakt:ReadUShort()                               +- Reads an uint16 from Pakt.
343Pakt:ReadLong()                                 +- Reads an int32 from Pakt.
344Pakt:ReadULong()                                +- Reads an uint32 from Pakt.
345Pakt:ReadFloat()                                +- Reads a float from Pakt.
346Pakt:ReadDouble()                               +- Reads a double from Pakt.
347Pakt:ReadGUID()                                 +- Reads an uint64 from Pakt.
348
349Pakt:WriteByte(val)                             +- Writes an int8 to Pakt.
350Pakt:WriteUByte(val)                            +- Writes an uint8 to Pakt.
351Pakt:WriteShort(val)                            +- Writes an int16 to Pakt.
352Pakt:WriteUShort(val)                           +- Writes an uint16 to Pakt.
353Pakt:WriteLong(val)                             +- Writes an int32 to Pakt.
354Pakt:WriteULong(val)                            +- Writes an uint32 to Pakt.
355Pakt:WriteFloat(val)                            +- Writes a float to Pakt.
356Pakt:WriteDouble(val)                           +- Writes a double to Pakt.
357Pakt:WriteGUID(val)                             +- Writes an uint64 to Pakt.
358Pakt:GetObjectType()                            +- Returns "Packet".
359
360:TAXI
361LuaTaxi:CreateTaxi()                            +- Returns a new Taxi object.
362Taxi:GetNodeCount()                             +- Returns the number of nodes in the path Taxi.
363Taxi: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
364                                                   inserted at the given index.
365Taxi:GetId()                                    +- Returns the ID of a Taxi path. Note custom paths have no ID.
366Taxi:GetObjectType()                            +- Returns "TaxiPath".
367
368:SPELLS
369Spell:GetCaster()                               +- Returns the caster of the spell. Can return a Unit, Item or GObj.
370Spell:GetEntry()                                +- Returns the entry ID of the spell.
371Spell:IsDuelSpell()                             +- Returns true if the spell was cast in a duel.
372Spell:GetSpellType()                            +- Returns the type of the spell:
373   SPELL_DMG_TYPE_NONE   = 0,
374   SPELL_DMG_TYPE_MAGIC  = 1,
375   SPELL_DMG_TYPE_MELEE  = 2,
376   SPELL_DMG_TYPE_RANGED = 3
377Spell:GetSpellState()                           +- Returns the state of the spell:
378   SPELL_STATE_NULL      = 0,
379   SPELL_STATE_PREPARING = 1,
380   SPELL_STATE_CASTING   = 2,
381   SPELL_STATE_FINISHED  = 3,
382   SPELL_STATE_IDLE      = 4
383Spell:Cancel()                                  +- Cancels the spell.
384Spell:Cast(check)                               +- Casts the spell. Set check to true if you want to check if the spell is castable, or false to force cast.
385Spell:CanCast()                                 +- Returns true if the spell is castable.
386Spell:Finish()                                  +- Finishes the spell, used post-casting.
387Spell:GetTarget()                               +- Returns the target of the spell. Can return a Unit, Item or GObj.
388Spell:IsStealthSpell()                          +- Returns true if the spell grants some kind of stealth.
389Spell:IsInvisibilitySpell()                     +- Like IsStealthSpell but for invisibility.
390Spell:GetPossibleEnemy([range])                 +- Returns the GUID of a possible unit enemy of the spell. range is optional.
391Spell:GetPossibleFriend([range])                +- Same as above but for a friendly target.
392Spell:HasPower()                                +- Returns true if the caster has enough power to cast the spell.
393Spell:IsAspect()                                +- Returns true if the spell is a hunter Aspect spell.
394Spell:IsSeal()                                  +- Returns true if the spell is a paladin Seal spell.
395Spell:GetObjectType()                           +- Returns "Spell".
396Spell:SetVar(var [,subindex], value)            +- var is a string referring to a parameter of Spell. subindex is optional; used when the variable you are
397                                                   setting has sub indexes. value is what you want to set it to. Returns true on success, false on failure.
398Spell:GetVar(var [,subindex])                   +- See above, but returns the value on success or nil on failure.
399Spell:ResetVar(var)                             +- Resets the specified var to the DBC original. Returns true on success, false on failure.
400Spell:ResetAllVars()                            +- Resets all of Spell's vars to the DBC originals. Returns true on success, false on failure.
401
402:QUERYRESULT
403QResult:GetColumn(colNum)                       +- Returns a field object (see below) based on the column number given, errors if colNum is greater than max columns
404 e.x Usage:
405   local qres = WorldDBQuery(...)
406   local field = qres:GetColumn(0)
407   print(field:GetString())
408QResult:NextRow()                               +- Makes QResult fetch the next row of the result set. Returns true on success, false otherwise.
409QResult:GetColumnCount()                        +- Returns the number of columns in QResult.
410QResult:GetRowCount()                           +- Returns the number of rows in QResult.
411
412:FIELD
413Field:GetString()                               +- Returns the cstring data that this field holds.
414Field:GetByte()                                 +- Returns the signed byte that this field holds
415Field:GetUByte()                                +- Returns the unsigned byte that this field holds.
416Field:GetBool()                                 +- Returns the boolean that this field holds.
417Field:GetShort()                                +- Returns the signed short that this field holds.
418Field:GetUShort()                               +- Returns the unsigned short that this field holds.
419Field:GetLong()                                 +- Returns the signed long that this field holds.
420Field:GetULong()                                +- Returns the unsigned long that this field holds.
421Field:GetGUID()                                 +- Returns the guid number that this field holds.
Note: See TracBrowser for help on using the browser.