2593 {
2595
2596 float factor;
2598
2601 {
2603 {
2605 float scaling = (totalILvl - 2500.0f) / 5.0f / 100.0f;
2606 scaling = std::max(0.1f, scaling);
2607 amount =
static_cast<int32>(std::round((scaling - 1.0f) * 100.0f));
2608 return;
2609 }
2611 factor = 1.0f;
2612 baseItemLevel = 205;
2613 break;
2614 default:
2615 factor = 1.0f;
2616 baseItemLevel = 170;
2617 break;
2618 }
2619
2621 if (avgILvl < baseItemLevel)
2622 return;
2623
2624 amount =
uint16((avgILvl - baseItemLevel) * factor);
2625 }
std::int32_t int32
Definition Define.h:103
std::uint16_t uint16
Definition Define.h:108
Unit * GetCaster() const
Definition SpellScript.cpp:1035
uint32 GetId() const
Definition SpellScript.cpp:1025
Player * ToPlayer()
Definition Object.h:202
float GetAverageItemLevel()
Definition Player.cpp:16178
float GetTotalItemLevel() const
Definition Player.cpp:16160
@ SPELL_GEAR_SCALING_ULDUAR
Definition spell_generic.cpp:2559
@ SPELL_GEAR_SCALING
Definition spell_generic.cpp:2558