diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-08-07 22:08:29 +0200 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2013-08-26 22:56:47 +0200 |
commit | ba573fcc38580a01985172b9bc864c97ce855af3 (patch) | |
tree | ebcdbcf9a86cd35d5a8ab3bb004faa5c490c16d4 /src/account-server/character.h | |
parent | 7dc001eb32ae5345905e108741984258ee2f1813 (diff) | |
download | manaserv-ba573fcc38580a01985172b9bc864c97ce855af3.tar.gz manaserv-ba573fcc38580a01985172b9bc864c97ce855af3.tar.bz2 manaserv-ba573fcc38580a01985172b9bc864c97ce855af3.tar.xz manaserv-ba573fcc38580a01985172b9bc864c97ce855af3.zip |
Made cooldowns of abilities scriptable
- Removed hardcoded using of attributes
- Simply introduced lua functions to set global and ability cooldowns
- Requires database update
- Bumps the protocol
Diffstat (limited to 'src/account-server/character.h')
-rw-r--r-- | src/account-server/character.h | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/src/account-server/character.h b/src/account-server/character.h index 1fa0e975..ff29ffe5 100644 --- a/src/account-server/character.h +++ b/src/account-server/character.h @@ -23,7 +23,7 @@ #include <string> #include <vector> -#include <map> +#include <set> #include "common/defines.h" #include "common/inventorydata.h" @@ -55,19 +55,6 @@ struct AttributeValue { return modified; } }; -struct AbilityValue -{ - AbilityValue() - : currentPoints(0) - {} - - AbilityValue(unsigned currentPoints) - : currentPoints(currentPoints) - {} - - int currentPoints; -}; - struct Status { Status() @@ -82,11 +69,6 @@ struct Status */ typedef std::map<unsigned, AttributeValue> AttributeMap; -/** - * Stores abilitys by their id. - */ -typedef std::map<unsigned, AbilityValue> AbilityMap; - class CharacterData { public: @@ -196,23 +178,13 @@ class CharacterData void setKillCount(int monsterId, int kills) { mKillCount[monsterId] = kills; } - /** - * Get / Set abilitys - */ - int getAbilitySize() const - { return mAbilities.size(); } - - AbilityMap::const_iterator getAbilityBegin() const - { return mAbilities.begin(); } - - AbilityMap::const_iterator getAbilityEnd() const - { return mAbilities.end(); } - + const std::set<int> &getAbilities() const + { return mAbilities; } void clearAbilities() { mAbilities.clear(); } - void giveAbility(int id, int currentMana); + void giveAbility(int id); /** * Gets the Id of the map that the character is on. @@ -278,7 +250,7 @@ class CharacterData AttributeMap mAttributes; //!< Attributes. std::map<int, Status> mStatusEffects; //!< Status Effects std::map<int, int> mKillCount; //!< Kill Count - AbilityMap mAbilities; + std::set<int> mAbilities; unsigned short mMapId; //!< Map the being is on. unsigned char mGender; //!< Gender of the being. unsigned char mHairStyle; //!< Hair style of the being. |