Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jan 28, 2024
1 parent 74780a8 commit ff712ef
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 5 deletions.
29 changes: 28 additions & 1 deletion TrinityCore/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -807,13 +807,26 @@ namespace LuaCreature
}
#endif

/**
* Returns the loot mode for the [Creature].
*
* <pre>
* LOOT_MODE_DEFAULT = 1,
* LOOT_MODE_HARD_MODE_1 = 2,
* LOOT_MODE_HARD_MODE_2 = 4,
* LOOT_MODE_HARD_MODE_3 = 8,
* LOOT_MODE_HARD_MODE_4 = 16,
* LOOT_MODE_JUNK_FISH = 32768
* </pre>
*
* @return uint16 lootMode
*/
int GetLootMode(Eluna* E, Creature* creature)
{
E->Push(creature->GetLootMode());
return 1;
}


/**
* Returns the guid of the [Creature] that is used as the ID in the database
*
Expand Down Expand Up @@ -864,6 +877,20 @@ namespace LuaCreature
return 0;
}

/**
* Sets the loot mode for the [Creature].
*
* <pre>
* LOOT_MODE_DEFAULT = 1,
* LOOT_MODE_HARD_MODE_1 = 2,
* LOOT_MODE_HARD_MODE_2 = 4,
* LOOT_MODE_HARD_MODE_3 = 8,
* LOOT_MODE_HARD_MODE_4 = 16,
* LOOT_MODE_JUNK_FISH = 32768
* </pre>
*
* @param uint16 lootMode
*/
int SetLootMode(Eluna* E, Creature* creature)
{
uint16 lootMode = Eluna::CHECKVAL<uint16>(E->L, 2);
Expand Down
5 changes: 5 additions & 0 deletions TrinityCore/GameObjectMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ namespace LuaGameObject
return 1;
}

/**
* Returns true if the [GameObject] is a destructible, false otherwise.
*
* @return bool isDestructible
*/
int IsDestructible(Eluna* E, GameObject* go)
{
E->Push(go->IsDestructibleBuilding());
Expand Down
2 changes: 1 addition & 1 deletion TrinityCore/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ namespace LuaGlobalFunctions
*
* - for MaNGOS returns the realmID as it is stored in the core.
* - for TrinityCore returns the realmID as it is in the conf file.
*
* @return uint32 realm ID
*/

int GetRealmID(Eluna* E)
{
E->Push(sConfigMgr->GetIntDefault("RealmID", 1));
Expand Down
14 changes: 11 additions & 3 deletions TrinityCore/GroupMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ namespace LuaGroup
return 1;
}

/**
* Returns true if the [Group] is a battlefield group, false otherwise
*
* @return bool isBFGroup
*/
int IsBFGroup(Eluna* E, Group* group)
{
E->Push(group->isBFGroup());
Expand Down Expand Up @@ -249,6 +254,7 @@ namespace LuaGroup
return 1;
}

#ifndef CATA
/**
* Returns the [Group] members' flags
*
Expand All @@ -260,11 +266,10 @@ namespace LuaGroup
* MEMBER_FLAG_MAINASSIST = 4
* };
* </pre>
*
*
* @param ObjectGuid guid : guid of the player
* @return uint8 flags
*/
#ifndef CATA
int GetMemberFlags(Eluna* E, Group* group)
{
ObjectGuid guid = Eluna::CHECKVAL<ObjectGuid>(E->L, 2);
Expand Down Expand Up @@ -393,12 +398,16 @@ namespace LuaGroup
return 0;
}

/**
* Converts the [Group] to a LFG group
*/
int ConvertToLFG(Eluna* /*E*/, Group* group)
{
group->ConvertToLFG();
return 0;
}

#ifndef CATA
/**
* Sets or removes a flag for a [Group] member
*
Expand All @@ -415,7 +424,6 @@ namespace LuaGroup
* @param bool apply : add the `flag` if `true`, remove the `flag` otherwise
* @param [GroupMemberFlags] flag : the flag to set or unset
*/
#ifndef CATA
int SetMemberFlag(Eluna* E, Group* group)
{
ObjectGuid target = Eluna::CHECKVAL<ObjectGuid>(E->L, 2);
Expand Down
20 changes: 20 additions & 0 deletions TrinityCore/ItemMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ namespace LuaItem
}

#ifndef CATA
/**
* Returns 'true' if the refund period has expired for this [Item], 'false' otherwise
*
* @return bool isRefundExpired
*/
int IsRefundExpired(Eluna* E, Item* item)
{
E->Push(item->IsRefundExpired());
Expand Down Expand Up @@ -315,6 +320,11 @@ namespace LuaItem
return 1;
}

/**
* Returns GUID of the [Player] who currently owns the [Item]
*
* @return ObjectGuid guid : guid of the [Player] who owns the [Item]
*/
int GetOwnerGUID(Eluna* E, Item* item)
{
E->Push(item->GetOwnerGUID());
Expand Down Expand Up @@ -629,6 +639,11 @@ namespace LuaItem
}

#ifdef WOTLK
/**
* Returns the amount of stat values on this [Item]
*
* @return uint32 statsCount
*/
int GetStatsCount(Eluna* E, Item* item)
{
E->Push(item->GetTemplate()->StatsCount);
Expand All @@ -651,6 +666,11 @@ namespace LuaItem
return 1;
}

/**
* Returns the random suffix ID of this [Item]
*
* @return uint32 suffixId
*/
int GetRandomSuffix(Eluna* E, Item* item)
{
#ifdef CATA
Expand Down
5 changes: 5 additions & 0 deletions TrinityCore/QuestMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ namespace LuaQuest
return 1;
}

/**
* Returns the maximum level where the [Quest] can still be picked up.
*
* @return uint32 maxLevel
*/
int GetMaxLevel(Eluna* E, Quest* quest)
{
E->Push(quest->GetMaxLevel());
Expand Down
15 changes: 15 additions & 0 deletions TrinityCore/UnitMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,18 +458,33 @@ namespace LuaUnit
return 1;
}

/**
* Returns true if the [Unit] is visible, false otherwise.
*
* @return bool isVisible
*/
int IsVisible(Eluna* E, Unit* unit)
{
E->Push(unit->IsVisible());
return 1;
}

/**
* Returns true if the [Unit] is moving, false otherwise.
*
* @return bool isMoving
*/
int IsMoving(Eluna* E, Unit* unit)
{
E->Push(unit->isMoving());
return 1;
}

/**
* Returns true if the [Unit] is flying, false otherwise.
*
* @return bool isFlying
*/
int IsFlying(Eluna* E, Unit* unit)
{
E->Push(unit->IsFlying());
Expand Down

0 comments on commit ff712ef

Please sign in to comment.