From 69f257303d353aa18c9ec6a8ad5a6a4ef71d2b97 Mon Sep 17 00:00:00 2001 From: Emagi Date: Thu, 14 Aug 2025 17:44:28 -0400 Subject: [PATCH] added int32 redlight, greenlight, bluelight into info struct for character sheet spell state colors --- source/WorldServer/Entity.cpp | 10 ++++++++++ source/WorldServer/Entity.h | 25 +++++++++++++++++++++++++ source/WorldServer/Player.cpp | 3 +++ 3 files changed, 38 insertions(+) diff --git a/source/WorldServer/Entity.cpp b/source/WorldServer/Entity.cpp index 1d247db..27e2ec4 100644 --- a/source/WorldServer/Entity.cpp +++ b/source/WorldServer/Entity.cpp @@ -320,6 +320,11 @@ void Entity::MapInfoStruct() get_int8_funcs["pet_movement"] = l::bind(&InfoStruct::get_pet_movement, &info_struct); get_int8_funcs["pet_behavior"] = l::bind(&InfoStruct::get_pet_behavior, &info_struct); get_int32_funcs["vision"] = l::bind(&InfoStruct::get_vision, &info_struct); + + get_int32_funcs["redlight"] = l::bind(&InfoStruct::get_redlight, &info_struct); + get_int32_funcs["greenlight"] = l::bind(&InfoStruct::get_greenlight, &info_struct); + get_int32_funcs["bluelight"] = l::bind(&InfoStruct::get_bluelight, &info_struct); + get_int8_funcs["breathe_underwater"] = l::bind(&InfoStruct::get_breathe_underwater, &info_struct); get_string_funcs["biography"] = l::bind(&InfoStruct::get_biography, &info_struct); get_float_funcs["drunk"] = l::bind(&InfoStruct::get_drunk, &info_struct); @@ -530,6 +535,11 @@ void Entity::MapInfoStruct() set_int8_funcs["pet_movement"] = l::bind(&InfoStruct::set_pet_movement, &info_struct, l::_1); set_int8_funcs["pet_behavior"] = l::bind(&InfoStruct::set_pet_behavior, &info_struct, l::_1); set_int32_funcs["vision"] = l::bind(&InfoStruct::set_vision, &info_struct, l::_1); + + set_int32_funcs["redlight"] = l::bind(&InfoStruct::set_redlight, &info_struct, l::_1); + set_int32_funcs["greenlight"] = l::bind(&InfoStruct::set_greenlight, &info_struct, l::_1); + set_int32_funcs["bluelight"] = l::bind(&InfoStruct::set_bluelight, &info_struct, l::_1); + set_int8_funcs["breathe_underwater"] = l::bind(&InfoStruct::set_breathe_underwater, &info_struct, l::_1); set_string_funcs["biography"] = l::bind(&InfoStruct::set_biography, &info_struct, l::_1); set_float_funcs["drunk"] = l::bind(&InfoStruct::set_drunk, &info_struct, l::_1); diff --git a/source/WorldServer/Entity.h b/source/WorldServer/Entity.h index a68b505..a3c2238 100644 --- a/source/WorldServer/Entity.h +++ b/source/WorldServer/Entity.h @@ -235,6 +235,11 @@ struct InfoStruct{ pet_movement_ = 0; pet_behavior_ = 0; vision_ = 0; + + redlight_ = 0; + greenlight_ = 0; + bluelight_ = 0; + breathe_underwater_ = 0; biography_ = std::string(""); drunk_ = 0; @@ -448,6 +453,11 @@ struct InfoStruct{ pet_movement_ = oldStruct->get_pet_movement(); pet_behavior_ = oldStruct->get_pet_behavior(); vision_ = oldStruct->get_vision(); + + redlight_ = oldStruct->get_redlight(); + greenlight_ = oldStruct->get_greenlight(); + bluelight_ = oldStruct->get_bluelight(); + breathe_underwater_ = oldStruct->get_breathe_underwater(); biography_ = std::string(oldStruct->get_biography()); drunk_ = oldStruct->get_drunk(); @@ -668,6 +678,11 @@ struct InfoStruct{ int8 get_pet_movement() { std::lock_guard lk(classMutex); return pet_movement_; } int8 get_pet_behavior() { std::lock_guard lk(classMutex); return pet_behavior_; } int32 get_vision() { std::lock_guard lk(classMutex); return vision_; } + + int32 get_redlight() { std::lock_guard lk(classMutex); return redlight_; } + int32 get_greenlight() { std::lock_guard lk(classMutex); return greenlight_; } + int32 get_bluelight() { std::lock_guard lk(classMutex); return bluelight_; } + int8 get_breathe_underwater() { std::lock_guard lk(classMutex); return breathe_underwater_; } std::string get_biography() { std::lock_guard lk(classMutex); return biography_; } float get_drunk() { std::lock_guard lk(classMutex); return drunk_; } @@ -987,6 +1002,11 @@ struct InfoStruct{ void set_max_weight(int32 value) { std::lock_guard lk(classMutex); max_weight_ = value; } void set_vision(int32 value) { std::lock_guard lk(classMutex); vision_ = value; } + + void set_redlight(int32 value) { std::lock_guard lk(classMutex); redlight_ = value; } + void set_greenlight(int32 value) { std::lock_guard lk(classMutex); greenlight_ = value; } + void set_bluelight(int32 value) { std::lock_guard lk(classMutex); bluelight_ = value; } + void set_breathe_underwater(int8 value) { std::lock_guard lk(classMutex); breathe_underwater_ = value; } void set_drunk(float value) { std::lock_guard lk(classMutex); drunk_ = value; } @@ -1232,6 +1252,11 @@ private: int8 pet_behavior_; int32 vision_; + + int32 redlight_; + int32 greenlight_; + int32 bluelight_; + int8 breathe_underwater_; std::string biography_; float drunk_; diff --git a/source/WorldServer/Player.cpp b/source/WorldServer/Player.cpp index 3098532..a30b7bc 100644 --- a/source/WorldServer/Player.cpp +++ b/source/WorldServer/Player.cpp @@ -1085,6 +1085,9 @@ EQ2Packet* PlayerInfo::serialize(int16 version, int16 modifyPos, int32 modifyVal packet->setDataByName("spell_state_fishvision", 1); break; } + packet->setDataByName("spell_prop_redlight", info_struct->get_redlight()); + packet->setDataByName("spell_prop_greenlight", info_struct->get_greenlight()); + packet->setDataByName("spell_prop_bluelight", info_struct->get_bluelight()); packet->setDataByName("breathe_underwater", info_struct->get_breathe_underwater()); int32 expireTimestamp = 0;