Merge pull request #376 from dalkon/master

Item phases & Fix party "bug" & Additions
master
Eduardo Bart 11 years ago
commit dd829395e3

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

@ -22,11 +22,14 @@ ShieldBlueNoSharedExpBlink = 7
ShieldYellowNoSharedExpBlink = 8
ShieldBlueNoSharedExp = 9
ShieldYellowNoSharedExp = 10
ShieldGray = 11
EmblemNone = 0
EmblemGreen = 1
EmblemRed = 2
EmblemBlue = 3
EmblemMember = 4
EmblemOther = 5
North = 0
East = 1

@ -52,23 +52,25 @@ function getShieldImagePathAndBlink(shieldId)
if shieldId == ShieldWhiteYellow then
path, blink = '/images/game/shields/shield_yellow_white', false
elseif shieldId == ShieldWhiteBlue then
path, blink = '/images/game/shields//shield_blue_white', false
path, blink = '/images/game/shields/shield_blue_white', false
elseif shieldId == ShieldBlue then
path, blink = '/images/game/shields//shield_blue', false
path, blink = '/images/game/shields/shield_blue', false
elseif shieldId == ShieldYellow then
path, blink = '/images/game/shields//shield_yellow', false
path, blink = '/images/game/shields/shield_yellow', false
elseif shieldId == ShieldBlueSharedExp then
path, blink = '/images/game/shields//shield_blue_shared', false
path, blink = '/images/game/shields/shield_blue_shared', false
elseif shieldId == ShieldYellowSharedExp then
path, blink = '/images/game/shields//shield_yellow_shared', false
path, blink = '/images/game/shields/shield_yellow_shared', false
elseif shieldId == ShieldBlueNoSharedExpBlink then
path, blink = '/images/game/shields//shield_blue_not_shared', true
path, blink = '/images/game/shields/shield_blue_not_shared', true
elseif shieldId == ShieldYellowNoSharedExpBlink then
path, blink = '/images/game/shields//shield_yellow_not_shared', true
path, blink = '/images/game/shields/shield_yellow_not_shared', true
elseif shieldId == ShieldBlueNoSharedExp then
path, blink = '/images/game/shields//shield_blue_not_shared', false
path, blink = '/images/game/shields/shield_blue_not_shared', false
elseif shieldId == ShieldYellowNoSharedExp then
path, blink = '/images/game/shields//shield_yellow_not_shared', false
path, blink = '/images/game/shields/shield_yellow_not_shared', false
elseif shieldId == ShieldGray then
path, blink = '/images/game/shields/shield_gray', false
end
return path, blink
end
@ -81,6 +83,10 @@ function getEmblemImagePath(emblemId)
path = '/images/game/emblems/emblem_red'
elseif emblemId == EmblemBlue then
path = '/images/game/emblems/emblem_blue'
elseif emblemId == EmblemMember then
path = '/images/game/emblems/emblem_member'
elseif emblemId == EmblemOther then
path = '/images/game/emblems/emblem_other'
end
return path
end

@ -227,14 +227,17 @@ namespace Otc
ShieldBlueNoSharedExpBlink, // 7 party member sexp inactive guilty
ShieldYellowNoSharedExpBlink, // 8 // party leader sexp inactive guilty
ShieldBlueNoSharedExp, // 9 party member sexp inactive innocent
ShieldYellowNoSharedExp // 10 party leader sexp inactive innocent
ShieldYellowNoSharedExp, // 10 party leader sexp inactive innocent
ShieldGray // 11 member of another party
};
enum PlayerEmblems {
EmblemNone = 0,
EmblemGreen,
EmblemRed,
EmblemBlue
EmblemBlue,
EmblemMember,
EmblemOther
};
enum PlayerStates {

@ -41,7 +41,10 @@ Item::Item() :
m_clientId(0),
m_serverId(0),
m_countOrSubType(1),
m_color(Color::alpha)
m_color(Color::alpha),
m_async(true),
m_phase(0),
m_lastPhase(0)
{
}
@ -363,9 +366,17 @@ void Item::calculatePatterns(int& xPattern, int& yPattern, int& zPattern)
int Item::calculateAnimationPhase(bool animate)
{
if(getAnimationPhases() > 1) {
if(animate)
return (g_clock.millis() % (Otc::ITEM_TICKS_PER_FRAME * getAnimationPhases())) / Otc::ITEM_TICKS_PER_FRAME;
else
if(animate) {
if(m_async)
return (g_clock.millis() % (Otc::ITEM_TICKS_PER_FRAME * getAnimationPhases())) / Otc::ITEM_TICKS_PER_FRAME;
else {
if(g_clock.millis() - m_lastPhase >= Otc::ITEM_TICKS_PER_FRAME) {
m_phase = (m_phase + 1) % getAnimationPhases();
m_lastPhase = g_clock.millis();
}
return m_phase;
}
} else
return getAnimationPhases()-1;
}
return 0;

@ -112,6 +112,8 @@ public:
void setActionId(uint16 actionId) { m_attribs.set(ATTR_ACTION_ID, actionId); }
void setUniqueId(uint16 uniqueId) { m_attribs.set(ATTR_UNIQUE_ID, uniqueId); }
void setAsync(bool enable) { m_async = enable; }
bool isHouseDoor() { return m_attribs.has(ATTR_HOUSEDOORID); }
bool isDepot() { return m_attribs.has(ATTR_DEPOT_ID); }
bool isContainer() { return m_attribs.has(ATTR_CONTAINER_ITEMS); }
@ -141,6 +143,10 @@ private:
stdext::packed_storage<uint8> m_attribs;
ItemList m_containerItems;
Color m_color;
bool m_async;
uint8 m_phase;
ticks_t m_lastPhase;
};
#pragma pack(pop)

@ -250,7 +250,9 @@ namespace Proto {
enum CreatureType {
CreatureTypePlayer = 0,
CreatureTypeMonster,
CreatureTypeNpc
CreatureTypeNpc,
CreatureTypeSummonOwn,
CreatureTypeSummonOther
};
enum CreaturesIdRange {

@ -2008,7 +2008,7 @@ ItemPtr ProtocolGame::getItem(const InputMessagePtr& msg, int id)
if(item->getAnimationPhases() > 1) {
// 0xfe => random phase
// 0xff => async?
msg->getU8(); // phase
item->setAsync(msg->getU8() == 0xff);
}
}

Loading…
Cancel
Save