From ArcEmu-Wiki
(Difference between revisions)
Jump to: navigation, search
Line 726: Line 726:
| [[LuaBridge:void|void]] || [[LuaBridge:Methods:Player:SetShapeShift|SetShapeShift]]( [[LuaBridge:uint8|uint8]] newss )
| [[LuaBridge:void|void]] || [[LuaBridge:Methods:Player:SetShapeShift|SetShapeShift]]( [[LuaBridge:uint8|uint8]] newss )
| [[LuaBridge:void|void]] || [[LuaBridge:Methods:Player:ResetAllCooldowns|ResetAllCooldowns()]]
| [[LuaBridge:void|void]] || [[LuaBridge:Methods:Player:ClearCooldownForSpell|ClearCooldownForSpell]]( [[LuaBridge:uint32|uint32]] spellid )

Revision as of 04:55, 2 June 2011


These are the Methods in LuaBridge.

Some method links have not be documented since the method name and parameters is self documenting enough.

Class Hierarchy

Gossip Menu

GossipMenu : constructor( GUID creature_guid, uint32 text_id, uint32 language )
void : AddItem( uint8 icon, string itemname, uint32 itemid, bool codebox )
void : AddMenuItem( uint8 icon, string itemname, uint32 itemid, uint32 boxmoney, string boxmsg, bool codebox )
void : Send( Player player )
uint32 : GetTextID()
void : SetTextID( uint32 newtextid )
static void : Complete( Player player )
static void : SendSimpleMenu( GUID creature_guid, uint32 text_id, Player player )


The object class is the highest base class(actually eventableobject is the highest but it's not accessible in Lua since it's purely for utility rather than a standalone class) in Arcemu.

All other classes such as Item, Unit, GameObject, derive from Object. All objects in the Lua environment can access their methods without explicit casting since it's the most basic class.


GUID methods

uint32 : GetHighGUID()
uint32 : GetLowGUID()
uint32 : GetEntryFromGUID()

Class identification methods

uint32 : GetEntry()
uint32 : GetTypeID()
bool : IsUnit()
bool : IsGameObject()
bool : IsPlayer()
bool : IsItem()
bool : IsCreature()
bool : IsPet()

Position methods

float : GetPositionX()
float : GetPositionY()
float : GetPositionZ()
float : GetOrientation()
void : SetPosition( float newX, float newY, float newZ, float newO )
float : GetSpawnX()
float : GetSpawnY()
float : GetSpawnZ()
float : GetSpawnO()
bool : IsInFront( Object target )
bool : IsBehind( Object target)
bool : IsInArc( Object target, float degrees )
float : CalcAngle( float x1, float y1, float x2, float y2 )
float : CalcRadAngle( float x1, float y1, float x2, float y2 )
uint32 : GetMapID()
uint32 : GetZoneID()
uint32 : SetMapID( uint32 newmapid )
uint32 : SetZoneID( uint32 newzoneid )

Object Model Manipulation

float : GetScale()
void : SetScale( float newscale )

Distance Manipulation Methods

float : CalcDistanceToObject( Object )
float : CalcDistanceToLocation( float x, float y, float z )

Phasing Methods

void : Phase ( uint32 command, uint32 newphase )
uint32 : GetPhase()
LCF void : PhaseAdd( uint32 phasetoadd )
LCF void : PhaseSet( uint32 phasetoset )
LCF void : PhaseDelete( uint32 phasetodelete )

InRange Objects Methods

table<Object> : GetInRangeOpposingFactions()
table<Object> : GetInRangeSameFactions()
table<Object> : GetInRangeObjects()
LCF table<Player> : GetInRangePlayers()
LCF table<Unit> : GetInRangeAllies()
LCF table<Unit> : GetInRangeEnemies()
LCF table<Unit> : GetRandomAlly()
LCF table<Unit> : GetRandomEnemy()
LCF table<Unit> : GetClosestAlly()
LCF table<Unit> : GetClosestEnemy()
LCF table<Player> : GetClosestPlayer()
LCF table<Player> : GetRandomPlayer( uint32 type )
LCF table<Creature> : GetInRangeCreatures()
LCF table<Unit> : GetInRangeUnits()
LCF table<Creature> : GetFriendlyCreatures()
LCF table<Creature> : GetHostileCreatures()
LCF table<GameObject> : GetInRangeGameObjects()

Object Flag Methods

uint32 : GetUInt32Value( uint32 field_index)
GUID : GetUInt64Value( uint32 field_index)
void : SetUInt32Value ( uint32 field_index, uint32 newvalue )
void : SetUInt64Value ( uint32 field_index, GUID newguid)
float : GetFloatValue ( uint32 field_index )
void : SetFloatValue ( uint32 field_index, float newvalue )
void : ModFloatValue ( uint32 field_index, float modvalue )
void : ModFloatValueByPCT ( uint32 field_index, int32 percentage )
void : ModUnsigned32Value ( uint32 field_index, int32 modvalue)
void : ModSigned32Value ( uint32 field_index, int32 modvalue)
uint8 : GetByte( uint32 field_index, uint32 byte_index )
void : SetByte( uint32 field_index, uint32 byte_index, uint8 byte_value)
void : SetFlag ( uint32 field_index, uint32 flag_to_append )
void : RemoveFlag ( uint32 field_index, uint32 flag_to_remove)

Misc Methods

void : PlaySoundToSet( uint32 sound_id )
bool : IsInBg()
bool : IsInWorld()
Spell : GetCurrentSpell()
void : SendPacket( WorldPacket packet )
void : DealDamage( Unit target, uint32 damage, uint32 targetEvent, uint32 spellid, bool no_remove_auras )


The Unit class is used to describe players and creatures.

It's effectively an abstract class since you can't instantiate a Unit.

It either has to be a player instantiation or a creature.

Unit derives from Object so it contains all its methods meaning you can call Object methods from a Unit userdata.


AIInterface : GetAIInterface()

PvP Methods

bool : IsPVPFlagged()
void : SetPVPFlag()
void : RemovePVPFlag()
bool : IsFFAPVPFlagged()
void : SetFFAPVPFlag()
void : RemoveFFAPVPFlag()
bool : IsSanctuaryFlagged()
void : SetSanctuaryFlag()
void : RemoveSanctuaryFlag()

Stat Methods

uint32 : GetLevel()
void : SetLevel( uint32 newlevel )
void : ModLevel( int32 modlevel )
uint32 : GetAP()
uint32 : GetRAP()
int32 : GetStealthLevel()
int32 : GetStealthDetectBonus()
void : SetMinDamage( float mindamage )
float : GetMinDamage()
void : SetMaxDamage( float maxdamage )
float : GetMaxDamage()
void : SetMinOffhandDamage( float minoffhanddamage )
float : GetMinOffhandDamage()
void : SetMaxOffhandDamage( float maxoffhanddamage )
float : GetMaxOffhandDamage()
void : SetStat( uint32 stat_index, uint32 amount )
uint32 : GetStat( uint32 stat_index )
void : SetResistance( uint32 res_index, uint32 amount )
uint32 : GetResistance( uint32 res_index )
void : SetBaseHealth( uint32 basehealth )
void : SetBaseMana( uint32 basemana )
uint32 : GetHealth()
void : SetHealth( uint32 newhealth)
uint32 : GetHealthPct()
void : SetHealthPct( uint32 percent )
uint32 : GetMaxHealth()
void : SetMaxHealth( uint32 newmaxhealth)
void : ModHealth( int32 modamount)
void : ModMaxHealth( int32 modamount)
uint32 : GetPower( uint32 power_type )
void : SetPower( uint32 power_type, uint32 amount )
uint32 : GetMaxPower( uint32 power_type )
void : SetMaxPower( uint32 power_type, uint32 amount )
void : SetManaPct( uint32 percent )

State Methods

bool : IsCasting()
bool : IsDazed()
bool : IsStealthed()
void  : RemoveStealth()
bool : IsInvisible()
void : SetInvisibility( uint32 id )
void : RemoveInvisibility()
bool : IsAlive()
bool : IsDead()
bool : IsPacified()
bool : IsFeared()
bool : IsStunned()
void : AddStateFlag( uint32 flag )
bool : HasStateFlag( uint32 flag )
void : ClearStateFlag( uint32 flag )
void : EnableAI()
void : DisableAI()
void : SetEmoteState( uint8 emote )
uint32 : GetOldEmote()


uint32 : GetClassMask()
uint32 : GetRaceMask()
uint32 : GetFaction()
void : SetFaction( uint32 faction )
bool : IsSpiritHealer()
uint32 : GetClass()
void : SetClass( uint32 class)
uint32 : GetRace()
void : SetRace( uint32 race)
uint32 : GetPowerType()
void : SetPowerType( uint32 power_type )
uint32 : GetDisplayID()
void : SetDisplayID( uint32 newdisplay )
uint32 : GetDisplayID()
void : SetNativeDisplayID( uint32 newdisplay )

Combat Methods

return type methods
bool IsAttackReady( bool offhand )
void SetAttackTimer( uint32 time, bool offhand )
CombatStatus CombatStatus
void Heal( Unit target, uint32 spellid, uint32 amount )
void Energize( Unit target, uint32 spellid, uint32 amount, uint32 power_type)
uint32 GetThreatModifyer()
void ModThreatModifyer( int32 mod )

Messaging Methods

return type method
void SendChatMessage( uint32 chat_type, uint32 language_type, string message, uint32 delay)
void SendChatMessageToPlayer( uint32 chat_type, uint32 language_type, string message, Player plr)
void SendChatMessageAlternateEntry( uint32 creature_entry, uint32 chat_type, uint32 language_type, string message)


return type method
float runspeed
float walkspeed
float flyspeed


void : Demorph()
void : CastSpell( Unit target, uint32 spellid, bool triggered)
void : CastSpellAoF( float x, float y, float z, SpellEntry spell, bool triggered)
bool : HasAura( uint32 spellid )
uint32 : GetAuraStackCount( uint32 spellid)
bool : HasAurasWithMechanic( uint32 mechanic)
bool : RemoveAura( uint32 spellid, GUID guid)
bool : RemoveAllAuras( uint32 spellid, GUID guid)
void : RemoveNegativeAuras()
void : RemoveAllNonPersistentAuras()


bool : IsInCombat()


The Creature class is what all in-game npcs are. It derives from Unit, so it contains all of Units methods.



bool : IsVehicle()
bool : IsVendor()
bool : IsTrainer()
bool : IsClassTrainer()
bool : IsProfTrainer()
bool : IsQuestGiver()
bool : IsFlightMaster()
bool : IsCharterGiver()
bool : IsGuildBanker()
bool : IsBattleMaster()
bool : IsBanker()
bool : IsInnKeeper()
bool : IsTabardDesigner()
bool : IsAuctioneer()
bool : IsStableMaster()
bool : IsArmorer()
bool : IsTotem()
bool : IsExotic()
bool : IsCritter()
bool : IsTrainingDummy()
uint32 : GetSQLID()


bool : HasItems()
uint32 : GetItemIdBySlot( uint32 slot )
uint32 : GetItemAmountBySlot( uint32 slot )
int32 : GetSlotByItemId( uint32 itemid)
uint32 : GetItemAmountByItemId( uint32 itemid)


bool : HasQuests()
bool : HasQuest( uint32 questid, uint32 type)
void : AddQuest( QuestRelation quest )
void : DeleteQuest( QuestRelation quest )
Quest : FindQuest( uint32 quest_id, uint8 relation)
uint32 : GetQuestRelation( uint32 quest_id)
uint32 : NumOfQuests()


void : RemoveFromWorld( bool free_guid)
CreatureProto : GetProto()
bool : CanSee( Unit target )
uint32 : GetTotemSlot()
Group : GetGroup()
CreatureInfo : GetCreatureInfo()
bool : isSkinned
bool : IsPickPocketed()
bool : Despawn( uint32 delay, uint32 respawndelay )
bool : m_noRespawn
Player : m_escorter
void : SaveToDB()
bool : canregeneratehp
void : RegisterEvent( lua_function function, uint32 delay, uint32 repeats, ... )
void : RemoveEvents()
CreatureAIScript : GetScript()


A structure that holds useful information describing a creature. Every unique creature id has a copy of this structure.

property type property name
uint32 Id
uint32 MinLevel
uint32 MaxLevel
uint32 Faction
uint32 MinHealth
uint32 MaxHealth
uint32 Mana
uint32 NPCFlags
uint32 MinDamage
uint32 MaxDamage
uint32 boss
float walk_speed
float run_speed
float fly_speed
uint32 guardtype
uint32 summonguard


Another structure that holds useful information for a creature.

property type property name
uint32 Id
string Name
string SubName
uint32 Type
uint32 Family
uint32 Rank


This class is what is responsible for calling the method AIUpdate() for creatures.

void : RegisterAIUpdateEvent( uint32 period )
void : ModifyAIUpdateEvent( uint32 newperiod)
void : RemoveAIUpdateEvent()


This class is what defines AI behavior for creatures.

return type method name
void SetUnitToFollow( Unit newtarget )
Unit GetUnitToFollow()
void SetFollowDistance( float newdistance )
void SetFollowAngle( float newangle )
Unit GetUnitToFear()
void SetUnitToFear( Unit newtarget )
Unit GetSoullinkedWith()
bool IsSoullinked()
void SetSoulLinkedWith( Unit newtarget )
uint8 GetAIState()
void SetAIState( uint32 newstate )
void MoveTo( float x,float y,float z, float o)
void StopMovement( uint32 stoptime )
bool hasWaypoints()
Unit GetNextTarget()
void SetNextTarget( Unit newtarget )
void AttackReaction( Unit target, uint32 threat, uint32 spellid )
void HealReaction( Unit healer, Unit victim, SpellEntry spell, uint32 amount )
void WipeHateList()
void RemoveThreatByPtr( Unit hated )
bool modThreatByPtr( Unit hated, int32 mod )
uint32 getThreatByPtr( Unit hated )
Unit GetMostHated()
Unit GetSecondHated()
bool taunt( Unit target, bool apply )
Unit GetTauntedBy()
bool IsTaunted()
uint32 GetCurrentWaypoint()
void ChangeWaypointID( uint32 oldid, uint32 newid )
Waypoint GetWaypoint( uint32 wpid )
void DeleteWayPoint( uint32 wpid )
void DeleteWayPoints()
void SetWaypointToMove( uint32 wpid )
void SetMoveType( uint32 movementtype)
uint32 GetMoveType()
bool IsFlying()
void AddWayPoint( Waypoint wptoadd )
uint32 GetAITargetsCount()
property type property name
bool canmove
bool moveRun
bool moveFly
bool disable_combat
bool disable_melee
bool disable_spell
bool disable_targeting


This class defines a structure that provides location vector coordinates and other information creatures use for waypoints.

property type property name
uint32 id
float x
float y
float z
float o
uint32 waittime
uint32 flags
uint32 backwardskinid
uint32 forwardskinid


This class object defines things like doors/chests/traps/transports, etc. GameObjects are very passive objects since they mostly require input from a unit to function.

return type method name
bool HasQuests()
uint32 NumOfQuests()
void Despawn( uint32 delay, uint32 respawndelay )
bool IsQuestGiver()
void RemoveFromWorld( bool free_guid )
GameObjectAIScript GetScript()
GameObjectInfo GetInfo()
void SaveToDB()
void RegisterEvent( lua_function function, uint32 delay, uint32 repeats, ... )
void RemoveEvents()


This class is what is responsible for calling the method AIUpdate() for gameobjects.

return type method name
void RegisterAIUpdateEvent( uint32 period )
void ModifyAIUpdateEvent( uint32 newperiod)
void RemoveAIUpdateEvent()


property type property name
uint32 ID
uint32 Type
uint32 DisplayID
string Name
uint32 SpellFocus


This class is what defines the player. It derives from Unit so it has all of its methods.

Skill Manipulation

return type method proto
void AdvanceSkillLine( uint32 skilline, uint32 amount )
void AddSkillLine( uint32 skilline, uint32 current, uint32 max )
uint32 GetSkillLineMax( uint32 skilline )
uint32 GetSkillLineCurrent( uint32 skilline )
uint32 RemoveSkillLine( uint32 skilline )
void ModifySkillBonus( uint32 skilline, int32 mod )
void ModifySkillBonusByType( uint32 skilltype, int32 mod )
bool HasSkillLine( uint32 skilline )
void removeSkillSpells( uint32 skilline )
void RemoveAllSkills()
void advanceSkills( uint32 amount )
void modifyMaxSkill( uint32 skilline, uint32 newmax )
void learnSkillSpells( uint32 skilline, uint32 skillcurrent )


return type method proto
void RemoveLanguages()
void AddLanguages( bool all )


return type method proto
TaxiPath GetTaxiPath()
bool GetTaxiState()
void TaxiStart( TaxiPath path, uint32 modelid, uint32 starting_node )
void SetTaxiPath( TaxiPath path)
void SetTaxiState( bool state )


return type method proto
bool HasQuests()
int32 GetOpenQuestSlot()
QuestLogEntry GetQuestLogForEntry( uint32 entry )
QuestLogEntry GetQuestLogInSlot( int32 slot )
uint32 GetQuestSharer()
void SetQuestSharer( uint32 guid )
void SetQuestLogSlot( QuestLogEntry qlog, uint32 slot )
void HasFinishedDaily( uint32 questid )
void AddToFinishedQuests( uint32 questid )
bool HasFinishedQuest( uint32 questid )
bool GetQuestRewardStatus( uint32 questid )
bool HasQuestForItem( uint32 itemid )
bool HasQuestSpell ( uint32 spellid )
void RemoveQuestSpell( uint32 spellid )
bool HasQuest( uint32 questid )
void RemoveQuestMob( uint32 id )

Player Team

return type method proto
uint32 GetTeam()
uint32 getInitialTeam()
void SetTeam( uint32 team )
void ResetTeam()
bool isHordeTeam()
bool isAllianceTeam()


return type method proto
bool HasSpell( uint32 spellid )
void AddSpell( uint32 spellid )
void AddShapeShiftSpell( uint32 spellid )
void RemoveShapeShiftSpell( uint32 spellid )
uint8 GetShapeShift()
void SetShapeShift( uint8 newss )
void ResetAllCooldowns()
void ClearCooldownForSpell( uint32 spellid )


return type method proto
int32 GetStanding( uint32 faction )
void ModStanding( uint32 faction, int32 mod )
int32 GetBaseStanding( uint32 faction )
void SetStanding( uint32 faction, int32 value )
Standing GetStandingRank( uint32 faction )
uint32 GetExaltedCount()
uint8 GetPVPRank()
void SetPVPRank( int32 newrank )
uint32 GetMaxPersonalRating()
uint32 HasTitle( RankTitles title )
void SetKnownTitle( RankTitles title, bool set )


return type method name
bool IsInGroup()
bool IsGroupLeader()
bool IsGroupMember( Player player )
bool IsInGuild()
uint32 GetGuildID()
void SetGuildID( uint32 id )
uint32 GetGuildRank()
void SetGuildRank( uint32 rank )


return type method proto
void RequestDuel( Player target )
void EndDuel( uint8 winreason )
void DuelCountDown()
void SetDuelStatus( uint8 status )
uint8 GetDuelStatus()
void SetDuelState( uint8 state )
uint8 GetDuelState()
uint32 GetDuelTeam()
void SetDuelTeam( uint32 team )


return type method proto
bool IsBanned()
void SetBanned()
void SetBannedWithReason( string reason )
void clearBan()
string GetBanReason()
void Kick( uint32 delay )
void SoftDisconnect()


return type method proto
bool CanSee( Object target )
bool IsVisible( GUID target )
bool IsMounted()
void Dismount()
void SafeTeleport( uint32 mapid, uint32 instanceid, float x, float y, float z, float o)
uint32 GetDungeonDifficulty()
uint32 GetRaidDifficulty()
void Possess( Unit target )
void Unpossess()
string GetName()
WorldSession GetSession()
void KillPlayer()
void ResurrectPlayer()
void SetBindPoint( float x, float y, float z, uint32 mapid, uint32 zoneid )


return type method proto
GUID GetFarsightTarget()
void SetFarsightTarget( GUID newtarget )
GUID GetTarget()
void SetTarget( GUID newtarget )
GUID GetSelection()
void SetSelection( GUID newtarget )

Global Methods

LuaPacket(opcode, size)
- Creates a LuaPacket object so that you can use Packet Methods
on it.

DBC Spell

This is executed on dbcSpell. This is a global variable.

SQL Query

These are executed on WorldDB or CharacterDB. Both of these are global variables.

Map Methods


Map Script Interface


Taxi Methods


Packet Methods

These are invoked on LuaPacket objects. :opcode()

Spell Methods


Personal tools