From 32c916ee6866ba29ef1d36625b71ff0867b0f169 Mon Sep 17 00:00:00 2001 From: Henrique Date: Wed, 30 Nov 2011 16:59:36 -0200 Subject: [PATCH] fluids fixed. thanks chojrak. still needs to create some constants to fluids type. --- src/otclient/const.h | 24 ++++++++++++++ src/otclient/core/item.cpp | 68 +++++++++++++++++++------------------- 2 files changed, 58 insertions(+), 34 deletions(-) diff --git a/src/otclient/const.h b/src/otclient/const.h index 275b979d..3649f558 100644 --- a/src/otclient/const.h +++ b/src/otclient/const.h @@ -315,6 +315,30 @@ namespace Otc NorthWest }; + enum FluidsColor { + FluidTransparent, + FluidBlue, + FluidRed, + FluidBrown, + FluidGreen, + FluidYellow, + FluidWhite, + FluidPurple + }; + + enum FluidsType { + FluidWater = 1, + FluidMana = 2, + FluidBeer = 3, + FluidBlood = 5, + FluidSlime = 6, + FluidLemonade = 8, + FluidMilk = 9, + FluidWine = 10, + FluidHealth = 11, + FluidCoconutMilk = 15 + }; + enum SpeakClasses { SpeakSay = 0x01, //normal talk SpeakWhisper = 0x02, //whispering - #w text diff --git a/src/otclient/core/item.cpp b/src/otclient/core/item.cpp index ad825566..5cced26b 100644 --- a/src/otclient/core/item.cpp +++ b/src/otclient/core/item.cpp @@ -47,7 +47,7 @@ void Item::setPosition(const Position& position) { const ThingType& type = getType(); - if(type.properties[ThingType::NotMovable]) { + if(type.properties[ThingType::IsGround]) { m_xPattern = position.x % type.dimensions[ThingType::PatternX]; m_yPattern = position.y % type.dimensions[ThingType::PatternY]; m_zPattern = position.z % type.dimensions[ThingType::PatternZ]; @@ -91,70 +91,70 @@ void Item::setData(int data) } } else if(type.properties[ThingType::IsFluid] || type.properties[ThingType::IsFluidContainer]) { - int var = 0; - // TODO: find out what the heck does it mean + int color = 0; + // TODO: find out what the heck does it mean 4, 7, 12, 13, 14, 16, 17. options are already there switch(data) { case 0: - var = 0; + color = 0; break; - case 1: - var = 1; + case Otc::FluidWater: + color = Otc::FluidBlue; break; - case 2: - var = 7; + case Otc::FluidMana: + color = Otc::FluidPurple; break; - case 3: - var = 3; + case Otc::FluidBeer: + color = Otc::FluidBrown; break; case 4: - var = 3; + color = Otc::FluidBrown; // oil, mud, mead, rum, tea break; - case 5: - var = 2; + case Otc::FluidBlood: + color = Otc::FluidRed; break; - case 6: - var = 4; + case Otc::FluidSlime: + color = Otc::FluidGreen; break; case 7: - var = 3; + color = Otc::FluidBrown; // oil, mud, mead, rum, tea break; - case 8: - var = 5; + case Otc::FluidLemonade: + color = Otc::FluidYellow; break; - case 9: - var = 6; + case Otc::FluidMilk: + color = Otc::FluidWhite; break; - case 10: - var = 7; + case Otc::FluidWine: + color = Otc::FluidPurple; break; - case 11: - var = 2; + case Otc::FluidHealth: + color = Otc::FluidRed; break; case 12: - var = 5; + color = Otc::FluidYellow; // urine, fruit juice break; case 13: - var = 3; + color = Otc::FluidBrown; // oil, mud, mead, rum, tea break; case 14: - var = 5; + color = Otc::FluidYellow; // urine, fruit juice break; - case 15: - var = 6; + case Otc::FluidCoconutMilk: + color = Otc::FluidWhite; break; case 16: - var = 3; + color = Otc::FluidBrown; // oil, mud, mead, rum, tea break; case 17: - var = 3; + color = Otc::FluidBrown; // oil, mud, mead, rum, tea break; default: - var = 1; + color = 1; break; } - m_xPattern = (var & 3) % type.dimensions[ThingType::PatternX]; - m_yPattern = (var >> 2) % type.dimensions[ThingType::PatternY]; + m_xPattern = (color % 4) % type.dimensions[ThingType::PatternX]; + m_yPattern = (color / 4) % type.dimensions[ThingType::PatternY]; } m_data = data;