[DiscordArchive] can some1 explain this to me ?
[DiscordArchive] can some1 explain this to me ?
Archived author: Anchy • Posted: 2023-05-05T04:58:03.431000+00:00
Original source
there are different contexts for accessing level for different units
Archived author: Anchy • Posted: 2023-05-05T04:58:06.730000+00:00
Original source
so I retract what I wrote
Archived author: Anchy • Posted: 2023-05-05T04:58:19.620000+00:00
Original source
for example
Archived author: Anchy • Posted: 2023-05-05T04:58:22.297000+00:00
Original source
```cpp
uint8 Creature::getLevelForTarget(WorldObject const* target) const
{
if (!isWorldBoss() || !target->ToUnit())
return Unit::getLevelForTarget(target);
uint16 level = target->ToUnit()->GetLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
if (level < 1)
return 1;
if (level > 255)
return 255;
return uint8(level);
}```
Archived author: Anchy • Posted: 2023-05-05T04:58:49.736000+00:00
Original source
and
Archived author: Anchy • Posted: 2023-05-05T04:58:52.308000+00:00
Original source
```cpp
uint8 getLevelForTarget(WorldObject const* target) const override
{
if (Unit* owner = GetOwner())
return owner->getLevelForTarget(target);
return 1;
}```
Archived author: Anchy • Posted: 2023-05-05T04:59:06.357000+00:00
Original source
the first one is for creatures, the second for game objects (i think)
Archived author: Anchy • Posted: 2023-05-05T04:59:38.290000+00:00
Original source
who knows what legacy code it would break if you start messing with it
Archived author: Anchy • Posted: 2023-05-05T04:59:41.394000+00:00
Original source
<:kek:1065379143887372398>
Archived author: Rymercyble • Posted: 2023-05-05T04:59:51.090000+00:00
Original source
https://tenor.com/view/forsen-nymn-shaki...f-12075452