Skip to content

Commit 515503e

Browse files
committed
Enable Item Random functions
1 parent 97c686b commit 515503e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

methods/TrinityCore/ItemMethods.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,11 +956,15 @@ namespace LuaItem
956956
int SetRandomProperty(Eluna* E, Item* item)
957957
{
958958
uint32 randomPropId = E->CHECKVAL<uint32>(2);
959-
//item->SetBonuses(randomPropId);
960-
//item->SetItemRandomProperties(randomPropId);
959+
#if ELUNA_EXPANSION < EXP_RETAIL
960+
item->SetItemRandomProperties(randomPropId);
961+
#else
962+
item->AddBonuses(randomPropId);
963+
#endif
961964
return 0;
962965
}
963966

967+
#if ELUNA_EXPANSION < EXP_RETAIL
964968
/**
965969
* Sets the random suffix for the [Item] from a given random suffix ID.
966970
*
@@ -969,9 +973,10 @@ namespace LuaItem
969973
int SetRandomSuffix(Eluna* E, Item* item)
970974
{
971975
uint32 randomPropId = E->CHECKVAL<uint32>(2);
972-
//item->SetItemRandomProperties(-(int32)randomPropId);
976+
item->SetItemRandomProperties(-(int32)randomPropId);
973977
return 0;
974978
}
979+
#endif
975980

976981
/* OTHER */
977982
/**
@@ -1071,7 +1076,11 @@ namespace LuaItem
10711076
{ "SetBinding", &LuaItem::SetBinding },
10721077
{ "SetCount", &LuaItem::SetCount },
10731078
{ "SetRandomProperty", &LuaItem::SetRandomProperty },
1079+
#if ELUNA_EXPANSION < EXP_RETAIL
10741080
{ "SetRandomSuffix", &LuaItem::SetRandomSuffix },
1081+
#else
1082+
{ "SetRandomSuffix", METHOD_REG_NONE },
1083+
#endif
10751084

10761085
// Boolean
10771086
{ "IsSoulBound", &LuaItem::IsSoulBound },

0 commit comments

Comments
 (0)