Code:::FULL COMMAND LISTING:: :Global PerformIngameSpawn(type,entry,map,x,y,z,o,facOrScale,dur [,eq1,eq2,eq3,instanceId]) *- Fixed to work correctly all round. GetPlayer(name) *- Fixed possible world crash. 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. ReloadLuaEngine() +- Reloads the Lua engine & scripts. 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 a world timed event, similar to RegisterEvent. GetArcemuRevision() +- Returns the server's ArcEmu revision number. SendPvPCaptureMessage(zoneId, message) +- Sends a PvP-capture style message to zoneId. WorldDBQueryTable(query) +- Performs a query. Results are returned as a table in the form t[col][row]. CharDBQueryTable(query) +- Same as above, but for the Char DB. WorldDBQuery(query [,colnum, rownum]) +- Performs a query. rownum and colnum are optional, should only be used to CharDBQuery(query [,colnum, rownum]) specify what col/row to get returned values from (SELECT statements) SendMail(type,senderRawGuid,receivrRawGuid,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 :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. Dodgy. Item:GetRawGUID() +- Gets Item's RawGUID. Not dodgy. Item:AddLoot(itemid,mincount,maxcount,ffa_loot) +- Adds loot with described parameters to Item. Good to use with SendLootWindow. 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. :GameObjects THE FOLLOWING UNIT FUNCTIONS HAVE BEEN PORTED FOR GAMEOBJECT USE: GetLandHeight SetZoneWeather GetDistanceYards PhaseSet PhaseAdd PhaseDelete GetPhase CastSpellOnTarget InitPacket AddDataToPacket SendPacketToSet SendPacketToZone SendPacketToInstance SendPacketToWorld GetRawGUID AddLoot GetInstanceOwner GetDungeonDifficulty SetDungeonDifficulty SetByteValue GetByteValue GetSpawnId GetAreaId PLEASE SEE THEIR USAGE IN ":Units" SECTION. Gobj:Update() +- Despawns and respawns Gobj. :Units PACKETS - PLEASE SEE ABOVE FOR FURTHER INFORMATION. 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. Please see above for full info. Plyr:SendPacketToGuild(packet) +- Sends the packet stored in buffer_index to Plyr's guild. Please see above for full info. Plyr:SendPacketToPlayer(packet) +- Sends the packet to Plyr. Please see above for full info. Unit:SendPacketToZone(packet,zone_id) +- Sends the packet to Zone zone_id. Please see above for full info. Unit:SendPacketToInstance(packet,instance_id) +- Sends the packet to Instance instance_id. Please see above for full info. Unit:SendPacketToWorld(packet) +- Sends the packet to the world. Please see above for full info. PHASES - PLEASE SEE ABOVE FOR FURTHER INFORMATION. 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:CastSpellOnTarget(spell_id,target) *- Now working as intended, at long last. Just like CastSpell, with a target. 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(raw_GUID, loot_type) +- Sends Plyr the loot window of the object identified by raw_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:GetRawGUID() +- Gets the RawGUID of Unit. Unit:AddLoot(itemid,mincount,maxcount,ffa_loot) +- Adds a loot item with the described parameters to Unit. Good to use for SendLootWindow or dynamic loot. Unit:SetPacified(true) +- Set true to 1 to pacify the Unit. 0 to un-pacify. Good for players. Unit:GetUnitByRawGUID(raw_GUID) +- Just like its GUID counterpart but uses raw_GUID. Unit:PlaySpellVisualByRawGUID(raw_GUID,spellid) +- Plays the visual of spellid through the unit identified by raw_GUID. Experimental. VEHICLE FUNCTIONS - EXPERIMENTAL Unit:SpawnVehicle(entry,x,y,z,o,faction,duration [,phase]) +- Spawns a creature as a vehicle with described parameters. Returns the vehicle spawned. Plyr:SetVehicle(vehicle, seat) +- Sets Plyr's vehicle, and their seat position - a number. Set to -1 for auto-choose. Plyr:GetVehicle() +- Returns the Unit for Plyr's current vehicle. Plyr:RemoveFromVehicle() +- Removes Plyr from their vehicle. Plyr:GetVehicleSeat() +- Returns what seat Plyr is sitting in. Unit:IsVehicle() +- Returns true if Unit is a vehicle, false otherwise. Unit:GetPassengerCount() +- Returns the current amount of passengers in the vehicle Unit. Unit:MoveVehicle(x,y,z,o) +- Moves the vehicle Unit (with all passengers) to defined position. Plyr:SetPlayerLock(Yes) +- Locks the player from all control. Yes should be 1 or 0. 0 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 = 0, MODE_HEROIC = 1, MODE_EPIC = 2, 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() +- Returns Plyr's guild's message of the day. Plyr:SetGuildInformation(newInfo) +- Makes Plyr set the guild information to newInfo. Plyr:AddGuildMember(target) +- Adds target to Plyr's guild. 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() +- Disbands Plyr'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. Plyr:Jump(height) +- Makes Plyr jump with specified height. Experimental. 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: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. :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: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.