Skip to content

Commit

Permalink
Add GetRank method for creatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed May 1, 2024
1 parent 66f08f1 commit 4885880
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions methods/CMangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ namespace LuaCreature
{ "ResetAllThreat", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "FixateTarget", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "ClearFixate", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "GetRank", nullptr, METHOD_REG_NONE }, // not implemented

{ NULL, NULL, METHOD_REG_NONE }
};
Expand Down
1 change: 1 addition & 0 deletions methods/Mangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ namespace LuaCreature
{ "ResetLootMode", nullptr, METHOD_REG_NONE }, // not implemented
{ "RemoveLootMode", nullptr, METHOD_REG_NONE }, // not implemented
{ "RemoveFromWorld", nullptr, METHOD_REG_NONE }, // not implemented
{ "GetRank", nullptr, METHOD_REG_NONE }, // not implemented

{ NULL, NULL, METHOD_REG_NONE }
};
Expand Down
12 changes: 12 additions & 0 deletions methods/TrinityCore/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,17 @@ namespace LuaCreature
return 1;
}

/**
* Returns the [Creature]'s rank as defined in the creature template.
*
* @return uint32 rank
*/
int GetRank(Eluna* E, Creature* creature)
{
E->Push(creature->GetCreatureTemplate()->rank);
return 1;
}

#ifndef CATA
/**
* Returns the [Creature]'s shield block value.
Expand Down Expand Up @@ -1428,6 +1439,7 @@ namespace LuaCreature
{ "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup },
{ "GetNPCFlags", &LuaCreature::GetNPCFlags },
{ "GetExtraFlags", &LuaCreature::GetExtraFlags },
{ "GetRank", &LuaCreature::GetRank },
#ifndef CATA
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
#endif
Expand Down
1 change: 1 addition & 0 deletions methods/VMangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ namespace LuaCreature
{ "ResetLootMode", nullptr, METHOD_REG_NONE }, // not implemented
{ "RemoveLootMode", nullptr, METHOD_REG_NONE }, // not implemented
{ "RemoveFromWorld", nullptr, METHOD_REG_NONE }, // not implemented
{ "GetRank", nullptr, METHOD_REG_NONE }, // not implemented

{ NULL, NULL }
};
Expand Down

0 comments on commit 4885880

Please sign in to comment.