mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Merge
This commit is contained in:
@@ -2522,49 +2522,47 @@ namespace LuaPlayer
|
||||
}
|
||||
|
||||
/**
|
||||
* Repairs [Item] at specified position. Returns total repair cost
|
||||
* Repairs [Item] at specified position.
|
||||
*
|
||||
* @param uint16 position
|
||||
* @param bool cost = true
|
||||
* @param float discountMod
|
||||
* @param bool guildBank = false
|
||||
* @return uint32 totalCost
|
||||
* @param float discountMod = 1.0
|
||||
*/
|
||||
int DurabilityRepair(lua_State* L, Player* player)
|
||||
{
|
||||
uint16 position = Eluna::CHECKVAL<uint16>(L, 2);
|
||||
bool cost = Eluna::CHECKVAL<bool>(L, 3, true);
|
||||
float discountMod = Eluna::CHECKVAL<float>(L, 4);
|
||||
bool guildBank = Eluna::CHECKVAL<bool>(L, 5, false);
|
||||
bool takeCost = Eluna::CHECKVAL<bool>(L, 3, true);
|
||||
float discountMod = Eluna::CHECKVAL<float>(L, 4, 1.0f);
|
||||
|
||||
#ifdef CLASSIC
|
||||
Eluna::Push(L, player->DurabilityRepair(position, cost, discountMod));
|
||||
player->DurabilityRepair(position, takeCost, discountMod);
|
||||
#elif defined(TRINITY)
|
||||
player->DurabilityRepair(position, takeCost, discountMod);
|
||||
#else
|
||||
Eluna::Push(L, player->DurabilityRepair(position, cost, discountMod, guildBank));
|
||||
player->DurabilityRepair(position, takeCost, discountMod, false);
|
||||
#endif
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Repairs all [Item]s. Returns total repair cost
|
||||
* Repairs all [Item]s.
|
||||
*
|
||||
* @param bool cost = true
|
||||
* @param float discountMod = 1
|
||||
* @param bool takeCost = true
|
||||
* @param float discountMod = 1.0
|
||||
* @param bool guidBank = false
|
||||
* @return uint32 totalCost
|
||||
*/
|
||||
int DurabilityRepairAll(lua_State* L, Player* player)
|
||||
{
|
||||
bool cost = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
bool takeCost = Eluna::CHECKVAL<bool>(L, 2, true);
|
||||
float discountMod = Eluna::CHECKVAL<float>(L, 3, 1.0f);
|
||||
bool guildBank = Eluna::CHECKVAL<bool>(L, 4, false);
|
||||
|
||||
#ifdef CLASSIC
|
||||
Eluna::Push(L, player->DurabilityRepairAll(cost, discountMod));
|
||||
player->DurabilityRepairAll(takeCost, discountMod);
|
||||
#else
|
||||
Eluna::Push(L, player->DurabilityRepairAll(cost, discountMod, guildBank));
|
||||
player->DurabilityRepairAll(takeCost, discountMod, guildBank);
|
||||
#endif
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user