Add some packet handlers for Refer-a-Friend (work in progress). There is no guarantee that this code will work or even compile. Use at own risk.
This commit is contained in:
@@ -3061,6 +3061,16 @@ void Player::GiveLevel(uint8 level)
|
||||
|
||||
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
|
||||
|
||||
// Refer-A-Friend
|
||||
if (GetSession()->GetRecruiterId())
|
||||
if (level < sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL)) {
|
||||
if (level % 2 == 0) {
|
||||
m_grantableLevels++;
|
||||
|
||||
if (!HasByteFlag(PLAYER_FIELD_BYTES, 1, 0x01))
|
||||
SetByteFlag(PLAYER_FIELD_BYTES, 1, 0x01);
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerLevelChanged(this, oldLevel);
|
||||
}
|
||||
|
||||
|
||||
@@ -866,6 +866,24 @@ enum CurrencyItems
|
||||
ITEM_ARENA_POINTS_ID = 43307
|
||||
};
|
||||
|
||||
enum ReferAFriendError
|
||||
{
|
||||
ERR_REFER_A_FRIEND_NONE = 0x00,
|
||||
ERR_REFER_A_FRIEND_NOT_REFERRED_BY = 0x01,
|
||||
ERR_REFER_A_FRIEND_TARGET_TOO_HIGH = 0x02,
|
||||
ERR_REFER_A_FRIEND_INSUFFICIENT_GRANTABLE_LEVELS = 0x03,
|
||||
ERR_REFER_A_FRIEND_TOO_FAR = 0x04,
|
||||
ERR_REFER_A_FRIEND_DIFFERENT_FACTION = 0x05,
|
||||
ERR_REFER_A_FRIEND_NOT_NOW = 0x06,
|
||||
ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I = 0x07,
|
||||
ERR_REFER_A_FRIEND_NO_TARGET = 0x08,
|
||||
ERR_REFER_A_FRIEND_NOT_IN_GROUP = 0x09,
|
||||
ERR_REFER_A_FRIEND_SUMMON_LEVEL_MAX_I = 0x0A,
|
||||
ERR_REFER_A_FRIEND_SUMMON_COOLDOWN = 0x0B,
|
||||
ERR_REFER_A_FRIEND_INSUF_EXPAN_LVL = 0x0C,
|
||||
ERR_REFER_A_FRIEND_SUMMON_OFFLINE_S = 0x0D
|
||||
};
|
||||
|
||||
class PlayerTaxi
|
||||
{
|
||||
public:
|
||||
@@ -1989,7 +2007,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool isHonorOrXPTarget(Unit* pVictim);
|
||||
|
||||
bool GetsRecruitAFriendBonus(bool forXP);
|
||||
uint8 GetGrantableLevels() { return GetByteValue(PLAYER_FIELD_BYTES, 1); }
|
||||
uint8 GetGrantableLevels() { return m_grantableLevels; }
|
||||
void SetGrantableLevels(uint8 val) { m_grantableLevels = val; }
|
||||
|
||||
ReputationMgr& GetReputationMgr() { return m_reputationMgr; }
|
||||
ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
|
||||
@@ -2693,6 +2712,9 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool canSeeAlways(WorldObject const* obj) const;
|
||||
|
||||
bool isAlwaysDetectableFor(WorldObject const* seer) const;
|
||||
|
||||
uint8 m_grantableLevels;
|
||||
|
||||
private:
|
||||
// internal common parts for CanStore/StoreItem functions
|
||||
InventoryResult _CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool swap, Item *pSrcItem) const;
|
||||
|
||||
@@ -30,11 +30,11 @@ class WorldPacket;
|
||||
|
||||
enum FriendStatus
|
||||
{
|
||||
FRIEND_STATUS_OFFLINE = 0,
|
||||
FRIEND_STATUS_ONLINE = 1,
|
||||
FRIEND_STATUS_AFK = 2,
|
||||
FRIEND_STATUS_UNK3 = 3,
|
||||
FRIEND_STATUS_DND = 4
|
||||
FRIEND_STATUS_OFFLINE = 0x00,
|
||||
FRIEND_STATUS_ONLINE = 0x01,
|
||||
FRIEND_STATUS_AFK = 0x02,
|
||||
FRIEND_STATUS_DND = 0x04,
|
||||
FRIEND_STATUS_RAF = 0x08
|
||||
};
|
||||
|
||||
enum SocialFlag
|
||||
|
||||
Reference in New Issue
Block a user