45 const char* _bloodlineName,
uint8 _race,
const char* _desc,
const char* _maleDesc,
const char* _femaleDesc,
uint32 _corporationID,
uint8 _perception,
uint8 _willpower,
uint8 _charisma,
uint8 _memory,
uint8 _intelligence,
const char* _shortDesc,
const char* _shortMaleDesc,
const char* _shortFemaleDesc)
46 : bloodlineName(_bloodlineName),
49 maleDescription(_maleDesc),
50 femaleDescription(_femaleDesc),
51 corporationID(_corporationID),
52 perception(_perception),
53 willpower(_willpower),
56 intelligence(_intelligence),
57 shortDescription(_shortDesc),
58 shortMaleDescription(_shortMaleDesc),
59 shortFemaleDescription(_shortFemaleDesc)
68 m_bloodlineID(_bloodlineID),
69 m_bloodlineName(_charData.bloodlineName),
70 m_description(_charData.description),
71 m_maleDescription(_charData.maleDescription),
72 m_femaleDescription(_charData.femaleDescription),
73 m_corporationID(_charData.corporationID),
74 m_perception(_charData.perception),
75 m_willpower(_charData.willpower),
76 m_charisma(_charData.charisma),
77 m_memory(_charData.memory),
78 m_intelligence(_charData.intelligence),
79 m_shortDescription(_charData.shortDescription),
80 m_shortMaleDescription(_charData.shortMaleDescription),
81 m_shortFemaleDescription(_charData.shortFemaleDescription)
84 assert(_data.
race == _charData.
race);
88 return ItemType::Load<CharacterType>(typeID );
98 for (; color_cur != colors->
end(); ++color_cur) {
99 if ((*color_cur)->IsObjectEx()) {
127 for (; modif_cur != modifiers->
end(); ++modif_cur) {
128 if ((*modif_cur)->IsObjectEx()) {
146 for (; sculpt_cur != sculpts->
end(); sculpt_cur++) {
147 if ((*sculpt_cur)->IsObjectEx()) {
239 m_charData(_charData),
240 m_corpData(_corpData),
242 m_inTraining(nullptr),
266 return InventoryItem::Load<Character>( characterID );
276 sLog.Error(
"Character::_Load",
"LoadContents returned false for char %u",
m_itemID);
280 sLog.Error(
"Character::_Load",
"LoadSkillQueue returned false for char %u",
m_itemID);
285 if (sRef.
get() !=
nullptr) {
298 sLog.Warning(
"Character::_Load",
"LoadCertificates returned false for char %u",
m_itemID);
313 std::vector<InventoryItemRef> skills;
315 for (
auto cur : skills) {
329 _log(CHARACTER__ERROR,
"Failed to get itemID for new character.");
370 _log(ACCOUNT__ERROR,
"Character::balance() - invalid type %u", type);
380 if ((
balance(type) + amount) < 0) {
381 std::map<std::string, PyRep *>
args;
382 args[
"amount"] =
new PyFloat(-amount);
385 .
AddISK (
"amount", -amount)
398 ac.accountKey =
"cash";
402 ac.accountKey =
"AURUM";
487 _log(EFFECTS__TRACE,
"Character::ResetModifiers()");
490 std::vector<InventoryItemRef> allSkills;
492 for (
auto curSkill : allSkills) {
493 curSkill->ClearModifiers();
494 curSkill->ResetAttributes();
500 _log(EFFECTS__TRACE,
"Character::ProcessEffects()");
504 std::vector<InventoryItemRef> allSkills;
508 std::vector<TypeEffects> typeFx;
509 for (
auto curSkill : allSkills) {
511 sFxDataMgr.GetTypeEffect(curSkill->typeID(), typeFx);
512 for (
auto curFx : typeFx) {
513 curEffect =
sFxDataMgr.GetEffect(curFx.effectID);
521 sFxProc.ApplyEffects(
this,
this, pShip);
539 return (
GetSkill(skillTypeID).
get() !=
nullptr);
553 std::vector<InventoryItemRef> skills;
555 for (
auto cur : skills)
569 if (skill.
get() ==
nullptr)
578 if (requiredSkill.
get() ==
nullptr)
579 return (zeroForNotInjected ? 0 : -1);
587 if (requiredSkill.
get() ==
nullptr)
619 tuple->
SetItem(0, skillLevels);
620 tuple->
SetItem(1, attributeValues);
630 sLog.Error(
"SkillQueue",
"%s(%u) flagged as training but queue empty", \
646 if (sRef->typeID() == itr->typeID)
647 if (sRef->GetAttribute(
AttrSkillLevel).get_uint32() >= itr->level)
664 SkillQueue_Element el;
665 el.typeID = cur.typeID;
666 el.level = cur.level;
681 std::vector<InventoryItemRef> skills;
683 for (
auto cur : skills)
691 if (absolutePoints < 1)
695 if (!
sDataMgr.IsSkillTypeID(skillTypeID))
708 if (oldSkill.
get() !=
nullptr) {
718 if ( !skill->SkillPrereqsComplete( *
this ) ) {
720 _log(SKILL__DEBUG,
"%s(%u): Requested to inject %s (%u/%u) but prereq not complete.", \
721 name(),
m_itemID, skill->name(), skill->typeID(), skill->itemID() );
727 if ( skill->quantity() > 1 ) {
730 if (skill.
get() == nullptr ) {
731 _log( ITEM__ERROR,
"%s (%u): Unable to split stack of %s (%u).",
name(),
m_itemID, skill->name(), skill->itemID() );
736 skill->ChangeSingleton(
true);
743 _log(SKILL__MESSAGE,
"%s(%u) has injected %s(%u)",
name(),
m_itemID, skill->name(), skill->itemID());
768 _log(SKILL__WARNING,
"LoadPausedSkillQueue() - type sent (%u) does not match first in queue (%u)",
774 uint32 currentSP(0), nextSP(0);
778 if (skill ==
nullptr)
784 if (itr->level == nextLvl) {
791 itr->startTime = startTime;
794 startTime = itr->endTime;
802 OnSkillStartTraining osst;
803 osst.itemID = skill->
itemID();
813 _log(SKILL__QUEUE,
"%s(%u) Paused Skill Queue Loaded and restarted",
name(),
m_itemID);
840 OnSkillTrainingStopped osst;
848 _log(SKILL__INFO,
"%s:%s(%u/%u) Training canceled from skill not in queue.", \
877 _log(SKILL__INFO,
"%s:%s(%u/%u) - CancelSkillInTraining - Training to level %u completed.", \
883 OnSkillTrainingStopped osst;
891 _log(SKILL__INFO,
"%s:%s(%u/%u) - Training to level %u canceled. CurrentSP: %u, nextSP: %u", \
909 if (skill ==
nullptr) {
911 _log(SKILL__QUEUE,
"Cannot find Skill %u.", typeID);
916 _log( SKILL__INFO,
"Starting checks to add %s to training queue.", skill->
name());
924 if (level < nextLvl) {
931 ost.itemID = skill->
itemID();
935 _log(SKILL__WARNING,
"Trying to add level %u but current level is %u.", level, nextLvl -1);
943 if (currentSP >= nextSP) {
950 ost.itemID = skill->
itemID();
954 _log(SKILL__WARNING,
"Trying to add level %u at %u sp but current sp is %u.", level, nextSP, currentSP);
971 OnSkillStartTraining osst;
972 osst.itemID = skill->
itemID();
973 osst.endOfTraining = qs.
endTime;
987 _log(SKILL__QUEUE,
"Added %s Level %u to queue with %s(%.1f) to train %uSP.", \
988 skill->
name(), level, formatedTime, timeLeft, nextSP - currentSP);
1001 _log(SKILL__QUEUE,
"%s(%u) calling SkillQueueLoop() - update %s",
name(),
m_itemID, update?
"true":
"false");
1022 bool sent(
false), multiple(
false);
1023 Skill* skill(
nullptr);
1027 if ((qs.
typeID == 0) or (skill ==
nullptr)) {
1028 _log( SKILL__WARNING,
"SkillID %u to train was not found. Erase and continue.", qs.
typeID);
1033 _log( SKILL__INFO,
"Starting checks for %s.", skill->
name());
1037 _log(SKILL__ERROR,
"endTime wasnt set. Erase from queue and continue.");
1052 _log(SKILL__INFO,
"Queued Training completed for level: %u", qs.
level);
1069 ost.itemID = skill->
itemID();
1074 if (sref.
get() ==
nullptr) {
1077 ost.itemID = skill->
itemID();
1083 OnSkillSwitched oss;
1084 oss.oldSkillID = skill->
itemID();
1085 oss.newSkillID = sref->itemID();
1106 m_pClient->
SendInfoModalMsg(
"Completed Skill Training.<br>Your ship will update to the new level the next time you undock.");
1128 _log(SKILL__INFO,
"Training started. %s to train %u sp for level %u", \
1133 OnSkillStartTraining osst;
1134 osst.itemID = skill->
itemID();
1135 osst.endOfTraining = qs.
endTime;
1148 if (!list->
empty()) {
1149 if (list->
size() > 1) {
1150 OnMultipleSkillsTrained omst;
1151 omst.skillList = list;
1152 tmp = omst.Encode();
1154 }
else if (skill !=
nullptr) {
1156 ost.itemID = skill->
itemID();
1172 _log(SKILL__QUEUE,
"%s(%u): UpdateSkillQueueEndTime() - Queue is empty.",
name(),
m_itemID);
1187 codelog(CHARACTER__ERROR,
"%s (%u): Failed to load contents for GetCharInfo",
name(),
m_itemID);
1191 Rsp_CommonGetInfo_Entry entry1;
1199 std::vector<InventoryItemRef> skills;
1208 for (
auto cur : skills) {
1209 Rsp_CommonGetInfo_Entry entry;
1210 if (cur->Populate(entry)) {
1213 codelog(CHARACTER__ERROR,
"%s (%u): Failed to load character item %u for GetCharInfo",
name(),
m_itemID, cur->itemID());
1224 row.header.push_back(
"description");
1227 return row.Encode();
1232 if (iRef.
get() ==
nullptr)
1237 _log( CHARACTER__INFO,
"%s(%u) has been added to %s with flag %i.", iRef->name(), iRef->itemID(),
name(), (
uint8)iRef->flag() );
1258 _log( CHARACTER__INFO,
"Saving character info for %u.",
m_itemID );
1267 _log( CHARACTER__INFO,
"Saving full character info for %u.",
m_itemID );
1283 std::string reason =
"Bounty for the killing of ";
1299 onlineTime /= 10000000;
1300 onlineTime -= 11644473600;
1302 return (
uint16)onlineTime;
1311 if (loginMinutes > 0) {
1342 _log( CHARACTER__INFO,
"Saving Certificates of character %u",
m_itemID );
static float GetStanding(uint32 fromID, uint32 toID)
void SetAccountKey(int32 accountKey)
bool LoadSkillQueue(uint32 charID, SkillQueue &into)
bool ContentsLoaded() const
SkillRef GetSkill(uint16 skillTypeID) const
void SendNotification(const PyAddress &dest, EVENotificationStream ¬i, bool seq=true)
bool LoadCertificates(uint32 characterID, CertMap &into)
void SendErrorMsg(const char *fmt,...)
void SetActiveShip(uint32 shipID)
#define _log(type, fmt,...)
static bool SaveCorpData(uint32 charID, const CorpData &data)
void SetAvatarColors(uint32 charID, uint32 colorID, uint32 colorNameA, uint32 colorNameBC, double weight, double gloss)
bool SaveSkillQueue(uint32 charID, SkillQueue &queue)
PyRep * GetItem(size_t index) const
Returns Python object.
uint32 PickAlternateShip(uint32 charID, uint32 locationID)
bool SaveCertificates(uint32 characterID, const CertMap &from)
PyRep * GetItemString(const char *key) const
Obtains database entry based on given key string.
void SetAvatarModifiers(uint32 charID, PyRep *modifierLocationID, PyRep *paperdollResourceID, PyRep *paperdollResourceVariation)
void SetLocation(uint32 stationID, SystemData &data)
void SetTrainingEndTime(int64 endTime)
void SetActivePod(uint32 podID)
bool SetFlag(EVEItemFlags flag, bool notify=false)
static bool SaveCharacter(uint32 charID, const CharacterData &data)
uint8 GetSPPerMin(Skill *skill)
virtual void AddItem(InventoryItemRef iRef)
uint8 PointsPerMinute(uint8 pAttr, uint8 sAttr)
void UpdateFleetSession(CharFleetData &fleet)
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint16 skillTypeID, uint8 skillLevel, uint32 absolutePoints)
void ClearSkillQueue(bool update=false)
void CancelSkillInTraining(bool update=false)
void AddItem(InventoryItemRef item)
void QueueDestinyEvent(PyTuple **multiEvent)
void GetCertificates(CertMap &crt)
static CharacterRef Spawn(CharacterData &charData, CorpData &corpData)
PyTuple * SendSkillQueue()
void SendInfoModalMsg(const char *fmt,...)
Python floating point number.
const_iterator begin() const
void UpdateCertificate(uint32 certificateID, bool pub)
storage_type::const_iterator const_iterator
PyObject * GetDescription() const
void UpdateCertificate(uint32 charID, uint32 certificateID, bool pub=false)
void UpdateSkillQueueEndTime(int64 endtime, uint32 charID)
void SetLogOffTime(uint32 charID)
Character(uint32 _characterID, const CharacterType &_charType, const ItemData &_data, const CharacterData &_charData, const CorpData &_corpData)
PyRep * GetSkillHistory(uint32 charID)
void SendNotifyMsg(const char *fmt,...)
uint32 GetSPForLevel(uint8 level)
RefPtr< Character > CharacterRef
std::map< uint16, CharCerts > CertMap
void UpdateSkillQueueEndTime()
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
UserError & AddISK(const char *name, double isk)
Shorthand method for adding an ISK amount.
void DeleteCharacter(uint32 charID)
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
float balance(uint8 type)
int64 EndTime(uint32 currentSP, uint32 nextSP, uint8 SPMin, int64 timeNow)
bool AlterBalance(float amount, uint8 type)
void PayBounty(CharacterRef cRef)
void VisitSystem(uint32 solarSystemID)
void SetCurrentShip(uint32 charID, uint32 shipID)
void SetFleetData(CharFleetData &fleet)
void AddToSkillQueue(uint16 typeID, uint8 level)
bool SavePausedSkillQueue(uint32 charID, SkillQueue &queue)
void VisitSystem(uint32 solarSystemID, uint32 charID)
void SetBaseID(uint32 baseID)
#define codelog(type, fmt,...)
void SetItem(size_t index, PyRep *object)
Stores Python object.
float GetStandingModified(uint32 fromID, uint32 toID=0)
static void TranserFunds(uint32 fromID, uint32 toID, double amount, std::string reason="", uint8 entryTypeID=Journal::EntryType::Undefined, uint32 referenceID=0, uint16 fromKey=Account::KeyType::Cash, uint16 toKey=Account::KeyType::Cash, Client *pClient=nullptr)
const uint8 MAXSKILLLEVEL
void UpdateCorpSession(CorpData &data)
void SetAttribute(uint16 attrID, int num, bool notify=true)
float GetNPCCorpStanding(uint32 fromID, uint32 toID=0)
static CharacterType * Load(uint16 typeID)
void AddItemInt(int32 intval)
void SkillQueueLoop(bool update=true)
bool Populate(Rsp_CommonGetInfo_Entry &into)
void ProcessEffects(ShipItem *pShip)
#define IsCharacterID(itemID)
CharFleetData m_fleetData
Python object "ccp_exceptions.UserError".
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
uint32 GetCurrentSP(Character *ch, int64 startTime=0)
bool HasCertificate(uint32 certificateID) const
void FleetShareMissionStandings(float newStanding)
bool LoadPausedSkillQueue(uint32 charID, SkillQueue &into)
CharacterType(uint16 _id, uint8 _bloodlineID, const Inv::TypeData &_data, const CharacterTypeData &_charData)
static void SetStanding(uint32 fromID, uint32 toID, float standing)
void Build(uint32 charID, PyDict *data)
RefPtr< InventoryItem > InventoryItemRef
bool HasSkillTrainedToLevel(uint16 skillTypeID, uint8 skillLevel) const
void GrantCertificate(uint32 certificateID)
void SetAvatarSculpts(uint32 charID, PyRep *sculptLocationID, PyRep *weightUpDown, PyRep *weightLeftRight, PyRep *weightForwardBack)
void SetPortraitInfo(uint32 charID, PortraitInfo &data)
void SetLogInTime(uint32 charID)
void AddCertificate(uint32 charID, CharCerts cert)
PyRep * GetSkillHistory()
const_iterator end() const
const std::string & itemName() const
void Build(uint32 ownerID, PyDict *data)
void SetAvatar(uint32 charID, PyRep *hairDarkness)
#define IsFleetID(itemID)
void UpdateCorpData(CorpData &data)
EvilNumber GetAttribute(const uint16 attrID) const
static uint32 NewCharacter(const CharacterData &data, const CorpData &corpData)
void JoinCorporation(const CorpData &data)
uint32 PickAlternateShip(uint32 locationID)
PyTuple * GetArgs() const
static void AddEmployment(uint32 charID, uint32 corpID, uint32 oldCorpID=0)
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
CharacterTypeData(const char *_bloodlineName="", uint8 _race=0, const char *_desc="", const char *_maleDesc="", const char *_femaleDesc="", uint32 _corporationID=0, uint8 _perception=0, uint8 _willpower=0, uint8 _charisma=0, uint8 _memory=0, uint8 _intelligence=0, const char *_shortDesc="", const char *_shortMaleDesc="", const char *_shortFemaleDesc="")
const char * FormatTime(int64 time=-1)
void GetSkillsList(std::vector< InventoryItemRef > &skills) const
uint8 InjectSkillIntoBrain(SkillRef skill)
const std::string & description() const
static int64 IntegerValue(PyRep *pRep)
void SetDescription(const char *newDescription)
void LoadPausedSkillQueue(uint16 typeID)
void SetCurrentPod(uint32 charID, uint32 podID)
void RemoveFromQueue(SkillRef sRef)
void SetStanding(uint32 fromID, uint32 toID, float standing)
PyObjectEx * AsObjectEx()
static CharacterRef Load(uint32 characterID)
InventoryItemRef GetByTypeFlag(uint32 typeID, EVEItemFlags flag) const
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Wrapper class for PyObjectEx of type 2.
void FleetShareMissionRewards()
bool ChangeCloneType(uint32 charID, uint32 typeID)
bool HasSkill(uint16 skillTypeID) const
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint32 skillTypeID, uint8 skillLevel, uint32 absolutePoints)