1888 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
34 lines
5.8 KiB
C++
34 lines
5.8 KiB
C++
#include "aura_translation.hpp"
|
|
#include "gateway/aura_definition_profile.hpp"
|
|
#include "gateway/roster_translation.hpp"
|
|
#include "gateway/turtle_entity_profile.hpp"
|
|
#include <iostream>
|
|
using namespace gateway;
|
|
namespace F=gateway::turtle_entity_fields;
|
|
static void check(bool ok,const char* message){if(!ok)throw Error(message);}
|
|
int main(){try{
|
|
const uint64_t creature=0xf130000001000001ULL;
|
|
const auto target=forever_creature_guid(creature,1,70,1);
|
|
for(const auto [spell,mask]:std::initializer_list<std::pair<uint32_t,uint32_t>>{{25,1},{56,1},{116,1},{120,1},{205,1},{692,1},{700,1},{835,1},{837,1},{853,1},{1090,1},{1715,2},{2070,1},{2140,1},{2637,1},{2647,1},{2880,1},{3109,1},{3143,1},{3145,1},{3271,1},{3355,1},{3409,1},{3514,1},{3600,1},{3604,1},{3609,1},{3618,1},{3635,1},{3636,1},{4064,2},{4065,2},{4066,2},{4067,2},{4068,2},{4069,2},{5101,1},{5106,1},{5116,1},{5164,1},{5165,1},{5211,1},{5403,2},{5588,1},{5589,1},{5648,1},{5649,1},{5703,1},{5726,1},{5727,1},{5951,1},{6253,1},{6304,1},{6358,1},{6432,1},{6435,1},{6524,1},{6537,1},{6581,1},{6601,1},{6728,1},{6730,1},{6749,1},{6754,1},{6770,1},{6798,1},{6869,1},{6945,1},{6982,1},{7184,1},{7267,1},{7322,1},{7372,2},{7373,2},{7803,1},{7922,1},{7961,1},{8034,1},{8037,1},{8040,1},{8056,1},{8058,1},{8150,2},{8208,1},{8242,1},{8338,2},{8398,1},{8399,1},{8406,1},{8407,1},{8408,1},{8492,1},{8510,2},{8511,2},{8646,1},{8672,1},{8901,1},{8983,1},{9032,1},{9159,1},{9179,1},{9256,1},{9462,1},{9484,1},{9485,1},{9672,2},{10136,1},{10159,1},{10160,1},{10161,1},{10179,1},{10180,1},{10181,1},{10308,1},{10458,1},{10472,1},{10473,1},{10734,1},{10856,1},{10955,1},{11113,2},{11131,1},{11201,1},{11297,1},{11428,1},{11430,1},{11444,1},{11538,2},{11650,1},{12098,1},{12323,1},{12355,1},{12421,2},{12484,1},{12540,2},{12543,2},{12548,1},{12557,1},{12562,2},{12611,1},{12675,2},{12705,1},{12734,2},{12737,2},{12809,1},{13005,1},{13018,2},{13019,2},{13020,2},{13021,2},{13237,2},{13238,2},{13322,2},{13360,1},{13439,1},{13496,1},{13579,2},{13808,2},{13902,1},{13907,2},{14207,1},{14308,1},{14309,1},{14821,1},{14870,1},{14871,2},{15043,2},{15089,1},{15091,2},{15244,1},{15269,1},{15283,1},{15398,1},{15497,2},{15499,1},{15530,2},{15535,1},{15571,1},{15618,1},{15655,1},{15660,1},{15744,2},{15753,1},{15878,1},{15970,1},{16045,1},{16046,2},{16075,2},{16096,1},{16104,1},{16249,2},{16310,1},{16352,1},{16353,1},{16452,2},{16600,1},{16790,1},{16798,1},{16799,2},{16803,2},{16869,1},{16916,1},{16922,1},{17145,2},{17174,1},{17277,2},{17286,1},{17308,1},{17398,1},{17492,2},{17503,2},{17528,2},{17691,1},{17716,2},{17745,2},{18093,1},{18103,1},{18118,1},{18223,1},{18328,1},{18657,1},{18658,1},{18798,1},{18812,1},{19128,1},{19133,1},{19136,2},{19364,1},{19410,1},{19482,1},{19496,1},{19769,2},{19784,2},{19872,1},{20007,1},{20066,1},{20170,1},{20229,2},{20253,1},{20276,1},{20277,1},{20297,2},{20310,1},{20511,1},{20549,1},{20614,1},{20615,1},{20663,1},{20669,1},{20683,1},{20685,2},{20792,2},{20806,2},{20819,2},{20822,2},{20828,1},{20989,1},{21030,1},{21066,2},{21151,2},{21152,1},{21369,2},{21401,1},{21748,2},{21749,2},{21990,1},{22289,1},{22357,2},{22424,2},{22519,2},{22561,1},{22582,1},{22592,1},{22643,2},{22703,2},{22746,1},{22856,1},{22915,1},{23039,2},{23055,2},{23102,2},{23103,1},{23113,2},{23115,1},{23171,1},{23186,1},{23269,1},{23412,2},{23447,1},{23454,1},{23600,1},{23775,1},{24004,1},{24020,2},{24225,1},{24335,1},{24388,2},{24594,1},{24600,1},{24615,2},{24647,1},{24664,1},{24671,1},{24686,1},{24698,2},{24754,1},{24778,1},{24883,1},{24919,1},{24942,2},{25043,1},{25189,1},{25304,1},{25495,1},{25515,1},{25774,2},{25809,1},{25900,1},{26102,2},{26141,2},{26180,1},{26211,2},{26379,1},{27584,2},{27615,1},{27880,1},{28127,1},{28160,1},{28323,1},{28445,1},{28450,1},{28456,2},{28478,2},{28479,2},{29163,1},{29164,1},{29484,1},{29544,1},{29607,1},{29825,1},{30092,2},{30095,1},{30109,2},{31248,1}}){
|
|
check(aura_definition_profile::mask(spell)==mask,"staged source index not preserved");
|
|
NativeAuraTranslation state;LegacyObjectUpdate create;create.kind=2;create.type=3;create.guid=creature;
|
|
create.fields={{F::UNIT_FIELD_AURA+32,spell},{F::UNIT_FIELD_AURAFLAGS+4,8},{F::UNIT_FIELD_AURALEVELS+8,60}};
|
|
state.consume({create});auto output=state.flush({{creature,target}});
|
|
check(output.size()==1 && output[0].opcode==0x690011,"source harmful holder not queued");
|
|
check(output[0].body==forever_aura_update({target,true,{{32,AuraSlotData{spell,mask,16,60,1}}}}),"source harmful holder serialization differs");
|
|
check(state.units.at(creature).shown[32],"source harmful holder not marked presented");
|
|
LegacyObjectUpdate clear;clear.guid=creature;clear.fields={{F::UNIT_FIELD_AURA+32,0}};
|
|
state.consume({clear});output=state.flush({{creature,target}});
|
|
check(output.size()==1 && output[0].body==forever_aura_update({target,false,{{32,std::nullopt}}}),"source removal not queued");
|
|
}
|
|
const auto player=forever_player_guid(4509,70);NativeAuraTranslation state;
|
|
LegacyObjectUpdate create;create.kind=2;create.type=4;create.guid=4509;
|
|
create.fields={{F::UNIT_FIELD_AURA,20007},{F::UNIT_FIELD_AURAFLAGS,5},{F::UNIT_FIELD_AURALEVELS,60}};
|
|
state.consume({create});auto output=state.flush({{4509,player}});
|
|
check(output.size()==1 && output[0].body==forever_aura_update({player,true,{{0,AuraSlotData{20007,1,2,60,1}}}}),"genuine Crusader holder not translated");
|
|
check(!state.units.at(4509).self_cast[0],"unobserved Crusader cast context fabricated");
|
|
check(!aura_definition_profile::mask(11581),"different Thunder Clap aura silently accepted");
|
|
check(!aura_definition_profile::mask(12566),"multi-aura Plainsrunning mask guessed");
|
|
std::cout<<"Staged native aura companion translation: all344 restored debuff IDs and Crusader holder/removal PASS; offline only, no live gameplay claim.\n";
|
|
}catch(const std::exception& error){std::cerr<<error.what()<<'\n';return 1;}}
|