Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] unit.cpp-> unit::DealDamage(){...

[DiscordArchive] unit.cpp-> unit::DealDamage(){...

[DiscordArchive] unit.cpp-> unit::DealDamage(){...

rektbyfaith
Administrator
0
07-27-2024, 02:42 PM
#1
Archived author: gemini • Posted: 2024-07-27T14:42:40.091000+00:00
Original source

unit.cpp-> unit:Big GrinealDamage(){...

if (Player* player = victim->ToPlayer())
if (player->GetCommandStatus(CHEAT_GOD))
return 0;
...
}

Certainly appears that there should be no actual dmg.

However, before this code, I see:

// Hook for OnDamage Event
sScriptMgr->OnDamage(attacker, victim, **damage**);

So I suspect OnDamage() is reporting dmg that is subsequently zero'd out... making it more or less a display issue?
rektbyfaith
07-27-2024, 02:42 PM #1

Archived author: gemini • Posted: 2024-07-27T14:42:40.091000+00:00
Original source

unit.cpp-> unit:Big GrinealDamage(){...

if (Player* player = victim->ToPlayer())
if (player->GetCommandStatus(CHEAT_GOD))
return 0;
...
}

Certainly appears that there should be no actual dmg.

However, before this code, I see:

// Hook for OnDamage Event
sScriptMgr->OnDamage(attacker, victim, **damage**);

So I suspect OnDamage() is reporting dmg that is subsequently zero'd out... making it more or less a display issue?

rektbyfaith
Administrator
0
07-27-2024, 02:43 PM
#2
Archived author: gemini • Posted: 2024-07-27T14:43:50.334000+00:00
Original source

yes- well- then why bother with docs at all if we don't care about accuracy?
rektbyfaith
07-27-2024, 02:43 PM #2

Archived author: gemini • Posted: 2024-07-27T14:43:50.334000+00:00
Original source

yes- well- then why bother with docs at all if we don't care about accuracy?

rektbyfaith
Administrator
0
07-27-2024, 02:44 PM
#3
Archived author: jackpoz • Posted: 2024-07-27T14:44:21.249000+00:00
Original source

docs are a copy of the code fixed in time
rektbyfaith
07-27-2024, 02:44 PM #3

Archived author: jackpoz • Posted: 2024-07-27T14:44:21.249000+00:00
Original source

docs are a copy of the code fixed in time

rektbyfaith
Administrator
0
07-27-2024, 02:44 PM
#4
Archived author: jackpoz • Posted: 2024-07-27T14:44:32.352000+00:00
Original source

when the code changes, docs don't change automatically
rektbyfaith
07-27-2024, 02:44 PM #4

Archived author: jackpoz • Posted: 2024-07-27T14:44:32.352000+00:00
Original source

when the code changes, docs don't change automatically

rektbyfaith
Administrator
0
07-27-2024, 02:44 PM
#5
Archived author: jackpoz • Posted: 2024-07-27T14:44:44.178000+00:00
Original source

if you want to know how something works, check the code
rektbyfaith
07-27-2024, 02:44 PM #5

Archived author: jackpoz • Posted: 2024-07-27T14:44:44.178000+00:00
Original source

if you want to know how something works, check the code

rektbyfaith
Administrator
0
07-27-2024, 02:55 PM
#6
Archived author: gemini • Posted: 2024-07-27T14:55:24.294000+00:00
Original source

You realize you're basically telling me not to ask questions.
rektbyfaith
07-27-2024, 02:55 PM #6

Archived author: gemini • Posted: 2024-07-27T14:55:24.294000+00:00
Original source

You realize you're basically telling me not to ask questions.

rektbyfaith
Administrator
0
07-27-2024, 03:00 PM
#7
Archived author: gemini • Posted: 2024-07-27T15:00:17.134000+00:00
Original source

code:

void ScriptMgr::OnDamage(Unit* attacker, Unit* victim, uint32& damage)
{
FOREACH_SCRIPT(UnitScript)->OnDamage(attacker, victim, damage);
}

So OnDamage() is specific to individual scripts. So how do I determine the specific script in question when an NPC, Creature, etc. is attacking me?
rektbyfaith
07-27-2024, 03:00 PM #7

Archived author: gemini • Posted: 2024-07-27T15:00:17.134000+00:00
Original source

code:

void ScriptMgr::OnDamage(Unit* attacker, Unit* victim, uint32& damage)
{
FOREACH_SCRIPT(UnitScript)->OnDamage(attacker, victim, damage);
}

So OnDamage() is specific to individual scripts. So how do I determine the specific script in question when an NPC, Creature, etc. is attacking me?

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)