EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Skill Class Reference

InventoryItem for skill. More...

#include "Skill.h"

Inheritance diagram for Skill:
Collaboration diagram for Skill:

Public Member Functions

 ~Skill ()
 
bool IsTraining ()
 
uint8 GetLevelForSP (uint32 currentSP)
 
uint32 GetSPForLevel (uint8 level)
 
uint32 GetCurrentSP (Character *ch, int64 startTime=0)
 
uint32 GetRemainingSP (Character *ch, int64 curTime=0)
 
uint32 GetTrainingTime (Character *ch, int64 startTime=0)
 
bool SkillPrereqsComplete (Character &ch)
 
void VerifySP ()
 
void VerifyAttribs ()
 
- Public Member Functions inherited from InventoryItem
 InventoryItem (uint32 _itemID, const ItemType &_type, const ItemData &_data)
 
 InventoryItem (const InventoryItem &oth)
 
 InventoryItem (InventoryItem &&oth) noexcept
 
InventoryItemoperator= (const InventoryItem &oth)=delete
 
InventoryItemoperator= (InventoryItem &&oth)=delete
 
virtual ~InventoryItem () noexcept
 
virtual ShipItemGetShipItem ()
 
virtual ModuleItemGetModuleItem ()
 
virtual bool IsShipItem ()
 
virtual bool IsModuleItem ()
 
virtual void Rename (std::string name)
 
InventoryGetMyInventory ()
 
bool contraband () const
 
bool isSingleton () const
 
int32 quantity () const
 
uint32 itemID () const
 
uint32 ownerID () const
 
uint32 locationID () const
 
EVEItemFlags flag () const
 
const GPointposition () const
 
const ItemTypetype () const
 
const std::string & itemName () const
 
const std::string & customInfo () const
 
const char * name ()
 
uint16 typeID () const
 
uint16 groupID () const
 
double radius () const
 
uint8 categoryID () const
 
bool isGlobal () const
 
bool IsOnline ()
 
void SetPosition (const GPoint &pos)
 
void SetCustomInfo (const char *ci)
 
void ChangeOwner (uint32 new_owner, bool notify=false)
 
void Move (uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
 
void Donate (uint32 new_owner=ownerSystem, uint32 new_location=locTemp, EVEItemFlags new_flag=flagNone, bool notify=true)
 
void SendItemChange (uint32 toID, std::map< int32, PyRep * > &changes)
 
void MergeTypesInCargo (ShipItem *pShip, EVEItemFlags flag=flagNone)
 
bool ChangeSingleton (bool singleton, bool notify=false)
 
bool AlterQuantity (int32 qty, bool notify=false)
 
bool SetQuantity (int32 qty, bool notify=false, bool deleteOnZero=true)
 
bool SetFlag (EVEItemFlags flag, bool notify=false)
 
void SetOwner (uint32 ownerID)
 
void SaveItem ()
 
void UpdateLocation ()
 
void UpdateLocation (uint32 locID)
 
virtual void Delete ()
 
virtual InventoryItemRef Split (int32 qty=0, bool notify=true, bool silent=false)
 
virtual bool Merge (InventoryItemRef to_merge, int32 qty=0, bool notify=true)
 
virtual void Relocate (uint32 locID=0, EVEItemFlags flag=flagNone)
 
virtual void AddItem (InventoryItemRef iRef)
 
virtual void RemoveItem (InventoryItemRef iRef)
 
double GetPackagedVolume ()
 
virtual void SetPlayer (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 
void ToVirtual (uint32 locationID)
 
virtual bool _Load ()
 
PyRepGetItem () const
 
void GetItemRow (PyPackedRow *into) const
 
void GetItemStatusRow (PyPackedRow *into) const
 
void GetChargeStatusRow (uint32 shipID, PyPackedRow *into) const
 
bool Populate (Rsp_CommonGetInfo_Entry &into)
 
PyListGetItemInfo () const
 
PyObjectItemGetInfo ()
 
PyPackedRowGetItemRow () const
 
PyPackedRowGetItemStatusRow () const
 
PyPackedRowGetChargeStatusRow (uint32 shipID) const
 
bool SkillCheck (InventoryItemRef refItem)
 
void ClearModifiers ()
 
void AddModifier (fxData &data)
 
void RemoveModifier (fxData &data)
 
void ResetAttributes ()
 
bool HasReqSkill (const uint16 skillID)
 
AttributeMapGetAttributeMap ()
 
int64 GetTimeStamp ()
 
void SetAttribute (uint16 attrID, int num, bool notify=true)
 
void SetAttribute (uint16 attrID, uint32 num, bool notify=true)
 
void SetAttribute (uint16 attrID, int64 num, bool notify=true)
 
void SetAttribute (uint16 attrID, float num, bool notify=true)
 
void SetAttribute (uint16 attrID, double num, bool notify=true)
 
void SetAttribute (uint16 attrID, EvilNumber num, bool notify=true)
 
void MultiplyAttribute (uint16 attrID, EvilNumber num, bool notify=false)
 
bool HasAttribute (const uint16 attrID) const
 
bool HasAttribute (const uint16 attrID, EvilNumber &value) const
 
bool SaveAttributes ()
 
void ResetAttribute (uint16 attrID, bool notify=false)
 
void DeleteAttribute (uint16 attrID)
 
EvilNumber GetAttribute (const uint16 attrID) const
 
EvilNumber GetDefaultAttribute (const uint16 attrID) const
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Static Public Member Functions

static SkillRef Load (uint32 skillID)
 
static SkillRef Spawn (ItemData &data)
 
static bool FitModuleSkillCheck (InventoryItemRef item, CharacterRef ch)
 
- Static Public Member Functions inherited from InventoryItem
static uint32 CreateItemID (ItemData &data)
 
static uint32 CreateTempItemID (ItemData &data)
 
static InventoryItemRef Load (uint32 itemID)
 
static InventoryItemRef SpawnItem (uint32 itemID, const ItemData &data)
 
static InventoryItemRef Spawn (ItemData &data)
 
static InventoryItemRef SpawnTemp (ItemData &data)
 

Protected Member Functions

 Skill (uint32 _skillID, const ItemType &_type, const ItemData &_data)
 
- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Static Protected Member Functions

template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 skillID, const ItemType &type, const ItemData &data)
 
- Static Protected Member Functions inherited from InventoryItem
template<class _Ty >
static RefPtr< _Ty > Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 itemID, const ItemType &type, const ItemData &data)
 

Friends

class InventoryItem
 

Additional Inherited Members

- Public Attributes inherited from InventoryItem
std::multimap< int8, fxDatam_modifiers
 
- Protected Attributes inherited from InventoryItem
InventorypInventory
 
uint32 m_itemID
 
AttributeMappAttributeMap
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Detailed Description

InventoryItem for skill.

Skill class where all skill stuff is placed.

Author
Bloody.Rabbit
Date
June 2009

Definition at line 48 of file Skill.h.

Constructor & Destructor Documentation

Skill::~Skill ( )
inline

Definition at line 53 of file Skill.h.

53 { /* do nothing here */ }
Skill::Skill ( uint32  _skillID,
const ItemType _type,
const ItemData _data 
)
protected

Definition at line 42 of file Skill.cpp.

Referenced by _LoadItem().

43 : InventoryItem(_skillID, _type, _data)
44 {
45 }
friend class InventoryItem
Definition: Skill.h:51

Here is the caller graph for this function:

Member Function Documentation

template<class _Ty >
static RefPtr<_Ty> Skill::_LoadItem ( uint32  skillID,
const ItemType type,
const ItemData data 
)
inlinestaticprotected

Definition at line 98 of file Skill.h.

References _log, ItemType::categoryID(), sConfig, sDataMgr, EVEDB::invCategories::Skill, Skill(), and EvE::traceStack().

98  {
100  _log(ITEM__ERROR, "Trying to load %s as Skill.", sDataMgr.GetCategoryName(type.categoryID()));
101  if (sConfig.debug.StackTrace)
102  EvE::traceStack();
103  return RefPtr<_Ty>();
104  }
105 
106  return SkillRef( new Skill(skillID, type, data ) );
107  }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
Skill(uint32 _skillID, const ItemType &_type, const ItemData &_data)
Definition: Skill.cpp:42
uint8 categoryID() const
Definition: ItemType.h:66
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online
RefPtr< Skill > SkillRef
Definition: ItemRef.h:57
void traceStack(void)
Definition: misc.cpp:169
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr

Here is the call graph for this function:

bool Skill::FitModuleSkillCheck ( InventoryItemRef  item,
CharacterRef  ch 
)
static

Definition at line 230 of file Skill.cpp.

References AttrRequiredSkill1, AttrRequiredSkill1Level, AttrRequiredSkill2, AttrRequiredSkill2Level, AttrRequiredSkill3, AttrRequiredSkill3Level, AttrRequiredSkill4, AttrRequiredSkill4Level, AttrRequiredSkill5, AttrRequiredSkill5Level, AttrRequiredSkill6, AttrRequiredSkill6Level, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Character::GetSkillLevel(), InventoryItem::HasAttribute(), and skillID().

Referenced by ShipItem::VerifyHoldType().

230  {
231  bool test(true);
232  EvilNumber skillID(0);
233  if (iRef->HasAttribute(AttrRequiredSkill1, skillID)) {//Primary Skill
234  if ( iRef->GetAttribute(AttrRequiredSkill1Level) > cRef->GetSkillLevel(skillID.get_uint32()))
235  test = false;
236  if (iRef->HasAttribute(AttrRequiredSkill2, skillID)) {//Secondary Skill
237  if ( iRef->GetAttribute(AttrRequiredSkill2Level) > cRef->GetSkillLevel(skillID.get_uint32()))
238  test = false;
239  if (iRef->HasAttribute(AttrRequiredSkill3, skillID)) {//Tertiary Skill
240  if ( iRef->GetAttribute(AttrRequiredSkill3Level) > cRef->GetSkillLevel(skillID.get_uint32()))
241  test = false;
242  if (iRef->HasAttribute(AttrRequiredSkill4, skillID)) {//Quarternary Skill
243  if ( iRef->GetAttribute(AttrRequiredSkill4Level) > cRef->GetSkillLevel(skillID.get_uint32()))
244  test = false;
245  if (iRef->HasAttribute(AttrRequiredSkill5, skillID)) {//Quinary Skill
246  if ( iRef->GetAttribute(AttrRequiredSkill5Level) > cRef->GetSkillLevel(skillID.get_uint32()))
247  test = false;
248  if (iRef->HasAttribute(AttrRequiredSkill6, skillID)) {//Senary Skill
249  if ( iRef->GetAttribute(AttrRequiredSkill6Level) > cRef->GetSkillLevel(skillID.get_uint32()))
250  test = false;
251  }
252  }
253  }
254  }
255  }
256  }
257 
258  return test;
259 }
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Skill::GetCurrentSP ( Character ch,
int64  startTime = 0 
)
Todo:
this isnt completely right....

Definition at line 80 of file Skill.cpp.

References _log, AttrSkillLevel, AttrSkillPoints, InventoryItem::flag(), flagSkill, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), GetFileTimeNow(), Character::GetSPPerMin(), EvESkill::MAXSKILLLEVEL, InventoryItem::name(), and EvE::Time::Second.

Referenced by Character::AddToSkillQueue(), Character::CancelSkillInTraining(), Character::LoadPausedSkillQueue(), Character::SaveFullCharacter(), and Character::SkillQueueLoop().

81 {
82  uint32 currentSP(GetAttribute(AttrSkillPoints).get_uint32());
83  if (flag() == flagSkill)
84  return currentSP;
85 
86  if (startTime == 0)
87  return currentSP;
88 
89  if (startTime > GetFileTimeNow())
90  return currentSP;
91 
93  if (level > EvESkill::MAXSKILLLEVEL)
95 
97  // at this point, the skill is in training. calculate accumulated sp and return
98  uint32 delta(0);
99  uint32 timeElapsed((GetFileTimeNow() - startTime) / EvE::Time::Second);
100  if (timeElapsed > 60) {
101  // skill in training - return updated SP based on elapsed training
102  delta = (timeElapsed /60) * ch->GetSPPerMin(this);
103  currentSP += delta;
104  }
105 
106  _log(SKILL__TRACE, "Skill::GetCurrentSP() for %s is %u - delta: %u, elapsed time: %us", \
107  name(), currentSP, delta, timeElapsed);
108 
109  return currentSP;
110 }
unsigned __int8 uint8
Definition: eve-compat.h:46
#define _log(type, fmt,...)
Definition: logsys.h:124
uint8 GetSPPerMin(Skill *skill)
Definition: Character.cpp:559
const char * name()
uint32 get_uint32()
Definition: EvilNumber.cpp:173
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag() const
double GetFileTimeNow()
Definition: utils_time.cpp:84
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

uint8 Skill::GetLevelForSP ( uint32  currentSP)

Definition at line 72 of file Skill.cpp.

References AttrSkillTimeConstant, InventoryItem::GetAttribute(), and EvEMath::Skill::LevelForPoints().

72  {
73  return EvEMath::Skill::LevelForPoints(currentSP, GetAttribute(AttrSkillTimeConstant).get_uint32());
74 }
uint8 LevelForPoints(uint32 currentSP, uint8 rank)
Definition: EvEMath.cpp:25
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

uint32 Skill::GetRemainingSP ( Character ch,
int64  curTime = 0 
)

Definition at line 112 of file Skill.cpp.

References AttrSkillLevel, AttrSkillPoints, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Character::GetEndOfTraining(), GetFileTimeNow(), GetSPForLevel(), Character::GetSPPerMin(), EvESkill::MAXSKILLLEVEL, and EvE::Time::Second.

113 {
115  if (level > EvESkill::MAXSKILLLEVEL)
116  return 0;
117 
118  if (curTime == 0)
119  curTime = GetFileTimeNow();
120 
121  // get full sp needed for next level
122  uint32 remainingSP(GetSPForLevel(level) - GetAttribute(AttrSkillPoints).get_uint32());
123 
124  float timeLeft((ch->GetEndOfTraining() - curTime) / EvE::Time::Second);
125  // if remaining time > 1m, subtract spm from total to get remaining
126  if (timeLeft > 60)
127  remainingSP -= ((timeLeft /60) * ch->GetSPPerMin(this));
128 
129  return remainingSP;
130 }
unsigned __int8 uint8
Definition: eve-compat.h:46
uint8 GetSPPerMin(Skill *skill)
Definition: Character.cpp:559
uint32 GetSPForLevel(uint8 level)
Definition: Skill.cpp:76
int64 GetEndOfTraining()
Definition: Character.cpp:624
uint32 get_uint32()
Definition: EvilNumber.cpp:173
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
unsigned __int32 uint32
Definition: eve-compat.h:50
double GetFileTimeNow()
Definition: utils_time.cpp:84
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

uint32 Skill::GetSPForLevel ( uint8  level)

Definition at line 76 of file Skill.cpp.

References AttrSkillTimeConstant, InventoryItem::GetAttribute(), and EvEMath::Skill::PointsAtLevel().

Referenced by Character::AddToSkillQueue(), Character::CancelSkillInTraining(), GetRemainingSP(), GetTrainingTime(), Character::LoadPausedSkillQueue(), Character::SkillQueueLoop(), and VerifySP().

76  {
78 }
uint32 PointsAtLevel(uint8 level, float rank)
Definition: EvEMath.cpp:17
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 Skill::GetTrainingTime ( Character ch,
int64  startTime = 0 
)

Definition at line 132 of file Skill.cpp.

References AttrSkillLevel, AttrSkillPoints, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), GetFileTimeNow(), GetSPForLevel(), Character::GetSPPerMin(), EvESkill::MAXSKILLLEVEL, and EvE::Time::Second.

133 {
135  if (level > EvESkill::MAXSKILLLEVEL)
136  return 0;
137 
138  // get full sp needed for next level
139  uint32 remainingSP(GetSPForLevel(level) - GetAttribute(AttrSkillPoints).get_uint32());
140  // divide by spm to get time and convert to seconds
141  uint32 timeLeft((remainingSP /ch->GetSPPerMin(this)) * 60);
142 
143  if (startTime == 0)
144  return timeLeft;
145 
146  uint32 delta = (uint32)ceil((GetFileTimeNow() - startTime) / EvE::Time::Second);
147  if (delta < 1)
148  return timeLeft;
149 
150  // this skill is currently training. subtract accumulated time from total and return
151  return timeLeft - delta;
152 }
unsigned __int8 uint8
Definition: eve-compat.h:46
uint8 GetSPPerMin(Skill *skill)
Definition: Character.cpp:559
uint32 GetSPForLevel(uint8 level)
Definition: Skill.cpp:76
uint32 get_uint32()
Definition: EvilNumber.cpp:173
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
unsigned __int32 uint32
Definition: eve-compat.h:50
double GetFileTimeNow()
Definition: utils_time.cpp:84
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

bool Skill::IsTraining ( )

Definition at line 68 of file Skill.cpp.

References InventoryItem::flag(), and flagSkillInTraining.

68  {
69  return (flag() == flagSkillInTraining);
70 }
EVEItemFlags flag() const

Here is the call graph for this function:

SkillRef Skill::Load ( uint32  skillID)
static

Loads skill.

Parameters
[in]factory
[in]skillIDID of skill to load.
Returns
Pointer to new Skill object; NULL if fails.

Definition at line 47 of file Skill.cpp.

References skillID().

Referenced by Spawn().

48 {
49  return InventoryItem::Load<Skill>(skillID );
50 }
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online

Here is the call graph for this function:

Here is the caller graph for this function:

bool Skill::SkillPrereqsComplete ( Character ch)

Definition at line 207 of file Skill.cpp.

References AttrRequiredSkill1, AttrRequiredSkill1Level, AttrRequiredSkill2, AttrRequiredSkill2Level, AttrRequiredSkill3, AttrRequiredSkill3Level, AttrRequiredSkill4, AttrRequiredSkill4Level, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Character::GetSkillLevel(), InventoryItem::HasAttribute(), and skillID().

207  {
208  bool test(true);
209  EvilNumber skillID(0);
212  test = false;
215  test = false;
218  test = false;
221  test = false;
222  }
223  }
224  }
225  }
226 
227  return test;
228 }
bool HasAttribute(const uint16 attrID) const
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online
EvilNumber GetAttribute(const uint16 attrID) const
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
Definition: Character.cpp:575

Here is the call graph for this function:

SkillRef Skill::Spawn ( ItemData data)
static

Spawns new skill.

Parameters
[in]factory
[in]dataItem data of new skill.
Returns
Pointer to new Skill object; NULL if fails.

Definition at line 52 of file Skill.cpp.

References InventoryItem::CreateItemID(), RefPtr< X >::get(), Load(), and skillID().

Referenced by InventoryItem::Spawn(), and ItemFactory::SpawnSkill().

53 {
55  if ( skillID == 0 )
56  return SkillRef(nullptr);
57 
58  SkillRef skillRef(Skill::Load(skillID));
59  if (skillRef.get() == nullptr) {
60  // make error msg here for failure to load skill?
61  return SkillRef(nullptr);
62  }
63 
64  skillRef->SaveItem();
65  return skillRef;
66 }
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online
RefPtr< Skill > SkillRef
Definition: ItemRef.h:57
static SkillRef Load(uint32 skillID)
Definition: Skill.cpp:47
unsigned __int32 uint32
Definition: eve-compat.h:50
static uint32 CreateItemID(ItemData &data)
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

void Skill::VerifyAttribs ( )

Definition at line 154 of file Skill.cpp.

References _log, AttrSkillLevel, AttrSkillPoints, InventoryItem::ChangeSingleton(), evil_number_int, InventoryItem::GetAttribute(), InventoryItem::isSingleton(), InventoryItem::name(), and InventoryItem::SetAttribute().

155 {
156  if (!isSingleton())
157  ChangeSingleton(true);
158  if (GetAttribute(AttrSkillLevel).get_type() != evil_number_int) {
159  _log(SKILL__INFO, "Skill %s level type != int. Fixing...", name());
161  }
162  if (GetAttribute(AttrSkillPoints).get_type() != evil_number_int) {
163  _log(SKILL__INFO, "Skill %s sp type != int. Fixing...", name());
165  }
166 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
bool isSingleton() const
Definition: InventoryItem.h:96
void SetAttribute(uint16 attrID, int num, bool notify=true)
bool ChangeSingleton(bool singleton, bool notify=false)
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

void Skill::VerifySP ( )

Definition at line 168 of file Skill.cpp.

References _log, AttrSkillLevel, AttrSkillPoints, EvilZero, InventoryItem::GetAttribute(), GetSPForLevel(), is_log_enabled, EvESkill::MAXSKILLLEVEL, InventoryItem::name(), and InventoryItem::SetAttribute().

169 {
170  if (is_log_enabled(SKILL__MESSAGE))
171  _log(SKILL__MESSAGE, "Begin SP check for %s. level %u: CurrentSP: %u", \
172  name(), GetAttribute(AttrSkillLevel).get_uint32(), GetAttribute(AttrSkillPoints).get_uint32());
173 
175  return;
176 
177  uint8 level(GetAttribute(AttrSkillLevel).get_uint32() + 1);
178  if (level > EvESkill::MAXSKILLLEVEL) {
179  level = EvESkill::MAXSKILLLEVEL;
180  SetAttribute(AttrSkillLevel, level, false);
181  }
182  uint32 spThisLevel(GetSPForLevel(level -1));
183  uint32 spCurrent(GetAttribute(AttrSkillPoints).get_uint32());
184  if (spCurrent < spThisLevel) {
185  _log(SKILL__WARNING, "Skill %s points low. Updating from %u to %u", name(), spCurrent, spThisLevel);
186  SetAttribute(AttrSkillPoints, spThisLevel, false);
187  // hit it again to be sure it's fixed
188  VerifySP();
189  return;
190  }
191  uint32 spNextLevel(GetSPForLevel(level));
192  if (spCurrent > spNextLevel) {
194  if (level > 4) {
195  _log(SKILL__WARNING, " %s - Skillpoints high for L5. Updating SP from %u to %u.", \
196  name(), spCurrent, spNextLevel);
197  } else {
198  _log(SKILL__WARNING, " %s - Skillpoints high. Updating level from %u to %u and SP from %u to %u.", \
199  name(), level -1, level, spCurrent, spNextLevel);
200  }
201  SetAttribute(AttrSkillPoints, spNextLevel, false);
202  // hit it again to be sure it's fixed
203  VerifySP();
204  }
205 }
unsigned __int8 uint8
Definition: eve-compat.h:46
#define _log(type, fmt,...)
Definition: logsys.h:124
void VerifySP()
Definition: Skill.cpp:168
const char * name()
uint32 GetSPForLevel(uint8 level)
Definition: Skill.cpp:76
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
#define is_log_enabled(type)
Definition: logsys.h:78
const uint8 MAXSKILLLEVEL
Definition: EvEMath.h:19
void SetAttribute(uint16 attrID, int num, bool notify=true)
unsigned __int32 uint32
Definition: eve-compat.h:50
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Friends And Related Function Documentation

friend class InventoryItem
friend

Definition at line 51 of file Skill.h.


The documentation for this class was generated from the following files:
  • /backups/local/src/eve/EvEmu_Crucible/src/eve-server/character/Skill.h
  • /backups/local/src/eve/EvEmu_Crucible/src/eve-server/character/Skill.cpp