[DiscordArchive] is this
[DiscordArchive] is this
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:14:08.790000+00:00
Original source
is this
```cpp
creature->SetUInt32Value(UNIT_FIELD_MINDAMAGE, mod_damage - 1.0f);
creature->SetUInt32Value(UNIT_FIELD_MAXDAMAGE, mod_damage + 1.0f);
```
the best way to do it?
Archived author: Luka • Posted: 2019-06-04T13:19:50.198000+00:00
Original source
UNIT_FIELD_MINDAMAGE, UNIT_FIELD_MAXDAMAGE are floats.
What exactly are you trying to achieve?
If I'm not mistaken min/max damage calculation is called often so it will override those code segments of yours.
Check how
`void Creature::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage)` works and where it's called.
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:21:50.506000+00:00
Original source
I am actually trying to override the `void OnCreatureCreate(Creature* creature) override` of an instance
I want the creatures to be spawned with different stats, since today I used SQL to achieve that, but I want to make it via C++ because I think it would be cooler
Archived author: Luka • Posted: 2019-06-04T13:22:56.725000+00:00
Original source
Why would you overcomplicate something when you have a perfectly well implemented system to achieve it? Just use the modifiers in the creature tables
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:24:53.456000+00:00
Original source
in creature_template?
idk I just wanna make it via c++, setting in for example an config values then take scanning the spawning the creatures in specific instance with modifiers
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:27:10.828000+00:00
Original source
```cpp
creature->SetLevel(level);
creature->SetMaxHealth(creature->GetMaxHealth() * mod_hp);
creature->SetHealth(creature->GetMaxHealth());
creature->SetUInt32Value(UNIT_FIELD_MINDAMAGE, creature->GetUInt32Value(UNIT_FIELD_MINDAMAGE) + mod_damage - 1.0f);
creature->SetUInt32Value(UNIT_FIELD_MAXDAMAGE, creature->GetUInt32Value(UNIT_FIELD_MINDAMAGE) + mod_damage + 1.0f);
```
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:27:18.744000+00:00
Original source
if I am not wrong, this should do the trick
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:47:00.923000+00:00
Original source
I mean, I saw a script named "Solocraft" which edited the player's stats, so I was wondering "Why editing the players's stats instead the instance instead"
Archived author: Luka • Posted: 2019-06-04T13:48:45.124000+00:00
Original source
There already is a plugin which scales dungeons and raids based on the amount of players in a party, as well as their levels.
It's called VAS autobalance
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:49:20.673000+00:00
Original source
oh