Changed: #1433 Merge changes from patch 1.13

hg/feature/gsoc2012-fabien
kervala 13 years ago
parent d50e7369cf
commit 457704b2b6

@ -82,6 +82,8 @@ namespace BOTCHATTYPE
ResaleKOBroken,
// this item can't be sold because its Resold time has expired
ResaleKONoTimeLeft,
// this item can't be sold because the owner has locked it (temporary hack to get around modifying database.xml)
ResaleKOLockedByOwner,
NumBotChatResaleFlag
};

@ -130,7 +130,7 @@ const TCoord THRESHOLD_BEHAVIOUR = 60000;
// Name
const TPropIndex PROPERTY_NAME_STRING_ID = 6;
const TCoord THRESHOLD_NAME_STRING_ID = 25000;
const TCoord THRESHOLD_NAME_STRING_ID = 100000;
// Main target
const TPropIndex PROPERTY_TARGET_ID = 7;

@ -73,6 +73,7 @@ CItemInfos::CItemInfos()
LacustreMagicResistance = 0;
JungleMagicResistance = 0;
PrimaryRootMagicResistance = 0;
PetNumber = 0; // 1 based!
}
void CItemInfos::serial(NLMISC::IStream & s)
@ -130,5 +131,6 @@ void CItemInfos::serial(NLMISC::IStream & s)
s.serial( CustomText );
s.serial( R2ItemDescription );
s.serial( R2ItemComment );
s.serial( PetNumber );
}

@ -139,6 +139,7 @@ public:
ucstring CustomText;
ucstring R2ItemDescription;
ucstring R2ItemComment;
uint8 PetNumber; // 1 based pet index
//@}
};

@ -176,16 +176,20 @@
inline uint32 saveGameCycleToSecond(NLMISC::TGameCycle tick)
{
// Evaluate the UTC of this event (with the current date of save). Suppose that 1 second==10 tick
return sint32(NLMISC::CTime::getSecondsSince1970()) + (sint32(tick) - sint32(CTickEventHandler::getGameCycle()))/10;
if (tick < CTickEventHandler::getGameCycle())
return NLMISC::CTime::getSecondsSince1970();
else
return NLMISC::CTime::getSecondsSince1970() + (tick - CTickEventHandler::getGameCycle())/10;
// NB: result should be positive since no event should have been launched before 1970!
}
inline NLMISC::TGameCycle loadSecondToGameCycle(uint32 second)
{
if (second < NLMISC::CTime::getSecondsSince1970())
return 0;
// Convert UTC of the event to game cycle. Suppose that 1 second==10 tick
sint32 newTick= CTickEventHandler::getGameCycle() + (sint32(second) - sint32(NLMISC::CTime::getSecondsSince1970()))*10;
// If game cycle is loaded on a server where current game cycle is too young, we can have here negative values => avoid them
return std::max(newTick, sint32(0));
return CTickEventHandler::getGameCycle() + (second - NLMISC::CTime::getSecondsSince1970())*10;
}
#endif

@ -35,6 +35,8 @@ namespace PVP_MODE
NL_STRING_CONVERSION_TABLE_ENTRY(PvpZoneOutpost)
NL_STRING_CONVERSION_TABLE_ENTRY(PvpFaction)
NL_STRING_CONVERSION_TABLE_ENTRY(PvpFactionFlagged)
NL_STRING_CONVERSION_TABLE_ENTRY(PvpZoneSafe)
NL_STRING_CONVERSION_TABLE_ENTRY(PvpSafe)
NL_END_STRING_CONVERSION_TABLE(TPVPMode, PVPModeConversion, Unknown)
TPVPMode fromString(const std::string & str)

@ -32,10 +32,12 @@ namespace PVP_MODE
PvpZoneOutpost = 32,
PvpFaction = 64,
PvpFactionFlagged = 128,
PvpZoneSafe = 256,
PvpSafe = 512,
Unknown,
NbModes = Unknown,
NbBits = 8 // number of bits needed to store all valid values
NbBits = 10 // number of bits needed to store all valid values
};

@ -138,7 +138,7 @@ void initRyzomVisualPropertyIndices( CMirroredDataSet& dataset );
#define TYPE_BOT_TRADE_SELECTOR2 uint64
#define TYPE_EVENT_FACTION_ID uint32
#define TYPE_PVP_MODE uint8
#define TYPE_PVP_MODE uint32
#define TYPE_PVP_CLAN uint32
#define TYPE_FUEL bool

@ -115,7 +115,7 @@ inline void npcChatToChannelEx(const TDataSetRow &senderId, CChatGroup::TGroupTy
* Chat group can be constructed from CChatGroup class.
* sentence is the sentence to be sent.
*/
inline void npcChatToChannelSentence(const TDataSetRow &senderId, CChatGroup::TGroupType groupType, std::string& sentence)
inline void npcChatToChannelSentence(const TDataSetRow &senderId, CChatGroup::TGroupType groupType, ucstring& sentence)
{
NLNET::CMessage msgout("NPC_CHAT_SENTENCE");
msgout.serial(const_cast<TDataSetRow&>(senderId));

Loading…
Cancel
Save