[DiscordArchive] hello i am trying to make a haste cap of 80k on...
[DiscordArchive] hello i am trying to make a haste cap of 80k on...
Archived author: Needle • Posted: 2025-07-05T00:40:01.890000+00:00
Original source
Archived author: Needle • Posted: 2025-07-05T00:40:02.597000+00:00
Original source
Thread automatically created by darkqc in <#415944535718494208>
Archived author: August • Posted: 2025-07-05T08:21:01.734000+00:00
Original source
```
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
{
float amount = GetFloatValue(UNIT_FIELD_BASEATTACKTIME + AsUnderlyingType(att));
float base = 80000.0f;
float factor = 1.0f - ((val > base ? base : val) / base);
float remainingTimePct = (float)m_attackTimer[att] / (GetAttackTime(att) * m_modAttackSpeedPct[att]);
if (apply)
{
amount *= factor;
m_modAttackSpeedPct[att] *= factor;
}
else
{
amount /= factor;
m_modAttackSpeedPct[att] /= factor;
}
SetFloatValue(UNIT_FIELD_BASEATTACKTIME + AsUnderlyingType(att), amount);
m_attackTimer[att] = uint32(GetAttackTime(att) * m_modAttackSpeedPct[att] * remainingTimePct);
}
void Unit::ApplyCastTimePercentMod(float val, bool apply)
{
float amount = GetFloatValue(UNIT_MOD_CAST_SPEED);
float base = 80000.0f;
float factor = 1.0f - ((val > base ? base : val) / base);
if (apply)
amount *= factor;
else
amount /= factor;
SetModCastingSpeed(amount);
}
```
Archived author: August • Posted: 2025-07-05T08:21:03.599000+00:00
Original source
try that instead
Archived author: August • Posted: 2025-07-05T08:21:21.118000+00:00
Original source
those functions already exist just edit them
Archived author: darkqc • Posted: 2025-07-06T00:37:01.417000+00:00
Original source
okay thank you i will
Archived author: darkqc • Posted: 2025-07-06T15:47:28.298000+00:00
Original source
i need to modify them in unit.cpp right ?
Archived author: darkqc • Posted: 2025-07-06T15:47:38.677000+00:00
Original source
do i need to modify something inside player.cpp ?
Archived author: August • Posted: 2025-07-06T15:58:47.596000+00:00
Original source
only unit.cpp
![[Image: image.png?ex=690c2c12&is=690ada92&hm=810...4e1841b68&]](https://cdn.discordapp.com/attachments/1390854700982861844/1391464523008970752/image.png?ex=690c2c12&is=690ada92&hm=810ef3692b1a72dd6bee1ca7c1299d2089c386b8b35e37dfe0787234e1841b68&)
Archived author: darkqc • Posted: 2025-07-06T17:03:14.504000+00:00
Original source
i have placed the code but its still getting stuck at with a 80k haste weapon
![[Image: image.png?ex=690c2c12&is=690ada92&hm=810...4e1841b68&]](https://cdn.discordapp.com/attachments/1390854700982861844/1391464523008970752/image.png?ex=690c2c12&is=690ada92&hm=810ef3692b1a72dd6bee1ca7c1299d2089c386b8b35e37dfe0787234e1841b68&)