Files
SatyandClaude Opus 5.5 175f55b399 Port spells, loot, effects, missiles, level-up and non-gameplay UI stand-ins
Gameplay:
- Spell system pieces, spell effects lifecycle (CEffect), special effects,
  procedural/loot effects, impact visuals
- Unit anim events: AnimEventCallback, HandleAnimEvent, HandleCombatAnimEvent,
  parry anims, vehicle bone grab/throw events
- CGUnit_C::CreateMissile (target, point, point-array overloads)
- Loot: CGLootInfo/LootWindow/LootDisplay, loot rolls, loot packets and scripts
- Bags/items: FindItem, container/inventory mirror handlers, UseContainerItem
  (sell/bank/mail/trade/auction/guild bank), UseItem, item lock/unlock
- Threat, power regen, XP gain, quest item updates, skill changes
- Packet_Group_9 (level up, item push, exploration, taxi, bind, roll, ...)
- ChatBubbleShow/Remove
- x64 fix: map entity callback param is uintptr_t (pointer was truncated)

Non-gameplay (parallel batch): chat channels/settings, chat bubble frame,
game/server time, minimap POIs and init, mail, class trainer, skills,
achievements, currencies, calendar, world states, world map arrow/ping,
commentator, merchant buyback, battleground/arena info, EnterWorld for
~15 UI modules

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 03:06:16 +02:00

129 lines
2.9 KiB
C++

#include "Spell.h"
#include <cmath>
#include "Engine/Source/Tempest/C3Vector.h"
// VERIFY: cbd89f17 auto
// OFFSET: 0x0076BD50
bool Spell_IsAuraEffect(int32_t effect) {
switch (effect) {
case 6:
case 27:
case 35:
case 65:
case 119:
case 128:
case 129:
case 143:
return true;
default:
return false;
}
}
// VERIFY: 64431913 auto
// OFFSET: 0x0076BE10
bool Spell_IsUnitAuraEffect(int32_t effect) {
switch (effect) {
case 6:
case 35:
case 65:
case 119:
case 128:
case 129:
case 143:
return true;
default:
return false;
}
}
// VERIFY: 0c750047 auto
// OFFSET: 0x0076BED0
bool Spell_IsAreaAuraEffect(int32_t effect) {
switch (effect) {
case 27:
case 35:
case 65:
case 119:
case 128:
case 129:
case 143:
return true;
default:
return false;
}
}
// VERIFY: 7a1110db auto
// OFFSET: 0x0076BF80
float SpellUtils_ComputeMissileTrajectoryTravelTime(float pitch, float speed, const C3Vector* delta, float gravity) {
bool hasGravity = fabs(gravity) > 0.0001f;
float horizontal = cos(pitch) * speed;
if (horizontal > 0.0001f) {
return sqrt(delta->y * delta->y + delta->x * delta->x) / horizontal;
}
if (speed <= 0.0001f) {
if (!hasGravity) {
return -1.0f;
}
} else if (!hasGravity) {
return fabs(delta->z) / speed;
}
float vertical = speed * sin(pitch);
float discriminant = vertical * vertical - (delta->z * gravity + delta->z * gravity);
if (discriminant < 0.0f) {
return -1.0f;
}
float root = sqrt(discriminant);
float scale = -1.0f / gravity;
float first = (root - vertical) * scale;
float second = scale * (-vertical - root);
if (first >= 0.0f && (second < 0.0f || first < second)) {
return first;
}
return second;
}
// VERIFY: 7fc1a99f auto
// OFFSET: 0x0076C070
int32_t SpellUtils_ComputeMissileTrajectory(float pitch, const C3Vector* delta, float gravity, float* speed, float* time, C3Vector* velocity) {
float c = cos(pitch);
float s = sin(pitch);
float horizontal = sqrt(delta->y * delta->y + delta->x * delta->x);
if (fabs(c) < 0.0001f || fabs(horizontal) < 0.0001f || fabs(gravity) < 0.0001f) {
return 1;
}
float half = (1.0f / c * horizontal * s - delta->z) / gravity;
float squared = half + half;
if (squared <= 0.01f) {
return 0;
}
float t = sqrt(squared);
*time = t;
float v = 1.0f / c * (horizontal / t);
*speed = v;
if (velocity) {
float inverse = 1.0f / horizontal;
velocity->x = v * delta->x * inverse * c;
velocity->y = c * (inverse * *speed) * delta->y;
velocity->z = s * *speed;
}
return 2;
}