mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Implement group mentor, leadership exp sharing (SoF+ only)
Currently only works in normal groups Some decisions: the EXP will be rounded in the favor of the group leader No idea how live actually handles it.
This commit is contained in:
+18
-5
@@ -2963,7 +2963,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
||||
return;
|
||||
}
|
||||
|
||||
query = StringFormat("INSERT INTO group_leaders(gid, leadername, marknpc, leadershipaa, maintank, assist, puller) VALUES(%u, '%s', '', '', '', '', '')",
|
||||
query = StringFormat("INSERT INTO group_leaders(gid, leadername, marknpc, leadershipaa, maintank, assist, puller, mentoree, mentor_percent) VALUES(%u, '%s', '', '', '', '', '', '', '0')",
|
||||
gid, EscapeString(name).c_str());
|
||||
result = QueryDatabase(query);
|
||||
|
||||
@@ -2972,8 +2972,9 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
||||
}
|
||||
}
|
||||
|
||||
char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank, char* assist, char* puller, char *marknpc, GroupLeadershipAA_Struct* GLAA){
|
||||
std::string query = StringFormat("SELECT `leadername`, `maintank`, `assist`, `puller`, `marknpc`, `leadershipaa` FROM `group_leaders` WHERE `gid` = %lu",(unsigned long)gid);
|
||||
char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank, char* assist, char* puller, char *marknpc, char *mentoree, int *mentor_percent, GroupLeadershipAA_Struct* GLAA)
|
||||
{
|
||||
std::string query = StringFormat("SELECT `leadername`, `maintank`, `assist`, `puller`, `marknpc`, `mentoree`, `mentor_percent`, `leadershipaa` FROM `group_leaders` WHERE `gid` = %lu",(unsigned long)gid);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success() || results.RowCount() == 0) {
|
||||
@@ -2992,6 +2993,12 @@ char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* mainta
|
||||
if(marknpc)
|
||||
marknpc[0] = '\0';
|
||||
|
||||
if (mentoree)
|
||||
mentoree[0] = '\0';
|
||||
|
||||
if (mentor_percent)
|
||||
*mentor_percent = 0;
|
||||
|
||||
return leaderbuf;
|
||||
}
|
||||
|
||||
@@ -3012,8 +3019,14 @@ char *Database::GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* mainta
|
||||
if(marknpc)
|
||||
strcpy(marknpc, row[4]);
|
||||
|
||||
if(GLAA && results.LengthOfColumn(5) == sizeof(GroupLeadershipAA_Struct))
|
||||
memcpy(GLAA, row[5], sizeof(GroupLeadershipAA_Struct));
|
||||
if (mentoree)
|
||||
strcpy(mentoree, row[5]);
|
||||
|
||||
if (mentor_percent)
|
||||
*mentor_percent = atoi(row[6]);
|
||||
|
||||
if(GLAA && results.LengthOfColumn(7) == sizeof(GroupLeadershipAA_Struct))
|
||||
memcpy(GLAA, row[7], sizeof(GroupLeadershipAA_Struct));
|
||||
|
||||
return leaderbuf;
|
||||
}
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ public:
|
||||
|
||||
void SetGroupLeaderName(uint32 gid, const char* name);
|
||||
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr,
|
||||
GroupLeadershipAA_Struct* GLAA = nullptr);
|
||||
char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
|
||||
void ClearGroupLeader(uint32 gid = 0);
|
||||
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ N(OP_GroupInvite2),
|
||||
N(OP_GroupLeaderChange),
|
||||
N(OP_GroupLeadershipAAUpdate),
|
||||
N(OP_GroupMakeLeader),
|
||||
N(OP_GroupMentor),
|
||||
N(OP_GroupRoles),
|
||||
N(OP_GroupUpdate),
|
||||
N(OP_GroupUpdateB),
|
||||
|
||||
@@ -2231,6 +2231,12 @@ struct GroupLeaderChange_Struct
|
||||
/*128*/ char Unknown128[20];
|
||||
};
|
||||
|
||||
struct GroupMentor_Struct {
|
||||
/*000*/ int percent;
|
||||
/*004*/ char name[64];
|
||||
/*068*/
|
||||
};
|
||||
|
||||
struct FaceChange_Struct {
|
||||
/*000*/ uint8 haircolor;
|
||||
/*001*/ uint8 beardcolor;
|
||||
|
||||
Reference in New Issue
Block a user