Files
praxisandClaude Fable 5.2 c2194c59d4 Protocol core: packet translation between source and native
127 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:47 +02:00

47 lines
2.5 KiB
C++

#pragma once
#include "gateway/protocol.hpp"
namespace gateway {
struct ItemSpellReply {uint32_t spell=0,trigger=0,category=0;int32_t charges=0,cooldown=-1,category_cooldown=-1;};
struct ItemStatReply {uint32_t type=0;int32_t value=0;};
struct ItemDamageReply {float minimum=0,maximum=0;uint32_t school=0;};
struct ItemTemplateReply {
uint32_t entry=0,cls=0,subclass=0,display=0,inventory_type=0,stack=0,max_durability=0;
bool found=false;std::string name;std::array<ItemSpellReply,5> spells;
// Retain the actual source wire reply, not a reconstructed SQL template.
// Tortoise normalizes consumable subclasses and some requirements/cooldowns
// before sending. Duration, scripts, PPM and BuyCount are not on this wire.
std::array<std::string,3> alternate_names;
uint32_t quality=0,flags=0,buy_price=0,sell_price=0,allowable_class=0,allowable_race=0;
uint32_t item_level=0,required_level=0,required_skill=0,required_skill_rank=0,required_spell=0;
uint32_t required_honor_rank=0,required_city_rank=0,required_reputation_faction=0,required_reputation_rank=0;
uint32_t max_count=0,container_slots=0,delay=0,ammo_type=0;
std::array<ItemStatReply,10> stats;
std::array<ItemDamageReply,5> damage;
int32_t armor=0,holy_resistance=0,fire_resistance=0,nature_resistance=0;
int32_t frost_resistance=0,shadow_resistance=0,arcane_resistance=0;
float ranged_modifier=0;
uint32_t bonding=0,page_text=0,language=0,page_material=0,start_quest=0,lock_id=0;
uint32_t material=0,sheath=0,random_property=0,block=0,item_set=0,area=0,map=0,bag_family=0;
std::string description;
};
Bytes turtle_item_query(uint32_t entry);
ItemTemplateReply turtle_item_template(std::span<const uint8_t>);
struct CreatureTemplateReply {
uint32_t entry=0, flags=0, family=0, display=0;
uint8_t type=0, rank=0;
bool found=false, leader=false, civilian=false;
std::array<std::string,4> names;
std::string title;
};
std::vector<uint32_t> forever_creature_queries(std::span<const uint8_t>);
Bytes turtle_creature_query(uint32_t entry);
CreatureTemplateReply turtle_creature_template(std::span<const uint8_t>);
// Tortoise also emits unspecified class0 (including its training dummies).
// Preserve it: Forever's CreatureStats query has an explicit Class=0 default.
// This is creature presentation eligibility, never playable class eligibility.
constexpr bool turtle_presentable_creature_class(uint8_t cls) {
return cls==0 || cls==1 || cls==2 || cls==4 || cls==8;
}
Bytes forever_creature_template(const CreatureTemplateReply&,uint8_t unit_class);
}