Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] is this

[DiscordArchive] is this

[DiscordArchive] is this

Pages (2): 1 2 Next
rektbyfaith
Administrator
0
06-04-2019, 01:14 PM
#1
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?
rektbyfaith
06-04-2019, 01:14 PM #1

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?

rektbyfaith
Administrator
0
06-04-2019, 01:19 PM
#2
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.
rektbyfaith
06-04-2019, 01:19 PM #2

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.

rektbyfaith
Administrator
0
06-04-2019, 01:21 PM
#3
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
rektbyfaith
06-04-2019, 01:21 PM #3

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

rektbyfaith
Administrator
0
06-04-2019, 01:22 PM
#4
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
rektbyfaith
06-04-2019, 01:22 PM #4

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

rektbyfaith
Administrator
0
06-04-2019, 01:24 PM
#5
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
rektbyfaith
06-04-2019, 01:24 PM #5

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

rektbyfaith
Administrator
0
06-04-2019, 01:27 PM
#6
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);
```
rektbyfaith
06-04-2019, 01:27 PM #6

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);
```

rektbyfaith
Administrator
0
06-04-2019, 01:27 PM
#7
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
rektbyfaith
06-04-2019, 01:27 PM #7

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

rektbyfaith
Administrator
0
06-04-2019, 01:47 PM
#8
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"
rektbyfaith
06-04-2019, 01:47 PM #8

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"

rektbyfaith
Administrator
0
06-04-2019, 01:48 PM
#9
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
rektbyfaith
06-04-2019, 01:48 PM #9

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

rektbyfaith
Administrator
0
06-04-2019, 01:49 PM
#10
Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:49:20.673000+00:00
Original source

oh
rektbyfaith
06-04-2019, 01:49 PM #10

Archived author: MR.MUSTACHE • Posted: 2019-06-04T13:49:20.673000+00:00
Original source

oh

Pages (2): 1 2 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)