-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2650 Parsing a combat log now works for SoD
- Loading branch information
Showing
35 changed files
with
1,274 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
199 changes: 199 additions & 0 deletions
199
app/Logic/CombatLog/CombatEvents/Advanced/Versions/V9SoD/AdvancedDataV9SoD.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
<?php | ||
|
||
namespace App\Logic\CombatLog\CombatEvents\Advanced\Versions\V9SoD; | ||
|
||
use App\Logic\CombatLog\CombatEvents\Advanced\AdvancedDataInterface; | ||
use App\Logic\CombatLog\CombatEvents\Interfaces\HasParameters; | ||
use App\Logic\CombatLog\Guid\Guid; | ||
|
||
/** | ||
* 12/9/2024 18:51:23.3640 SPELL_CAST_SUCCESS,Player-5827-01FF533F,"Nikp-LivingFlame-EU",0x511,0x0,0000000000000000,nil,0x80000000,0x80000000,425600,"Horn of Lordaeron",0x1,Player-5827-01FF533F,0000000000000000,100,100,0,0,0,0,0,-1,0,0,0,-8213.53,2012.04,0,1.3086,72 | ||
* | ||
* @author Wouter | ||
* | ||
* @since 08/01/2025 | ||
*/ | ||
class AdvancedDataV9SoD implements AdvancedDataInterface | ||
{ | ||
private ?Guid $infoGuid = null; | ||
|
||
private ?Guid $ownerGuid = null; | ||
|
||
private int $currentHP; | ||
|
||
private int $maxHP; | ||
|
||
private int $power; | ||
|
||
private int $armor; | ||
|
||
private int $unknown1; | ||
|
||
private int $unknown2; | ||
|
||
private int $absorb; | ||
|
||
/** @var int[] */ | ||
private array $powerType; | ||
|
||
/** @var int[] */ | ||
private array $currentPower; | ||
|
||
/** @var int[] */ | ||
private array $maxPower; | ||
|
||
/** @var int[] */ | ||
private array $powerCost; | ||
|
||
private float $positionX; | ||
|
||
private float $positionY; | ||
|
||
private int $uiMapId; | ||
|
||
private float $facing; | ||
|
||
private int $level; | ||
|
||
public function getInfoGuid(): ?Guid | ||
{ | ||
return $this->infoGuid; | ||
} | ||
|
||
public function getOwnerGuid(): ?Guid | ||
{ | ||
return $this->ownerGuid; | ||
} | ||
|
||
public function getCurrentHP(): int | ||
{ | ||
return $this->currentHP; | ||
} | ||
|
||
public function getMaxHP(): int | ||
{ | ||
return $this->maxHP; | ||
} | ||
|
||
public function getAttackPower(): int | ||
{ | ||
return $this->power; | ||
} | ||
|
||
public function getSpellPower(): int | ||
{ | ||
return $this->power; | ||
} | ||
|
||
public function getArmor(): int | ||
{ | ||
return $this->armor; | ||
} | ||
|
||
public function getUnknown1(): int | ||
{ | ||
return $this->unknown1; | ||
} | ||
|
||
public function getUnknown2(): int | ||
{ | ||
return $this->unknown2; | ||
} | ||
|
||
public function getAbsorb(): int | ||
{ | ||
return $this->absorb; | ||
} | ||
|
||
/** | ||
* @return int[] | ||
*/ | ||
public function getPowerType(): array | ||
{ | ||
return $this->powerType; | ||
} | ||
|
||
/** | ||
* @return int[] | ||
*/ | ||
public function getCurrentPower(): array | ||
{ | ||
return $this->currentPower; | ||
} | ||
|
||
/** | ||
* @return int[] | ||
*/ | ||
public function getMaxPower(): array | ||
{ | ||
return $this->maxPower; | ||
} | ||
|
||
/** | ||
* @return int[] | ||
*/ | ||
public function getPowerCost(): array | ||
{ | ||
return $this->powerCost; | ||
} | ||
|
||
public function getPositionX(): float | ||
{ | ||
return $this->positionX; | ||
} | ||
|
||
public function getPositionY(): float | ||
{ | ||
return $this->positionY; | ||
} | ||
|
||
public function getUiMapId(): int | ||
{ | ||
return $this->uiMapId; | ||
} | ||
|
||
public function getFacing(): float | ||
{ | ||
return $this->facing; | ||
} | ||
|
||
public function getLevel(): int | ||
{ | ||
return $this->level; | ||
} | ||
|
||
public function setParameters(array $parameters): HasParameters | ||
{ | ||
$this->infoGuid = Guid::createFromGuidString($parameters[0]); | ||
$this->ownerGuid = Guid::createFromGuidString($parameters[1]); | ||
$this->currentHP = $parameters[2]; | ||
$this->maxHP = $parameters[3]; | ||
$this->power = $parameters[4]; | ||
$this->armor = $parameters[5]; | ||
$this->unknown1 = $parameters[6]; | ||
$this->unknown2 = $parameters[7]; | ||
$this->absorb = $parameters[8]; | ||
$this->powerType = explode('|', (string)$parameters[9]); | ||
$this->currentPower = explode('|', (string)$parameters[10]); | ||
$this->maxPower = explode('|', (string)$parameters[11]); | ||
$this->powerCost = explode('|', (string)$parameters[12]); | ||
// https://forums.combatlogforums.com/t/unit-positions-from-combat-log-solved/822 | ||
// Be aware also that the coordinates are rotated 90 degrees for some crazy reason. This means that for the two numbers listed, pos1 and pos2, the following rules apply: | ||
// | ||
// x-position = -pos2 | ||
// y-position = pos1 | ||
// This fixes the above issue. X and Y are fine after this | ||
$this->positionX = $parameters[14] * -1; | ||
$this->positionY = $parameters[13]; | ||
$this->uiMapId = $parameters[15]; | ||
$this->facing = $parameters[16]; | ||
$this->level = $parameters[17]; | ||
|
||
return $this; | ||
} | ||
|
||
public function getParameterCount(): int | ||
{ | ||
return 18; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
app/Logic/CombatLog/CombatEvents/Suffixes/Missed/V9SoD/MissedV9SoD.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
|
||
namespace App\Logic\CombatLog\CombatEvents\Suffixes\Missed\V9SoD; | ||
|
||
use App\Logic\CombatLog\CombatEvents\Interfaces\HasParameters; | ||
use App\Logic\CombatLog\CombatEvents\Suffixes\Missed\MissedInterface; | ||
use App\Logic\CombatLog\CombatEvents\Suffixes\Suffix; | ||
use App\Logic\CombatLog\Guid\Guid; | ||
use App\Logic\CombatLog\Guid\MissType\Block; | ||
use App\Logic\CombatLog\Guid\MissType\Resist; | ||
|
||
class MissedV9SoD extends Suffix implements MissedInterface | ||
{ | ||
private Guid $missType; | ||
|
||
private bool $offhand; | ||
|
||
private int $amountMissed; | ||
|
||
private int $amountTotal; | ||
|
||
private ?string $damageType; | ||
|
||
public function getMissType(): Guid | ||
{ | ||
return $this->missType; | ||
} | ||
|
||
public function isOffHand(): bool | ||
{ | ||
return $this->offhand; | ||
} | ||
|
||
public function getAmountMissed(): int | ||
{ | ||
return $this->amountMissed; | ||
} | ||
|
||
public function getAmountTotal(): int | ||
{ | ||
return $this->amountTotal; | ||
} | ||
|
||
public function getDamageType(): ?string | ||
{ | ||
return $this->damageType; | ||
} | ||
|
||
public function isCritical(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
|
||
public function setParameters(array $parameters): HasParameters | ||
{ | ||
parent::setParameters($parameters); | ||
|
||
$this->missType = Guid::createFromGuidString($parameters[0]); | ||
$this->offhand = $parameters[1] !== 'nil'; | ||
if (!isset($parameters[2]) || in_array($parameters[2], ['ST', 'AOE'])) { | ||
$this->amountMissed = 0; | ||
$this->amountTotal = 0; | ||
$this->damageType = $parameters[2] ?? null; | ||
} else if ($this->missType instanceof Block || $this->missType instanceof Resist) { | ||
$this->amountMissed = 0; | ||
$this->amountTotal = 0; | ||
$this->damageType = $parameters[2]; | ||
} else { | ||
$this->amountMissed = $parameters[2]; | ||
$this->amountTotal = $parameters[3] ?? 0; | ||
$this->damageType = $parameters[4] ?? null; | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
public function getOptionalParameterCount(): int | ||
{ | ||
return 3; | ||
} | ||
|
||
public function getParameterCount(): int | ||
{ | ||
return 5; | ||
} | ||
} |
Oops, something went wrong.