Bläddra i källkod

InfoStruct accessible in LUA/mutli-thread

Fix #239

GetInfoStructString(Entity, fieldname)
GetInfoStructUInt(Entity, fieldname)
GetInfoStructSInt(Entity, fieldname)
GetInfoStructFloat(Entity, fieldname)

SetInfoStructString(Entity, fieldname, value)
SetInfoStructUInt(Entity, fieldname, value)
SetInfoStructSInt(Entity, fieldname, value)
SetInfoStructFloat(Entity, fieldname, value)
SetCharSheetChanged(Player, bool)
Image 4 år sedan
förälder
incheckning
463c6ce53a

+ 1 - 1
EQ2/source/WorldServer/AltAdvancement/AltAdvancement.cpp

@@ -300,7 +300,7 @@ void MasterAAList::DisplayAA(Client* client,int8 newtemplate,int8 changemode) {
 
 	for (int x = 0; x < TreeNodeList.size(); x++)
 	{
-		int8 class_id = client->GetPlayer()->GetInfoStruct()->class3;
+		int8 class_id = client->GetPlayer()->GetInfoStruct()->get_class3();
 		
 		if (TreeNodeList[x]->classID == class_id)
 		{

+ 20 - 19
EQ2/source/WorldServer/Bots/Bot.cpp

@@ -25,11 +25,11 @@ Bot::Bot() : NPC() {
 	AddSecondaryEntityCommand("bot inventory", 10000, "bot inv list", "", 0, 0);
 
 	InfoStruct* info = GetInfoStruct();
-	info->str_base = 50;
-	info->sta_base = 20;
-	info->wis_base = 20;
-	info->intel_base = 20;
-	info->agi_base = 20;
+	info->set_str_base(50);
+	info->set_sta_base(20);
+	info->set_wis_base(20);
+	info->set_intel_base(20);
+	info->set_agi_base(20);
 }
 
 Bot::~Bot() {
@@ -662,7 +662,7 @@ void Bot::ChangeLevel(int16 old_level, int16 new_level) {
 	ChangePrimaryWeapon();
 	ChangeSecondaryWeapon();
 	ChangeRangedWeapon();
-	GetInfoStruct()->level = new_level;
+	GetInfoStruct()->set_level(new_level);
 	// GetPlayer()->SetLevel(new_level);
 
 	LogWrite(MISC__TODO, 1, "TODO", "Get new HP/POWER/stat based on default values from DB\n\t(%s, function: %s, line #: %i)", __FILE__, __FUNCTION__, __LINE__);
@@ -672,21 +672,22 @@ void Bot::ChangeLevel(int16 old_level, int16 new_level) {
 	CalculateBonuses();
 	SetHP(GetTotalHP());
 	SetPower(GetTotalPower());
-	GetInfoStruct()->agi_base = new_level * 2 + 15;
-	GetInfoStruct()->intel_base = new_level * 2 + 15;
-	GetInfoStruct()->wis_base = new_level * 2 + 15;
-	GetInfoStruct()->str_base = new_level * 2 + 15;
-	GetInfoStruct()->sta_base = new_level * 2 + 15;
-	GetInfoStruct()->cold_base = (int16)(new_level*1.5 + 10);
-	GetInfoStruct()->heat_base = (int16)(new_level*1.5 + 10);
-	GetInfoStruct()->disease_base = (int16)(new_level*1.5 + 10);
-	GetInfoStruct()->mental_base = (int16)(new_level*1.5 + 10);
-	GetInfoStruct()->magic_base = (int16)(new_level*1.5 + 10);
-	GetInfoStruct()->divine_base = (int16)(new_level*1.5 + 10);
-	GetInfoStruct()->poison_base = (int16)(new_level*1.5 + 10);
+
+	GetInfoStruct()->set_agi_base(new_level * 2 + 15);
+	GetInfoStruct()->set_intel_base(new_level * 2 + 15);
+	GetInfoStruct()->set_wis_base(new_level * 2 + 15);
+	GetInfoStruct()->set_str_base(new_level * 2 + 15);
+	GetInfoStruct()->set_sta_base(new_level * 2 + 15);
+	GetInfoStruct()->set_cold_base((int16)(new_level*1.5 + 10));
+	GetInfoStruct()->set_heat_base((int16)(new_level*1.5 + 10));
+	GetInfoStruct()->set_disease_base((int16)(new_level*1.5 + 10));
+	GetInfoStruct()->set_mental_base((int16)(new_level*1.5 + 10));
+	GetInfoStruct()->set_magic_base((int16)(new_level*1.5 + 10));
+	GetInfoStruct()->set_divine_base((int16)(new_level*1.5 + 10));
+	GetInfoStruct()->set_poison_base((int16)(new_level*1.5 + 10));
+
 	SetHPRegen((int)(new_level*.75) + (int)(new_level / 10) + 3);
 	SetPowerRegen(new_level + (int)(new_level / 10) + 4);
-	GetInfoStruct()->poison_base = (int16)(new_level*1.5 + 10);
 	/*UpdateTimeStampFlag(LEVEL_UPDATE_FLAG);
 	GetPlayer()->SetCharSheetChanged(true);
 

+ 50 - 49
EQ2/source/WorldServer/Combat.cpp

@@ -231,7 +231,7 @@ void Entity::MeleeAttack(Spawn* victim, float distance, bool primary, bool multi
 
 	//Multi Attack roll
 	if(!multi_attack){
-		float multi_attack = info_struct.multi_attack;
+		float multi_attack = info_struct.get_multi_attack();
 		if(multi_attack > 0){
 			float chance = multi_attack;
 			if (multi_attack > 100){
@@ -260,7 +260,7 @@ void Entity::MeleeAttack(Spawn* victim, float distance, bool primary, bool multi
 		Entity* pet = 0;
 		bool AddHate = false;
 		if (victim->IsPlayer()) {
-			if (((Player*)victim)->GetInfoStruct()->pet_behavior & 1)
+			if (((Player*)victim)->GetInfoStruct()->get_pet_behavior() & 1)
 				AddHate = true;
 		}
 		else
@@ -317,7 +317,7 @@ void Entity::RangeAttack(Spawn* victim, float distance, Item* weapon, Item* ammo
 				Entity* pet = 0;
 				bool AddHate = false;
 				if (victim->IsPlayer()) {
-					if (((Player*)victim)->GetInfoStruct()->pet_behavior & 1)
+					if (((Player*)victim)->GetInfoStruct()->get_pet_behavior() & 1)
 						AddHate = true;
 				}
 				else
@@ -344,7 +344,7 @@ void Entity::RangeAttack(Spawn* victim, float distance, Item* weapon, Item* ammo
 	}
 	//Multi Attack roll
 	if(!multi_attack){
-		float multi_attack = info_struct.multi_attack;
+		float multi_attack = info_struct.get_multi_attack();
 		if(multi_attack > 0){
 			float chance = multi_attack;
 			if (multi_attack > 100){
@@ -437,31 +437,32 @@ bool Entity::SpellAttack(Spawn* victim, float distance, LuaSpell* luaspell, int8
 	if(EngagedInCombat() == false)
 	{
 		LogWrite(MISC__TODO, 1, "TODO", "//It would probably be better to add a column to the spells table for 'starts autoattack'\nfile: %s, func: %s, Line: %i", __FILE__, __FUNCTION__, __LINE__);
-		if(GetInfoStruct()->class1 == COMMONER ||
-			GetInfoStruct()->class1 == FIGHTER ||
-			GetInfoStruct()->class1 == WARRIOR ||
-			GetInfoStruct()->class1 == GUARDIAN ||
-			GetInfoStruct()->class1 == BERSERKER ||
-			GetInfoStruct()->class1 == BRAWLER ||
-			GetInfoStruct()->class1 == MONK ||
-			GetInfoStruct()->class1 == BRUISER ||
-			GetInfoStruct()->class1 == CRUSADER ||
-			GetInfoStruct()->class1 == SHADOWKNIGHT ||
-			GetInfoStruct()->class1 == PALADIN ||
-			GetInfoStruct()->class1 == SCOUT ||
-			GetInfoStruct()->class1 == ROGUE ||
-			GetInfoStruct()->class1 == SWASHBUCKLER ||
-			GetInfoStruct()->class1 == BRIGAND ||
-			GetInfoStruct()->class1 == BARD ||
-			GetInfoStruct()->class1 == TROUBADOR ||
-			GetInfoStruct()->class1 == DIRGE ||
-			GetInfoStruct()->class1 == PREDATOR ||
-			GetInfoStruct()->class1 == RANGER ||
-			GetInfoStruct()->class1 == ASSASSIN ||
-			GetInfoStruct()->class1 == ANIMALIST ||
-			GetInfoStruct()->class1 == BEASTLORD ||
-			GetInfoStruct()->class1 == SHAPER || 
-			GetInfoStruct()->class1 == CHANNELER) //note: it would probably be better to add a column to the spells table for "starts autoattack".
+		int8 class1_ = GetInfoStruct()->get_class1();
+		if(class1_ == COMMONER ||
+			class1_ == FIGHTER ||
+			class1_ == WARRIOR ||
+			class1_ == GUARDIAN ||
+			class1_ == BERSERKER ||
+			class1_ == BRAWLER ||
+			class1_ == MONK ||
+			class1_ == BRUISER ||
+			class1_ == CRUSADER ||
+			class1_ == SHADOWKNIGHT ||
+			class1_ == PALADIN ||
+			class1_ == SCOUT ||
+			class1_ == ROGUE ||
+			class1_ == SWASHBUCKLER ||
+			class1_ == BRIGAND ||
+			class1_ == BARD ||
+			class1_ == TROUBADOR ||
+			class1_ == DIRGE ||
+			class1_ == PREDATOR ||
+			class1_ == RANGER ||
+			class1_ == ASSASSIN ||
+			class1_ == ANIMALIST ||
+			class1_ == BEASTLORD ||
+			class1_ == SHAPER || 
+			class1_ == CHANNELER) //note: it would probably be better to add a column to the spells table for "starts autoattack".
 		{
 			if (victim->IsNPC())
 				((NPC*)victim)->AddHate(this, 5);
@@ -474,7 +475,7 @@ bool Entity::SpellAttack(Spawn* victim, float distance, LuaSpell* luaspell, int8
 		Entity* pet = 0;
 		bool AddHate = false;
 		if (victim->IsPlayer()) {
-			if (((Player*)victim)->GetInfoStruct()->pet_behavior & 1)
+			if (((Player*)victim)->GetInfoStruct()->get_pet_behavior() & 1)
 				AddHate = true;
 		}
 		else
@@ -526,7 +527,7 @@ bool Entity::ProcAttack(Spawn* victim, int8 damage_type, int32 low_damage, int32
 		Entity* pet = 0;
 		bool AddHate = false;
 		if (victim->IsPlayer()) {
-			if (((Player*)victim)->GetInfoStruct()->pet_behavior & 1)
+			if (((Player*)victim)->GetInfoStruct()->get_pet_behavior() & 1)
 				AddHate = true;
 		}
 		else
@@ -586,7 +587,7 @@ bool Entity::SpellHeal(Spawn* target, float distance, LuaSpell* luaspell, string
 			//heal_amt += base_roll * (GetPrimaryStat()
 		
 			//Ability Modifier can only be up to half of base roll + potency and primary stat bonus
-			heal_amt += (int32)min(info_struct.ability_modifier, (float)(heal_amt / 2));
+			heal_amt += (int32)min(info_struct.get_ability_modifier(), (float)(heal_amt / 2));
 		}
 
 		if(!crit_mod || crit_mod == 1){
@@ -594,12 +595,12 @@ bool Entity::SpellHeal(Spawn* target, float distance, LuaSpell* luaspell, string
 				crit = true;
 			else {
 				// Crit Roll
-				float chance = max((float)0, info_struct.crit_chance);
+				float chance = max((float)0, info_struct.get_crit_chance());
 				crit = (MakeRandomFloat(0, 100) <= chance); 
 			}
 			if(crit){
 				//Apply total crit multiplier with crit bonus
-				heal_amt *= (info_struct.crit_bonus / 100) + 1.3;
+				heal_amt *= (info_struct.get_crit_bonus() / 100) + 1.3;
 				if(luaspell->spell)
 					luaspell->crit = true;
 			}
@@ -780,37 +781,37 @@ float Entity::GetDamageTypeResistPercentage(int8 damage_type) {
 		break;
 										  }
 	case DAMAGE_PACKET_DAMAGE_TYPE_HEAT: {
-		ret += GetInfoStruct()->heat / 50;
+		ret += GetInfoStruct()->get_heat() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Heat (%i), Amt: %.2f", damage_type, ret);
 		break;
 										 }
 	case DAMAGE_PACKET_DAMAGE_TYPE_COLD: {
-		ret += GetInfoStruct()->cold / 50;
+		ret += GetInfoStruct()->get_cold() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Cold (%i), Amt: %.2f", damage_type, ret);
 		break;
 										 }
 	case DAMAGE_PACKET_DAMAGE_TYPE_MAGIC: {
-		ret += GetInfoStruct()->magic / 50;
+		ret += GetInfoStruct()->get_magic() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Magic (%i), Amt: %.2f", damage_type, ret);
 		break;
 										  }
 	case DAMAGE_PACKET_DAMAGE_TYPE_MENTAL: {
-		ret += GetInfoStruct()->mental / 50;
+		ret += GetInfoStruct()->get_mental() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Mental (%i), Amt: %.2f", damage_type, ret);
 		break;
 										   }
 	case DAMAGE_PACKET_DAMAGE_TYPE_DIVINE: {
-		ret += GetInfoStruct()->divine / 50;
+		ret += GetInfoStruct()->get_divine() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Divine (%i), Amt: %.2f", damage_type, ret);
 		break;
 										   }
 	case DAMAGE_PACKET_DAMAGE_TYPE_DISEASE: {
-		ret += GetInfoStruct()->disease / 50;
+		ret += GetInfoStruct()->get_disease() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Disease (%i), Amt: %.2f", damage_type, ret);
 		break;
 											}
 	case DAMAGE_PACKET_DAMAGE_TYPE_POISON: {
-		ret += GetInfoStruct()->poison / 50;
+		ret += GetInfoStruct()->get_poison() / 50;
 		LogWrite(COMBAT__DEBUG, 3, "Combat", "DamageType: Poison (%i), Amt: %.2f", damage_type, ret);
 		break;
 										   }
@@ -863,7 +864,7 @@ bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_
 
 		//DPS mod is only applied to auto attacks
 		if (type == DAMAGE_PACKET_TYPE_SIMPLE_DAMAGE || type == DAMAGE_PACKET_TYPE_RANGE_DAMAGE ) {
-			damage *= (info_struct.dps_multiplier);
+			damage *= (info_struct.get_dps_multiplier());
 		}
 		//Potency and ability mod is only applied to spells/CAs
 		else { 
@@ -871,7 +872,7 @@ bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_
 			damage *= ((stats[ITEM_STAT_POTENCY] / 100) + 1);
 
 			// Ability mod can only give up to half of damage after potency
-			int32 mod = (int32)min(info_struct.ability_modifier, (float)(damage / 2));
+			int32 mod = (int32)min(info_struct.get_ability_modifier(), (float)(damage / 2));
 			damage += mod;
 		}
 
@@ -883,14 +884,14 @@ bool Entity::DamageSpawn(Entity* victim, int8 type, int8 damage_type, int32 low_
 
 			// Crit Roll
 			else {
-				float chance = max((float)0, (info_struct.crit_chance - victim->stats[ITEM_STAT_CRITAVOIDANCE]));
+				float chance = max((float)0, (info_struct.get_crit_chance() - victim->stats[ITEM_STAT_CRITAVOIDANCE]));
 				if (MakeRandomFloat(0, 100) <= chance)
 					crit = true;
 			}
 			if(crit){
 				//Apply total crit multiplier with crit bonus
-				if(info_struct.crit_bonus > 0)
-					damage *= (1.3 + (info_struct.crit_bonus / 100));
+				if(info_struct.get_crit_bonus() > 0)
+					damage *= (1.3 + (info_struct.get_crit_bonus() / 100));
 				else
 					damage *= 1.3;
 
@@ -986,7 +987,7 @@ void Entity::AddHate(Entity* attacker, sint32 hate) {
 		return;
 
 	// If a players pet and protect self is off
-	if (IsPet() && ((NPC*)this)->GetOwner()->IsPlayer() && ((((Player*)((NPC*)this)->GetOwner())->GetInfoStruct()->pet_behavior & 2) == 0))
+	if (IsPet() && ((NPC*)this)->GetOwner()->IsPlayer() && ((((Player*)((NPC*)this)->GetOwner())->GetInfoStruct()->get_pet_behavior() & 2) == 0))
 		return;
 
 	if (IsNPC()) {
@@ -1011,7 +1012,7 @@ void Entity::AddHate(Entity* attacker, sint32 hate) {
 		AddHate(((NPC*)attacker)->GetOwner(), 1);
 
 	// If player and player has a pet and protect master is set add hate to the pet
-	if (IsPlayer() && HasPet() && (((Player*)this)->GetInfoStruct()->pet_behavior & 1)) {
+	if (IsPlayer() && HasPet() && (((Player*)this)->GetInfoStruct()->get_pet_behavior() & 1)) {
 		// If we have a combat pet add hate to it
 		if (((Player*)this)->GetPet())
 			AddHate(((Player*)this)->GetPet(), 1);
@@ -1247,7 +1248,7 @@ void Entity::SetAttackDelay(bool primary, bool ranged) {
 }
 
 float Entity::CalculateAttackSpeedMod(){
-	float aspeed = info_struct.attackspeed;
+	float aspeed = info_struct.get_attackspeed();
 	
 	if(aspeed > 0) {
 		if (aspeed <= 100)

+ 41 - 23
EQ2/source/WorldServer/Commands/Commands.cpp

@@ -155,6 +155,7 @@ Commands::Commands(){
 	spawn_set_values["merchant_min_level"] = SPAWN_SET_VALUE_MERCHANT_MIN_LEVEL;
 	spawn_set_values["merchant_max_level"] = SPAWN_SET_VALUE_MERCHANT_MAX_LEVEL;
 	spawn_set_values["skin_color"] = SPAWN_SET_SKIN_COLOR;
+	spawn_set_values["aaxp_rewards"] = SPAWN_SET_AAXP_REWARDS;
 
 	zone_set_values["expansion_id"] = ZONE_SET_VALUE_EXPANSION_ID;
 	zone_set_values["name"] = ZONE_SET_VALUE_NAME;
@@ -520,6 +521,10 @@ bool Commands::SetSpawnCommand(Client* client, Spawn* target, int8 type, const c
 				}
 				break;
 			}
+			case SPAWN_SET_AAXP_REWARDS: {
+				target->SetAAXPRewards(atoul(value));
+				break;
+			}
 
 			if(temp_value)
 				*temp_value = string(tmp);
@@ -540,7 +545,7 @@ bool Commands::SetSpawnCommand(Client* client, Spawn* target, int8 type, const c
 			if (target->GetDatabaseID() > 0)
 			{
 				char query[256];
-				snprintf(query, 256, "update spawn set expansion_flag=%i where id=%i", atoul(value), target->GetDatabaseID());
+				snprintf(query, 256, "update spawn set expansion_flag=%u where id=%i", atoul(value), target->GetDatabaseID());
 				if (database.RunQuery(query, strnlen(query, 256)))
 				{
 					client->Message(CHANNEL_COLOR_RED, "Ran query:%s", query);
@@ -553,7 +558,20 @@ bool Commands::SetSpawnCommand(Client* client, Spawn* target, int8 type, const c
 			if (target->GetDatabaseID() > 0)
 			{
 				char query[256];
-				snprintf(query, 256, "update spawn set holiday_flag=%i where id=%i", atoul(value), target->GetDatabaseID());
+				snprintf(query, 256, "update spawn set holiday_flag=%u where id=%i", atoul(value), target->GetDatabaseID());
+				if (database.RunQuery(query, strnlen(query, 256)))
+				{
+					client->Message(CHANNEL_COLOR_RED, "Ran query:%s", query);
+				}
+			}
+			break;
+		}
+		case SPAWN_SET_AAXP_REWARDS: {
+
+			if (target->GetDatabaseID() > 0)
+			{
+				char query[256];
+				snprintf(query, 256, "update spawn set aaxp_rewards=%u where id=%i", atoul(value), target->GetDatabaseID());
 				if (database.RunQuery(query, strnlen(query, 256)))
 				{
 					client->Message(CHANNEL_COLOR_RED, "Ran query:%s", query);
@@ -1782,7 +1800,7 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 		case COMMAND_RACE:{
 			if(sep && sep->arg[0][0] && sep->IsNumber(0)){
 				if(sep->arg[1][0] && sep->IsNumber(1)){
-					client->GetPlayer()->GetInfoStruct()->race = atoi(sep->arg[1]);
+					client->GetPlayer()->GetInfoStruct()->set_race(atoi(sep->arg[1]));
 					client->GetPlayer()->SetRace(atoi(sep->arg[1]));
 					client->UpdateTimeStampFlag ( RACE_UPDATE_FLAG );
 					client->GetPlayer()->SetCharSheetChanged(true);
@@ -1978,7 +1996,7 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 						   }
 		case COMMAND_GENDER:{
 			if(sep && sep->arg[ndx][0]){
-				client->GetPlayer()->GetInfoStruct()->gender = atoi(sep->arg[ndx]);
+				client->GetPlayer()->GetInfoStruct()->set_gender(atoi(sep->arg[ndx]));
 				client->GetPlayer()->SetCharSheetChanged(true);
 				client->UpdateTimeStampFlag ( GENDER_UPDATE_FLAG );
 			}else{
@@ -2265,8 +2283,7 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 								  }
 		case COMMAND_NAME:{
 			if(sep && sep->arg[ndx][0]){
-				memset(client->GetPlayer()->GetInfoStruct()->name, 0, 40);
-				strncpy(client->GetPlayer()->GetInfoStruct()->name, sep->arg[ndx], 39);
+				client->GetPlayer()->GetInfoStruct()->set_name(std::string(sep->arg[ndx]).substr(0,39));
 				client->GetPlayer()->SetCharSheetChanged(true);
 			}else
 				client->Message(CHANNEL_COLOR_YELLOW,"Usage: /name {new_name}");
@@ -3833,8 +3850,9 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
 								case SPAWN_SET_VALUE_EXPANSION_FLAG:
 								case SPAWN_SET_VALUE_HOLIDAY_FLAG:
 								case SPAWN_SET_VALUE_FACTION:
+								case SPAWN_SET_AAXP_REWARDS:
 								{
-									// not applicable
+									// not applicable already ran db command
 									break;
 								}
 								default:
@@ -6430,9 +6448,9 @@ void Commands::Command_ModifyCharacter(Client* client, Seperator* sep)
 				int8 tsclass = atoi(sep->arg[2]);
 
 				player->SetTradeskillClass(tsclass);
-				player->GetInfoStruct()->tradeskill_class1 = classes.GetTSBaseClass(player->GetTradeskillClass());
-				player->GetInfoStruct()->tradeskill_class2 = classes.GetSecondaryTSBaseClass(player->GetTradeskillClass());
-				player->GetInfoStruct()->tradeskill_class3 = player->GetTradeskillClass();
+				player->GetInfoStruct()->set_tradeskill_class1(classes.GetTSBaseClass(player->GetTradeskillClass()));
+				player->GetInfoStruct()->set_tradeskill_class2(classes.GetSecondaryTSBaseClass(player->GetTradeskillClass()));
+				player->GetInfoStruct()->set_tradeskill_class3(player->GetTradeskillClass());
 				player->SetCharSheetChanged(true);
 			}
 		}
@@ -6863,7 +6881,7 @@ void Commands::Command_Pet(Client* client, Seperator* sep)
 	
 	if (strcmp(sep->arg[0], "stay") == 0) {
 		client->Message(CHANNEL_COLOR_YELLOW, "You command your pet to stay.");
-		client->GetPlayer()->GetInfoStruct()->pet_movement = 1;
+		client->GetPlayer()->GetInfoStruct()->set_pet_movement(1);
 		client->GetPlayer()->SetCharSheetChanged(true);
 		if (client->GetPlayer()->GetPet())
 			client->GetPlayer()->GetPet()->following = false;
@@ -6872,28 +6890,28 @@ void Commands::Command_Pet(Client* client, Seperator* sep)
 	}
 	else if (strcmp(sep->arg[0], "follow") == 0) {
 		client->Message(CHANNEL_COLOR_YELLOW, "You command your pet to follow.");
-		client->GetPlayer()->GetInfoStruct()->pet_movement = 2;
+		client->GetPlayer()->GetInfoStruct()->set_pet_movement(2);
 		client->GetPlayer()->SetCharSheetChanged(true);
 	}
 	else if (strcmp(sep->arg[0], "preserve_master") == 0) {
-		if (client->GetPlayer()->GetInfoStruct()->pet_behavior & 1) {
+		if (client->GetPlayer()->GetInfoStruct()->get_pet_behavior() & 1) {
 			client->Message(CHANNEL_COLOR_YELLOW, "Your pet will no longer protect you.");
-			client->GetPlayer()->GetInfoStruct()->pet_behavior -= 1;
+			client->GetPlayer()->GetInfoStruct()->set_pet_behavior(client->GetPlayer()->GetInfoStruct()->get_pet_behavior()-1);
 		}
 		else {
 			client->Message(CHANNEL_COLOR_YELLOW, "You command your pet to protect you.");
-			client->GetPlayer()->GetInfoStruct()->pet_behavior += 1;
+			client->GetPlayer()->GetInfoStruct()->set_pet_behavior(client->GetPlayer()->GetInfoStruct()->get_pet_behavior()+1);
 		}
 		client->GetPlayer()->SetCharSheetChanged(true);
 	}
 	else if (strcmp(sep->arg[0], "preserve_self") == 0) {
-		if (client->GetPlayer()->GetInfoStruct()->pet_behavior & 2) {
+		if (client->GetPlayer()->GetInfoStruct()->get_pet_behavior() & 2) {
 			client->Message(CHANNEL_COLOR_YELLOW, "Your pet will no longer protect itself.");
-			client->GetPlayer()->GetInfoStruct()->pet_behavior -= 2;
+			client->GetPlayer()->GetInfoStruct()->set_pet_behavior(client->GetPlayer()->GetInfoStruct()->get_pet_behavior()-2);
 		}
 		else {
 			client->Message(CHANNEL_COLOR_YELLOW, "You command your pet to protect itself.");
-			client->GetPlayer()->GetInfoStruct()->pet_behavior += 2;
+			client->GetPlayer()->GetInfoStruct()->set_pet_behavior(client->GetPlayer()->GetInfoStruct()->get_pet_behavior()+2);
 		}
 		client->GetPlayer()->SetCharSheetChanged(true);
 	}
@@ -6903,7 +6921,7 @@ void Commands::Command_Pet(Client* client, Seperator* sep)
 			((NPC*)client->GetPlayer()->GetPet())->Brain()->ClearHate();
 		if (client->GetPlayer()->GetCharmedPet())
 			((NPC*)client->GetPlayer()->GetCharmedPet())->Brain()->ClearHate();
-		client->GetPlayer()->GetInfoStruct()->pet_behavior = 0;
+		client->GetPlayer()->GetInfoStruct()->set_pet_behavior(0);
 		client->GetPlayer()->SetCharSheetChanged(true);
 	}
 	else if (strcmp(sep->arg[0], "attack") == 0) {
@@ -9977,14 +9995,14 @@ void Commands::Command_ConsumeFood(Client* client, Seperator* sep) {
 void Commands::Command_Aquaman(Client* client, Seperator* sep) {
 	if (sep && sep->arg[0] && sep->IsNumber(0)) {
 		if (atoi(sep->arg[0]) == 1) {
-			client->GetPlayer()->GetInfoStruct()->vision = 4;
-			client->GetPlayer()->GetInfoStruct()->breathe_underwater = 1;
+			client->GetPlayer()->GetInfoStruct()->set_vision(4);
+			client->GetPlayer()->GetInfoStruct()->set_breathe_underwater(1);
 			client->GetPlayer()->SetCharSheetChanged(true);
 			client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Maybe you ought to stick to the shallow end until you know how to swim.");
 		}
 		else {
-			client->GetPlayer()->GetInfoStruct()->vision = 0;
-			client->GetPlayer()->GetInfoStruct()->breathe_underwater = 0;
+			client->GetPlayer()->GetInfoStruct()->set_vision(0);
+			client->GetPlayer()->GetInfoStruct()->set_breathe_underwater(0);
 			client->GetPlayer()->SetCharSheetChanged(true);
 			client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Aquaman mode turned off.");
 		}

+ 1 - 0
EQ2/source/WorldServer/Commands/Commands.h

@@ -517,6 +517,7 @@ private:
 #define SPAWN_SET_VALUE_MERCHANT_MAX_LEVEL  61
 #define SPAWN_SET_VALUE_HOLIDAY_FLAG		62
 #define SPAWN_SET_SKIN_COLOR				63
+#define SPAWN_SET_AAXP_REWARDS				64
 
 #define ZONE_SET_VALUE_EXPANSION_ID			0
 #define ZONE_SET_VALUE_NAME					1

+ 663 - 141
EQ2/source/WorldServer/Entity.cpp

@@ -35,6 +35,7 @@ extern MasterSpellList master_spell_list;
 extern Classes classes;
 
 Entity::Entity(){
+	MapInfoStruct();	
 	max_speed = 6;
 	base_speed = 0.0f;
 	last_x = -1;
@@ -47,7 +48,7 @@ Entity::Entity(){
 	casting = false;
 	memset(&melee_combat_data, 0, sizeof(CombatData));
 	memset(&ranged_combat_data, 0, sizeof(CombatData));
-	memset(&info_struct, 0, sizeof(InfoStruct));
+	//memset(&info_struct, 0, sizeof(InfoStruct));
 	memset(&features, 0, sizeof(CharFeatures));
 	memset(&equipment, 0, sizeof(EQ2_Equipment));
 	pet = 0;
@@ -70,15 +71,8 @@ Entity::Entity(){
 		control_effects[i] = NULL;
 
 	immunities.clear();
-
-	for(int i=0;i<45;i++){
-		if(i<NUM_MAINTAINED_EFFECTS){
-			info_struct.maintained_effects[i].spell_id = 0xFFFFFFFF;
-			if (IsPlayer())
-				info_struct.maintained_effects[i].icon = 0xFFFF;
-		}
-		info_struct.spell_effects[i].spell_id = 0xFFFFFFFF;	
-	}
+	
+	info_struct.ResetEffects(this);
 
 	MCommandMutex.SetName("Entity::MCommandMutex");
 	hasSeeInvisSpell = false;
@@ -102,6 +96,275 @@ Entity::~Entity(){
 	immunities.clear();
 }
 
+void Entity::MapInfoStruct()
+{
+/** GETS **/
+	get_string_funcs["name"] = l::bind(&InfoStruct::get_name, &info_struct);
+	get_int8_funcs["class1"] = l::bind(&InfoStruct::get_class1, &info_struct);
+	get_int8_funcs["class2"] = l::bind(&InfoStruct::get_class2, &info_struct);
+	get_int8_funcs["class3"] = l::bind(&InfoStruct::get_class3, &info_struct);
+	get_int8_funcs["race"] = l::bind(&InfoStruct::get_race, &info_struct);
+	get_int8_funcs["gender"] = l::bind(&InfoStruct::get_gender, &info_struct);
+	get_int16_funcs["level"] = l::bind(&InfoStruct::get_level, &info_struct);
+	get_int16_funcs["max_level"] = l::bind(&InfoStruct::get_max_level, &info_struct);
+	get_int16_funcs["tradeskill_level"] = l::bind(&InfoStruct::get_tradeskill_level, &info_struct);
+	get_int16_funcs["tradeskill_max_level"] = l::bind(&InfoStruct::get_tradeskill_max_level, &info_struct);
+	get_int8_funcs["cur_concentration"] = l::bind(&InfoStruct::get_cur_concentration, &info_struct);
+	get_int8_funcs["max_concentration"] = l::bind(&InfoStruct::get_max_concentration, &info_struct);
+	get_int16_funcs["cur_attack"] = l::bind(&InfoStruct::get_cur_attack, &info_struct);
+	get_int16_funcs["attack_base"] = l::bind(&InfoStruct::get_attack_base, &info_struct);
+	get_int16_funcs["cur_mitigation"] = l::bind(&InfoStruct::get_cur_mitigation, &info_struct);
+	get_int16_funcs["max_mitigation"] = l::bind(&InfoStruct::get_max_mitigation, &info_struct);
+	get_int16_funcs["mitigation_base"] = l::bind(&InfoStruct::get_mitigation_base, &info_struct);
+	get_int16_funcs["avoidance_display"] = l::bind(&InfoStruct::get_avoidance_display, &info_struct);
+	get_int16_funcs["cur_avoidance"] = l::bind(&InfoStruct::get_cur_avoidance, &info_struct);
+	get_int16_funcs["base_avoidance_pct"] = l::bind(&InfoStruct::get_base_avoidance_pct, &info_struct);
+	get_int16_funcs["avoidance_base"] = l::bind(&InfoStruct::get_avoidance_base, &info_struct);
+	get_int16_funcs["max_avoidance"] = l::bind(&InfoStruct::get_max_avoidance, &info_struct);
+	get_int16_funcs["parry"] = l::bind(&InfoStruct::get_parry, &info_struct);
+	get_int16_funcs["parry_base"] = l::bind(&InfoStruct::get_parry_base, &info_struct);
+	get_int16_funcs["deflection"] = l::bind(&InfoStruct::get_deflection, &info_struct);
+	get_int16_funcs["deflection_base"] = l::bind(&InfoStruct::get_deflection_base, &info_struct);
+	get_int16_funcs["block"] = l::bind(&InfoStruct::get_block, &info_struct);
+	get_int16_funcs["block_base"] = l::bind(&InfoStruct::get_block_base, &info_struct);
+	get_float_funcs["str"] = l::bind(&InfoStruct::get_str, &info_struct);
+	get_float_funcs["sta"] = l::bind(&InfoStruct::get_sta, &info_struct);
+	get_float_funcs["agi"] = l::bind(&InfoStruct::get_agi, &info_struct);
+	get_float_funcs["wis"] = l::bind(&InfoStruct::get_wis, &info_struct);
+	get_float_funcs["intel"] = l::bind(&InfoStruct::get_intel, &info_struct);
+	get_float_funcs["str_base"] = l::bind(&InfoStruct::get_str_base, &info_struct);
+	get_float_funcs["sta_base"] = l::bind(&InfoStruct::get_sta_base, &info_struct);
+	get_float_funcs["agi_base"] = l::bind(&InfoStruct::get_agi_base, &info_struct);
+	get_float_funcs["wis_base"] = l::bind(&InfoStruct::get_wis_base, &info_struct);
+	get_float_funcs["intel_base"] = l::bind(&InfoStruct::get_intel_base, &info_struct);
+	get_int16_funcs["heat"] = l::bind(&InfoStruct::get_heat, &info_struct);
+	get_int16_funcs["cold"] = l::bind(&InfoStruct::get_cold, &info_struct);
+	get_int16_funcs["magic"] = l::bind(&InfoStruct::get_magic, &info_struct);
+	get_int16_funcs["mental"] = l::bind(&InfoStruct::get_mental, &info_struct);
+	get_int16_funcs["divine"] = l::bind(&InfoStruct::get_divine, &info_struct);
+	get_int16_funcs["disease"] = l::bind(&InfoStruct::get_disease, &info_struct);
+	get_int16_funcs["poison"] = l::bind(&InfoStruct::get_poison, &info_struct);
+	get_int16_funcs["disease_base"] = l::bind(&InfoStruct::get_disease_base, &info_struct);
+	get_int16_funcs["cold_base"] = l::bind(&InfoStruct::get_cold_base, &info_struct);
+	get_int16_funcs["divine_base"] = l::bind(&InfoStruct::get_divine_base, &info_struct);
+	get_int16_funcs["magic_base"] = l::bind(&InfoStruct::get_magic_base, &info_struct);
+	get_int16_funcs["mental_base"] = l::bind(&InfoStruct::get_mental_base, &info_struct);
+	get_int16_funcs["heat_base"] = l::bind(&InfoStruct::get_heat_base, &info_struct);
+	get_int16_funcs["poison_base"] = l::bind(&InfoStruct::get_poison_base, &info_struct);
+	get_int16_funcs["elemental_base"] = l::bind(&InfoStruct::get_elemental_base, &info_struct);
+	get_int16_funcs["noxious_base"] = l::bind(&InfoStruct::get_noxious_base, &info_struct);
+	get_int16_funcs["arcane_base"] = l::bind(&InfoStruct::get_arcane_base, &info_struct);
+	get_int32_funcs["coin_copper"] = l::bind(&InfoStruct::get_coin_copper, &info_struct);
+	get_int32_funcs["coin_silver"] = l::bind(&InfoStruct::get_coin_silver, &info_struct);
+	get_int32_funcs["coin_gold"] = l::bind(&InfoStruct::get_coin_gold, &info_struct);
+	get_int32_funcs["coin_plat"] = l::bind(&InfoStruct::get_coin_plat, &info_struct);
+	get_int32_funcs["bank_coin_copper"] = l::bind(&InfoStruct::get_bank_coin_copper, &info_struct);
+	get_int32_funcs["bank_coin_silver"] = l::bind(&InfoStruct::get_bank_coin_silver, &info_struct);
+	get_int32_funcs["bank_coin_gold"] = l::bind(&InfoStruct::get_bank_coin_gold, &info_struct);
+	get_int32_funcs["bank_coin_plat"] = l::bind(&InfoStruct::get_bank_coin_plat, &info_struct);
+	get_int32_funcs["status_points"] = l::bind(&InfoStruct::get_status_points, &info_struct);
+	get_string_funcs["deity"] = l::bind(&InfoStruct::get_deity, &info_struct);
+	get_int32_funcs["weight"] = l::bind(&InfoStruct::get_weight, &info_struct);
+	get_int32_funcs["max_weight"] = l::bind(&InfoStruct::get_max_weight, &info_struct);
+	get_int8_funcs["tradeskill_class1"] = l::bind(&InfoStruct::get_tradeskill_class1, &info_struct);
+	get_int8_funcs["tradeskill_class2"] = l::bind(&InfoStruct::get_tradeskill_class2, &info_struct);
+	get_int8_funcs["tradeskill_class3"] = l::bind(&InfoStruct::get_tradeskill_class3, &info_struct);
+	get_int16_funcs["account_age_base"] = l::bind(&InfoStruct::get_account_age_base, &info_struct);
+	//	int8			account_age_bonus_[19];
+	get_int16_funcs["absorb"] = l::bind(&InfoStruct::get_absorb, &info_struct);
+	get_int32_funcs["xp"] = l::bind(&InfoStruct::get_xp, &info_struct);
+	get_int32_funcs["xp_needed"] = l::bind(&InfoStruct::get_xp_needed, &info_struct);
+	get_int32_funcs["xp_debt"] = l::bind(&InfoStruct::get_xp_debt, &info_struct);
+	get_int16_funcs["xp_yellow"] = l::bind(&InfoStruct::get_xp_yellow, &info_struct);
+	get_int16_funcs["xp_yellow_vitality_bar"] = l::bind(&InfoStruct::get_xp_yellow_vitality_bar, &info_struct);
+	get_int16_funcs["xp_blue_vitality_bar"] = l::bind(&InfoStruct::get_xp_blue_vitality_bar, &info_struct);
+	get_int16_funcs["xp_blue"] = l::bind(&InfoStruct::get_xp_blue, &info_struct);
+	get_int32_funcs["ts_xp"] = l::bind(&InfoStruct::get_ts_xp, &info_struct);
+	get_int32_funcs["ts_xp_needed"] = l::bind(&InfoStruct::get_ts_xp_needed, &info_struct);
+	get_int16_funcs["tradeskill_exp_yellow"] = l::bind(&InfoStruct::get_tradeskill_exp_yellow, &info_struct);
+	get_int16_funcs["tradeskill_exp_blue"] = l::bind(&InfoStruct::get_tradeskill_exp_blue, &info_struct);
+	get_int32_funcs["flags"] = l::bind(&InfoStruct::get_flags, &info_struct);
+	get_int32_funcs["flags2"] = l::bind(&InfoStruct::get_flags2, &info_struct);
+	get_float_funcs["xp_vitality"] = l::bind(&InfoStruct::get_xp_vitality, &info_struct);
+	get_float_funcs["tradeskill_xp_vitality"] = l::bind(&InfoStruct::get_tradeskill_xp_vitality, &info_struct);
+	get_int16_funcs["mitigation_skill1"] = l::bind(&InfoStruct::get_mitigation_skill1, &info_struct);
+	get_int16_funcs["mitigation_skill2"] = l::bind(&InfoStruct::get_mitigation_skill2, &info_struct);
+	get_int16_funcs["mitigation_skill3"] = l::bind(&InfoStruct::get_mitigation_skill3, &info_struct);
+	get_float_funcs["ability_modifier"] = l::bind(&InfoStruct::get_ability_modifier, &info_struct);
+	get_float_funcs["critical_mitigation"] = l::bind(&InfoStruct::get_critical_mitigation, &info_struct);
+	get_float_funcs["block_chance"] = l::bind(&InfoStruct::get_block_chance, &info_struct);
+	get_float_funcs["uncontested_parry"] = l::bind(&InfoStruct::get_uncontested_parry, &info_struct);
+	get_float_funcs["uncontested_block"] = l::bind(&InfoStruct::get_uncontested_block, &info_struct);
+	get_float_funcs["uncontested_dodge"] = l::bind(&InfoStruct::get_uncontested_dodge, &info_struct);
+	get_float_funcs["uncontested_riposte"] = l::bind(&InfoStruct::get_uncontested_riposte, &info_struct);
+	get_float_funcs["crit_chance"] = l::bind(&InfoStruct::get_crit_chance, &info_struct);
+	get_float_funcs["crit_bonus"] = l::bind(&InfoStruct::get_crit_bonus, &info_struct);
+	get_float_funcs["potency"] = l::bind(&InfoStruct::get_potency, &info_struct);
+	get_float_funcs["hate_mod"] = l::bind(&InfoStruct::get_hate_mod, &info_struct);
+	get_float_funcs["reuse_speed"] = l::bind(&InfoStruct::get_reuse_speed, &info_struct);
+	get_float_funcs["casting_speed"] = l::bind(&InfoStruct::get_casting_speed, &info_struct);
+	get_float_funcs["recovery_speed"] = l::bind(&InfoStruct::get_recovery_speed, &info_struct);
+	get_float_funcs["spell_reuse_speed"] = l::bind(&InfoStruct::get_spell_reuse_speed, &info_struct);
+	get_float_funcs["spell_multi_attack"] = l::bind(&InfoStruct::get_spell_multi_attack, &info_struct);
+	get_float_funcs["dps"] = l::bind(&InfoStruct::get_dps, &info_struct);
+	get_float_funcs["dps_multiplier"] = l::bind(&InfoStruct::get_dps_multiplier, &info_struct);
+	get_float_funcs["attackspeed"] = l::bind(&InfoStruct::get_attackspeed, &info_struct);
+	get_float_funcs["haste"] = l::bind(&InfoStruct::get_haste, &info_struct);
+	get_float_funcs["multi_attack"] = l::bind(&InfoStruct::get_multi_attack, &info_struct);
+	get_float_funcs["flurry"] = l::bind(&InfoStruct::get_flurry, &info_struct);
+	get_float_funcs["melee_ae"] = l::bind(&InfoStruct::get_melee_ae, &info_struct);
+	get_float_funcs["strikethrough"] = l::bind(&InfoStruct::get_strikethrough, &info_struct);
+	get_float_funcs["accuracy"] = l::bind(&InfoStruct::get_accuracy, &info_struct);
+	get_float_funcs["offensivespeed"] = l::bind(&InfoStruct::get_offensivespeed, &info_struct);
+	get_float_funcs["rain"] = l::bind(&InfoStruct::get_rain, &info_struct);
+	get_float_funcs["wind"] = l::bind(&InfoStruct::get_wind, &info_struct);
+	get_sint8_funcs["alignment"] = l::bind(&InfoStruct::get_alignment, &info_struct);
+	get_int32_funcs["pet_id"] = l::bind(&InfoStruct::get_pet_id, &info_struct);
+	get_string_funcs["pet_name"] = l::bind(&InfoStruct::get_pet_name, &info_struct);
+	get_float_funcs["pet_health_pct"] = l::bind(&InfoStruct::get_pet_health_pct, &info_struct);
+	get_float_funcs["pet_power_pct"] = l::bind(&InfoStruct::get_pet_power_pct, &info_struct);
+	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_int8_funcs["vision"] = l::bind(&InfoStruct::get_vision, &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);
+
+
+/** SETS **/
+	set_string_funcs["name"] = l::bind(&InfoStruct::set_name, &info_struct, l::_1);
+	set_int8_funcs["class1"] = l::bind(&InfoStruct::set_class1, &info_struct, l::_1);
+	set_int8_funcs["class2"] = l::bind(&InfoStruct::set_class2, &info_struct, l::_1);
+	set_int8_funcs["class3"] = l::bind(&InfoStruct::set_class3, &info_struct, l::_1);
+	set_int8_funcs["race"] = l::bind(&InfoStruct::set_race, &info_struct, l::_1);
+	set_int8_funcs["gender"] = l::bind(&InfoStruct::set_gender, &info_struct, l::_1);
+	set_int16_funcs["level"] = l::bind(&InfoStruct::set_level, &info_struct, l::_1);
+	set_int16_funcs["max_level"] = l::bind(&InfoStruct::set_max_level, &info_struct, l::_1);
+	set_int16_funcs["tradeskill_level"] = l::bind(&InfoStruct::set_tradeskill_level, &info_struct, l::_1);
+	set_int16_funcs["tradeskill_max_level"] = l::bind(&InfoStruct::set_tradeskill_max_level, &info_struct, l::_1);
+	set_int8_funcs["cur_concentration"] = l::bind(&InfoStruct::set_cur_concentration, &info_struct, l::_1);
+	set_int8_funcs["max_concentration"] = l::bind(&InfoStruct::set_max_concentration, &info_struct, l::_1);
+	set_int16_funcs["cur_attack"] = l::bind(&InfoStruct::set_cur_attack, &info_struct, l::_1);
+	set_int16_funcs["attack_base"] = l::bind(&InfoStruct::set_attack_base, &info_struct, l::_1);
+	set_int16_funcs["cur_mitigation"] = l::bind(&InfoStruct::set_cur_mitigation, &info_struct, l::_1);
+	set_int16_funcs["max_mitigation"] = l::bind(&InfoStruct::set_max_mitigation, &info_struct, l::_1);
+	set_int16_funcs["mitigation_base"] = l::bind(&InfoStruct::set_mitigation_base, &info_struct, l::_1);
+	set_int16_funcs["avoidance_display"] = l::bind(&InfoStruct::set_avoidance_display, &info_struct, l::_1);
+	set_int16_funcs["cur_avoidance"] = l::bind(&InfoStruct::set_cur_avoidance, &info_struct, l::_1);
+	set_int16_funcs["base_avoidance_pct"] = l::bind(&InfoStruct::set_base_avoidance_pct, &info_struct, l::_1);
+	set_int16_funcs["avoidance_base"] = l::bind(&InfoStruct::set_avoidance_base, &info_struct, l::_1);
+	set_int16_funcs["max_avoidance"] = l::bind(&InfoStruct::set_max_avoidance, &info_struct, l::_1);
+	set_int16_funcs["parry"] = l::bind(&InfoStruct::set_parry, &info_struct, l::_1);
+	set_int16_funcs["parry_base"] = l::bind(&InfoStruct::set_parry_base, &info_struct, l::_1);
+	set_int16_funcs["deflection"] = l::bind(&InfoStruct::set_deflection, &info_struct, l::_1);
+	set_int16_funcs["deflection_base"] = l::bind(&InfoStruct::set_deflection_base, &info_struct, l::_1);
+	set_int16_funcs["block"] = l::bind(&InfoStruct::set_block, &info_struct, l::_1);
+	set_int16_funcs["block_base"] = l::bind(&InfoStruct::set_block_base, &info_struct, l::_1);
+	set_float_funcs["str"] = l::bind(&InfoStruct::set_str, &info_struct, l::_1);
+	set_float_funcs["sta"] = l::bind(&InfoStruct::set_sta, &info_struct, l::_1);
+	set_float_funcs["agi"] = l::bind(&InfoStruct::set_agi, &info_struct, l::_1);
+	set_float_funcs["wis"] = l::bind(&InfoStruct::set_wis, &info_struct, l::_1);
+	set_float_funcs["intel"] = l::bind(&InfoStruct::set_intel, &info_struct, l::_1);
+	set_float_funcs["str_base"] = l::bind(&InfoStruct::set_str_base, &info_struct, l::_1);
+	set_float_funcs["sta_base"] = l::bind(&InfoStruct::set_sta_base, &info_struct, l::_1);
+	set_float_funcs["agi_base"] = l::bind(&InfoStruct::set_agi_base, &info_struct, l::_1);
+	set_float_funcs["wis_base"] = l::bind(&InfoStruct::set_wis_base, &info_struct, l::_1);
+	set_float_funcs["intel_base"] = l::bind(&InfoStruct::set_intel_base, &info_struct, l::_1);
+	set_int16_funcs["heat"] = l::bind(&InfoStruct::set_heat, &info_struct, l::_1);
+	set_int16_funcs["cold"] = l::bind(&InfoStruct::set_cold, &info_struct, l::_1);
+	set_int16_funcs["magic"] = l::bind(&InfoStruct::set_magic, &info_struct, l::_1);
+	set_int16_funcs["mental"] = l::bind(&InfoStruct::set_mental, &info_struct, l::_1);
+	set_int16_funcs["divine"] = l::bind(&InfoStruct::set_divine, &info_struct, l::_1);
+	set_int16_funcs["disease"] = l::bind(&InfoStruct::set_disease, &info_struct, l::_1);
+	set_int16_funcs["poison"] = l::bind(&InfoStruct::set_poison, &info_struct, l::_1);
+	set_int16_funcs["disease_base"] = l::bind(&InfoStruct::set_disease_base, &info_struct, l::_1);
+	set_int16_funcs["cold_base"] = l::bind(&InfoStruct::set_cold_base, &info_struct, l::_1);
+	set_int16_funcs["divine_base"] = l::bind(&InfoStruct::set_divine_base, &info_struct, l::_1);
+	set_int16_funcs["magic_base"] = l::bind(&InfoStruct::set_magic_base, &info_struct, l::_1);
+	set_int16_funcs["mental_base"] = l::bind(&InfoStruct::set_mental_base, &info_struct, l::_1);
+	set_int16_funcs["heat_base"] = l::bind(&InfoStruct::set_heat_base, &info_struct, l::_1);
+	set_int16_funcs["poison_base"] = l::bind(&InfoStruct::set_poison_base, &info_struct, l::_1);
+	set_int16_funcs["elemental_base"] = l::bind(&InfoStruct::set_elemental_base, &info_struct, l::_1);
+	set_int16_funcs["noxious_base"] = l::bind(&InfoStruct::set_noxious_base, &info_struct, l::_1);
+	set_int16_funcs["arcane_base"] = l::bind(&InfoStruct::set_arcane_base, &info_struct, l::_1);
+	set_int32_funcs["coin_copper"] = l::bind(&InfoStruct::set_coin_copper, &info_struct, l::_1);
+	set_int32_funcs["coin_silver"] = l::bind(&InfoStruct::set_coin_silver, &info_struct, l::_1);
+	set_int32_funcs["coin_gold"] = l::bind(&InfoStruct::set_coin_gold, &info_struct, l::_1);
+	set_int32_funcs["coin_plat"] = l::bind(&InfoStruct::set_coin_plat, &info_struct, l::_1);
+	set_int32_funcs["bank_coin_copper"] = l::bind(&InfoStruct::set_bank_coin_copper, &info_struct, l::_1);
+	set_int32_funcs["bank_coin_silver"] = l::bind(&InfoStruct::set_bank_coin_silver, &info_struct, l::_1);
+	set_int32_funcs["bank_coin_gold"] = l::bind(&InfoStruct::set_bank_coin_gold, &info_struct, l::_1);
+	set_int32_funcs["bank_coin_plat"] = l::bind(&InfoStruct::set_bank_coin_plat, &info_struct, l::_1);
+	set_int32_funcs["status_points"] = l::bind(&InfoStruct::set_status_points, &info_struct, l::_1);
+	set_string_funcs["deity"] = l::bind(&InfoStruct::set_deity, &info_struct, l::_1);
+	set_int32_funcs["weight"] = l::bind(&InfoStruct::set_weight, &info_struct, l::_1);
+	set_int32_funcs["max_weight"] = l::bind(&InfoStruct::set_max_weight, &info_struct, l::_1);
+	set_int8_funcs["tradeskill_class1"] = l::bind(&InfoStruct::set_tradeskill_class1, &info_struct, l::_1);
+	set_int8_funcs["tradeskill_class2"] = l::bind(&InfoStruct::set_tradeskill_class2, &info_struct, l::_1);
+	set_int8_funcs["tradeskill_class3"] = l::bind(&InfoStruct::set_tradeskill_class3, &info_struct, l::_1);
+	set_int16_funcs["account_age_base"] = l::bind(&InfoStruct::set_account_age_base, &info_struct, l::_1);
+	//	int8			account_age_bonus_[19];
+	set_int16_funcs["absorb"] = l::bind(&InfoStruct::set_absorb, &info_struct, l::_1);
+	set_int32_funcs["xp"] = l::bind(&InfoStruct::set_xp, &info_struct, l::_1);
+	set_int32_funcs["xp_needed"] = l::bind(&InfoStruct::set_xp_needed, &info_struct, l::_1);
+	set_int32_funcs["xp_debt"] = l::bind(&InfoStruct::set_xp_debt, &info_struct, l::_1);
+	set_int16_funcs["xp_yellow"] = l::bind(&InfoStruct::set_xp_yellow, &info_struct, l::_1);
+	set_int16_funcs["xp_yellow_vitality_bar"] = l::bind(&InfoStruct::set_xp_yellow_vitality_bar, &info_struct, l::_1);
+	set_int16_funcs["xp_blue_vitality_bar"] = l::bind(&InfoStruct::set_xp_blue_vitality_bar, &info_struct, l::_1);
+	set_int16_funcs["xp_blue"] = l::bind(&InfoStruct::set_xp_blue, &info_struct, l::_1);
+	set_int32_funcs["ts_xp"] = l::bind(&InfoStruct::set_ts_xp, &info_struct, l::_1);
+	set_int32_funcs["ts_xp_needed"] = l::bind(&InfoStruct::set_ts_xp_needed, &info_struct, l::_1);
+	set_int16_funcs["tradeskill_exp_yellow"] = l::bind(&InfoStruct::set_tradeskill_exp_yellow, &info_struct, l::_1);
+	set_int16_funcs["tradeskill_exp_blue"] = l::bind(&InfoStruct::set_tradeskill_exp_blue, &info_struct, l::_1);
+	set_int32_funcs["flags"] = l::bind(&InfoStruct::set_flags, &info_struct, l::_1);
+	set_int32_funcs["flags2"] = l::bind(&InfoStruct::set_flags2, &info_struct, l::_1);
+	set_float_funcs["xp_vitality"] = l::bind(&InfoStruct::set_xp_vitality, &info_struct, l::_1);
+	set_float_funcs["tradeskill_xp_vitality"] = l::bind(&InfoStruct::set_tradeskill_xp_vitality, &info_struct, l::_1);
+	set_int16_funcs["mitigation_skill1"] = l::bind(&InfoStruct::set_mitigation_skill1, &info_struct, l::_1);
+	set_int16_funcs["mitigation_skill2"] = l::bind(&InfoStruct::set_mitigation_skill2, &info_struct, l::_1);
+	set_int16_funcs["mitigation_skill3"] = l::bind(&InfoStruct::set_mitigation_skill3, &info_struct, l::_1);
+	set_float_funcs["ability_modifier"] = l::bind(&InfoStruct::set_ability_modifier, &info_struct, l::_1);
+	set_float_funcs["critical_mitigation"] = l::bind(&InfoStruct::set_critical_mitigation, &info_struct, l::_1);
+	set_float_funcs["block_chance"] = l::bind(&InfoStruct::set_block_chance, &info_struct, l::_1);
+	set_float_funcs["uncontested_parry"] = l::bind(&InfoStruct::set_uncontested_parry, &info_struct, l::_1);
+	set_float_funcs["uncontested_block"] = l::bind(&InfoStruct::set_uncontested_block, &info_struct, l::_1);
+	set_float_funcs["uncontested_dodge"] = l::bind(&InfoStruct::set_uncontested_dodge, &info_struct, l::_1);
+	set_float_funcs["uncontested_riposte"] = l::bind(&InfoStruct::set_uncontested_riposte, &info_struct, l::_1);
+	set_float_funcs["crit_chance"] = l::bind(&InfoStruct::set_crit_chance, &info_struct, l::_1);
+	set_float_funcs["crit_bonus"] = l::bind(&InfoStruct::set_crit_bonus, &info_struct, l::_1);
+	set_float_funcs["potency"] = l::bind(&InfoStruct::set_potency, &info_struct, l::_1);
+	set_float_funcs["hate_mod"] = l::bind(&InfoStruct::set_hate_mod, &info_struct, l::_1);
+	set_float_funcs["reuse_speed"] = l::bind(&InfoStruct::set_reuse_speed, &info_struct, l::_1);
+	set_float_funcs["casting_speed"] = l::bind(&InfoStruct::set_casting_speed, &info_struct, l::_1);
+	set_float_funcs["recovery_speed"] = l::bind(&InfoStruct::set_recovery_speed, &info_struct, l::_1);
+	set_float_funcs["spell_reuse_speed"] = l::bind(&InfoStruct::set_spell_reuse_speed, &info_struct, l::_1);
+	set_float_funcs["spell_multi_attack"] = l::bind(&InfoStruct::set_spell_multi_attack, &info_struct, l::_1);
+	set_float_funcs["dps"] = l::bind(&InfoStruct::set_dps, &info_struct, l::_1);
+	set_float_funcs["dps_multiplier"] = l::bind(&InfoStruct::set_dps_multiplier, &info_struct, l::_1);
+	set_float_funcs["attackspeed"] = l::bind(&InfoStruct::set_attackspeed, &info_struct, l::_1);
+	set_float_funcs["haste"] = l::bind(&InfoStruct::set_haste, &info_struct, l::_1);
+	set_float_funcs["multi_attack"] = l::bind(&InfoStruct::set_multi_attack, &info_struct, l::_1);
+	set_float_funcs["flurry"] = l::bind(&InfoStruct::set_flurry, &info_struct, l::_1);
+	set_float_funcs["melee_ae"] = l::bind(&InfoStruct::set_melee_ae, &info_struct, l::_1);
+	set_float_funcs["strikethrough"] = l::bind(&InfoStruct::set_strikethrough, &info_struct, l::_1);
+	set_float_funcs["accuracy"] = l::bind(&InfoStruct::set_accuracy, &info_struct, l::_1);
+	set_float_funcs["offensivespeed"] = l::bind(&InfoStruct::set_offensivespeed, &info_struct, l::_1);
+	set_float_funcs["rain"] = l::bind(&InfoStruct::set_rain, &info_struct, l::_1);
+	set_float_funcs["wind"] = l::bind(&InfoStruct::set_wind, &info_struct, l::_1);
+	set_sint8_funcs["alignment"] = l::bind(&InfoStruct::set_alignment, &info_struct, l::_1);
+	set_int32_funcs["pet_id"] = l::bind(&InfoStruct::set_pet_id, &info_struct, l::_1);
+	set_string_funcs["pet_name"] = l::bind(&InfoStruct::set_pet_name, &info_struct, l::_1);
+	set_float_funcs["pet_health_pct"] = l::bind(&InfoStruct::set_pet_health_pct, &info_struct, l::_1);
+	set_float_funcs["pet_power_pct"] = l::bind(&InfoStruct::set_pet_power_pct, &info_struct, l::_1);
+	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_int8_funcs["vision"] = l::bind(&InfoStruct::set_vision, &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);
+
+}
+
 bool Entity::HasMoved(bool include_heading){
 	if(GetX() == last_x && GetY() == last_y && GetZ() == last_z && ((!include_heading) || (include_heading && GetHeading() == last_heading)))
 		return false;
@@ -117,123 +380,123 @@ bool Entity::HasMoved(bool include_heading){
 }
 
 int16 Entity::GetStr(){
-	return GetInfoStruct()->str;
+	return GetInfoStruct()->get_str();
 }
 
 int16 Entity::GetSta(){
-	return GetInfoStruct()->sta;
+	return GetInfoStruct()->get_sta();
 }
 
 int16 Entity::GetInt(){
-	return GetInfoStruct()->intel;
+	return GetInfoStruct()->get_intel();
 }
 
 int16 Entity::GetWis(){
-	return GetInfoStruct()->wis;
+	return GetInfoStruct()->get_wis();
 }
 
 int16 Entity::GetAgi(){
-	return GetInfoStruct()->agi;
+	return GetInfoStruct()->get_agi();
 }
 
 int16 Entity::GetPrimaryStat(){
 	int8 base_class = classes.GetBaseClass(GetAdventureClass());
 	if (base_class == FIGHTER) 
-		return GetInfoStruct()->str;	
+		return GetInfoStruct()->get_str();	
 	else if (base_class == PRIEST) 
-		return GetInfoStruct()->wis;
+		return GetInfoStruct()->get_wis();
 	else if (base_class == MAGE) 
-		return GetInfoStruct()->intel;
+		return GetInfoStruct()->get_intel();
 	else
-		return GetInfoStruct()->agi;
+		return GetInfoStruct()->get_agi();
 }
 
 int16 Entity::GetHeatResistance(){
-	return GetInfoStruct()->heat;
+	return GetInfoStruct()->get_heat();
 }
 
 int16 Entity::GetColdResistance(){
-	return GetInfoStruct()->cold;
+	return GetInfoStruct()->get_cold();
 }
 
 int16 Entity::GetMagicResistance(){
-	return GetInfoStruct()->magic;
+	return GetInfoStruct()->get_magic();
 }
 
 int16 Entity::GetMentalResistance(){
-	return GetInfoStruct()->mental;
+	return GetInfoStruct()->get_mental();
 }
 
 int16 Entity::GetDivineResistance(){
-	return GetInfoStruct()->divine;
+	return GetInfoStruct()->get_divine();
 }
 
 int16 Entity::GetDiseaseResistance(){
-	return GetInfoStruct()->disease;
+	return GetInfoStruct()->get_disease();
 }
 
 int16 Entity::GetPoisonResistance(){
-	return GetInfoStruct()->poison;
+	return GetInfoStruct()->get_poison();
 }
 
 int8 Entity::GetConcentrationCurrent() {
-	return GetInfoStruct()->cur_concentration;
+	return GetInfoStruct()->get_cur_concentration();
 }
 
 int8 Entity::GetConcentrationMax() {
-	return GetInfoStruct()->max_concentration;
+	return GetInfoStruct()->get_max_concentration();
 }
 
 int16 Entity::GetStrBase(){
-	return GetInfoStruct()->str_base;
+	return GetInfoStruct()->get_str_base();
 }
 
 int16 Entity::GetStaBase(){
-	return GetInfoStruct()->sta_base;
+	return GetInfoStruct()->get_sta_base();
 }
 
 int16 Entity::GetIntBase(){
-	return GetInfoStruct()->intel_base;
+	return GetInfoStruct()->get_intel_base();
 }
 
 int16 Entity::GetWisBase(){
-	return GetInfoStruct()->wis_base;
+	return GetInfoStruct()->get_wis_base();
 }
 
 int16 Entity::GetAgiBase(){
-	return GetInfoStruct()->agi_base;
+	return GetInfoStruct()->get_agi_base();
 }
 
 int16 Entity::GetHeatResistanceBase(){
-	return GetInfoStruct()->heat_base;
+	return GetInfoStruct()->get_heat_base();
 }
 
 int16 Entity::GetColdResistanceBase(){
-	return GetInfoStruct()->cold_base;
+	return GetInfoStruct()->get_cold_base();
 }
 
 int16 Entity::GetMagicResistanceBase(){
-	return GetInfoStruct()->magic_base;
+	return GetInfoStruct()->get_magic_base();
 }
 
 int16 Entity::GetMentalResistanceBase(){
-	return GetInfoStruct()->mental_base;
+	return GetInfoStruct()->get_mental_base();
 }
 
 int16 Entity::GetDivineResistanceBase(){
-	return GetInfoStruct()->divine_base;
+	return GetInfoStruct()->get_divine_base();
 }
 
 int16 Entity::GetDiseaseResistanceBase(){
-	return GetInfoStruct()->disease_base;
+	return GetInfoStruct()->get_disease_base();
 }
 
 int16 Entity::GetPoisonResistanceBase(){
-	return GetInfoStruct()->poison_base;
+	return GetInfoStruct()->get_poison_base();
 }
 
 sint8 Entity::GetAlignment(){
-	return GetInfoStruct()->alignment;
+	return GetInfoStruct()->get_alignment();
 }
 
 bool Entity::IsCasting(){
@@ -314,9 +577,9 @@ void Entity::ChangePrimaryWeapon(){
 		melee_combat_data.wield_type = 2;
 	}
 	if(IsNPC())
-		melee_combat_data.primary_weapon_damage_high += (int32)(GetInfoStruct()->str / 10);
+		melee_combat_data.primary_weapon_damage_high += (int32)(GetInfoStruct()->get_str() / 10);
 	else
-		melee_combat_data.primary_weapon_damage_high += (int32)(GetInfoStruct()->str / 25);
+		melee_combat_data.primary_weapon_damage_high += (int32)(GetInfoStruct()->get_str() / 25);
 }
 
 void Entity::ChangeSecondaryWeapon(){
@@ -334,9 +597,9 @@ void Entity::ChangeSecondaryWeapon(){
 		melee_combat_data.secondary_weapon_type = 1;
 	}
 	if(IsNPC())
-		melee_combat_data.secondary_weapon_damage_high += (int32)(GetInfoStruct()->str / 10);
+		melee_combat_data.secondary_weapon_damage_high += (int32)(GetInfoStruct()->get_str() / 10);
 	else
-		melee_combat_data.secondary_weapon_damage_high += (int32)(GetInfoStruct()->str / 25);
+		melee_combat_data.secondary_weapon_damage_high += (int32)(GetInfoStruct()->get_str() / 25);
 }
 
 void Entity::ChangeRangedWeapon(){
@@ -704,76 +967,80 @@ void Entity::SetMaxSpeed(float val){
 
 void Entity::CalculateBonuses(){
 	InfoStruct* info = &info_struct;
-	info->block = info->block_base;
+	info->set_block(info->get_block_base());
 	
-	info->cur_attack = info->attack_base;
-	info->cur_mitigation = info->mitigation_base;
-	info->base_avoidance_pct = info->avoidance_base;
+	info->set_cur_attack(info->get_attack_base());
+	info->set_cur_mitigation(info->get_mitigation_base());
+	info->set_base_avoidance_pct(info->get_avoidance_base());
 
 	LogWrite(MISC__TODO, 1, "TODO", "Calculate via current spells\n\t(%s, function: %s, line #: %i)", __FILE__, __FUNCTION__, __LINE__);
 
 	//info->cur_concentration = 0;
-	info->parry = info->parry_base;
-	info->deflection = info->deflection_base;
-
-	info->disease = info->disease_base;
-	info->divine = info->divine_base;
-	info->heat = info->heat_base;
-	info->magic = info->magic_base;
-	info->mental = info->mental_base;
-	info->cold = info->cold_base;
-	info->poison = info->poison_base;
-	info->elemental_base = info->heat;
-	info->noxious_base = info->poison;
-	info->arcane_base = info->magic;
-
-	info->sta = info->sta_base;
-	info->agi = info->agi_base;
-	info->str = info->str_base;
-	info->wis = info->wis_base;
-	info->intel = info->intel_base;
-	info->ability_modifier = 0;
-	info->critical_mitigation = 0;
-	info->block_chance = 0;
-	info->crit_chance = 0;
-	info->crit_bonus = 0;
-	info->potency = 0;
-	info->hate_mod = 0;
-	info->reuse_speed = 0;
-	info->casting_speed = 0;
-	info->recovery_speed = 0;
-	info->spell_reuse_speed = 0;
-	info->spell_multi_attack = 0;
-	info->dps = 0;
-	info->dps_multiplier = 0;
-	info->haste = 0;
-	info->attackspeed = 0;
-	info->multi_attack = 0;
-	info->flurry = 0;
-	info->melee_ae = 0;
-	info->strikethrough = 0;
-	info->accuracy = 0;
-	info->offensivespeed = 0;
+	info->set_parry(info->get_parry_base());
+	info->set_deflection(info->get_deflection_base());
+
+	info->set_disease(info->get_disease_base());
+	info->set_divine(info->get_divine_base());
+	info->set_heat(info->get_heat_base());
+	info->set_magic(info->get_magic_base());
+	info->set_mental(info->get_mental_base());
+	info->set_cold(info->get_cold_base());
+	info->set_poison(info->get_poison_base());
+	info->set_elemental_base(info->get_heat());
+	info->set_noxious_base(info->get_poison());
+	info->set_arcane_base(info->get_magic());
+
+	info->set_sta(info->get_sta_base());
+	info->set_agi(info->get_agi_base());
+	info->set_str(info->get_str_base());
+	info->set_wis(info->get_wis_base());
+	info->set_intel(info->get_intel_base());
+	info->set_ability_modifier(0);
+	info->set_critical_mitigation(0);
+
+	info->set_block_chance(0);
+	info->set_crit_chance(0);
+	info->set_crit_bonus(0);
+	info->set_potency(0);
+	info->set_hate_mod(0);
+	info->set_reuse_speed(0);
+	info->set_casting_speed(0);
+	info->set_recovery_speed(0);
+	info->set_spell_reuse_speed(0);
+	info->set_spell_multi_attack(0);
+	info->set_dps(0);
+	info->set_dps_multiplier(0);
+	info->set_haste(0);
+	info->set_attackspeed(0);
+	info->set_multi_attack(0);
+	info->set_flurry(0);
+	info->set_melee_ae(0);
+
+	info->set_strikethrough(0);
+
+	info->set_accuracy(0);
+
+	info->set_offensivespeed(0);
 
 	stats.clear();
 	ItemStatsValues* values = equipment_list.CalculateEquipmentBonuses(this);
 	CalculateSpellBonuses(values);
-	info->sta += values->sta;
-	info->str += values->str;
-	info->agi += values->agi;
-	info->wis += values->wis;
-	info->intel += values->int_;
-
-	info->disease += values->vs_disease;
-	info->divine += values->vs_divine;
-	info->heat += values->vs_heat;
-	info->magic += values->vs_magic;
+	info->add_sta(values->sta);
+	info->add_str(values->str);
+	info->add_agi(values->agi);
+	info->add_wis(values->wis);
+	info->add_intel(values->int_);
+
+	info->add_disease(values->vs_disease);
+	info->add_divine(values->vs_divine);
+	info->add_heat(values->vs_heat);
+	info->add_magic(values->vs_magic);
 	int32 sta_hp_bonus = 0.0;
 	int32 prim_power_bonus = 0.0;
 	float bonus_mod = 0.0;
 	if (IsPlayer()) {
 		bonus_mod = CalculateBonusMod(); 
-		sta_hp_bonus = info->sta * bonus_mod;
+		sta_hp_bonus = info->get_sta() * bonus_mod;
 		prim_power_bonus = GetPrimaryStat() * bonus_mod;
 	}
 	prim_power_bonus = floor(float(prim_power_bonus));
@@ -784,38 +1051,43 @@ void Entity::CalculateBonuses(){
 		SetHP(GetTotalHP());
 	if(GetPower() > GetTotalPower())
 		SetPower(GetTotalPower());
-	info->mental += values->vs_mental;
-	info->poison += values->vs_poison;
-	info->max_concentration += values->concentration;
-	info->cold += values->vs_cold;
-	info->mitigation_skill1 += values->vs_slash;
-	info->mitigation_skill2 += values->vs_pierce;
-	info->mitigation_skill3 += values->vs_crush;
-	info->ability_modifier += values->ability_modifier;
-	info->critical_mitigation += values->criticalmitigation;
-	info->block_chance += values->extrashieldblockchance;
-	info->crit_chance += values->beneficialcritchance;
-	info->crit_bonus += values->critbonus;
-	info->potency += values->potency;
-	info->hate_mod += values->hategainmod;
-	info->reuse_speed += values->abilityreusespeed;
-	info->casting_speed += values->abilitycastingspeed;
-	info->recovery_speed += values->abilityrecoveryspeed;
-	info->spell_reuse_speed += values->spellreusespeed;
-	info->spell_multi_attack += values->spellmultiattackchance;
-	info->dps += values->dps;
-	info->dps_multiplier = CalculateDPSMultiplier();
-	info->haste += values->attackspeed;
-	info->multi_attack += values->multiattackchance;
-	info->flurry += values->flurry;
-	info->melee_ae += values->aeautoattackchance;
-	info->strikethrough += values->strikethrough;
-	info->accuracy += values->accuracy;
-	info->offensivespeed += values->offensivespeed;
-	info->uncontested_block += values->uncontested_block;
-	info->uncontested_parry += values->uncontested_parry;
-	info->uncontested_dodge += values->uncontested_dodge;
-	info->uncontested_riposte += values->uncontested_riposte;
+
+	info->add_mental(values->vs_mental);
+
+	info->add_poison(values->vs_poison);
+
+	info->add_max_concentration(values->concentration);
+
+	info->add_cold(values->vs_cold);
+
+	info->add_mitigation_skill1(values->vs_slash);
+	info->add_mitigation_skill2(values->vs_pierce);
+	info->add_mitigation_skill3(values->vs_crush);
+	info->add_ability_modifier(values->ability_modifier);
+	info->add_critical_mitigation(values->criticalmitigation);
+	info->add_block_chance(values->extrashieldblockchance);
+	info->add_crit_chance(values->beneficialcritchance);
+	info->add_crit_bonus(values->critbonus);
+	info->add_potency(values->potency);
+	info->add_hate_mod(values->hategainmod);
+	info->add_reuse_speed(values->abilityreusespeed);
+	info->add_casting_speed(values->abilitycastingspeed);
+	info->add_recovery_speed(values->abilityrecoveryspeed);
+	info->add_spell_reuse_speed(values->spellreusespeed);
+	info->add_spell_multi_attack(values->spellmultiattackchance);
+	info->add_dps(values->dps);
+	info->add_dps_multiplier(CalculateDPSMultiplier());
+	info->add_haste(values->attackspeed);
+	info->add_multi_attack(values->multiattackchance);
+	info->add_flurry(values->flurry);
+	info->add_melee_ae(values->aeautoattackchance);
+	info->add_strikethrough(values->strikethrough);
+	info->add_accuracy(values->accuracy);
+	info->add_offensivespeed(values->offensivespeed);
+	info->add_uncontested_block(values->uncontested_block);
+	info->add_uncontested_parry(values->uncontested_parry);
+	info->add_uncontested_dodge(values->uncontested_dodge);
+	info->add_uncontested_riposte(values->uncontested_riposte);
 	safe_delete(values);
 }
 
@@ -1178,7 +1450,7 @@ float Entity::CalculateBonusMod() {
 }
 
 float Entity::CalculateDPSMultiplier(){
-	float dps = GetInfoStruct()->dps;
+	float dps = GetInfoStruct()->get_dps();
 
 	if (dps > 0){
 		if (dps <= 100)
@@ -1356,7 +1628,7 @@ int32 Entity::CheckWards(Entity* attacker, int32 damage, int8 damage_type) {
 }
 
 float Entity::CalculateCastingSpeedMod() {
-	float cast_speed = info_struct.casting_speed;
+	float cast_speed = info_struct.get_casting_speed();
 	
 	if(cast_speed > 0)
 		return 100 * max((float) 0.5, (float) (1 + (1 - (1 / (1 + (cast_speed * .01))))));
@@ -1472,9 +1744,9 @@ void Entity::CureDetrimentByType(int8 cure_count, int8 det_type, string cure_nam
 		if (det && det->det_type == det_type && !det->incurable){
 			levels = det->spell->spell->GetSpellLevels();
 			info_struct = det->caster->GetInfoStruct();
-			caster_class1 = info_struct->class1;
-			caster_class2 = info_struct->class2;
-			caster_class3 = info_struct->class3;
+			caster_class1 = info_struct->get_class1();
+			caster_class2 = info_struct->get_class2();
+			caster_class3 = info_struct->get_class3();
 			pass_level_check = false;
 			for (int32 x = 0; x < levels->size(); x++){
 				level_class = levels->at(x)->adventure_class;
@@ -1527,9 +1799,9 @@ void Entity::CureDetrimentByControlEffect(int8 cure_count, int8 control_type, st
 		if (det && det->control_effect == control_type && !det->incurable){
 			levels = det->spell->spell->GetSpellLevels();
 			info_struct = det->caster->GetInfoStruct();
-			caster_class1 = info_struct->class1;
-			caster_class2 = info_struct->class2;
-			caster_class3 = info_struct->class3;
+			caster_class1 = info_struct->get_class1();
+			caster_class2 = info_struct->get_class2();
+			caster_class3 = info_struct->get_class3();
 			pass_level_check = false;
 			for (int32 x = 0; x < levels->size(); x++){
 				level_class = levels->at(x)->adventure_class;
@@ -2551,4 +2823,254 @@ void Entity::HaltMovement()
 		GetZone()->movementMgr->StopNavigation(this);
 
 	RunToLocation(GetX(), GetY(), GetZ());
+}	
+
+std::string Entity::GetInfoStructString(std::string field)
+{
+		map<string, boost::function<std::string()>>::const_iterator itr = get_string_funcs.find(field);
+		if(itr != get_string_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return std::string("");
+}
+
+int8 Entity::GetInfoStructInt8(std::string field)
+{
+		map<string, boost::function<int8()>>::const_iterator itr = get_int8_funcs.find(field);
+		if(itr != get_int8_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+int16 Entity::GetInfoStructInt16(std::string field)
+{
+		map<string, boost::function<int16()>>::const_iterator itr = get_int16_funcs.find(field);
+		if(itr != get_int16_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+int32 Entity::GetInfoStructInt32(std::string field)
+{
+		map<string, boost::function<int32()>>::const_iterator itr = get_int32_funcs.find(field);
+		if(itr != get_int32_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+int64 Entity::GetInfoStructInt64(std::string field)
+{
+		map<string, boost::function<int64()>>::const_iterator itr = get_int64_funcs.find(field);
+		if(itr != get_int64_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+sint8 Entity::GetInfoStructSInt8(std::string field)
+{
+		map<string, boost::function<sint8()>>::const_iterator itr = get_sint8_funcs.find(field);
+		if(itr != get_sint8_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+sint16 Entity::GetInfoStructSInt16(std::string field)
+{
+		map<string, boost::function<sint16()>>::const_iterator itr = get_sint16_funcs.find(field);
+		if(itr != get_sint16_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+sint32 Entity::GetInfoStructSInt32(std::string field)
+{
+		map<string, boost::function<sint32()>>::const_iterator itr = get_sint32_funcs.find(field);
+		if(itr != get_sint32_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+sint64 Entity::GetInfoStructSInt64(std::string field)
+{
+		map<string, boost::function<sint64()>>::const_iterator itr = get_sint64_funcs.find(field);
+		if(itr != get_sint64_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0;
+}
+
+float Entity::GetInfoStructFloat(std::string field)
+{
+		map<string, boost::function<float()>>::const_iterator itr = get_float_funcs.find(field);
+		if(itr != get_float_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+	return 0.0f;
+}
+
+int64 Entity::GetInfoStructUInt(std::string field)
+{
+		map<string, boost::function<int8()>>::const_iterator itr = get_int8_funcs.find(field);
+		if(itr != get_int8_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+		map<string, boost::function<int16()>>::const_iterator itr2 = get_int16_funcs.find(field);
+		if(itr2 != get_int16_funcs.end())
+		{
+			auto func = (itr2->second)();
+			return func;
+		}
+		map<string, boost::function<int32()>>::const_iterator itr3 = get_int32_funcs.find(field);
+		if(itr3 != get_int32_funcs.end())
+		{
+			auto func = (itr3->second)();
+			return func;
+		}
+		map<string, boost::function<int64()>>::const_iterator itr4 = get_int64_funcs.find(field);
+		if(itr4 != get_int64_funcs.end())
+		{
+			auto func = (itr4->second)();
+			return func;
+		}
+	return 0;
+}
+
+sint64 Entity::GetInfoStructSInt(std::string field)
+{
+		map<string, boost::function<sint8()>>::const_iterator itr = get_sint8_funcs.find(field);
+		if(itr != get_sint8_funcs.end())
+		{
+			auto func = (itr->second)();
+			return func;
+		}
+		map<string, boost::function<sint16()>>::const_iterator itr2 = get_sint16_funcs.find(field);
+		if(itr2 != get_sint16_funcs.end())
+		{
+			auto func = (itr2->second)();
+			return func;
+		}
+		map<string, boost::function<sint32()>>::const_iterator itr3 = get_sint32_funcs.find(field);
+		if(itr3 != get_sint32_funcs.end())
+		{
+			auto func = (itr3->second)();
+			return func;
+		}
+		map<string, boost::function<sint64()>>::const_iterator itr4 = get_sint64_funcs.find(field);
+		if(itr4 != get_sint64_funcs.end())
+		{
+			auto func = (itr4->second)();
+			return func;
+		}
+	return 0;
+}
+
+
+bool Entity::SetInfoStructString(std::string field, std::string value)
+{
+		map<string, boost::function<void(std::string)>>::const_iterator itr = set_string_funcs.find(field);
+		if(itr != set_string_funcs.end())
+		{
+			(itr->second)(value);
+			return true;
+		}
+	return false;
+}
+
+
+bool Entity::SetInfoStructUInt(std::string field, int64 value)
+{
+		map<string, boost::function<void(int8)>>::const_iterator itr = set_int8_funcs.find(field);
+		if(itr != set_int8_funcs.end())
+		{
+			(itr->second)((int8)value);
+			return true;
+		}
+		map<string, boost::function<void(int16)>>::const_iterator itr2 = set_int16_funcs.find(field);
+		if(itr2 != set_int16_funcs.end())
+		{
+			(itr2->second)((int16)value);
+			return true;
+		}
+		map<string, boost::function<void(int32)>>::const_iterator itr3 = set_int32_funcs.find(field);
+		if(itr3 != set_int32_funcs.end())
+		{
+			(itr3->second)((int32)value);
+			return true;
+		}
+		map<string, boost::function<void(int64)>>::const_iterator itr4 = set_int64_funcs.find(field);
+		if(itr4 != set_int64_funcs.end())
+		{
+			(itr4->second)(value);
+			return true;
+		}
+	return false;
+}
+
+bool Entity::SetInfoStructSInt(std::string field, sint64 value)
+{
+		map<string, boost::function<void(sint8)>>::const_iterator itr = set_sint8_funcs.find(field);
+		if(itr != set_sint8_funcs.end())
+		{
+			(itr->second)((sint8)value);
+			return true;
+		}
+		map<string, boost::function<void(sint16)>>::const_iterator itr2 = set_sint16_funcs.find(field);
+		if(itr2 != set_sint16_funcs.end())
+		{
+			(itr2->second)((sint16)value);
+			return true;
+		}
+		map<string, boost::function<void(sint32)>>::const_iterator itr3 = set_sint32_funcs.find(field);
+		if(itr3 != set_sint32_funcs.end())
+		{
+			(itr3->second)((sint32)value);
+			return true;
+		}
+		map<string, boost::function<void(sint64)>>::const_iterator itr4 = set_sint64_funcs.find(field);
+		if(itr4 != set_sint64_funcs.end())
+		{
+			(itr4->second)(value);
+			return true;
+		}
+	return false;
+}
+
+bool Entity::SetInfoStructFloat(std::string field, float value)
+{
+		map<string, boost::function<void(float)>>::const_iterator itr = set_float_funcs.find(field);
+		if(itr != set_float_funcs.end())
+		{
+			(itr->second)(value);
+			return true;
+		}
+	return false;
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 847 - 139
EQ2/source/WorldServer/Entity.h


+ 2 - 2
EQ2/source/WorldServer/Items/Items.cpp

@@ -3699,13 +3699,13 @@ EQ2Packet* EquipmentItemList::serialize(int16 version, Player* player){
 ItemStatsValues* EquipmentItemList::CalculateEquipmentBonuses(Entity* entity){
 	ItemStatsValues* stats = new ItemStatsValues;
 	memset(stats, 0, sizeof(ItemStatsValues));
-	entity->GetInfoStruct()->mitigation_base = 0;
+	entity->GetInfoStruct()->set_mitigation_base(0);
 	MEquipmentItems.lock();
 	for(int8 i=0;i<NUM_SLOTS;i++){
 		if(items[i] && items[i]->details.item_id > 0){
 			master_item_list.CalculateItemBonuses(items[i], entity, stats);
 			if (items[i]->armor_info && !items[i]->IsShield())
-				entity->GetInfoStruct()->mitigation_base += items[i]->armor_info->mitigation_high;
+				entity->GetInfoStruct()->add_mitigation_base(items[i]->armor_info->mitigation_high);
 		}
 	}
 	MEquipmentItems.unlock();

+ 219 - 29
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -1796,9 +1796,9 @@ int EQ2Emu_lua_SetTradeskillClass(lua_State* state) {
 	if (spawn) {
 		spawn->SetTradeskillClass(value);
 		if (spawn->IsEntity()) {
-			((Entity*)spawn)->GetInfoStruct()->tradeskill_class1 = classes.GetTSBaseClass(spawn->GetTradeskillClass());
-			((Entity*)spawn)->GetInfoStruct()->tradeskill_class2 = classes.GetSecondaryTSBaseClass(spawn->GetTradeskillClass());
-			((Entity*)spawn)->GetInfoStruct()->tradeskill_class3 = spawn->GetTradeskillClass();
+			((Entity*)spawn)->GetInfoStruct()->set_tradeskill_class1(classes.GetTSBaseClass(spawn->GetTradeskillClass()));
+			((Entity*)spawn)->GetInfoStruct()->set_tradeskill_class2(classes.GetSecondaryTSBaseClass(spawn->GetTradeskillClass()));
+			((Entity*)spawn)->GetInfoStruct()->set_tradeskill_class3(spawn->GetTradeskillClass());
 		}
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
@@ -2519,7 +2519,7 @@ int EQ2Emu_lua_SetIntBase(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	int16 value = lua_interface->GetInt16Value(state, 2);
 	if (spawn && spawn->IsEntity()) {
-		((Entity*)spawn)->GetInfoStruct()->intel_base = value;
+		((Entity*)spawn)->GetInfoStruct()->set_intel_base(value);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -2532,7 +2532,7 @@ int EQ2Emu_lua_SetAgiBase(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	int16 value = lua_interface->GetInt16Value(state, 2);
 	if (spawn && spawn->IsEntity()) {
-		((Entity*)spawn)->GetInfoStruct()->agi_base = value;
+		((Entity*)spawn)->GetInfoStruct()->set_agi_base(value);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -2545,7 +2545,7 @@ int EQ2Emu_lua_SetWisBase(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	int16 value = lua_interface->GetInt16Value(state, 2);
 	if (spawn && spawn->IsEntity()) {
-		((Entity*)spawn)->GetInfoStruct()->wis_base = value;
+		((Entity*)spawn)->GetInfoStruct()->set_wis_base(value);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -2558,7 +2558,7 @@ int EQ2Emu_lua_SetStaBase(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	int16 value = lua_interface->GetInt16Value(state, 2);
 	if (spawn && spawn->IsEntity()) {
-		((Entity*)spawn)->GetInfoStruct()->sta_base = value;
+		((Entity*)spawn)->GetInfoStruct()->set_sta_base(value);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -2571,7 +2571,7 @@ int EQ2Emu_lua_SetStrBase(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	int16 value = lua_interface->GetInt16Value(state, 2);
 	if (spawn && spawn->IsEntity()) {
-		((Entity*)spawn)->GetInfoStruct()->str_base = value;
+		((Entity*)spawn)->GetInfoStruct()->set_str_base(value);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -4406,12 +4406,12 @@ int EQ2Emu_lua_Charm(lua_State* state) {
 		// If owner is player and player does not have a summoned pet set the players charsheet
 		if (owner->IsPlayer() && !((Entity*)owner)->GetPet()) {
 			Player* player = (Player*)owner;
-			player->GetInfoStruct()->pet_id = player->GetIDWithPlayerSpawn(pet);
-			strcpy(player->GetInfoStruct()->pet_name, pet->GetName());
-			player->GetInfoStruct()->pet_movement = 2;
-			player->GetInfoStruct()->pet_behavior = 3;
-			player->GetInfoStruct()->pet_health_pct = 1.0f;
-			player->GetInfoStruct()->pet_power_pct = 1.0f;
+			player->GetInfoStruct()->set_pet_id(player->GetIDWithPlayerSpawn(pet));
+			player->GetInfoStruct()->set_pet_name(std::string(pet->GetName()));
+			player->GetInfoStruct()->set_pet_movement(2);
+			player->GetInfoStruct()->set_pet_behavior(3);
+			player->GetInfoStruct()->set_pet_health_pct(1.0f);
+			player->GetInfoStruct()->set_pet_power_pct(1.0f);
 			// Make sure the values get sent to the client
 			player->SetCharSheetChanged(true);
 		}
@@ -4709,12 +4709,13 @@ int EQ2Emu_lua_SummonPet(lua_State* state) {
 	// If player set various values for the char sheet (pet window)
 	if (spawn->IsPlayer()) {
 		Player* player = (Player*)spawn;
-		player->GetInfoStruct()->pet_id = player->GetIDWithPlayerSpawn(pet);
-		strcpy(player->GetInfoStruct()->pet_name, random_pet_name.c_str());
-		player->GetInfoStruct()->pet_movement = 2;
-		player->GetInfoStruct()->pet_behavior = 3;
-		player->GetInfoStruct()->pet_health_pct = 1.0f;
-		player->GetInfoStruct()->pet_power_pct = 1.0f;
+		
+		player->GetInfoStruct()->set_pet_id(player->GetIDWithPlayerSpawn(pet));
+		player->GetInfoStruct()->set_pet_name(random_pet_name);
+		player->GetInfoStruct()->set_pet_movement(2);
+		player->GetInfoStruct()->set_pet_behavior(3);
+		player->GetInfoStruct()->set_pet_health_pct(1.0f);
+		player->GetInfoStruct()->set_pet_power_pct(1.0f);
 		// Make sure the values get sent to the client
 		player->SetCharSheetChanged(true);
 	}
@@ -7893,14 +7894,14 @@ int EQ2Emu_lua_SetVision(lua_State* state) {
 		for (int8 i = 0; i < spell->targets.size(); i++) {
 			Spawn* target = zone->GetSpawnByID(spell->targets.at(i));
 			if (target->IsEntity()) {
-				((Entity*)target)->GetInfoStruct()->vision = vision;
+				((Entity*)target)->GetInfoStruct()->set_vision(vision);
 				if (target->IsPlayer())
 					((Player*)target)->SetCharSheetChanged(true);
 			}
 		}
 	}
 	else {
-		((Entity*)spawn)->GetInfoStruct()->vision = vision;
+		((Entity*)spawn)->GetInfoStruct()->set_vision(vision);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -7930,14 +7931,14 @@ int EQ2Emu_lua_BlurVision(lua_State* state) {
 		for (int8 i = 0; i < spell->targets.size(); i++) {
 			Spawn* target = zone->GetSpawnByID(spell->targets.at(i));
 			if (target && target->IsEntity()) {
-				((Entity*)target)->GetInfoStruct()->drunk = intensity;
+				((Entity*)target)->GetInfoStruct()->set_drunk(intensity);
 				if (target->IsPlayer())
 					((Player*)target)->SetCharSheetChanged(true);
 			}
 		}
 	}
 	else {
-		((Entity*)spawn)->GetInfoStruct()->drunk = intensity;
+		((Entity*)spawn)->GetInfoStruct()->set_drunk(intensity);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -7967,14 +7968,14 @@ int EQ2Emu_lua_BreatheUnderwater(lua_State* state) {
 		for (int8 i = 0; i < spell->targets.size(); i++) {
 			Spawn* target = zone->GetSpawnByID(spell->targets.at(i));
 			if (target->IsEntity()) {
-				((Entity*)target)->GetInfoStruct()->breathe_underwater = breatheUnderwater;
+				((Entity*)target)->GetInfoStruct()->set_breathe_underwater(breatheUnderwater);
 				if (target->IsPlayer())
 					((Player*)target)->SetCharSheetChanged(true);
 			}
 		}
 	}
 	else {
-		((Entity*)spawn)->GetInfoStruct()->breathe_underwater = breatheUnderwater;
+		((Entity*)spawn)->GetInfoStruct()->set_breathe_underwater(breatheUnderwater);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -10689,14 +10690,14 @@ int EQ2Emu_lua_SetAlignment(lua_State* state) {
 		for (int8 i = 0; i < spell->targets.size(); i++) {
 			Spawn* target = zone->GetSpawnByID(spell->targets.at(i));
 			if (target->IsEntity()) {
-				((Entity*)target)->GetInfoStruct()->alignment = (sint8)alignment;
+				((Entity*)target)->GetInfoStruct()->set_alignment((sint8)alignment);
 				if (target->IsPlayer())
 					((Player*)target)->SetCharSheetChanged(true);
 			}
 		}
 	}
 	else {
-		((Entity*)spawn)->GetInfoStruct()->alignment = (sint8)alignment;
+		((Entity*)spawn)->GetInfoStruct()->set_alignment((sint8)alignment);
 		if (spawn->IsPlayer())
 			((Player*)spawn)->SetCharSheetChanged(true);
 	}
@@ -11042,6 +11043,7 @@ int EQ2Emu_lua_InWater(lua_State* state) {
 	if (!lua_interface)
 		return 0;
 	Spawn* spawn = lua_interface->GetSpawn(state);
+	lua_interface->ResetFunctionStack(state);
 	if (spawn) {
 		lua_interface->SetBooleanValue(state, spawn->InWater());
 		return 1;
@@ -11053,6 +11055,7 @@ int EQ2Emu_lua_InLava(lua_State* state) {
 	if (!lua_interface)
 		return 0;
 	Spawn* spawn = lua_interface->GetSpawn(state);
+	lua_interface->ResetFunctionStack(state);
 	if (spawn) {
 		lua_interface->SetBooleanValue(state, spawn->InLava());
 		return 1;
@@ -11076,6 +11079,7 @@ int EQ2Emu_lua_DamageSpawn(lua_State* state) {
 	bool no_calcs = (lua_interface->GetInt8Value(state, 10) == 1);
 	bool ignore_attacker = (lua_interface->GetInt8Value(state, 11) == 1);
 
+	lua_interface->ResetFunctionStack(state);
 	if (!attacker) {
 		lua_interface->LogError("%s: LUA ProcDamage command error: caster is not a valid spawn", lua_interface->GetScriptName(state));
 		return 0;
@@ -11104,6 +11108,7 @@ int EQ2Emu_lua_IsInvulnerable(lua_State* state) {
 	if (!lua_interface)
 		return 0;
 	Spawn* spawn = lua_interface->GetSpawn(state);
+	lua_interface->ResetFunctionStack(state);
 	if (spawn) {
 		lua_interface->SetBooleanValue(state, spawn->GetInvulnerable());
 		return 1;
@@ -11116,6 +11121,7 @@ int EQ2Emu_lua_SetInvulnerable(lua_State* state) {
 		return 0;
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	bool invul = lua_interface->GetBooleanValue(state, 2);
+	lua_interface->ResetFunctionStack(state);
 	if (spawn) {
 		spawn->SetInvulnerable(invul);
 	}
@@ -11127,6 +11133,7 @@ int EQ2Emu_lua_GetRuleFlagInt32(lua_State* state) {
 		return 0;
 	string category = lua_interface->GetStringValue(state);
 	string name = lua_interface->GetStringValue(state, 2);
+	lua_interface->ResetFunctionStack(state);
 	Rule *ret = 0;
 	if ((ret = rule_manager.GetGlobalRule(category.c_str(), name.c_str()))) {
 		
@@ -11144,6 +11151,7 @@ int EQ2Emu_lua_GetAAInfo(lua_State* state) {
 		return 0;
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	string type = lua_interface->GetStringValue(state, 2);
+	lua_interface->ResetFunctionStack(state);
 	if (spawn) {
 		int res = 1;
 
@@ -11181,6 +11189,7 @@ int EQ2Emu_lua_SetAAInfo(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	string type = lua_interface->GetStringValue(state, 2);
 	sint32 value = lua_interface->GetSInt32Value(state, 3);
+	lua_interface->ResetFunctionStack(state);
 	if (spawn) {
 		boost::to_lower(type);
 		if(type == "assigned_aa")
@@ -11213,6 +11222,7 @@ int EQ2Emu_lua_AddMasterTitle(lua_State* state) {
 	string titleName = lua_interface->GetStringValue(state);
 	int8 isPrefix = lua_interface->GetInt8Value(state, 2);
 	
+	lua_interface->ResetFunctionStack(state);
 	sint32 index = database.AddMasterTitle(titleName.c_str(), isPrefix);
 	lua_interface->SetSInt32Value(state, index);
 
@@ -11226,6 +11236,7 @@ int EQ2Emu_lua_AddCharacterTitle(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	string titleName = lua_interface->GetStringValue(state, 2);
 	
+	lua_interface->ResetFunctionStack(state);
 	if(!spawn->IsPlayer())
 	{
 		lua_interface->LogError("%s: LUA AddCharacterTitle command error: player is not valid", lua_interface->GetScriptName(state));
@@ -11274,6 +11285,7 @@ int EQ2Emu_lua_SetCharacterTitleSuffix(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	string titleName = lua_interface->GetStringValue(state, 2);
 	
+	lua_interface->ResetFunctionStack(state);
 	if(!spawn->IsPlayer())
 	{
 		lua_interface->LogError("%s: LUA SetCharacterTitleSuffix command error: player is not valid", lua_interface->GetScriptName(state));
@@ -11309,6 +11321,7 @@ int EQ2Emu_lua_SetCharacterTitlePrefix(lua_State* state) {
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	string titleName = lua_interface->GetStringValue(state, 2);
 	
+	lua_interface->ResetFunctionStack(state);
 	if(!spawn->IsPlayer())
 	{
 		lua_interface->LogError("%s: LUA SetCharacterTitlePrefix command error: player is not valid", lua_interface->GetScriptName(state));
@@ -11343,6 +11356,7 @@ int EQ2Emu_lua_ResetCharacterTitleSuffix(lua_State* state) {
 
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	
+	lua_interface->ResetFunctionStack(state);
 	if(!spawn->IsPlayer())
 	{
 		lua_interface->LogError("%s: LUA ResetCharacterTitleSuffix command error: player is not valid", lua_interface->GetScriptName(state));
@@ -11364,6 +11378,7 @@ int EQ2Emu_lua_ResetCharacterTitlePrefix(lua_State* state) {
 
 	Spawn* spawn = lua_interface->GetSpawn(state);
 	
+	lua_interface->ResetFunctionStack(state);
 	if(!spawn->IsPlayer())
 	{
 		lua_interface->LogError("%s: LUA ResetCharacterTitlePrefix command error: player is not valid", lua_interface->GetScriptName(state));
@@ -11377,4 +11392,179 @@ int EQ2Emu_lua_ResetCharacterTitlePrefix(lua_State* state) {
 	player->GetClient()->SendTitleUpdate();
 
 	return 1;
-}
+}
+
+int EQ2Emu_lua_GetInfoStructString(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA GetInfoStructString command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	lua_interface->SetStringValue(state, ent->GetInfoStructString(field).c_str());
+
+	return 1;
+}
+
+int EQ2Emu_lua_GetInfoStructUInt(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA GetInfoStructUInt command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	lua_interface->SetInt64Value(state, ent->GetInfoStructUInt(field));
+
+	return 1;
+}
+
+int EQ2Emu_lua_GetInfoStructSInt(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA GetInfoStructSInt command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	lua_interface->SetSInt64Value(state, ent->GetInfoStructSInt(field));
+
+	return 1;
+}
+
+int EQ2Emu_lua_GetInfoStructFloat(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA GetInfoStructFloat command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	lua_interface->SetFloatValue(state, ent->GetInfoStructFloat(field));
+
+	return 1;
+}
+
+int EQ2Emu_lua_SetInfoStructString(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	string value = lua_interface->GetStringValue(state, 3);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA SetInfoStructString command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	bool set_ = ent->SetInfoStructString(field, value);
+	lua_interface->SetBooleanValue(state, set_);
+	return 1;
+}
+
+int EQ2Emu_lua_SetInfoStructUInt(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	int64 value = lua_interface->GetInt64Value(state, 3);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA SetInfoStructUInt command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	bool set_ = ent->SetInfoStructUInt(field, value);
+	lua_interface->SetBooleanValue(state, set_);
+	return 1;
+}
+
+int EQ2Emu_lua_SetInfoStructSInt(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	sint64 value = lua_interface->GetSInt64Value(state, 3);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA SetInfoStructSInt command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	bool set_ = ent->SetInfoStructSInt(field, value);
+	lua_interface->SetBooleanValue(state, set_);
+	return 1;
+}
+
+int EQ2Emu_lua_SetInfoStructFloat(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	string field = lua_interface->GetStringValue(state, 2);
+	float value = lua_interface->GetFloatValue(state, 3);
+	
+	lua_interface->ResetFunctionStack(state);
+	if(!spawn || !spawn->IsEntity())
+	{
+		lua_interface->LogError("%s: LUA SetInfoStructFloat command error: spawn is not valid, either does not exist or is not an entity", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	Entity* ent = (Entity*)spawn;
+	bool set_ = ent->SetInfoStructFloat(field, value);
+	lua_interface->SetBooleanValue(state, set_);
+	return 1;
+}
+
+int EQ2Emu_lua_SetCharSheetChanged(lua_State* state) {
+	if (!lua_interface)
+		return 0;
+	Spawn* spawn = lua_interface->GetSpawn(state);
+	bool value = lua_interface->GetBooleanValue(state, 2);
+	lua_interface->ResetFunctionStack(state);
+	
+	if(!spawn || !spawn->IsPlayer())
+	{
+		lua_interface->LogError("%s: LUA SetCharSheetChanged command error: spawn is not valid, either does not exist or is not a player", lua_interface->GetScriptName(state));
+		return 0;
+	}
+	
+	((Player*)spawn)->SetCharSheetChanged(value);
+
+	return 0;
+}
+

+ 12 - 0
EQ2/source/WorldServer/LuaFunctions.h

@@ -532,4 +532,16 @@ int EQ2Emu_lua_SetCharacterTitleSuffix(lua_State* state);
 int EQ2Emu_lua_SetCharacterTitlePrefix(lua_State* state);
 int EQ2Emu_lua_ResetCharacterTitleSuffix(lua_State* state);
 int EQ2Emu_lua_ResetCharacterTitlePrefix(lua_State* state);
+
+int EQ2Emu_lua_GetInfoStructString(lua_State* state);
+int EQ2Emu_lua_GetInfoStructUInt(lua_State* state);
+int EQ2Emu_lua_GetInfoStructSInt(lua_State* state);
+int EQ2Emu_lua_GetInfoStructFloat(lua_State* state);
+
+int EQ2Emu_lua_SetInfoStructString(lua_State* state);
+int EQ2Emu_lua_SetInfoStructUInt(lua_State* state);
+int EQ2Emu_lua_SetInfoStructSInt(lua_State* state);
+int EQ2Emu_lua_SetInfoStructFloat(lua_State* state);
+
+int EQ2Emu_lua_SetCharSheetChanged(lua_State* state);
 #endif

+ 36 - 0
EQ2/source/WorldServer/LuaInterface.cpp

@@ -1246,6 +1246,18 @@ void LuaInterface::RegisterFunctions(lua_State* state) {
 	lua_register(state, "SetCharacterTitlePrefix", EQ2Emu_lua_SetCharacterTitlePrefix);
 	lua_register(state, "ResetCharacterTitleSuffix", EQ2Emu_lua_ResetCharacterTitleSuffix);
 	lua_register(state, "ResetCharacterTitlePrefix", EQ2Emu_lua_ResetCharacterTitlePrefix);
+	
+	lua_register(state, "GetInfoStructString", EQ2Emu_lua_GetInfoStructString);
+	lua_register(state, "GetInfoStructUInt", EQ2Emu_lua_GetInfoStructUInt);
+	lua_register(state, "GetInfoStructSInt", EQ2Emu_lua_GetInfoStructSInt);
+	lua_register(state, "GetInfoStructFloat", EQ2Emu_lua_GetInfoStructFloat);
+	
+	lua_register(state, "SetInfoStructString", EQ2Emu_lua_SetInfoStructString);
+	lua_register(state, "SetInfoStructUInt", EQ2Emu_lua_SetInfoStructUInt);
+	lua_register(state, "SetInfoStructSInt", EQ2Emu_lua_SetInfoStructSInt);
+	lua_register(state, "SetInfoStructFloat", EQ2Emu_lua_SetInfoStructFloat);
+	
+	lua_register(state, "SetCharSheetChanged", EQ2Emu_lua_SetCharSheetChanged);
 }
 
 void LuaInterface::LogError(const char* error, ...)  {
@@ -1503,6 +1515,22 @@ ZoneServer* LuaInterface::GetZone(lua_State* state, int8 arg_num) {
 	return ret;
 }
 
+sint64 LuaInterface::GetSInt64Value(lua_State* state, int8 arg_num) {
+	sint64 val = 0;
+	if(lua_isnumber(state, arg_num)){
+		val = (sint64)lua_tointeger(state, arg_num);
+	}
+	return val;
+}
+
+int64 LuaInterface::GetInt64Value(lua_State* state, int8 arg_num) {
+	int64 val = 0;
+	if(lua_isnumber(state, arg_num)){
+		val = (int64)lua_tonumber(state, arg_num);
+	}
+	return val;
+}
+
 sint32 LuaInterface::GetSInt32Value(lua_State* state, int8 arg_num) {
 	sint32 val = 0;
 	if(lua_isnumber(state, arg_num)){
@@ -1577,6 +1605,14 @@ void LuaInterface::SetSInt32Value(lua_State* state, sint32 value) {
 	lua_pushinteger(state, value);
 }
 
+void LuaInterface::SetInt64Value(lua_State* state, int64 value) {
+	lua_pushinteger(state, value);
+}
+
+void LuaInterface::SetSInt64Value(lua_State* state, sint64 value) {
+	lua_pushinteger(state, value);
+}
+
 void LuaInterface::SetSpawnValue(lua_State* state, Spawn* spawn) {
 	LUASpawnWrapper* spawn_wrapper = new LUASpawnWrapper();
 	spawn_wrapper->spawn = spawn;

+ 4 - 0
EQ2/source/WorldServer/LuaInterface.h

@@ -204,6 +204,8 @@ public:
 	int16			GetInt16Value(lua_State* state, int8 arg_num = 1);
 	int32			GetInt32Value(lua_State* state, int8 arg_num = 1);
 	sint32			GetSInt32Value(lua_State* state, int8 arg_num = 1);
+	int64			GetInt64Value(lua_State* state, int8 arg_num = 1);
+	sint64			GetSInt64Value(lua_State* state, int8 arg_num = 1);
 	float			GetFloatValue(lua_State* state, int8 arg_num = 1);
 	string			GetStringValue(lua_State* state, int8 arg_num = 1);
 	bool			GetBooleanValue(lua_State*state, int8 arg_num = 1);
@@ -212,6 +214,8 @@ public:
 
 	void			SetInt32Value(lua_State* state, int32 value);
 	void			SetSInt32Value(lua_State* state, sint32 value);
+	void			SetInt64Value(lua_State* state, int64 value);
+	void			SetSInt64Value(lua_State* state, sint64 value);
 	void			SetFloatValue(lua_State* state, float value);
 	void			SetBooleanValue(lua_State* state, bool value);
 	void			SetStringValue(lua_State* state, const char* value);

+ 2 - 1
EQ2/source/WorldServer/NPC.cpp

@@ -62,7 +62,8 @@ NPC::NPC(NPC* old_npc){
 		database_id = old_npc->database_id;
 		primary_command_list_id = old_npc->primary_command_list_id;
 		secondary_command_list_id = old_npc->secondary_command_list_id;
-		memcpy(GetInfoStruct(), old_npc->GetInfoStruct(), sizeof(InfoStruct));
+		this->SetInfoStruct(old_npc->GetInfoStruct());
+		//memcpy(GetInfoStruct(), old_npc->GetInfoStruct(), sizeof(InfoStruct));
 		memcpy(&appearance, &old_npc->appearance, sizeof(AppearanceData));
 		memcpy(&features, &old_npc->features, sizeof(CharFeatures));
 		memcpy(&equipment, &old_npc->equipment, sizeof(EQ2_Equipment));

+ 1 - 1
EQ2/source/WorldServer/NPC_AI.cpp

@@ -539,7 +539,7 @@ void CombatPetBrain::Think() {
 	LogWrite(NPC_AI__DEBUG, 7, "NPC_AI", "Pet AI code called for %s", GetBody()->GetName());
 
 	// If owner is a player and player has stay set then return out
-	if (GetBody()->GetOwner()->IsPlayer() && ((Player*)GetBody()->GetOwner())->GetInfoStruct()->pet_movement == 1)
+	if (GetBody()->GetOwner()->IsPlayer() && ((Player*)GetBody()->GetOwner())->GetInfoStruct()->get_pet_movement() == 1)
 		return;
 
 	// Set target to owner

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 329 - 285
EQ2/source/WorldServer/Player.cpp


+ 19 - 10
EQ2/source/WorldServer/Spawn.cpp

@@ -414,8 +414,8 @@ void Spawn::InitializeFooterPacketData(Player* player, PacketStruct* footer) {
 
 EQ2Packet* Spawn::spawn_serialize(Player* player, int16 version, int16 offset, int32 value, int16 offset2, int16 offset3, int16 offset4, int32 value2) {
 	// If spawn is NPC AND is pet && owner is a player && owner is the player passed to this function && player's char sheet pet id is 0
-	if (IsNPC() && ((NPC*)this)->IsPet() && ((NPC*)this)->GetOwner()->IsPlayer() && player == ((NPC*)this)->GetOwner() && player->GetInfoStruct()->pet_id == 0) {
-		((Player*)((NPC*)this)->GetOwner())->GetInfoStruct()->pet_id = player->spawn_id;
+	if (IsNPC() && ((NPC*)this)->IsPet() && ((NPC*)this)->GetOwner()->IsPlayer() && player == ((NPC*)this)->GetOwner() && player->GetInfoStruct()->get_pet_id() == 0) {
+		((Player*)((NPC*)this)->GetOwner())->GetInfoStruct()->set_pet_id(player->spawn_id);
 		player->SetCharSheetChanged(true);
 	}
 	m_Update.writelock(__FUNCTION__, __LINE__);
@@ -1372,12 +1372,12 @@ void Spawn::SetHP(sint32 new_val, bool setUpdateFlags){
 		Player* player = (Player*)((NPC*)this)->GetOwner();
 		if (player->GetPet() && player->GetCharmedPet()) {
 			if (this == player->GetPet()) {
-				player->GetInfoStruct()->pet_health_pct = (float)basic_info.cur_hp / (float)basic_info.max_hp;
+				player->GetInfoStruct()->set_pet_health_pct((float)basic_info.cur_hp / (float)basic_info.max_hp);
 				player->SetCharSheetChanged(true);
 			}
 		}
 		else {
-			player->GetInfoStruct()->pet_health_pct = (float)basic_info.cur_hp / (float)basic_info.max_hp;
+			player->GetInfoStruct()->set_pet_health_pct((float)basic_info.cur_hp / (float)basic_info.max_hp);
 			player->SetCharSheetChanged(true);
 		}
 	}
@@ -1402,12 +1402,12 @@ void Spawn::SetTotalHP(sint32 new_val){
 		Player* player = (Player*)((NPC*)this)->GetOwner();
 		if (player->GetPet() && player->GetCharmedPet()) {
 			if (this == player->GetPet()) {
-				player->GetInfoStruct()->pet_health_pct = (float)basic_info.cur_hp / (float)basic_info.max_hp;
+				player->GetInfoStruct()->set_pet_health_pct((float)basic_info.cur_hp / (float)basic_info.max_hp);
 				player->SetCharSheetChanged(true);
 			}
 		}
 		else {
-			player->GetInfoStruct()->pet_health_pct = (float)basic_info.cur_hp / (float)basic_info.max_hp;
+			player->GetInfoStruct()->set_pet_health_pct((float)basic_info.cur_hp / (float)basic_info.max_hp);
 			player->SetCharSheetChanged(true);
 		}
 	}
@@ -1461,12 +1461,12 @@ void Spawn::SetPower(sint32 power, bool setUpdateFlags){
 		Player* player = (Player*)((NPC*)this)->GetOwner();
 		if (player->GetPet() && player->GetCharmedPet()) {
 			if (this == player->GetPet()) {
-				player->GetInfoStruct()->pet_power_pct = (float)basic_info.cur_power / (float)basic_info.max_power;
+				player->GetInfoStruct()->set_pet_power_pct((float)basic_info.cur_power / (float)basic_info.max_power);
 				player->SetCharSheetChanged(true);
 			}
 		}
 		else {
-			player->GetInfoStruct()->pet_power_pct = (float)basic_info.cur_power / (float)basic_info.max_power;
+			player->GetInfoStruct()->set_pet_power_pct((float)basic_info.cur_power / (float)basic_info.max_power);
 			player->SetCharSheetChanged(true);
 		}
 	}
@@ -1492,12 +1492,12 @@ void Spawn::SetTotalPower(sint32 new_val)
 		Player* player = (Player*)((NPC*)this)->GetOwner();
 		if (player->GetPet() && player->GetCharmedPet()) {
 			if (this == player->GetPet()) {
-				player->GetInfoStruct()->pet_power_pct = (float)basic_info.cur_power / (float)basic_info.max_power;
+				player->GetInfoStruct()->set_pet_power_pct((float)basic_info.cur_power / (float)basic_info.max_power);
 				player->SetCharSheetChanged(true);
 			}
 		}
 		else {
-			player->GetInfoStruct()->pet_power_pct = (float)basic_info.cur_power / (float)basic_info.max_power;
+			player->GetInfoStruct()->set_pet_power_pct((float)basic_info.cur_power / (float)basic_info.max_power);
 			player->SetCharSheetChanged(true);
 		}
 	}
@@ -1648,6 +1648,10 @@ void Spawn::SetUnassignedTradeskillPrestigeAA(sint16 new_val)
 	SetInfo(&basic_info.unassigned_tradeskill_prestige_aa, new_val);
 }
 
+void Spawn::SetAAXPRewards(int32 value)
+{
+	SetInfo(&basic_info.aaxp_rewards, value, false);
+}
 
 sint16 Spawn::GetAssignedAA()
 {
@@ -1689,6 +1693,11 @@ sint16 Spawn::GetUnassignedTradeskillPrestigeAA()
 	return basic_info.unassigned_tradeskill_prestige_aa;
 }
 
+int32 Spawn::GetAAXPRewards()
+{
+	return basic_info.aaxp_rewards;
+}
+
 float Spawn::GetDistance(float x1, float y1, float z1, float x2, float y2, float z2){
 	x1 = x1 - x2;
 	y1 = y1 - y2;

+ 3 - 0
EQ2/source/WorldServer/Spawn.h

@@ -203,6 +203,7 @@ struct BasicInfoStruct{
 	sint16	unassigned_prestige_aa;
 	sint16	tradeskill_prestige_aa;
 	sint16	unassigned_tradeskill_prestige_aa;
+	int32	aaxp_rewards;
 };
 
 struct MovementLocation{
@@ -672,6 +673,7 @@ public:
 	sint16 GetUnassignedPretigeAA();
 	sint16 GetTradeskillPrestigeAA();
 	sint16 GetUnassignedTradeskillPrestigeAA();
+	int32 GetAAXPRewards();
 
 	void SetTotalPower(sint32 new_val);
 	void SetTotalHP(sint32 new_val);
@@ -693,6 +695,7 @@ public:
 	void SetUnassignedPrestigeAA(sint16 new_val);
 	void SetTradeskillPrestigeAA(sint16 new_val);
 	void SetUnassignedTradeskillPrestigeAA(sint16 new_val);
+	void SetAAXPRewards(int32 amount);
 	void SetPrivateQuestSpawn(bool val) {req_quests_private = val;}
 	void SetQuestsRequiredOverride(int16 val) {req_quests_override = val;}
 	void SetQuestsRequiredContinuedAccess(bool val) {req_quests_continued_access = val;}

+ 5 - 3
EQ2/source/WorldServer/SpellProcess.cpp

@@ -656,10 +656,11 @@ bool SpellProcess::AddConcentration(LuaSpell* spell) {
 		int8 req = spell->spell->GetSpellData()->req_concentration / 256;
 		int8 current_avail = 5 - spell->caster->GetConcentrationCurrent();
 		if (current_avail >= req) {
-			spell->caster->GetInfoStruct()->cur_concentration += req;
+			int8 curConcentration = spell->caster->GetInfoStruct()->get_cur_concentration();
+			spell->caster->GetInfoStruct()->set_cur_concentration(curConcentration + req);
 			if (spell->caster->IsPlayer())
 				spell->caster->GetZone()->TriggerCharSheetTimer();
-			LogWrite(SPELL__DEBUG, 0, "Spell", "Concentration is now %u on %s", spell->caster->GetInfoStruct()->cur_concentration, spell->caster->GetName());
+			LogWrite(SPELL__DEBUG, 0, "Spell", "Concentration is now %u on %s", spell->caster->GetInfoStruct()->get_cur_concentration(), spell->caster->GetName());
 			return true;
 		}
 	}
@@ -931,7 +932,8 @@ void SpellProcess::ProcessSpell(ZoneServer* zone, Spell* spell, Entity* caster,
 
 				if (actual_concentration > 0)
 				{
-					caster->GetInfoStruct()->cur_concentration -= actual_concentration;
+					int8 curConcentration = caster->GetInfoStruct()->get_cur_concentration();
+					caster->GetInfoStruct()->set_cur_concentration(curConcentration - actual_concentration);
 					if (caster->IsPlayer())
 						caster->GetZone()->TriggerCharSheetTimer();
 				}

+ 25 - 25
EQ2/source/WorldServer/Spells.cpp

@@ -432,8 +432,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					effect_message.replace(effect_message.find("%DML"), 6, damage);
@@ -447,8 +447,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					effect_message.replace(effect_message.find("%DMH"), 6, damage);
@@ -462,8 +462,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					effect_message.replace(effect_message.find("%LDML"), 7, damage);
@@ -477,8 +477,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					effect_message.replace(effect_message.find("%LDMH"), 7, damage);
@@ -622,8 +622,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = next_spell->lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = next_spell->lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					damage.erase(damage.find_last_not_of('0') + 1, std::string::npos);
@@ -638,8 +638,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = next_spell->lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = next_spell->lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					damage.erase(damage.find_last_not_of('0') + 1, std::string::npos);
@@ -654,8 +654,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = next_spell->lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = next_spell->lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					effect_message.replace(effect_message.find("%LDML"), 7, damage);
@@ -669,8 +669,8 @@ void Spell::SetAAPacketInformation(PacketStruct* packet, AltAdvanceData* data, C
 						value = next_spell->lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 					else
 						value = next_spell->lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-					value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+					value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+					int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 					value += mod;
 					string damage = to_string((int)round(value));
 					effect_message.replace(effect_message.find("%LDMH"), 7, damage);
@@ -815,8 +815,8 @@ void Spell::SetPacketInformation(PacketStruct* packet, Client* client, bool disp
 					value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 				else
 					value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-				value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+				value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 				value += mod;
 				string damage = to_string((int)round(value));
 				effect_message.replace(effect_message.find("%DML"), 6, damage);
@@ -830,8 +830,8 @@ void Spell::SetPacketInformation(PacketStruct* packet, Client* client, bool disp
 					value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 				else
 					value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-				value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+				value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 				value += mod;
 				string damage = to_string((int)round(value));
 				effect_message.replace(effect_message.find("%DMH"), 6, damage);
@@ -845,8 +845,8 @@ void Spell::SetPacketInformation(PacketStruct* packet, Client* client, bool disp
 					value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 				else
 					value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-				value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+				value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 				value += mod;
 				string damage = to_string((int)round(value));
 				effect_message.replace(effect_message.find("%LDML"), 7, damage);
@@ -860,8 +860,8 @@ void Spell::SetPacketInformation(PacketStruct* packet, Client* client, bool disp
 					value = lua_data[data_index]->float_value * client->GetPlayer()->GetLevel();
 				else
 					value = lua_data[data_index]->int_value * client->GetPlayer()->GetLevel();
-				value *= ((client->GetPlayer()->GetInfoStruct()->potency / 100) + 1);
-				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->ability_modifier, (float)(value / 2));
+				value *= ((client->GetPlayer()->GetInfoStruct()->get_potency() / 100) + 1);
+				int32 mod = (int32)min(client->GetPlayer()->GetInfoStruct()->get_ability_modifier(), (float)(value / 2));
 				value += mod;
 				string damage = to_string((int)round(value));
 				effect_message.replace(effect_message.find("%LDMH"), 7, damage);
@@ -2077,7 +2077,7 @@ bool Spell::IsCopiedSpell() {
 
 void Spell::ModifyCastTime(Entity* caster){
 	int16 cast_time = spell->cast_time;
-	float cast_speed = caster->GetInfoStruct()->casting_speed;
+	float cast_speed = caster->GetInfoStruct()->get_casting_speed();
 	if (cast_time > 0){
 		if (cast_speed > 0) // casting speed can only reduce up to half a cast time
 			spell->cast_time *= max((float) 0.5, (float) (1 / (1 + (cast_speed * .01))));

+ 4 - 4
EQ2/source/WorldServer/World.cpp

@@ -710,8 +710,8 @@ void ZoneList::ProcessWhoQuery(vector<string>* queries, ZoneServer* zone, vector
 			add_player = true;
 			Client* find_client = zone_list.GetClientByCharName(player->GetName());
 			if (find_client == NULL) continue;
-			int flags = find_client->GetPlayer()->GetInfoStruct()->flags;
-			int flags2 = find_client->GetPlayer()->GetInfoStruct()->flags2;
+			int flags = find_client->GetPlayer()->GetInfoStruct()->get_flags();
+			int flags2 = find_client->GetPlayer()->GetInfoStruct()->get_flags2();
 			for(int32 i=0;add_player && queries && i<queries->size();i++){
 				found_match = false;
 				if(queries->at(i) == "ALL")
@@ -846,8 +846,8 @@ void ZoneList::ProcessWhoQuery(const char* query, Client* client){
 				break;
 			player = *spawn_iter;
 			Client* find_client = zone_list.GetClientByCharName(player->GetName());
-			int flags = find_client->GetPlayer()->GetInfoStruct()->flags;
-			int flags2 = find_client->GetPlayer()->GetInfoStruct()->flags2;
+			int flags = find_client->GetPlayer()->GetInfoStruct()->get_flags();
+			int flags2 = find_client->GetPlayer()->GetInfoStruct()->get_flags2();
 			packet->setArrayDataByName("char_name", player->GetName(), i);
 			packet->setArrayDataByName("level", player->GetLevel(), i);
 			packet->setArrayDataByName("admin_level", ((flags2 & (1 << (CF_HIDE_STATUS - 32))) && !isGM)?0:(find_client->GetAdminStatus() >> 4), i);

+ 122 - 87
EQ2/source/WorldServer/WorldDatabase.cpp

@@ -900,7 +900,7 @@ void WorldDatabase::LoadNPCs(ZoneServer* zone){
 	NPC* npc = 0;
 	int32 id = 0;
 	int32 total = 0;
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT,"SELECT npc.spawn_id, s.name, npc.min_level, npc.max_level, npc.enc_level, s.race, s.model_type, npc.class_, npc.gender, s.command_primary, s.command_secondary, s.show_name, npc.min_group_size, npc.max_group_size, npc.hair_type_id, npc.facial_hair_type_id, npc.wing_type_id, npc.chest_type_id, npc.legs_type_id, npc.soga_hair_type_id, npc.soga_facial_hair_type_id, s.attackable, s.show_level, s.targetable, s.show_command_icon, s.display_hand_icon, s.hp, s.power, s.size, s.collision_radius, npc.action_state, s.visual_state, npc.mood_state, npc.initial_state, npc.activity_status, s.faction_id, s.sub_title, s.merchant_id, s.merchant_type, s.size_offset, npc.attack_type, npc.ai_strategy+0, npc.spell_list_id, npc.secondary_spell_list_id, npc.skill_list_id, npc.secondary_skill_list_id, npc.equipment_list_id, npc.str, npc.sta, npc.wis, npc.intel, npc.agi, npc.heat, npc.cold, npc.magic, npc.mental, npc.divine, npc.disease, npc.poison, npc.aggro_radius, npc.cast_percentage, npc.randomize, npc.soga_model_type, npc.heroic_flag, npc.alignment, npc.elemental, npc.arcane, npc.noxious, s.savagery, s.dissonance, npc.hide_hood, npc.emote_state, s.prefix, s.suffix, s.last_name, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT,"SELECT npc.spawn_id, s.name, npc.min_level, npc.max_level, npc.enc_level, s.race, s.model_type, npc.class_, npc.gender, s.command_primary, s.command_secondary, s.show_name, npc.min_group_size, npc.max_group_size, npc.hair_type_id, npc.facial_hair_type_id, npc.wing_type_id, npc.chest_type_id, npc.legs_type_id, npc.soga_hair_type_id, npc.soga_facial_hair_type_id, s.attackable, s.show_level, s.targetable, s.show_command_icon, s.display_hand_icon, s.hp, s.power, s.size, s.collision_radius, npc.action_state, s.visual_state, npc.mood_state, npc.initial_state, npc.activity_status, s.faction_id, s.sub_title, s.merchant_id, s.merchant_type, s.size_offset, npc.attack_type, npc.ai_strategy+0, npc.spell_list_id, npc.secondary_spell_list_id, npc.skill_list_id, npc.secondary_skill_list_id, npc.equipment_list_id, npc.str, npc.sta, npc.wis, npc.intel, npc.agi, npc.heat, npc.cold, npc.magic, npc.mental, npc.divine, npc.disease, npc.poison, npc.aggro_radius, npc.cast_percentage, npc.randomize, npc.soga_model_type, npc.heroic_flag, npc.alignment, npc.elemental, npc.arcane, npc.noxious, s.savagery, s.dissonance, npc.hide_hood, npc.emote_state, s.prefix, s.suffix, s.last_name, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 													"FROM spawn s\n"
 													"INNER JOIN spawn_npcs npc\n"
 													"ON s.id = npc.spawn_id\n"
@@ -1006,26 +1006,27 @@ void WorldDatabase::LoadNPCs(ZoneServer* zone){
 		npc->SetEquipmentListID(atoul(row[46]));
 
 		InfoStruct* info = npc->GetInfoStruct();
-		info->str_base = atoi(row[47]);
-		info->sta_base = atoi(row[48]);
-		info->wis_base = atoi(row[49]);		
-		info->intel_base = atoi(row[50]);
-		info->agi_base = atoi(row[51]);
-		info->heat_base = atoi(row[52]);
-		info->cold_base = atoi(row[53]);
-		info->magic_base = atoi(row[54]);
-		info->mental_base = atoi(row[55]);
-		info->divine_base = atoi(row[56]);
-		info->disease_base = atoi(row[57]);
-		info->poison_base = atoi(row[58]);
-		info->alignment = atoi(row[64]);
+		info->set_str_base(atoi(row[47]));
+		info->set_sta_base(atoi(row[48]));
+		info->set_wis_base(atoi(row[49]));		
+		info->set_intel_base(atoi(row[50]));
+		info->set_agi_base(atoi(row[51]));
+		info->set_heat_base(atoi(row[52]));
+		info->set_cold_base(atoi(row[53]));
+		info->set_magic_base(atoi(row[54]));
+		info->set_mental_base(atoi(row[55]));
+		info->set_divine_base(atoi(row[56]));
+		info->set_disease_base(atoi(row[57]));
+		info->set_poison_base(atoi(row[58]));
+		info->set_alignment(atoi(row[64]));
+
 		npc->SetAggroRadius(atof(row[59]));
 		npc->SetCastPercentage(atoi(row[60]));
 		npc->appearance.heroic_flag = atoi(row[63]);
 
-		info->elemental_base = atoi(row[65]);
-		info->arcane_base = atoi(row[66]);
-		info->noxious_base = atoi(row[67]);
+		info->set_elemental_base(atoi(row[65]));
+		info->set_arcane_base(atoi(row[66]));
+		info->set_noxious_base(atoi(row[67]));
 		npc->SetTotalSavagery(atoul(row[68]));
 		npc->SetTotalDissonance(atoul(row[69]));
 		npc->SetSavagery(npc->GetTotalSavagery());
@@ -1048,6 +1049,8 @@ void WorldDatabase::LoadNPCs(ZoneServer* zone){
 		npc->SetSoundsDisabled(disableSounds);
 
 		npc->SetMerchantLevelRange(atoul(row[78]), atoul(row[79]));
+		
+		npc->SetAAXPRewards(atoul(row[80]));
 
 		zone->AddNPC(id, npc);
 		total++;
@@ -1067,7 +1070,7 @@ void WorldDatabase::LoadSigns(ZoneServer* zone){
 	Sign* sign = 0;
 	int32 id = 0;
 	int32 total = 0;
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT ss.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, ss.widget_id, ss.widget_x, ss.widget_y, ss.widget_z, s.command_primary, s.command_secondary, s.collision_radius, ss.icon, ss.type, ss.title, ss.description, ss.sign_distance, ss.zone_id, ss.zone_x, ss.zone_y, ss.zone_z, ss.zone_heading, ss.include_heading, ss.include_location, s.transport_id, s.size_offset, s.display_hand_icon, s.visual_state, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT ss.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, ss.widget_id, ss.widget_x, ss.widget_y, ss.widget_z, s.command_primary, s.command_secondary, s.collision_radius, ss.icon, ss.type, ss.title, ss.description, ss.sign_distance, ss.zone_id, ss.zone_x, ss.zone_y, ss.zone_z, ss.zone_heading, ss.include_heading, ss.include_location, s.transport_id, s.size_offset, s.display_hand_icon, s.visual_state, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 												  "FROM spawn s\n"
 												  "INNER JOIN spawn_signs ss\n"
 												  "ON s.id = ss.spawn_id\n"
@@ -1137,6 +1140,8 @@ void WorldDatabase::LoadSigns(ZoneServer* zone){
 		sign->SetSoundsDisabled(disableSounds);
 
 		sign->SetMerchantLevelRange(atoul(row[31]), atoul(row[32]));
+		
+		sign->SetAAXPRewards(atoul(row[33]));
 
 		zone->AddSign(id, sign);
 		total++;
@@ -1153,7 +1158,7 @@ void WorldDatabase::LoadWidgets(ZoneServer* zone){
 	Widget* widget = 0;
 	int32 id = 0;
 	int32 total = 0;
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT sw.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, sw.widget_id, sw.widget_x, sw.widget_y, sw.widget_z, s.command_primary, s.command_secondary, s.collision_radius, sw.include_heading, sw.include_location, sw.icon, sw.type, sw.open_heading, sw.open_y, sw.action_spawn_id, sw.open_sound_file, sw.close_sound_file, sw.open_duration, sw.closed_heading, sw.linked_spawn_id, sw.close_y, s.transport_id, s.size_offset, sw.house_id, sw.open_x, sw.open_z, sw.close_x, sw.close_z, s.display_hand_icon, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT sw.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, sw.widget_id, sw.widget_x, sw.widget_y, sw.widget_z, s.command_primary, s.command_secondary, s.collision_radius, sw.include_heading, sw.include_location, sw.icon, sw.type, sw.open_heading, sw.open_y, sw.action_spawn_id, sw.open_sound_file, sw.close_sound_file, sw.open_duration, sw.closed_heading, sw.linked_spawn_id, sw.close_y, s.transport_id, s.size_offset, sw.house_id, sw.open_x, sw.open_z, sw.close_x, sw.close_z, s.display_hand_icon, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 												  "FROM spawn s\n"
 												  "INNER JOIN spawn_widgets sw\n"
 												  "ON s.id = sw.spawn_id\n"
@@ -1237,6 +1242,8 @@ void WorldDatabase::LoadWidgets(ZoneServer* zone){
 		widget->SetSoundsDisabled(disableSounds);
 
 		widget->SetMerchantLevelRange(atoul(row[36]), atoul(row[37]));
+		
+		widget->SetAAXPRewards(atoul(row[38]));
 
 		zone->AddWidget(id, widget);
 		total++;
@@ -1253,7 +1260,7 @@ void WorldDatabase::LoadObjects(ZoneServer* zone){
 	Object* object = 0;
 	int32 id = 0;
 	int32 total = 0;
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT so.spawn_id, s.name, s.race, s.model_type, s.command_primary, s.command_secondary, s.targetable, s.size, s.show_name, s.visual_state, s.attackable, s.show_level, s.show_command_icon, s.display_hand_icon, s.faction_id, s.collision_radius, s.transport_id, s.size_offset, so.device_id, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT so.spawn_id, s.name, s.race, s.model_type, s.command_primary, s.command_secondary, s.targetable, s.size, s.show_name, s.visual_state, s.attackable, s.show_level, s.show_command_icon, s.display_hand_icon, s.faction_id, s.collision_radius, s.transport_id, s.size_offset, so.device_id, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 												  "FROM spawn s\n"
 												  "INNER JOIN spawn_objects so\n"
 												  "ON s.id = so.spawn_id\n"
@@ -1311,6 +1318,8 @@ void WorldDatabase::LoadObjects(ZoneServer* zone){
 
 		object->SetMerchantLevelRange(atoul(row[22]), atoul(row[23]));
 
+		object->SetAAXPRewards(atoul(row[24]));
+
 		zone->AddObject(id, object);
 		total++;
 
@@ -1326,7 +1335,7 @@ void WorldDatabase::LoadGroundSpawns(ZoneServer* zone){
 	GroundSpawn* spawn = 0;
 	int32 id = 0;
 	int32 total = 0;
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT sg.spawn_id, s.name, s.race, s.model_type, s.command_primary, s.command_secondary, s.targetable, s.size, s.show_name, s.visual_state, s.attackable, s.show_level, s.show_command_icon, s.display_hand_icon, s.faction_id, s.collision_radius, sg.number_harvests, sg.num_attempts_per_harvest, sg.groundspawn_id, sg.collection_skill, s.size_offset, s.expansion_flag, s.holiday_flag, s.disable_sounds\n"
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT sg.spawn_id, s.name, s.race, s.model_type, s.command_primary, s.command_secondary, s.targetable, s.size, s.show_name, s.visual_state, s.attackable, s.show_level, s.show_command_icon, s.display_hand_icon, s.faction_id, s.collision_radius, sg.number_harvests, sg.num_attempts_per_harvest, sg.groundspawn_id, sg.collection_skill, s.size_offset, s.expansion_flag, s.holiday_flag, s.disable_sounds, s.aaxp_rewards\n"
 												  "FROM spawn s\n"
 												  "INNER JOIN spawn_ground sg\n"
 												  "ON s.id = sg.spawn_id\n"
@@ -1385,6 +1394,8 @@ void WorldDatabase::LoadGroundSpawns(ZoneServer* zone){
 		int8 disableSounds = atoul(row[23]);
 		spawn->SetSoundsDisabled(disableSounds);
 
+		spawn->SetAAXPRewards(atoul(row[24]));
+
 		zone->AddGroundSpawn(id, spawn);
 		total++;
 		LogWrite(GROUNDSPAWN__DEBUG, 5, "GSpawn", "---Loading GroundSpawn: '%s' (%u)", spawn->appearance.name, id);
@@ -1442,36 +1453,43 @@ bool WorldDatabase::LoadCharacterStats(int32 id, int32 account_id, Client* clien
 
 			client->GetPlayer()->SetHP(result.GetSInt32Str("hp"));
 			client->GetPlayer()->SetPower(result.GetSInt32Str("power"));
-			info->max_concentration = result.GetInt8Str("max_concentration");
-			if (info->max_concentration == 0)
-				info->max_concentration = 5;
-			info->attack_base = result.GetInt16Str("attack");
-			info->mitigation_base = result.GetInt16Str("mitigation");
-			info->avoidance_base = result.GetInt16Str("avoidance");
-			info->parry_base = result.GetInt16Str("parry");
-			info->deflection_base = result.GetInt16Str("deflection");
-			info->block_base = result.GetInt16Str("block");
-			info->str_base = result.GetInt16Str("str");
-			info->sta_base = result.GetInt16Str("sta");
-			info->agi_base = result.GetInt16Str("agi");
-			info->wis_base = result.GetInt16Str("wis");
-			info->intel_base = result.GetInt16Str("intel");
+			info->set_max_concentration(result.GetInt8Str("max_concentration"));
+			
+			if (info->get_max_concentration() == 0)
+				info->set_max_concentration(5);
+
+			info->set_attack_base(result.GetInt16Str("attack"));
+			info->set_mitigation_base(result.GetInt16Str("mitigation"));
+			info->set_avoidance_base(result.GetInt16Str("avoidance"));
+			info->set_parry_base(result.GetInt16Str("parry"));
+			info->set_deflection_base(result.GetInt16Str("deflection"));
+			info->set_block_base(result.GetInt16Str("block"));
+			info->set_str_base(result.GetInt16Str("str"));
+			info->set_sta_base(result.GetInt16Str("sta"));
+			info->set_agi_base(result.GetInt16Str("agi"));
+			info->set_wis_base(result.GetInt16Str("wis"));
+			info->set_intel_base(result.GetInt16Str("intel"));
+
 			// old resist types
-			info->heat_base = result.GetInt16Str("heat");
-			info->cold_base = result.GetInt16Str("cold");
-			info->magic_base = result.GetInt16Str("magic");
-			info->mental_base = result.GetInt16Str("mental");
-			info->divine_base = result.GetInt16Str("divine");
-			info->disease_base = result.GetInt16Str("disease");
-			info->poison_base = result.GetInt16Str("poison");
+			info->set_heat_base(result.GetInt16Str("heat"));
+			info->set_cold_base(result.GetInt16Str("cold"));
+			info->set_magic_base(result.GetInt16Str("magic"));
+			info->set_mental_base(result.GetInt16Str("mental"));
+			info->set_divine_base(result.GetInt16Str("divine"));
+			info->set_disease_base(result.GetInt16Str("disease"));
+			info->set_poison_base(result.GetInt16Str("poison"));
+
 			//
-			info->coin_copper = result.GetInt32Str("coin_copper");
-			info->coin_silver = result.GetInt32Str("coin_silver");
-			info->coin_gold = result.GetInt32Str("coin_gold");
-			info->coin_plat = result.GetInt32Str("coin_plat");
-			strcpy(info->pet_name, result.GetStringStr("pet_name"));
-			strcpy(info->biography, result.GetStringStr("biography"));
-			info->status_points = result.GetInt32Str("status_points");
+
+			info->set_coin_copper(result.GetInt32Str("coin_copper"));
+			info->set_coin_silver(result.GetInt32Str("coin_silver"));
+			info->set_coin_gold(result.GetInt32Str("coin_gold"));
+			info->set_coin_plat(result.GetInt32Str("coin_plat"));
+			info->set_pet_name(result.GetStringStr("pet_name") ? std::string(result.GetStringStr("pet_name")) : std::string(""));
+			const char* bio = result.GetStringStr("biography");
+			if(bio && strlen(bio) > 0)
+				info->set_biography(std::string(bio));
+			info->set_status_points(result.GetInt32Str("status_points"));
 			client->GetPlayer()->GetPlayerInfo()->SetBindZone(result.GetInt32Str("bind_zone_id"));
 			client->GetPlayer()->GetPlayerInfo()->SetBindX(result.GetFloatStr("bind_x"));
 			client->GetPlayer()->GetPlayerInfo()->SetBindY(result.GetFloatStr("bind_y"));
@@ -1488,34 +1506,40 @@ bool WorldDatabase::LoadCharacterStats(int32 id, int32 account_id, Client* clien
 			client->GetPlayer()->SetUnassignedPrestigeAA(result.GetInt16Str("unassigned_prestige_aa"));
 			client->GetPlayer()->SetTradeskillPrestigeAA(result.GetInt16Str("tradeskill_prestige_aa"));
 			client->GetPlayer()->SetUnassignedTradeskillPrestigeAA(result.GetInt16Str("unassigned_tradeskill_prestige_aa"));
-			info->xp = result.GetInt32Str("xp");
-			info->xp_needed = result.GetInt32Str("xp_needed");
-			if(info->xp_needed == 0)
+			info->set_xp(result.GetInt32Str("xp"));
+
+			info->set_xp_needed(result.GetInt32Str("xp_needed"));
+
+			if(info->get_xp_needed()== 0)
 				client->GetPlayer()->SetNeededXP();
-			info->xp_debt = result.GetInt32Str("xp_debt");
-			info->xp_vitality = result.GetFloatStr("xp_vitality");
-			info->ts_xp = result.GetInt32Str("tradeskill_xp");
-			info->ts_xp_needed = result.GetInt32Str("tradeskill_xp_needed");
-			if (info->ts_xp_needed == 0)
+
+			info->set_xp_debt(result.GetInt32Str("xp_debt"));
+			info->set_xp_vitality(result.GetFloatStr("xp_vitality"));
+			info->set_ts_xp(result.GetInt32Str("tradeskill_xp"));
+			info->set_ts_xp_needed(result.GetInt32Str("tradeskill_xp_needed"));
+
+			if (info->get_ts_xp_needed() == 0)
 				client->GetPlayer()->SetNeededTSXP();
-			info->tradeskill_xp_vitality = result.GetFloatStr("tradeskill_xp_vitality");
+
+			info->set_tradeskill_xp_vitality(result.GetFloatStr("tradeskill_xp_vitality"));
 			client->GetPlayer()->SetTotalHPBase(client->GetPlayer()->GetTotalHP());
 			client->GetPlayer()->SetTotalPowerBase(client->GetPlayer()->GetTotalPower());
-			info->bank_coin_copper = result.GetInt32Str("bank_copper");
-			info->bank_coin_silver = result.GetInt32Str("bank_silver");
-			info->bank_coin_gold = result.GetInt32Str("bank_gold");
-			info->bank_coin_plat = result.GetInt32Str("bank_plat");
+			info->set_bank_coin_copper(result.GetInt32Str("bank_copper"));
+			info->set_bank_coin_silver(result.GetInt32Str("bank_silver"));
+			info->set_bank_coin_gold(result.GetInt32Str("bank_gold"));
+			info->set_bank_coin_plat(result.GetInt32Str("bank_plat"));
+
 			client->GetPlayer()->SetCombatVoice(result.GetInt16Str("combat_voice"));
 			client->GetPlayer()->SetEmoteVoice(result.GetInt16Str("emote_voice"));
 			client->GetPlayer()->SetBiography(result.GetStringStr("biography"));
-			client->GetPlayer()->GetInfoStruct()->flags = result.GetInt32Str("flags");
-			client->GetPlayer()->GetInfoStruct()->flags2 = result.GetInt32Str("flags2");
+			client->GetPlayer()->GetInfoStruct()->set_flags(result.GetInt32Str("flags"));
+			client->GetPlayer()->GetInfoStruct()->set_flags2(result.GetInt32Str("flags2"));
 			client->GetPlayer()->SetLastName(result.GetStringStr("last_name"));
 
 			// new resist types
-			info->elemental_base = result.GetInt16Str("elemental");
-			info->arcane_base = result.GetInt16Str("arcane");
-			info->noxious_base = result.GetInt16Str("noxious");
+			info->set_elemental_base(result.GetInt16Str("elemental"));
+			info->set_arcane_base(result.GetInt16Str("arcane"));
+			info->set_noxious_base(result.GetInt16Str("noxious"));
 			// new savagery and dissonance
 			client->GetPlayer()->SetSavagery(result.GetSInt16Str("savagery"));
 			client->GetPlayer()->SetDissonance(result.GetSInt16Str("dissonance"));
@@ -6110,7 +6134,7 @@ bool WorldDatabase::LoadSign(ZoneServer* zone, int32 spawn_id) {
 	Sign* sign = 0;
 	int32 id = 0;
 	DatabaseResult result;
-	database_new.Select(&result, "SELECT ss.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, ss.widget_id, ss.widget_x, ss.widget_y, ss.widget_z, s.command_primary, s.command_secondary, s.collision_radius, ss.icon, ss.type, ss.title, ss.description, ss.sign_distance, ss.zone_id, ss.zone_x, ss.zone_y, ss.zone_z, ss.zone_heading, ss.include_heading, ss.include_location, s.transport_id, s.size_offset, s.display_hand_icon, s.visual_state, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	database_new.Select(&result, "SELECT ss.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, ss.widget_id, ss.widget_x, ss.widget_y, ss.widget_z, s.command_primary, s.command_secondary, s.collision_radius, ss.icon, ss.type, ss.title, ss.description, ss.sign_distance, ss.zone_id, ss.zone_x, ss.zone_y, ss.zone_z, ss.zone_heading, ss.include_heading, ss.include_location, s.transport_id, s.size_offset, s.display_hand_icon, s.visual_state, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 								 "FROM spawn s\n"
 								 "INNER JOIN spawn_signs ss\n"
 								 "ON ss.spawn_id = s.id\n"
@@ -6165,6 +6189,8 @@ bool WorldDatabase::LoadSign(ZoneServer* zone, int32 spawn_id) {
 		sign->SetSoundsDisabled(result.GetInt8(28));
 
 		sign->SetMerchantLevelRange(result.GetInt32(29), result.GetInt32(30));
+		
+		sign->SetAAXPRewards(result.GetInt32(31));
 
 		zone->AddSign(id, sign);
 
@@ -6181,7 +6207,7 @@ bool WorldDatabase::LoadWidget(ZoneServer* zone, int32 spawn_id) {
 	int32 id = 0;
 	DatabaseResult result;
 
-	database_new.Select(&result, "SELECT sw.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, sw.widget_id, sw.widget_x, sw.widget_y, sw.widget_z, s.command_primary, s.command_secondary, s.collision_radius, sw.include_heading, sw.include_location, sw.icon, sw.type, sw.open_heading, sw.open_y, sw.action_spawn_id, sw.open_sound_file, sw.close_sound_file, sw.open_duration, sw.closed_heading, sw.linked_spawn_id, sw.close_y, s.transport_id, s.size_offset, sw.house_id, sw.open_x, sw.open_z, sw.close_x, sw.close_z, s.display_hand_icon, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	database_new.Select(&result, "SELECT sw.spawn_id, s.name, s.model_type, s.size, s.show_command_icon, sw.widget_id, sw.widget_x, sw.widget_y, sw.widget_z, s.command_primary, s.command_secondary, s.collision_radius, sw.include_heading, sw.include_location, sw.icon, sw.type, sw.open_heading, sw.open_y, sw.action_spawn_id, sw.open_sound_file, sw.close_sound_file, sw.open_duration, sw.closed_heading, sw.linked_spawn_id, sw.close_y, s.transport_id, s.size_offset, sw.house_id, sw.open_x, sw.open_z, sw.close_x, sw.close_z, s.display_hand_icon, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 								 "FROM spawn s\n"
 								 "INNER JOIN spawn_widgets sw\n"
 								 "ON sw.spawn_id = s.id\n"
@@ -6243,6 +6269,9 @@ bool WorldDatabase::LoadWidget(ZoneServer* zone, int32 spawn_id) {
 		widget->SetSoundsDisabled(result.GetInt8(33));
 
 		widget->SetMerchantLevelRange(result.GetInt32(34), result.GetInt32(35));
+		
+		widget->SetAAXPRewards(result.GetInt32(36));
+
 		zone->AddWidget(id, widget);
 
 		LogWrite(WIDGET__DEBUG, 0, "Widget", "Loaded Widget: '%s' (%u).", widget->appearance.name, spawn_id);
@@ -6258,7 +6287,7 @@ bool WorldDatabase::LoadObject(ZoneServer* zone, int32 spawn_id) {
 	int32 id = 0;
 	DatabaseResult result;
 
-	database_new.Select(&result, "SELECT so.spawn_id, s.name, s.race, s.model_type, s.command_primary, s.command_secondary, s.targetable, s.size, s.show_name, s.visual_state, s.attackable, s.show_level, s.show_command_icon, s.display_hand_icon, s.faction_id, s.collision_radius, s.transport_id, s.size_offset, so.device_id, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	database_new.Select(&result, "SELECT so.spawn_id, s.name, s.race, s.model_type, s.command_primary, s.command_secondary, s.targetable, s.size, s.show_name, s.visual_state, s.attackable, s.show_level, s.show_command_icon, s.display_hand_icon, s.faction_id, s.collision_radius, s.transport_id, s.size_offset, so.device_id, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 								 "FROM spawn s\n"
 								 "INNER JOIN spawn_objects so\n"
 								 "ON so.spawn_id = s.id\n"
@@ -6298,6 +6327,9 @@ bool WorldDatabase::LoadObject(ZoneServer* zone, int32 spawn_id) {
 		object->SetSoundsDisabled(result.GetInt8(19));
 
 		object->SetMerchantLevelRange(result.GetInt32(20), result.GetInt32(21));
+		
+		object->SetAAXPRewards(result.GetInt32(22));
+
 		zone->AddObject(id, object);
 
 		LogWrite(OBJECT__DEBUG, 0, "Object", "Loaded Object: '%s' (%u).", object->appearance.name, spawn_id);
@@ -6407,7 +6439,7 @@ bool WorldDatabase::LoadNPC(ZoneServer* zone, int32 spawn_id) {
 	int32 id = 0;
 	DatabaseResult result;
 										
-	database_new.Select(&result, "SELECT npc.spawn_id, s.name, npc.min_level, npc.max_level, npc.enc_level, s.race, s.model_type, npc.class_, npc.gender, s.command_primary, s.command_secondary, s.show_name, npc.min_group_size, npc.max_group_size, npc.hair_type_id, npc.facial_hair_type_id, npc.wing_type_id, npc.chest_type_id, npc.legs_type_id, npc.soga_hair_type_id, npc.soga_facial_hair_type_id, s.attackable, s.show_level, s.targetable, s.show_command_icon, s.display_hand_icon, s.hp, s.power, s.size, s.collision_radius, npc.action_state, s.visual_state, npc.mood_state, npc.initial_state, npc.activity_status, s.faction_id, s.sub_title, s.merchant_id, s.merchant_type, s.size_offset, npc.attack_type, npc.ai_strategy+0, npc.spell_list_id, npc.secondary_spell_list_id, npc.skill_list_id, npc.secondary_skill_list_id, npc.equipment_list_id, npc.str, npc.sta, npc.wis, npc.intel, npc.agi, npc.heat, npc.cold, npc.magic, npc.mental, npc.divine, npc.disease, npc.poison, npc.aggro_radius, npc.cast_percentage, npc.randomize, npc.soga_model_type, npc.heroic_flag, npc.alignment, npc.elemental, npc.arcane, npc.noxious, s.savagery, s.dissonance, npc.hide_hood, npc.emote_state, s.prefix, s.suffix, s.last_name, s.disable_sounds, s.merchant_min_level, s.merchant_max_level\n"
+	database_new.Select(&result, "SELECT npc.spawn_id, s.name, npc.min_level, npc.max_level, npc.enc_level, s.race, s.model_type, npc.class_, npc.gender, s.command_primary, s.command_secondary, s.show_name, npc.min_group_size, npc.max_group_size, npc.hair_type_id, npc.facial_hair_type_id, npc.wing_type_id, npc.chest_type_id, npc.legs_type_id, npc.soga_hair_type_id, npc.soga_facial_hair_type_id, s.attackable, s.show_level, s.targetable, s.show_command_icon, s.display_hand_icon, s.hp, s.power, s.size, s.collision_radius, npc.action_state, s.visual_state, npc.mood_state, npc.initial_state, npc.activity_status, s.faction_id, s.sub_title, s.merchant_id, s.merchant_type, s.size_offset, npc.attack_type, npc.ai_strategy+0, npc.spell_list_id, npc.secondary_spell_list_id, npc.skill_list_id, npc.secondary_skill_list_id, npc.equipment_list_id, npc.str, npc.sta, npc.wis, npc.intel, npc.agi, npc.heat, npc.cold, npc.magic, npc.mental, npc.divine, npc.disease, npc.poison, npc.aggro_radius, npc.cast_percentage, npc.randomize, npc.soga_model_type, npc.heroic_flag, npc.alignment, npc.elemental, npc.arcane, npc.noxious, s.savagery, s.dissonance, npc.hide_hood, npc.emote_state, s.prefix, s.suffix, s.last_name, s.disable_sounds, s.merchant_min_level, s.merchant_max_level, s.aaxp_rewards\n"
 								 "FROM spawn s\n"
 								 "INNER JOIN spawn_npcs npc\n"
 								 "ON npc.spawn_id = s.id\n"
@@ -6494,26 +6526,27 @@ bool WorldDatabase::LoadNPC(ZoneServer* zone, int32 spawn_id) {
 		npc->SetEquipmentListID(result.GetInt32(46));
 
 		InfoStruct* info = npc->GetInfoStruct();
-		info->str_base = result.GetInt16(47);
-		info->sta_base = result.GetInt16(48);
-		info->wis_base = result.GetInt16(49);		
-		info->intel_base = result.GetInt16(50);
-		info->agi_base = result.GetInt16(51);
-		info->heat_base = result.GetInt16(52);
-		info->cold_base = result.GetInt16(53);
-		info->magic_base = result.GetInt16(54);
-		info->mental_base = result.GetInt16(55);
-		info->divine_base = result.GetInt16(56);
-		info->disease_base = result.GetInt16(57);
-		info->poison_base = result.GetInt16(58);
-		info->alignment = result.GetInt8(64);
+		info->set_str_base(result.GetInt16(47));
+		info->set_sta_base(result.GetInt16(48));
+		info->set_wis_base(result.GetInt16(49));		
+		info->set_intel_base(result.GetInt16(50));
+		info->set_agi_base(result.GetInt16(51));
+		info->set_heat_base(result.GetInt16(52));
+		info->set_cold_base(result.GetInt16(53));
+		info->set_magic_base(result.GetInt16(54));
+		info->set_mental_base(result.GetInt16(55));
+		info->set_divine_base(result.GetInt16(56));
+		info->set_disease_base(result.GetInt16(57));
+		info->set_poison_base(result.GetInt16(58));
+		info->set_alignment(result.GetInt8(64));
+
 		npc->SetAggroRadius(result.GetFloat(59));
 		npc->SetCastPercentage(result.GetInt8(60));
 		npc->appearance.heroic_flag = result.GetInt8(63);
 
-		info->elemental_base = result.GetInt16(65);
-		info->arcane_base = result.GetInt16(66);
-		info->noxious_base = result.GetInt16(67);
+		info->set_elemental_base(result.GetInt16(65));
+		info->set_arcane_base(result.GetInt16(66));
+		info->set_noxious_base(result.GetInt16(67));
 		npc->SetTotalSavagery(result.GetInt32(68));
 		npc->SetTotalDissonance(result.GetInt32(69));
 		npc->SetSavagery(npc->GetTotalSavagery());
@@ -6533,6 +6566,8 @@ bool WorldDatabase::LoadNPC(ZoneServer* zone, int32 spawn_id) {
 		npc->SetSoundsDisabled(result.GetInt8(75));
 
 		npc->SetMerchantLevelRange(result.GetInt32(76), result.GetInt32(77));
+		
+		npc->SetAAXPRewards(result.GetInt32(78));
 
 		zone->AddNPC(id, npc);
 

+ 92 - 84
EQ2/source/WorldServer/client.cpp

@@ -1838,49 +1838,51 @@ bool Client::HandlePacket(EQApplicationPacket* app) {
 			string name = packet->getType_EQ2_16BitString_ByName("pet_name").data;
 			if (strlen(name.c_str()) != 0) {
 				target->SetName(name.c_str());
-				strcpy(player->GetInfoStruct()->pet_name, name.c_str());
+				player->GetInfoStruct()->set_pet_name(name);
 				GetCurrentZone()->SendUpdateTitles(target);
 				change = true;
 			}
 
+			int8 pet_behavior = player->GetInfoStruct()->get_pet_behavior();
 			// Check protect self setting and update if needed
 			if (packet->getType_int8_ByName("protect_self") == 1) {
-				if ((player->GetInfoStruct()->pet_behavior & 2) == 0) {
-					player->GetInfoStruct()->pet_behavior += 2;
+				if ((pet_behavior & 2) == 0) {
+					player->GetInfoStruct()->set_pet_behavior(pet_behavior + 2);
 					change = true;
 				}
 			}
 			else {
-				if ((player->GetInfoStruct()->pet_behavior & 2) != 0) {
-					player->GetInfoStruct()->pet_behavior -= 2;
+				if ((pet_behavior & 2) != 0) {
+					player->GetInfoStruct()->set_pet_behavior(pet_behavior - 2);
 					change = true;
 				}
 			}
 
 			// Check protect master setting and update if needed
 			if (packet->getType_int8_ByName("protect_master") == 1) {
-				if ((player->GetInfoStruct()->pet_behavior & 1) == 0) {
-					player->GetInfoStruct()->pet_behavior += 1;
+				if ((pet_behavior & 1) == 0) {
+					player->GetInfoStruct()->set_pet_behavior(pet_behavior + 1);
 					change = true;
 				}
 			}
 			else {
-				if ((player->GetInfoStruct()->pet_behavior & 1) != 0) {
-					player->GetInfoStruct()->pet_behavior -= 1;
+				if ((pet_behavior & 1) != 0) {
+					player->GetInfoStruct()->set_pet_behavior(pet_behavior - 1);
 					change = true;
 				}
 			}
 
+			int8 pet_movement = player->GetInfoStruct()->get_pet_movement();
 			// Check stay/follow setting and update if needed
 			if (packet->getType_int8_ByName("stay_follow_toggle") == 1) {
-				if (player->GetInfoStruct()->pet_movement != 2) {
-					player->GetInfoStruct()->pet_movement = 2;
+				if (pet_movement != 2) {
+					player->GetInfoStruct()->set_pet_movement(2);
 					change = true;
 				}
 			}
 			else {
-				if (player->GetInfoStruct()->pet_movement != 1) {
-					player->GetInfoStruct()->pet_movement = 1;
+				if (pet_movement != 1) {
+					player->GetInfoStruct()->set_pet_movement(1);
 					change = true;
 				}
 			}
@@ -4185,7 +4187,7 @@ void Client::ChangeLevel(int16 old_level, int16 new_level) {
 	GetPlayer()->ChangePrimaryWeapon();
 	GetPlayer()->ChangeSecondaryWeapon();
 	GetPlayer()->ChangeRangedWeapon();
-	GetPlayer()->GetInfoStruct()->level = new_level;
+	GetPlayer()->GetInfoStruct()->set_level(new_level);
 	// GetPlayer()->SetLevel(new_level);
 
 	LogWrite(MISC__TODO, 1, "TODO", "Get new HP/POWER/stat based on default values from DB\n\t(%s, function: %s, line #: %i)", __FILE__, __FUNCTION__, __LINE__);
@@ -4196,21 +4198,21 @@ void Client::ChangeLevel(int16 old_level, int16 new_level) {
 	GetPlayer()->SetHP(GetPlayer()->GetTotalHP());
 	GetPlayer()->SetPower(GetPlayer()->GetTotalPower());
 	InfoStruct* info = player->GetInfoStruct();
-	info->agi_base = new_level * 2 + 15;
-	info->intel_base = new_level * 2 + 15;
-	info->wis_base = new_level * 2 + 15;
-	info->str_base = new_level * 2 + 15;
-	info->sta_base = new_level * 2 + 15;
-	info->cold_base = (int16)(new_level * 1.5 + 10);
-	info->heat_base = (int16)(new_level * 1.5 + 10);
-	info->disease_base = (int16)(new_level * 1.5 + 10);
-	info->mental_base = (int16)(new_level * 1.5 + 10);
-	info->magic_base = (int16)(new_level * 1.5 + 10);
-	info->divine_base = (int16)(new_level * 1.5 + 10);
-	info->poison_base = (int16)(new_level * 1.5 + 10);
+	info->set_agi_base(new_level * 2 + 15);
+	info->set_intel_base(new_level * 2 + 15);
+	info->set_wis_base(new_level * 2 + 15);
+	info->set_str_base(new_level * 2 + 15);
+	info->set_sta_base(new_level * 2 + 15);
+	info->set_cold_base((int16)(new_level * 1.5 + 10));
+	info->set_heat_base((int16)(new_level * 1.5 + 10));
+	info->set_disease_base((int16)(new_level * 1.5 + 10));
+	info->set_mental_base((int16)(new_level * 1.5 + 10));
+	info->set_magic_base((int16)(new_level * 1.5 + 10));
+	info->set_divine_base((int16)(new_level * 1.5 + 10));
+	info->set_poison_base((int16)(new_level * 1.5 + 10));
 	GetPlayer()->SetHPRegen((int)(new_level * .75) + (int)(new_level / 10) + 3);
 	GetPlayer()->SetPowerRegen(new_level + (int)(new_level / 10) + 4);
-	GetPlayer()->GetInfoStruct()->poison_base = (int16)(new_level * 1.5 + 10);
+	GetPlayer()->GetInfoStruct()->set_poison_base((int16)(new_level * 1.5 + 10));
 	UpdateTimeStampFlag(LEVEL_UPDATE_FLAG);
 	GetPlayer()->SetCharSheetChanged(true);
 
@@ -4351,7 +4353,7 @@ void Client::ChangeTSLevel(int16 old_level, int16 new_level) {
 		QueuePacket(command_packet->serialize());
 		safe_delete(command_packet);
 	}
-	GetPlayer()->GetInfoStruct()->tradeskill_level = new_level;
+	GetPlayer()->GetInfoStruct()->set_tradeskill_level(new_level);
 	GetPlayer()->SetTSLevel(new_level);
 
 
@@ -4874,17 +4876,17 @@ void Client::Bank(Spawn* banker, bool cancel) {
 		PacketStruct* packet = configReader.getStruct("WS_UpdateBank", GetVersion());
 		if (packet) {
 			packet->setDataByName("spawn_id", GetPlayer()->GetIDWithPlayerSpawn(banker));
-			int64 coins = GetPlayer()->GetInfoStruct()->bank_coin_copper + GetPlayer()->GetInfoStruct()->bank_coin_silver * 100 +
-				GetPlayer()->GetInfoStruct()->bank_coin_gold * 10000 + (int64)GetPlayer()->GetInfoStruct()->bank_coin_plat * 1000000;
+			int64 coins = GetPlayer()->GetInfoStruct()->get_bank_coin_copper() + GetPlayer()->GetInfoStruct()->get_bank_coin_silver() * 100 +
+				GetPlayer()->GetInfoStruct()->get_bank_coin_gold() * 10000 + (int64)GetPlayer()->GetInfoStruct()->get_bank_coin_plat() * 1000000;
 			int32 coins1, coins2;
 			coins1 = ((int32*)&coins)[0];
 			coins2 = ((int32*)&coins)[1];
 			packet->setDataByName("bank_coins", coins1);
 			packet->setDataByName("bank_coins2", coins2);
-			packet->setDataByName("copper", GetPlayer()->GetInfoStruct()->coin_copper);
-			packet->setDataByName("silver", GetPlayer()->GetInfoStruct()->coin_silver);
-			packet->setDataByName("gold", GetPlayer()->GetInfoStruct()->coin_gold);
-			packet->setDataByName("plat", GetPlayer()->GetInfoStruct()->coin_plat);
+			packet->setDataByName("copper", GetPlayer()->GetInfoStruct()->get_coin_copper());
+			packet->setDataByName("silver", GetPlayer()->GetInfoStruct()->get_coin_silver());
+			packet->setDataByName("gold", GetPlayer()->GetInfoStruct()->get_coin_gold());
+			packet->setDataByName("plat", GetPlayer()->GetInfoStruct()->get_coin_plat());
 			if (!cancel)
 				packet->setDataByName("display", 1);
 			QueuePacket(packet->serialize());
@@ -4902,11 +4904,12 @@ void Client::BankWithdrawal(int64 amount) {
 		int32 tmp = 0;
 		if (amount >= 1000000) {
 			tmp = amount / 1000000;
-			if (tmp > GetPlayer()->GetBankCoinsPlat())
+			int32 bank_coins_plat = GetPlayer()->GetBankCoinsPlat();
+			if (tmp > bank_coins_plat)
 				cheater = true;
 			else {
-				GetPlayer()->GetInfoStruct()->bank_coin_plat -= tmp;
-				GetPlayer()->GetInfoStruct()->coin_plat += tmp;
+				GetPlayer()->GetInfoStruct()->set_bank_coin_plat(bank_coins_plat - tmp);
+				GetPlayer()->GetInfoStruct()->add_coin_plat(tmp);
 				amount -= (int64)tmp * 1000000;
 				sprintf(withdrawal_data, "%u Platinum ", tmp);
 				withdrawal.append(withdrawal_data);
@@ -4918,13 +4921,14 @@ void Client::BankWithdrawal(int64 amount) {
 			if (tmp > GetPlayer()->GetBankCoinsGold())
 				cheater = true;
 			else {
-				GetPlayer()->GetInfoStruct()->bank_coin_gold -= tmp;
-				if ((GetPlayer()->GetInfoStruct()->coin_gold + tmp) > 100) {
-					GetPlayer()->GetInfoStruct()->coin_gold = (GetPlayer()->GetInfoStruct()->coin_gold + tmp) - 100;
-					GetPlayer()->GetInfoStruct()->coin_plat += 1;
+				int32 bank_coins_gold = GetPlayer()->GetInfoStruct()->get_bank_coin_gold();
+				bank_coins_gold -= tmp;
+				if ((GetPlayer()->GetInfoStruct()->get_coin_gold() + tmp) > 100) {
+					GetPlayer()->GetInfoStruct()->set_coin_gold((GetPlayer()->GetInfoStruct()->get_coin_gold() + tmp) - 100);
+					GetPlayer()->GetInfoStruct()->add_coin_plat(1);
 				}
 				else
-					GetPlayer()->GetInfoStruct()->coin_gold += tmp;
+					GetPlayer()->GetInfoStruct()->add_coin_gold(tmp);
 				amount -= tmp * 10000;
 				sprintf(withdrawal_data, "%u Gold ", tmp);
 				withdrawal.append(withdrawal_data);
@@ -4933,16 +4937,17 @@ void Client::BankWithdrawal(int64 amount) {
 		}
 		if (!cheater && amount >= 100) {
 			tmp = amount / 100;
-			if (tmp > GetPlayer()->GetBankCoinsSilver())
+				int32 bank_coins_silver = GetPlayer()->GetBankCoinsSilver();
+			if (tmp > bank_coins_silver)
 				cheater = true;
 			else {
-				GetPlayer()->GetInfoStruct()->bank_coin_silver -= tmp;
-				if ((GetPlayer()->GetInfoStruct()->coin_silver + tmp) > 100) {
-					GetPlayer()->GetInfoStruct()->coin_silver = (GetPlayer()->GetInfoStruct()->coin_silver + tmp) - 100;
-					GetPlayer()->GetInfoStruct()->coin_gold += 1;
+				GetPlayer()->GetInfoStruct()->set_bank_coin_silver(bank_coins_silver - tmp);
+				if ((GetPlayer()->GetInfoStruct()->get_coin_silver() + tmp) > 100) {
+					GetPlayer()->GetInfoStruct()->set_coin_silver((GetPlayer()->GetInfoStruct()->get_coin_silver() + tmp) - 100);
+					GetPlayer()->GetInfoStruct()->add_coin_gold(1);
 				}
 				else
-					GetPlayer()->GetInfoStruct()->coin_silver += tmp;
+					GetPlayer()->GetInfoStruct()->add_coin_silver(tmp);
 				amount -= tmp * 100;
 				sprintf(withdrawal_data, "%u Silver ", tmp);
 				withdrawal.append(withdrawal_data);
@@ -4953,18 +4958,20 @@ void Client::BankWithdrawal(int64 amount) {
 			if (amount > 0) {
 				sprintf(withdrawal_data, "%u Copper ", (int32)amount);
 				withdrawal.append(withdrawal_data);
-				GetPlayer()->GetInfoStruct()->bank_coin_copper -= amount;
-				if ((GetPlayer()->GetInfoStruct()->coin_copper + amount) > 100) {
-					GetPlayer()->GetInfoStruct()->coin_copper = (GetPlayer()->GetInfoStruct()->coin_copper + amount) - 100;
-					GetPlayer()->GetInfoStruct()->coin_silver += 1;
+				int32 bank_coin_copper = GetPlayer()->GetInfoStruct()->get_bank_coin_copper();
+
+				GetPlayer()->GetInfoStruct()->set_bank_coin_copper(bank_coin_copper - amount);
+				if ((GetPlayer()->GetInfoStruct()->get_coin_copper() + amount) > 100) {
+					GetPlayer()->GetInfoStruct()->set_coin_copper((GetPlayer()->GetInfoStruct()->get_coin_copper() + amount) - 100);
+					GetPlayer()->GetInfoStruct()->add_coin_silver(1);
 				}
 				else
-					GetPlayer()->GetInfoStruct()->coin_copper += amount;
+					GetPlayer()->GetInfoStruct()->add_coin_copper(amount);
 			}
 			if (withdrawal.length() > 0) {
 				withdrawal.append("withdrawn ");
-				sprintf(withdrawal_data, "(%u Plat %u Gold %u Silver %u Copper in the bank now.)", GetPlayer()->GetInfoStruct()->bank_coin_plat,
-					GetPlayer()->GetInfoStruct()->bank_coin_gold, GetPlayer()->GetInfoStruct()->bank_coin_silver, GetPlayer()->GetInfoStruct()->bank_coin_copper);
+				sprintf(withdrawal_data, "(%u Plat %u Gold %u Silver %u Copper in the bank now.)", GetPlayer()->GetInfoStruct()->get_bank_coin_plat(),
+					GetPlayer()->GetInfoStruct()->get_bank_coin_gold(), GetPlayer()->GetInfoStruct()->get_bank_coin_silver(), GetPlayer()->GetInfoStruct()->get_bank_coin_copper());
 				withdrawal.append(withdrawal_data);
 				SimpleMessage(CHANNEL_NARRATIVE, withdrawal.c_str());
 			}
@@ -4988,8 +4995,8 @@ void Client::BankDeposit(int64 amount) {
 			if (tmp > GetPlayer()->GetCoinsPlat())
 				cheater = true;
 			else {
-				GetPlayer()->GetInfoStruct()->bank_coin_plat += tmp;
-				GetPlayer()->GetInfoStruct()->coin_plat -= tmp;
+				GetPlayer()->GetInfoStruct()->add_bank_coin_plat(tmp);
+				GetPlayer()->GetInfoStruct()->set_coin_plat(GetPlayer()->GetInfoStruct()->get_coin_plat() - tmp);
 				amount -= (int64)tmp * 1000000;
 				sprintf(deposit_data, "%u Platinum ", tmp);
 				deposit.append(deposit_data);
@@ -5001,13 +5008,13 @@ void Client::BankDeposit(int64 amount) {
 			if (tmp > GetPlayer()->GetCoinsGold())
 				cheater = true;
 			else {
-				if ((GetPlayer()->GetInfoStruct()->bank_coin_gold + tmp) > 100) {
-					GetPlayer()->GetInfoStruct()->bank_coin_gold = (GetPlayer()->GetInfoStruct()->bank_coin_gold + tmp) - 100;
-					GetPlayer()->GetInfoStruct()->bank_coin_plat += 1;
+				if ((GetPlayer()->GetInfoStruct()->get_bank_coin_gold() + tmp) > 100) {
+					GetPlayer()->GetInfoStruct()->set_bank_coin_gold((GetPlayer()->GetInfoStruct()->get_bank_coin_gold() + tmp) - 100);
+					GetPlayer()->GetInfoStruct()->add_bank_coin_plat(1);
 				}
 				else
-					GetPlayer()->GetInfoStruct()->bank_coin_gold += tmp;
-				GetPlayer()->GetInfoStruct()->coin_gold -= tmp;
+					GetPlayer()->GetInfoStruct()->add_bank_coin_gold(tmp);
+				GetPlayer()->GetInfoStruct()->set_coin_gold(GetPlayer()->GetInfoStruct()->get_coin_gold() - tmp);
 				amount -= tmp * 10000;
 				sprintf(deposit_data, "%u Gold ", tmp);
 				deposit.append(deposit_data);
@@ -5019,13 +5026,13 @@ void Client::BankDeposit(int64 amount) {
 			if (tmp > GetPlayer()->GetCoinsSilver())
 				cheater = true;
 			else {
-				if ((GetPlayer()->GetInfoStruct()->bank_coin_silver + tmp) > 100) {
-					GetPlayer()->GetInfoStruct()->bank_coin_silver = (GetPlayer()->GetInfoStruct()->bank_coin_silver + tmp) - 100;
-					GetPlayer()->GetInfoStruct()->bank_coin_gold += 1;
+				if ((GetPlayer()->GetInfoStruct()->get_bank_coin_silver() + tmp) > 100) {
+					GetPlayer()->GetInfoStruct()->set_bank_coin_silver((GetPlayer()->GetInfoStruct()->get_bank_coin_silver() + tmp) - 100);
+					GetPlayer()->GetInfoStruct()->add_bank_coin_gold(1);
 				}
 				else
-					GetPlayer()->GetInfoStruct()->bank_coin_silver += tmp;
-				GetPlayer()->GetInfoStruct()->coin_silver -= tmp;
+					GetPlayer()->GetInfoStruct()->add_bank_coin_silver(tmp);
+				GetPlayer()->GetInfoStruct()->set_coin_silver(GetPlayer()->GetInfoStruct()->get_coin_silver() - tmp);
 				amount -= tmp * 100;
 				sprintf(deposit_data, "%u Silver ", tmp);
 				deposit.append(deposit_data);
@@ -5036,18 +5043,18 @@ void Client::BankDeposit(int64 amount) {
 			if (amount > 0) {
 				sprintf(deposit_data, "%u Copper ", (int32)amount);
 				deposit.append(deposit_data);
-				if ((GetPlayer()->GetInfoStruct()->bank_coin_copper + amount) > 100) {
-					GetPlayer()->GetInfoStruct()->bank_coin_copper = (GetPlayer()->GetInfoStruct()->bank_coin_copper + amount) - 100;
-					GetPlayer()->GetInfoStruct()->bank_coin_silver += 1;
+				if ((GetPlayer()->GetInfoStruct()->get_bank_coin_copper() + amount) > 100) {
+					GetPlayer()->GetInfoStruct()->set_bank_coin_copper((GetPlayer()->GetInfoStruct()->get_bank_coin_copper() + amount) - 100);
+					GetPlayer()->GetInfoStruct()->add_bank_coin_silver(1);
 				}
 				else
-					GetPlayer()->GetInfoStruct()->bank_coin_copper += amount;
-				GetPlayer()->GetInfoStruct()->coin_copper -= amount;
+					GetPlayer()->GetInfoStruct()->add_bank_coin_copper(amount);
+				GetPlayer()->GetInfoStruct()->set_coin_copper(GetPlayer()->GetInfoStruct()->get_coin_copper() - amount);
 			}
 			if (deposit.length() > 0) {
 				deposit.append("deposited ");
-				sprintf(deposit_data, "(%u Plat %u Gold %u Silver %u Copper in the bank now.)", GetPlayer()->GetInfoStruct()->bank_coin_plat,
-					GetPlayer()->GetInfoStruct()->bank_coin_gold, GetPlayer()->GetInfoStruct()->bank_coin_silver, GetPlayer()->GetInfoStruct()->bank_coin_copper);
+				sprintf(deposit_data, "(%u Plat %u Gold %u Silver %u Copper in the bank now.)", GetPlayer()->GetInfoStruct()->get_bank_coin_plat(),
+					GetPlayer()->GetInfoStruct()->get_bank_coin_gold(), GetPlayer()->GetInfoStruct()->get_bank_coin_silver(), GetPlayer()->GetInfoStruct()->get_bank_coin_copper());
 				deposit.append(deposit_data);
 				SimpleMessage(CHANNEL_NARRATIVE, deposit.c_str());
 			}
@@ -5521,7 +5528,7 @@ void Client::AcceptQuestReward(Quest* quest, int32 item_id) {
 				player->GetFactions()->DecreaseFaction(faction_id, (amount * -1));
 		}
 		if (player->GetGuild()) {
-			player->GetInfoStruct()->status_points += quest->GetStatusPoints();
+			player->GetInfoStruct()->add_status_points(quest->GetStatusPoints());
 			player->SetCharSheetChanged(true);
 		}
 	}
@@ -5570,7 +5577,7 @@ void Client::DisplayQuestRewards(Quest* quest, int64 coin, vector<Item*>* reward
 		packet2->setSubstructDataByName("reward_data", "max_coin", coin);
 		if (player->GetGuild()) {
 			if (!quest) { //this entire function is either for version <=546 or for quest rewards in middle of quest, so quest should be 0, otherwise quest will handle the rewards
-				player->GetInfoStruct()->status_points += status_points;
+				player->GetInfoStruct()->add_status_points(status_points);
 				player->SetCharSheetChanged(true);
 			}
 			packet2->setSubstructDataByName("reward_data", "status_points", status_points);
@@ -6267,7 +6274,7 @@ void Client::SellItem(int32 item_id, int16 quantity, int32 unique_id) {
 				quantity = item->details.count;
 			if (player->GetGuild()) {
 				total_status_sell_price = status_sell_price * quantity;
-				player->GetInfoStruct()->status_points += total_status_sell_price;
+				player->GetInfoStruct()->add_status_points(total_status_sell_price);
 				guild->UpdateGuildStatus(GetPlayer(), total_status_sell_price / 10);
 				guild->SendGuildMemberList();
 				guild->AddEXPCurrent((total_status_sell_price / 10), true);
@@ -6440,7 +6447,7 @@ void Client::BuyItem(int32 item_id, int16 quantity) {
 
 					// Check if the player has enough status, coins and staion cash to buy the item before checking the items
 					// TODO: need to add support for station cash
-					if (player->GetInfoStruct()->status_points >= ItemInfo->price_status && player->HasCoins(ItemInfo->price_coins * quantity)) {
+					if (player->GetInfoStruct()->get_status_points() >= ItemInfo->price_status && player->HasCoins(ItemInfo->price_coins * quantity)) {
 						// Check items
 						int16 item_quantity = 0;
 						// Default these to true in case price_item_id or price_item2_id was never set
@@ -6479,7 +6486,7 @@ void Client::BuyItem(int32 item_id, int16 quantity) {
 						}
 						// if we have every thing then remove the price and give the item
 						if (hasItem1 && hasItem2) {
-							player->GetInfoStruct()->status_points -= ItemInfo->price_status;
+							player->GetInfoStruct()->set_status_points(player->GetInfoStruct()->get_status_points() - ItemInfo->price_status);
 							// TODO: station cash
 
 							// The update that would normally be sent after modifing the players inventory is automatically sent in AddItem wich is called later
@@ -8945,11 +8952,11 @@ void Client::SendPetOptionsWindow(const char* pet_name, int8 type) {
 	if (packet) {
 		if (pet_name)
 			packet->setDataByName("pet_name", pet_name);
-		if (player->GetInfoStruct()->pet_behavior & 1)
+		if (player->GetInfoStruct()->get_pet_behavior() & 1)
 			packet->setDataByName("protect_master", 1);
-		if (player->GetInfoStruct()->pet_behavior & 2)
+		if (player->GetInfoStruct()->get_pet_behavior() & 2)
 			packet->setDataByName("protect_self", 1);
-		if (player->GetInfoStruct()->pet_movement == 2)
+		if (player->GetInfoStruct()->get_pet_movement() == 2)
 			packet->setDataByName("stay_follow_toggle", 1);
 
 		packet->setDataByName("pet_type", type);
@@ -8967,8 +8974,9 @@ bool Client::IsCrafting() {
 void Client::SendBiography() {
 	PacketStruct* packet = configReader.getStruct("WS_BioUpdate", GetVersion());
 	if (packet) {
-		if (strlen(player->GetInfoStruct()->biography) > 0)
-			packet->setDataByName("biography", player->GetInfoStruct()->biography);
+		char biography[512];
+		strncpy(biography, player->GetInfoStruct()->get_biography().c_str(), player->GetInfoStruct()->get_biography().size());
+		packet->setDataByName("biography", biography);
 
 		QueuePacket(packet->serialize());
 	}

+ 1 - 1
EQ2/source/WorldServer/makefile

@@ -20,7 +20,7 @@ Lua_W_Flags	= -Wall
 
 
 # World flags
-C_Flags		= -I/usr/include/mariadb -I../depends/fmt/include -I../depends/recastnavigation/Detour/Include -I/usr/local/include/boost -I../depends/glm/ -march=native -pipe -pthread -std=c++0x
+C_Flags		= -I/usr/include/mariadb -I../depends/fmt/include -I../depends/recastnavigation/Detour/Include -I/usr/local/include/boost -I../depends/glm/ -march=native -pipe -pthread -std=c++14
 LD_Flags	= -L/usr/lib/x86_64-linux-gnu -lz -lpthread -lmariadbclient -L../depends/recastnavigation/RecastDemo/Build/gmake/lib/Debug -lDebugUtils -lDetour -lDetourCrowd -lDetourTileCache -lRecast -L/usr/local/lib -rdynamic -lm -Wl,-E -ldl -lreadline -lboost_system -lboost_filesystem -lboost_iostreams -lboost_regex
 W_Flags		= -Wall -Wno-reorder
 D_Flags		= -DEQ2 -DWORLD -D_GNU_SOURCE

+ 1 - 1
EQ2/source/WorldServer/makefile.a64

@@ -145,7 +145,7 @@ SRC= ../common/Condition.o \
 	zoneserver.o
 
 
-CXXFLAGS=-std=c++0x
+CXXFLAGS=-std=c++14
 CFLAGS=`mysql_config --cflags` -march=native -pipe -pthread
 LDFLAGS=`mysql_config --libs` -I$(LUADIR) -L$(LUADIR) -llua5-3-4 -rdynamic
 WFLAGS=-Wall -Wno-reorder

+ 12 - 12
EQ2/source/WorldServer/zoneserver.cpp

@@ -2894,7 +2894,7 @@ void ZoneServer::AddSpawn(Spawn* spawn) {
 	if(spawn->IsPlayer() && ((Player*)spawn)->GetGroupMemberInfo())
 		world.GetGroupManager()->SendGroupUpdate(((Player*)spawn)->GetGroupMemberInfo()->group_id, GetClientBySpawn(spawn));
 	if (spawn->IsPlayer()) {
-		((Player*)spawn)->GetInfoStruct()->rain = rain;
+		((Player*)spawn)->GetInfoStruct()->set_rain(rain);
 		((Player*)spawn)->SetCharSheetChanged(true);
 	}
 	
@@ -3220,11 +3220,11 @@ void ZoneServer::UpdateVitality(float amount){
 	MClientList.readlock(__FUNCTION__, __LINE__);
 	for (client_itr = clients.begin(); client_itr != clients.end(); client_itr++) {
 		client = *client_itr;
-		if(client && client->GetPlayer()->GetInfoStruct()->xp_vitality < 100){
-			if((client->GetPlayer()->GetInfoStruct()->xp_vitality + amount) > 100)
-				client->GetPlayer()->GetInfoStruct()->xp_vitality = 100;
+		if(client && client->GetPlayer()->GetInfoStruct()->get_xp_vitality() < 100){
+			if((client->GetPlayer()->GetInfoStruct()->get_xp_vitality() + amount) > 100)
+				client->GetPlayer()->GetInfoStruct()->set_xp_vitality(100);
 			else
-				client->GetPlayer()->GetInfoStruct()->xp_vitality += amount;
+				client->GetPlayer()->GetInfoStruct()->add_xp_vitality(amount);
 			client->GetPlayer()->SetCharSheetChanged(true);
 		}
 	}
@@ -6232,7 +6232,7 @@ void ZoneServer::SetRain(float val) {
 	MClientList.readlock(__FUNCTION__, __LINE__);
 	for (itr = clients.begin(); itr != clients.end(); itr++) {
 		Client* client = *itr;
-		client->GetPlayer()->GetInfoStruct()->rain = val;
+		client->GetPlayer()->GetInfoStruct()->set_rain(val);
 		client->GetPlayer()->SetCharSheetChanged(true);
 		if( val >= 0.75 && !weather_signaled )
 		{
@@ -6261,7 +6261,7 @@ void ZoneServer::SetWind(float val) {
 	MClientList.readlock(__FUNCTION__, __LINE__);
 	for (itr = clients.begin(); itr != clients.end(); itr++) {
 		Client* client = *itr;
-		client->GetPlayer()->GetInfoStruct()->wind = val;
+		client->GetPlayer()->GetInfoStruct()->set_wind(val);
 		client->GetPlayer()->SetCharSheetChanged(true);
 	}
 	MClientList.releasereadlock(__FUNCTION__, __LINE__);
@@ -6517,21 +6517,21 @@ void ZoneServer::ResurrectSpawn(Spawn* spawn, Client* client) {
 		power_amt *= ((caster->stats[ITEM_STAT_POTENCY] / 100) + 1);
 
 		//Ability Mod
-		heal_amt += (int32)min((int32)info->ability_modifier, (int32)(heal_amt / 2));
-		power_amt += (int32)min((int32)info->ability_modifier, (int32)(power_amt / 2));
+		heal_amt += (int32)min((int32)info->get_ability_modifier(), (int32)(heal_amt / 2));
+		power_amt += (int32)min((int32)info->get_ability_modifier(), (int32)(power_amt / 2));
 
 		if(!crit_mod || crit_mod == 1){
 			if(crit_mod == 1) 
 				crit = true;
 			else {
 				// Crit Roll
-				float chance = (float)max((float)0, (float)info->crit_chance);
+				float chance = (float)max((float)0, (float)info->get_crit_chance());
 				crit = (MakeRandomFloat(0, 100) <= chance); 
 			}
 			if(crit){
 				//Apply total crit multiplier with crit bonus
-				heal_amt *= ((info->crit_bonus / 100) + 1.3);
-				power_amt *= ((info->crit_bonus / 100) + 1.3);
+				heal_amt *= ((info->get_crit_bonus() / 100) + 1.3);
+				power_amt *= ((info->get_crit_bonus() / 100) + 1.3);
 			}
 		}
 	}

+ 5 - 4
EQ2/source/common/PacketStruct.cpp

@@ -2279,11 +2279,11 @@ void PacketStruct::SetSubPacketSize(int32 new_size) {
 }
 void* PacketStruct::GetStructPointer(DataStruct* data_struct, bool erase) {
 	try {
-		void* tmp = struct_data[data_struct];
-		if (tmp != 0) {
+		map<DataStruct*, void*>::iterator tmpitr = struct_data.find(data_struct);
+		if (tmpitr != struct_data.end()) {
 			if (erase)
 				struct_data.erase(data_struct);
-			return tmp;
+			return tmpitr->second;
 		}
 		else {
 			PacketStruct* packet = 0;
@@ -2291,7 +2291,7 @@ void* PacketStruct::GetStructPointer(DataStruct* data_struct, bool erase) {
 			for (itr2 = arrays.begin(); itr2 != arrays.end(); itr2++) {
 				packet = *itr2;
 				if (packet) {
-					tmp = packet->GetStructPointer(data_struct, erase);
+					void* tmp = packet->GetStructPointer(data_struct, erase);
 					if (tmp != 0)
 						return tmp;
 				}
@@ -2581,6 +2581,7 @@ void PacketStruct::setItem(DataStruct* ds, Item* item, Player* player, int32 ind
 			memcpy(out_ptr, (uchar*)generic_string_data->c_str() + (13 + offset), generic_string_data->length() - (13 + offset));
 		}
 		ds->SetItemSize(size);
+		//printf("Item Name: %s\n",item->name.c_str());
 		//DumpPacket(out_data, size);
 		memcpy(ptr, out_data, size);
 		safe_delete_array(out_data);

Vissa filer visades inte eftersom för många filer har ändrats