-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathimmersive.h
91 lines (77 loc) · 3.36 KB
/
immersive.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#pragma once
#include "GossipDef.h"
#include "ImmersiveConfig.h"
using namespace std;
namespace immersive
{
enum ImmersiveEffectiveChance
{
IMMERSIVE_EFFECTIVE_CHANCE_MISS,
IMMERSIVE_EFFECTIVE_CHANCE_DODGE,
IMMERSIVE_EFFECTIVE_CHANCE_PARRY,
IMMERSIVE_EFFECTIVE_CHANCE_BLOCK,
IMMERSIVE_EFFECTIVE_CHANCE_CRIT,
IMMERSIVE_EFFECTIVE_CHANCE_SPELL_MISS,
IMMERSIVE_EFFECTIVE_ATTACK_DISTANCE
};
class ImmersiveAction
{
public:
ImmersiveAction() {}
public:
virtual bool Run(Player* player, Player* bot) = 0;
virtual string GetMessage() = 0;
protected:
virtual bool CheckSharedPercentReqs(Player* player, Player* bot);
virtual bool CheckSharedPercentReqsSingle(Player* player, Player* bot);
};
class Immersive
{
public:
Immersive();
public:
PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_);
void GetPlayerLevelInfo(Player *player, PlayerLevelInfo* info);
void OnGossipSelect(Player *player, uint32 gossipListId, GossipMenuItemData *menuData);
float GetFallDamage(float zdist);
void OnDeath(Player *player);
void OnGiveXP(Player *player, uint32 xp, Unit* victim);
void OnModifyMoney(Player *player, int32 delta);
void OnReputationChange(Player* player, FactionEntry const* factionEntry, int32& standing, bool incremental);
void OnRewardQuest(Player* player, Quest const* quest);
bool OnFishing(Player* player, bool success);
int32 CalculateEffectiveChance(int32 difference, const Unit* attacker, const Unit* victim, ImmersiveEffectiveChance type);
uint32 GetModifierValue(uint32 owner);
uint32 GetStatsValue(uint32 owner, Stats type);
void SetStatsValue(uint32 owner, Stats type, uint32 value);
uint32 GetTotalStats(Player *player, uint8 level = 0);
void OnGoUse(Player *player, GameObject* obj);
void OnGossipHello(Player* player, Creature* creature);
void CheckScaleChange(Player* player);
void OnPause(Player *player, uint32 spellId);
private:
void PrintHelp(Player *player, bool detailed = false, bool help = false);
void IncreaseStat(Player *player, uint32 type);
void ChangeModifier(Player *player, uint32 type);
void ResetStats(Player *player);
void CastPortal(Player *player, bool meetingStone = false);
void SendMessage(Player *player, string message);
uint32 CalculateEffectiveChanceDelta(const Unit* unit);
bool IsPaused(Unit *unit, uint32 spellId);
void PauseUnit(Unit *unit, SpellEntry const* spellInfo);
void ResumeUnit(Unit *unit, uint32 spellId);
private:
uint32 GetUsedStats(Player *player);
uint32 GetStatCost(Player *player, uint8 level = 0, uint32 usedStats = 0);
private:
void RunAction(Player* player, ImmersiveAction* action);
private:
uint32 GetValue(uint32 owner, string type);
void SetValue(uint32 owner, string type, uint32 value);
private:
static map<Stats, string> statValues;
static map<Stats, string> statNames;
map<uint32, map<string, uint32> > valueCache;
};
}
#define sImmersive MaNGOS::Singleton<immersive::Immersive>::Instance()