[DiscordArchive] Or is there an aura that I cant find for duals that creates this condition?
[DiscordArchive] Or is there an aura that I cant find for duals that creates this condition?
Archived author: londoge • Posted: 2023-08-22T16:57:54.031000+00:00
Original source
Or is there an aura that I cant find for duals that creates this condition?
Archived author: Revision • Posted: 2023-08-22T18:20:09.710000+00:00
Original source
There's a health check to make sure the player doesn't die. You could create something similar using a module, I assume.
```cpp
// duel ends when player has 1 or less hp
bool duel_hasEnded = false;
bool duel_wasMounted = false;
if (victim->GetTypeId() == TYPEID_PLAYER && victim->ToPlayer()->duel && damage >= (health - 1))
{
// xinef: situation not possible earlier, just return silently.
if (!attacker)
return 0;
// prevent kill only if killed in duel and killed by opponent or opponent controlled creature
if (victim->ToPlayer()->duel->Opponent == attacker || victim->ToPlayer()->duel->Opponent->GetGUID() == attacker->GetOwnerGUID())
damage = health - 1;
duel_hasEnded = true;
}
```