Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::FULL COMMAND LISTING::
- :Global
- PerformIngameSpawn(type,entry,map,x,y,z,o,facOrScale,dur [,eq1,eq2,eq3,instanceId,save]) +- Fixed to work correctly, added new arguments.
- GetLuaEngine() +- Returns what engine the server is using. Should be LuaHypArc.
- GetLuaEngineVersion() +- Returns what version LuaHypArc on the server is.
- GetGameTime() +- Returns server time in seconds.
- ReloadTable(tablename) +- Reloads table tablename.
- Rehash() +- Rehashes server config files.
- RegisterServerHook(event, functionName) +- Registers a server hook event. Further documentation included.
- logcol(colourVal) +- Sets the colour of the next print() message:
- FOREGROUND_BLUE = 1 // text color contains blue.
- FOREGROUND_GREEN = 2 // text color contains green.
- FOREGROUND_RED = 4 // text color contains red.
- FOREGROUND_INTENSITY = 8 // text color is intensified (brightened).
- //these can be added together, for example 1+8 = bright blue.
- GetPlayersInWorld() +- Returns a table containing all the players in the world.
- GetPlayersInMap(mapId) +- Returns a table containing all the players in map mapId.
- GetPlayersInZone(zoneId) +- Returns a table containing all the players in zone zoneId.
- RegisterTimedEvent(funcName, delay, repeats, ...) +- Registers funcName to occur repeatedly. delay is in milliseconds. repeats can be 0 for infinite repeats.
- The ... arguments are passed on to the registered function as arguments.
- (Returns a unique reference that can be used later.)
- RemoveTimedEvents() +- Removes all events registered with RegisterTimedEvent.
- RemoveTimedEvent(reference) +- Removes the specific timed event. reference is returned by RegisterTimedEvent.
- RemoveTimedEventsWithName(name) +- Removes all timed events with the specified name.
- RemoveTimedEventsInTable(table) +- Removes all timed events from the specified table (string).
- HasTimedEvents() +- Returns true if any timed events are registered.
- HasTimedEvent(reference) +- Returns true if the specific event is still registered. reference is as above.
- HasTimedEventsWithName(name) +- Returns true if an event with the specified name is registered.
- HasTimedEventsInTable(table) +- Returns true if an event with the specified table is registered.
- GetArcemuRevision() +- Returns the server's ArcEmu revision number.
- SendPvPCaptureMessage(zoneId, message) +- Sends a PvP-capture style message to zoneId.
- WorldDBQuery(query) +- Performs a query on the world database. Returns a "QueryResult" object.
- CharDBQuery(query) +- Performs a query on the character database. Returns a "QueryResult" object.
- SendMail(type,senderGuid,receivrGuid,subject,body,money,codAmt,itemRawGuid,stationeryId) +- Sends a mail message with specified parameters.
- type can be:
- NORMAL = 0
- COD = 1
- AUCTION = 2
- stationery:
- MAIL_STATIONERY_TEST1 = 1,
- MAIL_STATIONERY_TEST2 = 41,
- MAIL_STATIONERY_GM = 61,
- MAIL_STATIONERY_AUCTION = 62,
- MAIL_STATIONERY_VALENTINES = 64,
- MAIL_STATIONERY_XMAS = 65
- GetTaxiPath(path_id) +- Returns the Taxi object for a path from the DBCs, with id path_id.
- RegisterDummySpell(entry, funcName) +- entry must be a spell id with a "dummy", "script effect" or "send events" effect. funcName is the function
- that will trigger when that spell is cast.
- SetDBCSpellVar(entry, var [,subindex], value) +- Similar to Spell:SetVar, but this sets vars by entry id, rather than by individual spell objects.
- GetDBCSpellVar(entry, var [,subindex]) +- Retrieves a spell var based on spell entry id.
- The following functions were added to perform C++ bit operations on Lua values. They evaluate and return the value.
- bit_and(...)
- bit_or(...)
- bit_xor(...)
- bit_shiftleft(op,shift_number)
- bit_shiftright(op,shift_number)
- bit_not(op1)
- NumberToGUID(n) +- Turns a number into a GUID object.
- SendPacketToZone(packet,zone_id) +- Sends the packet to Zone zone_id.
- SendPacketToInstance(packet,instance_id) +- Sends the packet to Instance instance_id.
- SendPacketToWorld(packet) +- Sends the packet to the world.
- SendPacketToChannel(packet,name,team) +- Sends the packet to the channel with the specified name and team (0 = alliance).
- GetInstanceCreature(mapId, instanceId, id) +- Returns a creature from the specified instance. <<id can only be a spawn id or a GUID.>>
- GetInstancePlayerCount(mapId, instanceId) +- Returns the number of players in the specified instance.
- GetPlayersInInstance(mapId, instanceId) +- Returns a table containing all of the players in the instance.
- RegisterInstanceEvent(map, event, func) +- Registers an instance event. See below for more info.
- GetGuildByName(name) +- Returns the guild id of the guild with the specified name, or -1 on error.
- GetGuildByLeaderGuid(guid) +- Returns the guild id of the guild with the specified leader's guid, or -1 on error.
- :Items
- Item:GetEntryId() *- Now fixed and working correctly.
- Item:GetName() +- Returns Item's name.
- Item:GetSpellId(index) +- Returns Item's index'th spell Id. 0 means the first spell on the item.
- Item:GetSpellTrigger(index) +- Returns Item's index'th spell's trigger type. 0 means the first spell on the item.
- USE = 0
- ON_EQUIP = 1
- CHANCE_ON_HIT = 2
- SOULSTONE = 4
- LEARNING = 6
- Item:GetGUID() +- Gets Item's GUID.
- 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,
- chance must then also be provided, and the new loot will save in the DB.
- Item:GetItemLink() +- Returns a string containing Item's item link.
- Item:SetByteValue(index,index1,value) +- Modifies the specified byte value of Item.
- Item:GetByteValue(index,index1) +- Gets the specified byte value of Item.
- Item:GetItemLevel() +- Returns the item level.
- Item:GetRequiredLevel() +- Returns the required level.
- Item:GetBuyPrice() +- Returns the buy price.
- Item:GetSellPrice() +- Returns the sell price.
- Item:RepairItem() +- Repairs Item.
- Item:GetMaxDurability() +- Returns Item's max durability.
- Item:GetDurability() +- Returns Item's current durability.
- Item:HasEnchantment() +- Returns true if Item has an enchantment.
- Item:ModifyEnchantmentTime(slot,duration) +- Modifies Item's enchantment in slot to duration.
- Item:SetStackCount(count) +- Sets the number of stacked Items to count.
- Item:IsContainer() +- Returns true if Item is a bag.
- Item:GetContainerItemCount(id) +- Returns how many items with the specified id are within Item. Item must be a bag.
- Item:GetEquippedSlot() +- Returns the slot that Item is equipped in, or -1 if not equipped. See Plyr:GetEquippedItemBySlot.
- Item:GetObjectType() +- Returns "Item".
- Item:Remove() +- Removes the item from the world.
- Item:Create(entry_id, stackcount) +- Creates a new item with the specified ID and stack count, and returns it. This is like LuaPacket:Create,
- you are creating a new object to use. Eg: "local myItem = Item:Create(1234, 1); print(myItem:GetEntryId())"
- :GameObjects
- THE FOLLOWING UNIT FUNCTIONS HAVE BEEN PORTED FOR GAMEOBJECT USE:
- GetLandHeight
- SetZoneWeather
- GetDistanceYards
- PhaseSet
- PhaseAdd
- PhaseDelete
- GetPhase
- CastSpellOnTarget
- SendPacketToSet
- AddLoot
- GetInstanceOwner
- GetDungeonDifficulty
- SetDungeonDifficulty
- SetByteValue
- GetByteValue
- GetSpawnId
- GetAreaId
- GetInRangeUnits
- GetClosestUnit
- PLEASE SEE THEIR USAGE IN ":Units" SECTION.
- GObj:Update() +- Despawns and respawns Gobj.
- 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.
- GObj:GetObjectType() +- Returns "GameObject".
- GObj:SetScale(scale) +- Sets the scale of GObj (1.0 is 100%). Remember to GObj:Update() for visual changes.
- GObj:GetScale() +- Returns GObj's scale.
- :Units
- Unit:SendPacket(packet, self) +- Sends the packet to the nearby units. if self is true, the packet will also be sent to Unit.
- Plyr:SendPacketToGroup(packet) +- Sends the packet to Plyr's group.
- Plyr:SendPacketToGuild(packet [,guildId]) +- Sends the packet to Plyr's guild, or the guildId if specified.
- Plyr:SendPacketToPlayer(packet) +- Sends the packet to Plyr.
- 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.
- Unit:PhaseAdd(newphase [,save]) +- Unit becomes a member of newphase. save is as above.
- Unit:PhaseDelete(phase [,save]) +- Removes phase from Unit. save is as above.
- Also mapped to SetPhase, AddToPhase and DeletePhase respectively.
- Unit:GetPhase() +- Returns Unit's current phase.
- Plyr:PlaySoundToPlayer(sound_id) +- Plays sound_id to Plyr only.
- Plyr:GetDuelState() +- Returns the player's duel state:
- DUEL_STATE_REQUESTED = 0
- DUEL_STATE_STARTED = 1
- DUEL_STATE_FINISHED = 2 (Default)
- Unit:SetPosition(x,y,z [,o]) +- Instantly relocates the Unit to the specified x,y,z, optional orientation.
- Unit:GetLandHeight(x,y) +- Get the Z of the land at (x,y). Requires V-Maps to work correctly.
- Unit:QuestAddStarter(quest_id) +- Makes Unit a quest starter for quest_id.
- Unit:QuestAddFinisher(quest_id) +- Makes Unit a quest finisher for quest_id.
- Plyr:SetPlayerSpeed(speed) +- Sets the speed of Plyr (0-255).
- Plyr:GiveHonor(amount) +- Adds amount of honour to Plyr.
- Plyr:SetBindPoint(x,y,z,map_id,zone_id) +- Sets Plyr's Hearthstone to x,y,z in zone_id, map_id.
- Plyr:SoftDisconnect() +- Logs out Plyr.
- Unit:SetZoneWeather(zone_id,type,density) +- Sets the weather of zone_id to type, and density (0.3-2.0).
- WEATHER_TYPE_NORMAL = 0, // NORMAL (SUNNY)
- WEATHER_TYPE_FOG = 1, // FOG
- WEATHER_TYPE_RAIN = 2, // RAIN
- WEATHER_TYPE_HEAVY_RAIN = 4, // HEAVY_RAIN
- WEATHER_TYPE_SNOW = 8, // SNOW
- WEATHER_TYPE_SANDSTORM = 16 // SANDSTORM
- Plyr:SetPlayerWeather(type,density) +- Sets the weather for Plyr ONLY. See above for other arguments.
- Plyr:PlayerSendChatMessage(type,lang,msg) +- Forces Plyr to send a chat message. See existing SendChatMessage function for other arguments.
- Unit:GetDistanceYards(target) +- Gets the distance between Unit and target in yards.
- Unit:VendorAddItem(item_id,amount,extcost) +- Adds amount items with entry item_id and extended cost extcost to Unit.
- Unit:VendorRemoveItem(item_guid) +- Removes the item item_guid from the vendor. Note this is NOT entry id. Recommend function below.
- Unit:VendorRemoveAllItems() +- Removes all the items from the vendor Unit.
- Unit:CreatureHasQuest(quest_id) +- Returns true if Unit has quest quest_id.
- Plyr:SendBattlegroundWindow(bg_id) +- Sends a battleground window for bg_id to Plyr.
- BATTLEGROUND_ALTERAC_VALLEY = 1,
- BATTLEGROUND_WARSONG_GULCH = 2,
- BATTLEGROUND_ARATHI_BASIN = 3,
- BATTLEGROUND_ARENA_2V2 = 4,
- BATTLEGROUND_ARENA_3V3 = 5,
- BATTLEGROUND_ARENA_5V5 = 6,
- BATTLEGROUND_EYE_OF_THE_STORM = 7,
- BATTLEGROUND_STRAND_OF_THE_ANCIENT = 9,
- BATTLEGROUND_ISLE_OF_CONQUEST = 30
- Plyr:SendVendorWindow(unit) +- Sends Plyr unit's vendor window. Note that this isn't an entry id.
- Plyr:SendTrainerWindow(unit) +- Same as above, except with a Trainer window.
- Plyr:SendInnkeeperWindow(unit) +- Same as above, except with an innkeeper bind.
- Plyr:SendBankWindow(unit) +- Same as above, except with a bank window.
- Plyr:SendAuctionWindow(unit) +- Same as above, except with an auction house window.
- Plyr:GetInventoryItem(bag_slot,slot) +- Returns the item object in Plyr's bag bag_slot and slot number slot.
- Plyr:GetInventoryItemById(item_id) +- Returns the item object in Plyr's inventory with entry item_id.
- Plyr:GetPrimaryCombatTarget() +- Returns Plyr's combat target. Should use instead of old GetTarget.
- Unit:MoveRandomArea(x1,y1,z1,x2,y2,z2,o2) +- Moves Unit to a random point in the area.
- Plyr:SendLootWindow(GUID, loot_type) +- Sends Plyr the loot window of the object identified by GUID.
- Loot type MUST be
- 1-creature, regular
- 2-creature, skinning
- 3-creature, pickpocketing
- 4-go, regular (includes fishing schools)
- 5-go, herbalism/mining
- 6-item, regular/milling/prospecting/disenchanting
- Unit:AddLoot(itemid,mincount,maxcount,ffa_loot[,bPerm,chance]) +- Adds a loot item with the described parameters to Unit. Good to use for SendLootWindow.
- If bPerm is true, chance must then also be provided, and the new loot will save in the DB.
- Unit:SetPacified(true) +- Set true to 1 to pacify the Unit. 0 to un-pacify. Good for players.
- Plyr:SetPlayerLock(Yes) +- Locks the player from all control. Yes should be true or false. False unlocks the player.
- Plyr:MovePlayerTo(x,y,z,o,type [,speed]) +- Forces a player to move to x,y,z,o. Speed is optional.
- type must be:
- 0 - walk
- 256 - teleport
- 4096 - run
- 12288 - fly
- Plyr:IsGm() +- Returns true if Plyr is a GM.
- Plyr:GetGroupPlayers() +- Returns a table similar to GetInRangePlayers() but containing Plyr's group members.
- Unit:GetDungeonDifficulty() +- Returns the Unit's current dungeon difficulty:
- Unit:SetDungeonDifficulty(difficulty) +- Sets the Unit's dungeon difficulty:
- MODE_NORMAL_10MEN = 0,
- MODE_NORMAL_25MEN = 1,
- MODE_HEROIC_10MEN = 2,
- MODE_HEROIC_25MEN = 3
- Plyr:GetGroupLeader() +- Returns Plyr's group's leader.
- 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.
- Plyr:AddGroupMember(player [,subgroup]) +- Adds player to Plyr's group, subgroup is optional.
- Plyr:IsGroupFull() +- Returns true if Plyr's group is full.
- Plyr:IsGroupedWith(target) +- Returns true if target is in Plyr's group.
- Plyr:GetTotalHonor() +- Returns Plyr's total honor.
- Plyr:GetHonorToday() +- Returns Plyr's honor today.
- Plyr:GetHonorYesterday() +- Returns Plyr's honor for yesterday.
- Plyr:GetArenaPoints() +- Returns Plyr's arena points.
- Plyr:AddArenaPoints(amt) +- Adds amt of arena points to Plyr.
- Plyr:AddLifetimeKills(amt) +- Adds amt of lifetime kills to Plyr.
- Plyr:GetInRangePlayersWithAura(spellId) +- Returns a table of in range players with spellId as an aura.
- Unit:GetGender() +- Returns 0-male or 1-female.
- Unit:SetGender(gender) +- Sets the gender of unit. Works on players - requires relog to take effect.
- Plyr:GetGroupType() +- Returns Plyr's group type:
- GROUP_TYPE_PARTY = 0,
- GROUP_TYPE_RAID = 1,
- Plyr:ExpandToRaid() +- Expands Plyr's group to a raid.
- Plyr:GetGuildId() +- Returns Plyr's guild id.
- Plyr:GetGuildRank() +- Returns Plyr's rank in his guild.
- Plyr:SetGuildRank(rank) +- Set's Plyr's rank in his guild to rank.
- Plyr:IsInGuild() +- Returns true if Plyr is in a guild, false otherwise.
- Plyr:SendGuildInvite(recipient) +- Makes Plyr send recipient an invite to their guild.
- Plyr:DemoteGuildMember(target) +- Makes Plyr demote target.
- Plyr:PromoteGuildMember(target) +- Makes Plyr promote target.
- Plyr:SetGuildMotd(newMotd) +- Makes Plyr set the guild message of the day.
- Plyr:GetGuildMotd([guildId]) +- Returns Plyr's (or the specified guild Id's) guild message of the day.
- Plyr:SetGuildInformation(newInfo) +- Makes Plyr set the guild information to newInfo.
- Plyr:AddGuildMember(guildId, [,rank]) +- Adds Plyr to the guild with the specified guildId. rank will be the rank forced on the new member.
- Plyr:RemoveGuildMember(target) +- Removes target from Plyr's guild.
- Plyr:SetPublicNote(target, note) +- Makes Plyr set the public note of target to note.
- Plyr:SetOfficerNote(target, note) +- Makes Plyr set the officer note of target to note.
- Plyr:DisbandGuild([guildId]) +- Disbands Plyr's (or the specified guild ID's) guild.
- Plyr:ChangeGuildMaster(target) +- Changes Plyr's guild leader to target.
- Plyr:SendGuildChatMessage(message,isOfficerChat)+- Plyr sends a guild chat message. Set isOfficerChat to true to make it an officer chat message.
- Plyr:SendGuildLog(target) +- Sends Plyr's guild log to target.
- Plyr:GuildBankDepositMoney(amount) +- Makes Plyr deposit an amount of money into the guild bank.
- Plyr:GuildBankWithdrawMoney(amount) +- Makes Plyr withdraw an amount of money from the guild bank.
- Unit:GetInstanceOwner() +- Returns the owner of the instance Unit is currently in.
- Plyr:GetGmRank() +- Returns Plyr's GM rank as a string, eg. 'z' or 'az'.
- Unit:SetByteValue(index,index1,value) +- Modifies the specified byte value of Unit.
- Unit:GetByteValue(index,index1) +- Gets the specified byte value of Unit.
- Plyr:IsPvPFlagged() +- Returns true if Plyr is PvP flagged.
- Plyr:IsFFAPvPFlagged() +- Returns true if Plyr is free-for-all PvP flagged.
- Plyr:FlagFFA(bool) + Pass in true to flag the player for ffa pvp and false to unflag.
- Plyr:GetGuildLeader() +- Returns the name of Plyr's guild's leader.
- Plyr:GetGuildMemberCount() +- Returns the number of people in Plyr's guild.
- Unit:CanAttack(target) +- Returns true if Unit can attack target.
- Unit:GetInRangeFriends() *- Now working as intended.
- Unit:GetInRangeEnemies() +- Returns Unit's in range enemies.
- Unit:GetInRangeUnits() +- Returns all units near Unit.
- Unit:IsFriendly(obj) +- Returns true if Unit is friendly to obj, false otherwise.
- Unit:IsInPhase(phase) +- Returns true if Unit is in phase.
- Unit:HasFlag(index, flag) +- Returns true if the Unit has UInt32Value at index and flag.
- Plyr:GetPlayerMovementVector() +- Returns Plyr's movement vector in table x,y,z,o. Experimental.
- Plyr:UnsetKnownTitle(id) +- Removes the title with id from Plyr.
- Unit:SetMovementFlags(flag) +- Sets the way the unit moves.
- flag must be:
- 0 - walk
- 1 - run
- 2 - fly
- Plyr:Repop() +- Forces the player to spirit release to the nearest graveyard.
- Plyr:GetEquippedItemBySlot(slot) +- Gets the item Plyr has equipped in the specified slot.
- slot must be:
- HEAD 0
- NECK 1
- SHOULDERS 2
- BODY 3
- CHEST 4
- WAIST 5
- LEGS 6
- FEET 7
- WRISTS 8
- HANDS 9
- FINGER1 10
- FINGER2 11
- TRINKET1 12
- TRINKET2 13
- BACK 14
- MAINHAND 15
- OFFHAND 16
- RANGED 17
- TABARD 18
- Unit:EventChat(type,language,message,delay) +- Makes the Unit send a chat message in delay milliseconds.
- Plyr:ResetTalents() +- Resets Plyr's talent points.
- Plyr:SetTalentPoints(spec, newValue) +- Sets Plyr's talent points to newValue. spec must be 0 or 1, identifying which spec to modify.
- Plyr:GetTalentPoints(spec) +- Returns how many talent points Plyr has. spec must be 0 or 1, identifying which spec to modify.
- Unit:GetSpawnId() +- Returns the Unit's spawn id ("Sql id" from .npc info).
- Plyr:GetGuildMembers() +- Returns a table containing the names of the players in Plyr's guild.
- Plyr:TakeHonor(amt) +- Removes amt of honor from Plyr.
- Plyr:RemoveArenaPoints(amt) +- Removes amt of arena points from Plyr.
- Unit:GetAreaId() +- Returns Unit's current area (subzone) id. Requires V-Maps.
- Plyr:ResetPetTalents() +- Resets Plyr's pet's talents.
- Unit:IsDazed() +- Returns true if Unit is dazed/ensnared.
- Unit:GetAura(slot) +- Returns the ID of the aura on Unit in the specified slot.
- Unit:IsRooted() +- Returns true if Unit us rooted.
- Unit:HasAuraWithMechanic(id) +- Returns true if Unit has an aura containing the specified mechanic.
- Unit:HasNegativeAura() +- Returns true if Unit has a negative aura.
- Unit:HasPositiveAura() +- Returns true if Unit has a positive aura.
- Unit:GetClosestEnemy() +- Returns the closest enemy to Unit.
- Unit:GetClosestFriend() +- Returns the closest friend to Unit.
- Plyr:StartTaxi(Taxi, mount_id) *- Modified to use the Taxi system, and mounts them on the set display id.
- Plyr:IsOnTaxi() +- Returns true if Plyr is on a taxi.
- Plyr:GetTaxi() +- Returns the Taxi object that Plyr is currently on, or nil if not on a taxi.
- Unit:GetObjectType() +- Returns "Player" if Unit is a player, "Unit" for NPCs.
- 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.
- POWER_TYPE_MANA = 0,
- POWER_TYPE_RAGE = 1,
- POWER_TYPE_FOCUS = 2,
- POWER_TYPE_ENERGY = 3,
- POWER_TYPE_HAPPINESS = 4,
- POWER_TYPE_RUNES = 5,
- POWER_TYPE_RUNIC_POWER = 6
- Unit:GetMaxPower([type]) +- Returns the amount of max power Unit can have. type is as above.
- Unit:GetPowerPct([type]) +- Returns percentage of power unit has. type is as above.
- Unit:SetMaxPower(amount, [type]) +- Sets Unit's max power. type is as above. This MUST be set when using a non-default power type.
- (Note: Rage and Runic power's default internal maximum is 1000, displays as 100 in-game)
- Unit:SetPowerPct(amount, [type]) +- Sets Unit's power as a percentage of its max. type is as above.
- Unit:SetPower(amount, [type]) +- Sets Unit's power. type is as above.
- Unit:CreateCustomWaypoint(id,x,y,z,o,waittime,movementflags,modelid) +- Same as CreateWaypoint, but allows for set ID instead of incremental.
- Unit:DeleteWaypoints() +- Erases all waypoints that Unit has.
- Plyr:LearnSpells(lua_table) +- lua_table must be an array of spell ids. The function will teach Plyr each of those spells.
- ex.
- function LearnSpellz(player)
- local spellz = {1,2,3,4,5,6,7}
- player:LearnSpells(spellz)
- end
- Plyr:AddAchievement(ID) +- Makes Plyr complete an achievement with the specified ID. Returns true on success, false on failure.
- Plyr:RemoveAchievement(ID) +- Removes the achievement with the specified ID from Plyr.
- Plyr:HasAchievement(ID) +- Returns true if Plyr has completed the specified achievement, false otherwise.
- Plyr:GetPlayerMovementFlags() +- Returns Plyr's movement flags. See enum MovementFlags from WorldSession.h for possible values.
- Unit/Plyr:IsInDungeon() +- return true if the creature/plr is in a dungeon.
- Unit/Plyr:IsInRaid() +- returns true if the creature/plr is in a raid.
- Unit:TeleportCreature(x,y,z) +- Teleports the creature x,y,z (Mostly used for teleportation spells and such.)
- Unit:IsAttackable(obj) +- Returns true if Unit can attack Obj.
- Unit:IsHostile(obj) +- Returns true if Unit is hostile to Obj.
- Unit:GetMovementType() +- Returns the movement type of Unit. Can be:
- MOVEMENTTYPE_NONE = 0
- MOVEMENTTYPE_RANDOMWP = 1
- MOVEMENTTYPE_CIRCLEWP = 2
- MOVEMENTTYPE_WANTEDWP = 3
- MOVEMENTTYPE_DONTMOVEWP = 4
- MOVEMENTTYPE_QUEST = 10
- MOVEMENTTYPE_FORWARDTHANSTOP = 11
- Unit:GetNumWaypoints() +- Returns the number of waypoints Unit has.
- Plyr:GetQuestLogSlot(entry) +- Returns the slot of Plyr's quest log that has quest with the specified entry, or -1 on error.
- Plyr:IsInChannel(channel_name) +- Returns true if Plyr is in the channel: "channel_name" (channel_name is a string).
- Plyr:JoinChannel(channel_name) +- Makes Plyr join the channel: "channel_name".
- Plyr:LeaveChannel(channel_name) +- Makes Plyr leave the channel: "channel_name".
- Plyr:SetChannelName(channel_name, new_name) +- Sets the name of the channel to new_name.
- Plyr:SetChannelPassword(channel_name, password) +- Sets the password of the channel to password.
- Plyr:GetChannelPassword(channel_name) +- Returns the channel's password.
- Plyr:KickFromChannel(channel_name) +- Kicks Plyr from the channel.
- Plyr:BanFromChannel(channel_name) +- Kicks and bans Plyr from the channel.
- Plyr:UnbanFromChannel(channel_name) +- Unbans Plyr from the channel.
- Plyr:GetChannelMemberCount(channel_name) +- Returns the amount of members in the channel.
- Unit:GetAuraObject(slot) +- Returns the aura object at the specified slot. See GetAura.
- Unit:GetAuraStackCount(id) +- Returns how many stacks of the aura with specified entry id Unit has.
- Unit:AddAuraObject(aura) +- Adds the specified aura object to Unit.
- Unit:GetAuraObjectById(id) +- Returns the aura object with the specified spell id.
- Unit:GetNativeFaction() +- Returns Unit's native faction.
- Plyr:StopPlayerAttack() +- Makes Plyr stop attacking (melee only).
- Plyr:GetQuestObjectiveCompletion(quest,obj) +- Returns how many mobs killed for the specified quest and objective.
- Unit:FullCastSpellAoF(x,y,z,sp) +- Just like CastSpellAoF with cast times and power costs.
- Unit:GetClosestUnit() +- Returns the closest unit.
- Plyr:SetSelectedGO(GObj) +- Sets the player's selected GO used with the GM command.
- :Packets
- LuaPacket:CreatePacket(opcode, size) +- Returns a new packet object with the specified opcode and size.
- Pakt:GetOpcode() +- Returns Pakt's opcode.
- Pakt:GetSize() +- Returns Pakt's size.
- Pakt:ReadByte() +- Reads an int8 from Pakt.
- Pakt:ReadUByte() +- Reads an uint8 from Pakt.
- Pakt:ReadShort() +- Reads an int16 from Pakt.
- Pakt:ReadUShort() +- Reads an uint16 from Pakt.
- Pakt:ReadLong() +- Reads an int32 from Pakt.
- Pakt:ReadULong() +- Reads an uint32 from Pakt.
- Pakt:ReadFloat() +- Reads a float from Pakt.
- Pakt:ReadDouble() +- Reads a double from Pakt.
- Pakt:ReadGUID() +- Reads an uint64 from Pakt.
- Pakt:ReadWoWGuid() +- Reads the WoWGuid.
- Pakt:WriteByte(val) +- Writes an int8 to Pakt.
- Pakt:WriteUByte(val) +- Writes an uint8 to Pakt.
- Pakt:WriteShort(val) +- Writes an int16 to Pakt.
- Pakt:WriteUShort(val) +- Writes an uint16 to Pakt.
- Pakt:WriteLong(val) +- Writes an int32 to Pakt.
- Pakt:WriteULong(val) +- Writes an uint32 to Pakt.
- Pakt:WriteFloat(val) +- Writes a float to Pakt.
- Pakt:WriteDouble(val) +- Writes a double to Pakt.
- Pakt:WriteGUID(val) +- Writes an uint64 to Pakt.
- Pakt:WriteWoWGuid(object) +- Writes the WoWGuid of the object passed in.
- Pakt:GetObjectType() +- Returns "Packet".
- :TAXI
- LuaTaxi:CreateTaxi() +- Returns a new Taxi object.
- Taxi:GetNodeCount() +- Returns the number of nodes in the path Taxi.
- 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
- inserted at the given index.
- Taxi:GetId() +- Returns the ID of a Taxi path. Note custom paths have no ID.
- Taxi:GetObjectType() +- Returns "TaxiPath".
- :SPELLS
- Spell:GetCaster() +- Returns the caster of the spell. Can return a Unit, Item or GObj.
- Spell:GetEntry() +- Returns the entry ID of the spell.
- Spell:IsDuelSpell() +- Returns true if the spell was cast in a duel.
- Spell:GetSpellType() +- Returns the type of the spell:
- SPELL_DMG_TYPE_NONE = 0,
- SPELL_DMG_TYPE_MAGIC = 1,
- SPELL_DMG_TYPE_MELEE = 2,
- SPELL_DMG_TYPE_RANGED = 3
- Spell:GetSpellState() +- Returns the state of the spell:
- SPELL_STATE_NULL = 0,
- SPELL_STATE_PREPARING = 1,
- SPELL_STATE_CASTING = 2,
- SPELL_STATE_FINISHED = 3,
- SPELL_STATE_IDLE = 4
- Spell:Cancel() +- Cancels the spell.
- 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.
- Spell:CanCast() +- Returns true if the spell is castable.
- Spell:Finish() +- Finishes the spell, used post-casting.
- Spell:GetTarget() +- Returns the target of the spell. Can return a Unit, Item or GObj.
- Spell:IsStealthSpell() +- Returns true if the spell grants some kind of stealth.
- Spell:IsInvisibilitySpell() +- Like IsStealthSpell but for invisibility.
- Spell:GetPossibleEnemy([range]) +- Returns the GUID of a possible unit enemy of the spell. range is optional.
- Spell:GetPossibleFriend([range]) +- Same as above but for a friendly target.
- Spell:HasPower() +- Returns true if the caster has enough power to cast the spell.
- Spell:IsAspect() +- Returns true if the spell is a hunter Aspect spell.
- Spell:IsSeal() +- Returns true if the spell is a paladin Seal spell.
- Spell:GetObjectType() +- Returns "Spell".
- Spell:SetVar(var [,subindex], value) +- var is a string referring to a parameter of Spell. subindex is optional; used when the variable you are
- setting has sub indexes. value is what you want to set it to. Returns true on success, false on failure.
- Spell:GetVar(var [,subindex]) +- See above, but returns the value on success or nil on failure.
- Spell:ResetVar(var) +- Resets the specified var to the DBC original. Returns true on success, false on failure.
- Spell:ResetAllVars() +- Resets all of Spell's vars to the DBC originals. Returns true on success, false on failure.
- Spell:GetCastedItemId() +- Returns what item ID cast the spell.
- :QUERYRESULT
- QResult:GetColumn(colNum) +- Returns a field object (see below) based on the column number given. Errors if colNum is greater than max columns
- e.x Usage:
- local qres = WorldDBQuery(...)
- local field = qres:GetColumn(0)
- print(field:GetString())
- QResult:NextRow() +- Makes QResult fetch the next row of the result set. Returns true on success, false otherwise.
- QResult:GetColumnCount() +- Returns the number of columns in QResult.
- QResult:GetRowCount() +- Returns the number of rows in QResult.
- :FIELD
- Field:GetString() +- Returns the cstring data that this field holds.
- Field:GetByte() +- Returns the signed byte that this field holds
- Field:GetUByte() +- Returns the unsigned byte that this field holds.
- Field:GetBool() +- Returns the boolean that this field holds.
- Field:GetShort() +- Returns the signed short that this field holds.
- Field:GetUShort() +- Returns the unsigned short that this field holds.
- Field:GetLong() +- Returns the signed long that this field holds.
- Field:GetULong() +- Returns the unsigned long that this field holds.
- Field:GetGUID() +- Returns the guid number that this field holds.
- :AURA
- Aura:GetObjectType() +- Returns "Aura".
- Aura:GetSpellID() +- Gets the spell Id of Aura.
- Aura:GetCaster() +- Returns the caster of Aura.
- Aura:GetTarget() +- Returns the target of the aura, as in, the unit who is currently affected by it.
- Aura:GetDuration() +- Returns the overall duration of the aura in milliseconds.
- Aura:SetDuration(dur) +- Sets a new duration of the aura.
- Aura:GetTimeLeft() +- Returns how long until the aura is removed. In milliseconds.
- Aura:SetNegative([amt]) +- Sets the aura specified as negative, amt is optional; the number of "points" to take away.
- (Some spells need more "points" to be removed to make it negative, generally unneeded though)
- Aura:SetPositive([amt]) +- Sets the aura specified as positive, amt is optional; the number of points to add.
- Aura:Remove() +- Removes the aura.
- Aura:SetVar(var [,subindex], value) +- See Spell:SetVar
- Aura:GetVar(var [,subindex]) +- See Spell:GetVar
- Aura:GetAuraSlot() +- Returns the aura's slot, see Unit.h for slot meanings.
- Aura:SetAuraSlot(slot) +- Sets the aura's slot, see Unit.h for slot meanings.
- RegisterInstanceEvent documentation
- Format: NAME_OF_EVENT = event_id, (arguments given to registered function) {additional notes}
- INSTANCE_EVENT_ON_PLAYER_DEATH = 1, (nInstanceId, pPlayer, pKiller)
- INSTANCE_EVENT_ON_PLAYER_ENTER = 2, (nInstanceId, pPlayer)
- INSTANCE_EVENT_ON_AREA_TRIGGER = 3, (nInstanceId, pPlayer, nAreaId)
- INSTANCE_EVENT_ON_ZONE_CHANGE = 4, (nInstanceId, pPlayer, nNewZone, nOldZone)
- INSTANCE_EVENT_ON_CREATURE_DEATH = 5, (nInstanceId, pVictim, pKiller)
- INSTANCE_EVENT_ON_CREATURE_PUSH = 6, (nInstanceId, pUnit) {AKA "OnSpawn" but for within an instance}
- INSTANCE_EVENT_ON_GO_ACTIVATE = 7, (nInstanceId, pGO, pPlayer)
- INSTANCE_EVENT_ON_GO_PUSH = 8, (nInstanceId, pGO) {AKA "OnSpawn" but for within an instance}
- INSTANCE_EVENT_ONLOAD = 9, (nInstanceId) {When the instance is created}
- INSTANCE_EVENT_DESTROY = 10, (nInstanceId) {When the instance is destroyed, happens when the instance resets.}
- LCF's function documentation
- Creature :
- SpawnLocalCreature(entry,faction,duration) - simply spawns the creature entry at the current unit's position.
- SpawnLocalGameObject(entry,duration) - same as above
- MonsterSay(msg) - takes in the message to send and the current unit calls SendChatMessage with CHAT_MSG_MONSTER_SAY
- MonsterYell(msg) - save as above except calls SendChatMessage with CHAT_MSG_MONSTER_YELL
- MonsterEmote(msg) - same as above but with CHAT_MSG_MONSTER_EMOTE
- MonsterYellToPlayer(plr,msg) - sends the yell packet to the plr only(as opposed to all inrange players)
- MonsterSayToPlayer(plr,msg) - sends a say to the plr
- MonsterWhisperToPlayer(plr,msg) - sends a whisper to the plr.
- MoveToUnit(target) - simply moves the current unit to the target unit's location.
- 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.
- - 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.
- - 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.
- RemoveLuaEvent(func) -- deprecated, use obj:RemoveEvents() to remove events
- FaceUnit(tar) - makes the Creature face the target specified.
- GetNearestUnitWithEntry(entry) - returns the nearest unit to the creature with the specified entry.
- GetLocalCreature(creature_entry) - simply calls GetCreatureNearestCoords with the unit's position.
- GetLocalGameObject(go_entry)
- GetCreator() - returns the unit whos guid is stored in UNIT_FIELD_CREATEDBY/SUMMONEDBY
- SetCreator(creator_obj) - sets UNIT_FIELD_CREATEDBY/SUMMONEDBY to creator_obj:GetGUID()
- IsCasting() - returns true if the creature is casting a spell.
- Player:
- GetStrength()
- GetStamina()
- GetAgility()
- GetSpirit()
- GetIntellect()
- IsAlliance()
- IsHorde()
- IsHeroic() - returns true if the player is a heroic dungeon or raid.
- SpawnLocalCreature(entry,faction,duration)
- SpawnLocalGameObject(entry,faction,duration)
- RegisterLuaEvent(func,delay,repeats,extra_args_go_here) - same as creature
- RemoveLuaEvent(func) - deprecated, use obj:RemoveEvents() to remove events
- GetNearestUnitWithEntry(entry) - same as creature
- GetLocalCreature(creature_entry) - simply calls GetCreatureNearestCoords with the player's position.
- GetLocalGameObject(go_entry)
- IsCasting() - returns true if the player is casting a spell.
- GameObject:
- SetClickable()
- SetUnclickable()
- IsClickable()
- IsUnclickable()
- Respawn() - simply despawns and respawns the go instantly.
- IsOpen()
- IsClosed()
- Close()
- Open()
- RegisterLuaEvent(func,delay,repeats,extra_args_go_here) - same as creature.
- RemoveLuaEvent(func) - deprecated, use obj:RemoveEvents() to remove events
- RemoveEvents() - used to remove any events registered through RegisterLuaEvent
- GetCreator() - returns the unit whos guid is stored in OBJECT_FIELD_CREATEDBY
- SetCreator(creator_obj) - sets OBJECT_FIELD_CREATEDBY to creator_obj:GetGUID()
- GetLocalCreature(creature_entry) - simply calls GetCreatureNearestCoords with the go's position.
- GetLocalGameObject(go_entry)
- EXTRA METHODS
- 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
- LCF:RegisterAreaTrigger(area_id,func) - same as above except for area triggers
- - 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
- LCF:RemoveZoneHook(zone_id,func) - removes the lua function from the list of hooked functions.
- LCF:RemoveAreaTrigger(area_trig,func) - does the same as above except for area triggers
- 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.
- 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.
- 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