2615 {
2617
2618 float factor;
2620
2623 {
2625 {
2627 float scaling = (totalILvl - 2500.0f) / 5.0f / 100.0f;
2628 scaling = std::max(0.1f, scaling);
2629 amount =
static_cast<int32>(std::round((scaling - 1.0f) * 100.0f));
2630 return;
2631 }
2633 factor = 1.0f;
2634 baseItemLevel = 205;
2635 break;
2636 default:
2637 factor = 1.0f;
2638 baseItemLevel = 170;
2639 break;
2640 }
2641
2643 if (avgILvl < baseItemLevel)
2644 return;
2645
2646 amount =
uint16((avgILvl - baseItemLevel) * factor);
2647 }
std::int32_t int32
Definition Define.h:103
std::uint16_t uint16
Definition Define.h:108
Unit * GetCaster() const
Definition SpellScript.cpp:1026
uint32 GetId() const
Definition SpellScript.cpp:1016
Player * ToPlayer()
Definition Object.h:208
float GetAverageItemLevel()
Definition Player.cpp:16261
float GetTotalItemLevel() const
Definition Player.cpp:16243
@ SPELL_GEAR_SCALING_ULDUAR
Definition spell_generic.cpp:2581
@ SPELL_GEAR_SCALING
Definition spell_generic.cpp:2580