Skip to content

Commit

Permalink
Add GetRank method for creatures
Browse files Browse the repository at this point in the history
CMaNGOS and VMaNGOS
  • Loading branch information
Niam5 committed May 2, 2024
1 parent 4885880 commit f7bafb2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion methods/CMangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,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->GetCreatureInfo()->Rank);
return 1;
}

#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
/**
* Returns the [Creature]'s shield block value.
Expand Down Expand Up @@ -1205,6 +1216,7 @@ namespace LuaCreature
{ "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup },
{ "GetNPCFlags", &LuaCreature::GetNPCFlags },
{ "GetExtraFlags", &LuaCreature::GetExtraFlags },
{ "GetRank", &LuaCreature::GetRank },
{ "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow },
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
#ifndef CATA
Expand Down Expand Up @@ -1297,7 +1309,6 @@ 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
13 changes: 12 additions & 1 deletion methods/VMangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,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->GetCreatureInfo()->rank);
return 1;
}

/**
* Returns the [Creature]'s shield block value.
*
Expand Down Expand Up @@ -1130,6 +1141,7 @@ namespace LuaCreature
{ "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup },
{ "GetNPCFlags", &LuaCreature::GetNPCFlags },
{ "GetExtraFlags", &LuaCreature::GetExtraFlags },
{ "GetRank", &LuaCreature::GetRank },
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
{ "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow },
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
Expand Down Expand Up @@ -1203,7 +1215,6 @@ 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 f7bafb2

Please sign in to comment.