10.94, 10.95 support
This commit is contained in:
parent
8992d40e37
commit
1ec3b65a3a
|
@ -78,6 +78,11 @@ function resetSkillColor(id)
|
|||
widget:setColor('#bbbbbb')
|
||||
end
|
||||
|
||||
function toggleSkill(id, state)
|
||||
local skill = skillsWindow:recursiveGetChildById(id)
|
||||
skill:setVisible(state)
|
||||
end
|
||||
|
||||
function setSkillBase(id, value, baseValue)
|
||||
if baseValue <= 0 or value < 0 then
|
||||
return
|
||||
|
@ -118,12 +123,14 @@ end
|
|||
function setSkillPercent(id, percent, tooltip)
|
||||
local skill = skillsWindow:recursiveGetChildById(id)
|
||||
local widget = skill:getChildById('percent')
|
||||
if widget then
|
||||
widget:setPercent(math.floor(percent))
|
||||
|
||||
if tooltip then
|
||||
widget:setTooltip(tooltip)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function checkAlert(id, value, maxValue, threshold, greaterThan)
|
||||
if greaterThan == nil then greaterThan = false end
|
||||
|
@ -204,17 +211,26 @@ function refresh()
|
|||
onRegenerationChange(player, player:getRegenerationTime())
|
||||
onSpeedChange(player, player:getSpeed())
|
||||
|
||||
for i=0,6 do
|
||||
local hasAdditionalSkills = g_game.getFeature(GameAdditionalSkills)
|
||||
for i = Skill.Fist, Skill.ManaLeechAmount do
|
||||
onSkillChange(player, i, player:getSkillLevel(i), player:getSkillLevelPercent(i))
|
||||
onBaseSkillChange(player, i, player:getSkillBaseLevel(i))
|
||||
|
||||
if i > Skill.Fishing then
|
||||
toggleSkill('skillId'..i, hasAdditionalSkills)
|
||||
end
|
||||
end
|
||||
|
||||
update()
|
||||
|
||||
local contentsPanel = skillsWindow:getChildById('contentsPanel')
|
||||
skillsWindow:setContentMinimumHeight(44)
|
||||
if hasAdditionalSkills then
|
||||
skillsWindow:setContentMaximumHeight(480)
|
||||
else
|
||||
skillsWindow:setContentMaximumHeight(390)
|
||||
end
|
||||
end
|
||||
|
||||
function offline()
|
||||
if expSpeedEvent then expSpeedEvent:cancel() expSpeedEvent = nil end
|
||||
|
|
|
@ -5,6 +5,9 @@ SkillButton < UIButton
|
|||
margin-bottom: 2
|
||||
&onClick: onSkillButtonClick
|
||||
|
||||
SmallSkillButton < SkillButton
|
||||
height: 14
|
||||
|
||||
SkillNameLabel < GameLabel
|
||||
font: verdana-11px-monochrome
|
||||
anchors.left: parent.left
|
||||
|
@ -170,3 +173,39 @@ MiniWindow
|
|||
!text: tr('Fishing')
|
||||
SkillValueLabel
|
||||
SkillPercentPanel
|
||||
|
||||
SmallSkillButton
|
||||
id: skillId7
|
||||
SkillNameLabel
|
||||
!text: tr('Critical Hit Chance')
|
||||
SkillValueLabel
|
||||
|
||||
SmallSkillButton
|
||||
id: skillId8
|
||||
SkillNameLabel
|
||||
!text: tr('Critical Hit Damage')
|
||||
SkillValueLabel
|
||||
|
||||
SmallSkillButton
|
||||
id: skillId9
|
||||
SkillNameLabel
|
||||
!text: tr('Life Leech Chance')
|
||||
SkillValueLabel
|
||||
|
||||
SmallSkillButton
|
||||
id: skillId10
|
||||
SkillNameLabel
|
||||
!text: tr('Life Leech Amount')
|
||||
SkillValueLabel
|
||||
|
||||
SmallSkillButton
|
||||
id: skillId11
|
||||
SkillNameLabel
|
||||
!text: tr('Life Leech Chance')
|
||||
SkillValueLabel
|
||||
|
||||
SmallSkillButton
|
||||
id: skillId12
|
||||
SkillNameLabel
|
||||
!text: tr('Life Leech Amount')
|
||||
SkillValueLabel
|
||||
|
|
|
@ -45,6 +45,22 @@ Directions = {
|
|||
NorthWest = 7
|
||||
}
|
||||
|
||||
Skill = {
|
||||
Fist = 0,
|
||||
Club = 1,
|
||||
Sword = 2,
|
||||
Axe = 3,
|
||||
Distance = 4,
|
||||
Shielding = 5,
|
||||
Fishing = 6,
|
||||
CriticalChance = 7,
|
||||
CriticalDamage = 8,
|
||||
LifeLeechChance = 9,
|
||||
LifeLeechAmount = 10,
|
||||
ManaLeechChance = 11,
|
||||
ManaLeechAmount = 12
|
||||
}
|
||||
|
||||
North = Directions.North
|
||||
East = Directions.East
|
||||
South = Directions.South
|
||||
|
@ -134,6 +150,9 @@ GameDeathType = 70
|
|||
GameIdleAnimations = 71
|
||||
GameKeepUnawareTiles = 72
|
||||
GameIngameStore = 73
|
||||
GameIngameStoreHighlights = 74
|
||||
GameIngameStoreServiceType = 75
|
||||
GameAdditionalSkills = 76
|
||||
|
||||
TextColors = {
|
||||
red = '#f55e5e', --'#c83200'
|
||||
|
|
|
@ -75,7 +75,7 @@ function g_game.getSupportedClients()
|
|||
1063, 1064, 1070, 1071, 1072,
|
||||
1073, 1074, 1075, 1076, 1080,
|
||||
1081, 1082, 1090, 1091, 1092,
|
||||
1093
|
||||
1093, 1094, 1095
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -148,6 +148,12 @@ namespace Otc
|
|||
Distance,
|
||||
Shielding,
|
||||
Fishing,
|
||||
CriticalChance,
|
||||
CriticalDamage,
|
||||
LifeLeechChance,
|
||||
LifeLeechAmount,
|
||||
ManaLeechChance,
|
||||
ManaLeechAmount,
|
||||
LastSkill
|
||||
};
|
||||
|
||||
|
@ -318,19 +324,20 @@ namespace Otc
|
|||
MessageTutorialHint = 38,
|
||||
MessageThankyou = 39,
|
||||
MessageMarket = 40,
|
||||
MessageBeyondLast = 41,
|
||||
MessageMana = 41,
|
||||
MessageBeyondLast = 42,
|
||||
|
||||
// deprecated
|
||||
MessageMonsterYell = 42,
|
||||
MessageMonsterSay = 43,
|
||||
MessageRed = 44,
|
||||
MessageBlue = 45,
|
||||
MessageRVRChannel = 46,
|
||||
MessageRVRAnswer = 47,
|
||||
MessageRVRContinue = 48,
|
||||
MessageGameHighlight = 49,
|
||||
MessageNpcFromStartBlock = 50,
|
||||
LastMessage = 51,
|
||||
MessageMonsterYell = 43,
|
||||
MessageMonsterSay = 44,
|
||||
MessageRed = 45,
|
||||
MessageBlue = 46,
|
||||
MessageRVRChannel = 47,
|
||||
MessageRVRAnswer = 48,
|
||||
MessageRVRContinue = 49,
|
||||
MessageGameHighlight = 50,
|
||||
MessageNpcFromStartBlock = 51,
|
||||
LastMessage = 52,
|
||||
MessageInvalid = 255
|
||||
};
|
||||
|
||||
|
@ -408,6 +415,7 @@ namespace Otc
|
|||
GameIngameStore = 73,
|
||||
GameIngameStoreHighlights = 74,
|
||||
GameIngameStoreServiceType = 75,
|
||||
GameAdditionalSkills = 76,
|
||||
|
||||
LastGameFeature = 101
|
||||
};
|
||||
|
|
|
@ -1492,7 +1492,7 @@ void Game::setProtocolVersion(int version)
|
|||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change protocol version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1093))
|
||||
if(version != 0 && (version < 740 || version > 1095))
|
||||
stdext::throw_exception(stdext::format("Protocol version %d not supported", version));
|
||||
|
||||
m_protocolVersion = version;
|
||||
|
@ -1510,7 +1510,7 @@ void Game::setClientVersion(int version)
|
|||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
if(version != 0 && (version < 740 || version > 1093))
|
||||
if(version != 0 && (version < 740 || version > 1095))
|
||||
stdext::throw_exception(stdext::format("Client version %d not supported", version));
|
||||
|
||||
m_features.reset();
|
||||
|
@ -1674,6 +1674,9 @@ void Game::setClientVersion(int version)
|
|||
enableFeature(Otc::GameIngameStoreHighlights);
|
||||
}
|
||||
|
||||
if(version >= 1094) {
|
||||
enableFeature(Otc::GameAdditionalSkills);
|
||||
}
|
||||
|
||||
m_clientVersion = version;
|
||||
|
||||
|
|
|
@ -387,9 +387,13 @@ void Client::registerLuaFunctions()
|
|||
g_lua.bindClassMemberFunction<Thing>("isTranslucent", &Thing::isTranslucent);
|
||||
g_lua.bindClassMemberFunction<Thing>("isFullGround", &Thing::isFullGround);
|
||||
g_lua.bindClassMemberFunction<Thing>("isMarketable", &Thing::isMarketable);
|
||||
g_lua.bindClassMemberFunction<Thing>("getMarketData", &Thing::getMarketData);
|
||||
g_lua.bindClassMemberFunction<Thing>("isUsable", &Thing::isUsable);
|
||||
g_lua.bindClassMemberFunction<Thing>("isWrapable", &Thing::isWrapable);
|
||||
g_lua.bindClassMemberFunction<Thing>("isUnwrapable", &Thing::isUnwrapable);
|
||||
g_lua.bindClassMemberFunction<Thing>("isTopEffect", &Thing::isTopEffect);
|
||||
g_lua.bindClassMemberFunction<Thing>("isLyingCorpse", &Thing::isLyingCorpse);
|
||||
g_lua.bindClassMemberFunction<Thing>("getParentContainer", &Thing::getParentContainer);
|
||||
g_lua.bindClassMemberFunction<Thing>("getMarketData", &Thing::getMarketData);
|
||||
|
||||
g_lua.registerClass<House>();
|
||||
g_lua.bindClassStaticFunction<House>("create", []{ return HousePtr(new House); });
|
||||
|
@ -541,6 +545,10 @@ void Client::registerLuaFunctions()
|
|||
g_lua.bindClassMemberFunction<ThingType>("isCloth", &ThingType::isCloth);
|
||||
g_lua.bindClassMemberFunction<ThingType>("isMarketable", &ThingType::isMarketable);
|
||||
g_lua.bindClassMemberFunction<ThingType>("getMarketData", &ThingType::getMarketData);
|
||||
g_lua.bindClassMemberFunction<ThingType>("isUsable", &ThingType::isUsable);
|
||||
g_lua.bindClassMemberFunction<ThingType>("isWrapable", &ThingType::isWrapable);
|
||||
g_lua.bindClassMemberFunction<ThingType>("isUnwrapable", &ThingType::isUnwrapable);
|
||||
g_lua.bindClassMemberFunction<ThingType>("isTopEffect", &ThingType::isTopEffect);
|
||||
g_lua.bindClassMemberFunction<ThingType>("getSprites", &ThingType::getSprites);
|
||||
g_lua.bindClassMemberFunction<ThingType>("hasAttribute", &ThingType::hasAttr);
|
||||
g_lua.bindClassMemberFunction<ThingType>("exportImage", &ThingType::exportImage);
|
||||
|
|
|
@ -29,6 +29,10 @@ std::map<uint8, uint8> messageModesMap;
|
|||
void buildMessageModesMap(int version) {
|
||||
messageModesMap.clear();
|
||||
|
||||
if(version >= 1094) {
|
||||
messageModesMap[Otc::MessageMana] = 43;
|
||||
}
|
||||
|
||||
if(version >= 1055) { // might be 1054
|
||||
messageModesMap[Otc::MessageNone] = 0;
|
||||
messageModesMap[Otc::MessageSay] = 1;
|
||||
|
|
|
@ -1376,7 +1376,11 @@ void ProtocolGame::parsePlayerStats(const InputMessagePtr& msg)
|
|||
|
||||
void ProtocolGame::parsePlayerSkills(const InputMessagePtr& msg)
|
||||
{
|
||||
for(int skill = 0; skill < Otc::LastSkill; skill++) {
|
||||
int lastSkill = Otc::Fishing + 1;
|
||||
if(g_game.getFeature(Otc::GameAdditionalSkills))
|
||||
lastSkill = Otc::LastSkill;
|
||||
|
||||
for(int skill = 0; skill < lastSkill; skill++) {
|
||||
int level;
|
||||
|
||||
if(g_game.getFeature(Otc::GameDoubleSkills))
|
||||
|
@ -1393,7 +1397,10 @@ void ProtocolGame::parsePlayerSkills(const InputMessagePtr& msg)
|
|||
else
|
||||
baseLevel = level;
|
||||
|
||||
int levelPercent = msg->getU8();
|
||||
int levelPercent = 0;
|
||||
// Critical, Life Leech and Mana Leech have no level percent
|
||||
if(skill <= Otc::Fishing)
|
||||
levelPercent = msg->getU8();
|
||||
|
||||
m_localPlayer->setSkill((Otc::Skill)skill, level, levelPercent);
|
||||
m_localPlayer->setBaseSkill((Otc::Skill)skill, baseLevel);
|
||||
|
@ -1635,6 +1642,7 @@ void ProtocolGame::parseTextMessage(const InputMessagePtr& msg)
|
|||
break;
|
||||
}
|
||||
case Otc::MessageHeal:
|
||||
case Otc::MessageMana:
|
||||
case Otc::MessageExp:
|
||||
case Otc::MessageHealOthers:
|
||||
case Otc::MessageExpOthers: {
|
||||
|
|
|
@ -117,6 +117,10 @@ public:
|
|||
bool isIgnoreLook() { return rawGetThingType()->isIgnoreLook(); }
|
||||
bool isCloth() { return rawGetThingType()->isCloth(); }
|
||||
bool isMarketable() { return rawGetThingType()->isMarketable(); }
|
||||
bool isUsable() { return rawGetThingType()->isUsable(); }
|
||||
bool isWrapable() { return rawGetThingType()->isWrapable(); }
|
||||
bool isUnwrapable() { return rawGetThingType()->isUnwrapable(); }
|
||||
bool isTopEffect() { return rawGetThingType()->isTopEffect(); }
|
||||
MarketData getMarketData() { return rawGetThingType()->getMarketData(); }
|
||||
|
||||
virtual void onPositionChange(const Position& newPos, const Position& oldPos) { }
|
||||
|
|
|
@ -84,6 +84,9 @@ enum ThingAttr : uint8 {
|
|||
ThingAttrCloth = 32,
|
||||
ThingAttrMarket = 33,
|
||||
ThingAttrUsable = 34,
|
||||
ThingAttrWrapable = 35,
|
||||
ThingAttrUnwrapable = 36,
|
||||
ThingAttrTopEffect = 37,
|
||||
|
||||
// additional
|
||||
ThingAttrOpacity = 100,
|
||||
|
@ -193,6 +196,11 @@ public:
|
|||
bool isIgnoreLook() { return m_attribs.has(ThingAttrLook); }
|
||||
bool isCloth() { return m_attribs.has(ThingAttrCloth); }
|
||||
bool isMarketable() { return m_attribs.has(ThingAttrMarket); }
|
||||
bool isUsable() { return m_attribs.has(ThingAttrUsable); }
|
||||
bool isWrapable() { return m_attribs.has(ThingAttrWrapable); }
|
||||
bool isUnwrapable() { return m_attribs.has(ThingAttrUnwrapable); }
|
||||
bool isTopEffect() { return m_attribs.has(ThingAttrTopEffect); }
|
||||
|
||||
std::vector<int> getSprites() { return m_spritesIndex; }
|
||||
|
||||
// additional
|
||||
|
|
|
@ -195,6 +195,9 @@ void Tile::addThing(const ThingPtr& thing, int stackPos)
|
|||
return;
|
||||
|
||||
if(thing->isEffect()) {
|
||||
if(thing->isTopEffect())
|
||||
m_effects.insert(m_effects.begin(), thing->static_self_cast<Effect>());
|
||||
else
|
||||
m_effects.push_back(thing->static_self_cast<Effect>());
|
||||
} else {
|
||||
// priority 854
|
||||
|
|
Loading…
Reference in New Issue