It broadcasts a message to the player "Your X coordinate is [whatever the player's X coordinate is]".
There are a few more slightly more advanced functions in the library, but if you want to know what they are, you might as well find them out yourself.
Code:
-- Alvanaar's Extended Lua Library --
-- http://www.ac-web.org/ --
-- [ Requires 'DefinedVariables.lua' ] --
-- To load the library use the following function:
-- [[ dofile(AELL_DIRECTORY) ]] --
--
AELL_DIRECTORY = "scripts/ExtendedLuaLibrary" -- change to this file's file directory in relation to your arcemu_world.exe/aspire_world.exe file.
Record_Errors = true -- set this to true if you want AELL to record errors and vice versa.
--
AELL_ERRORS = {}
--
function Coords(targ)
if (targ == nil) then
errorlog_write("[Function: Coords(targ)] Function was called with no arguments - it requires one (1) argument.")
else
local map, zone, x, y, z, o = targ:GetMapId(), targ:GetZoneId(), targ:GetX(), targ:GetY(), targ:GetZ(), targ:GetO()
return {map, zone, x, y, z, o}
end
end
function MessageInRangePlayers(unit, typ, msg, maxrng)
if (unit == nil) then
errorlog_write("[Function: MessageInRangePlayers(unit, typ, msg, maxrng)] Function was called with no arguments - it requires three (3) arguments.")
elseif (unit ~= nil) and (typ == nil) then
errorlog_write("[Function: MessageInRangePlayers(unit, typ, msg, maxrng)] Function was called with one (1) argument - it requires three (3) arguments.")
elseif (typ ~= nil) and (msg == nil) then
errorlog_write("[Function: MessageInRangePlayers(unit, typ, msg, maxrng)] Function was called with two (2) arguments - it requires three (3) arguments.")
elseif (msg ~= nil) and (maxrng == nil) then
local plrs = unit:GetInRangePlayers()
local msged = {}
for i=1, #plrs do
if (tablefind(msged, plrs[i]:GetName() == false) then
if (typ == 1) then
plrs[i]:SendBroadcastMessage(msg)
table.insert(msged, plrs[i]:GetName())
elseif (typ == 2) then
plrs[i]:SendAreaTriggerMessage(msg)
table.insert(msged, plrs[i]:GetName())
elseif (typ == 3) then
plrs[i]:SendBroadcastMessage(msg)
plrs[i]:SendAreaTriggerMessage(msg)
table.insert(msged, plrs[i]:GetName())
end
end
end
elseif (msg ~= nil) and (maxrng ~= nil) then
for i=1, #plrs do
if (tablefind(msged, plrs[i]:GetName() == false) then
if (unit:GetDistance(plrs[i]) < maxrng) then
if (typ == 1) then
plrs[i]:SendBroadcastMessage(msg)
elseif (typ == 2) then
plrs[i]:SendAreaTriggerMessage(msg)
elseif (typ == 3) then
plrs[i]:SendBroadcastMessage(msg)
plrs[i]:SendAreaTriggerMessage(msg)
end
end
end
end
end
end
function Mount(targ, mountid)
if (targ == nil) then
errorlog_write("[Function: Mount(targ, mountid)] Function was called with no arguments - it requires two (2) arguments.")
elseif (targ ~= nil) and (mountid == nil) then
errorlog_write("[Function: Mount(targ, mountid)] Function was called with no arguments - it requires two (2) arguments.")
else
targ:SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, mountid)
end
end
function Dismount(targ)
if (targ == nil) then
errorlog_write("[Function: Dismount(targ)] Function was called with no arguments - it requires one (1) argument.")
end
if (targ:IsPlayer() == true) then
targ:SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0)
targ:RemoveAllAuras() -- temporary
else
targ:SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0)
end
end
function Equip(unit, slot1, slot2, slot3)
if (unit == nil) then
errorlog_write("[Function: Equip(unit, slot1, slot2, slot3)] Function was called with no arguments - it requires two (2) arguments.")
elseif (unit ~= nil) and (slot1 == nil) then
errorlog_write("[Function: Equip(unit, slot1, slot2, slot3)] Function was called with one (1) argument - it requires two (2) arguments.")
elseif (slot2 ~= nil) and (slot2 == nil) then
unit:SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, slot1)
elseif (slot2 ~= nil) and (slot3 == nil) then
unit:SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, slot1)
unit:SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID_1, slot2)
elseif (slot3 ~= nil) then
unit:SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, slot1)
unit:SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID_1, slot2)
unit:SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID_2, slot3)
end
end
function reload(directory)
if (directory == nil) then
errorlog_write("[Function: reload(directory)] Function was called with no arguments - it requires one (1) argument.")
else
dofile(directory)
end
end
function Notify(prefix, txt)
if (txt == nil) then
print(prefix)
elseif (prefix == nil) then
return
elseif (prefix ~= nil) and (txt ~= nil) then
print("["..prefix.."] "..txt)
end
end
function ShowErrors()
for k, v in pairs(AELL_ERRORS) do
Notify("[AELL Error]", v)
end
end
function tablefind(tab, val)
if (type(tab) == "table") and val then
for k, v in pairs(tab) do
if (v == val) then
return true
end
end
end
return false
end
function errorlog_write(err)
if (err == nil) then
return false
else
table.insert(AELL_ERRORS, err)
end
endprint("Alvanaar's Extended Lua Library\nLoaded!")
Bookmarks