mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Added reset aa command for rof2 (50 status req), fixed #resetaa command
This commit is contained in:
parent
335470d3db
commit
34f0106437
@ -548,4 +548,5 @@ N(OP_ZoneServerInfo),
|
|||||||
N(OP_ZoneServerReady),
|
N(OP_ZoneServerReady),
|
||||||
N(OP_ZoneSpawns),
|
N(OP_ZoneSpawns),
|
||||||
N(OP_ZoneUnavail),
|
N(OP_ZoneUnavail),
|
||||||
|
N(OP_ResetAA),
|
||||||
// mail and chat opcodes located in ../mail_oplist.h
|
// mail and chat opcodes located in ../mail_oplist.h
|
||||||
|
|||||||
@ -353,6 +353,7 @@ OP_OpenContainer=0x0000
|
|||||||
OP_Marquee=0x502e
|
OP_Marquee=0x502e
|
||||||
OP_ItemRecastDelay=0x15a9
|
OP_ItemRecastDelay=0x15a9
|
||||||
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
|
#OP_OpenInventory=0x0000 # Likely does not exist in RoF -U
|
||||||
|
OP_ResetAA=0x1669
|
||||||
|
|
||||||
# Expeditions
|
# Expeditions
|
||||||
OP_DzAddPlayer=0x4701
|
OP_DzAddPlayer=0x4701
|
||||||
|
|||||||
114
zone/aa.cpp
114
zone/aa.cpp
@ -483,39 +483,34 @@ bool Client::CheckAAEffect(aaEffectType type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::ResetAA() {
|
void Client::ResetAA() {
|
||||||
// RefundAA();
|
RefundAA();
|
||||||
// uint32 i;
|
uint32 i;
|
||||||
// for (i=0; i < MAX_PP_AA_ARRAY; i++) {
|
for (i=0; i < MAX_PP_AA_ARRAY; i++) {
|
||||||
// aa[i]->AA = 0;
|
m_pp.aa_array[i].AA = 0;
|
||||||
// aa[i]->value = 0;
|
m_pp.aa_array[i].value = 0;
|
||||||
// aa[i]->charges = 0;
|
m_pp.aa_array[i].charges= 0;
|
||||||
// m_pp.aa_array[i].AA = 0;
|
}
|
||||||
// m_pp.aa_array[i].value = 0;
|
|
||||||
// m_pp.aa_array[i].charges= 0;
|
aa_ranks.clear();
|
||||||
// }
|
|
||||||
//
|
for(int i = 0; i < _maxLeaderAA; ++i)
|
||||||
// std::map<uint32,uint8>::iterator itr;
|
m_pp.leader_abilities.ranks[i] = 0;
|
||||||
// for(itr = aa_points.begin(); itr != aa_points.end(); ++itr)
|
|
||||||
// aa_points[itr->first] = 0;
|
m_pp.group_leadership_points = 0;
|
||||||
//
|
m_pp.raid_leadership_points = 0;
|
||||||
// for(int i = 0; i < _maxLeaderAA; ++i)
|
m_pp.group_leadership_exp = 0;
|
||||||
// m_pp.leader_abilities.ranks[i] = 0;
|
m_pp.raid_leadership_exp = 0;
|
||||||
//
|
|
||||||
// m_pp.group_leadership_points = 0;
|
database.DeleteCharacterAAs(CharacterID());
|
||||||
// m_pp.raid_leadership_points = 0;
|
SaveAA();
|
||||||
// m_pp.group_leadership_exp = 0;
|
SendClearAA();
|
||||||
// m_pp.raid_leadership_exp = 0;
|
SendAlternateAdvancementTable();
|
||||||
//
|
SendAlternateAdvancementPoints();
|
||||||
// database.DeleteCharacterAAs(this->CharacterID());
|
SendAlternateAdvancementStats();
|
||||||
// SaveAA();
|
database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
||||||
// SendClearAA();
|
// undefined for these clients
|
||||||
// SendAAList();
|
if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
|
||||||
// SendAATable();
|
Kick();
|
||||||
// SendAAStats();
|
|
||||||
// database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
|
||||||
// // undefined for these clients
|
|
||||||
// if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
|
|
||||||
// Kick();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SendClearAA()
|
void Client::SendClearAA()
|
||||||
@ -802,34 +797,31 @@ void Client::DurationRampage(uint32 duration)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::RefundAA() {
|
void Client::RefundAA() {
|
||||||
// int cur = 0;
|
int refunded = 0;
|
||||||
// bool refunded = false;
|
|
||||||
//
|
for(auto &rank_value : aa_ranks) {
|
||||||
// for(int x = 0; x < aaHighestID; x++) {
|
AA::Ability *ability = zone->GetAlternateAdvancementAbility(rank_value.first);
|
||||||
// cur = GetAA(x);
|
if(!ability) {
|
||||||
// if(cur > 0){
|
continue;
|
||||||
// SendAA_Struct* curaa = zone->FindAA(x);
|
}
|
||||||
// if(cur){
|
|
||||||
// SetAA(x, 0);
|
if(ability->charges > 0 && rank_value.second.second < 1) {
|
||||||
// for(int j = 0; j < cur; j++) {
|
continue;
|
||||||
// m_pp.aapoints += curaa->cost + (curaa->cost_inc * j);
|
}
|
||||||
// refunded = true;
|
|
||||||
// }
|
AA::Rank *rank = ability->GetRankByPointsSpent(rank_value.second.first);
|
||||||
// }
|
if(!rank) {
|
||||||
// else
|
continue;
|
||||||
// {
|
}
|
||||||
// m_pp.aapoints += cur;
|
|
||||||
// SetAA(x, 0);
|
refunded += rank->total_cost;
|
||||||
// refunded = true;
|
}
|
||||||
// }
|
|
||||||
// }
|
if(refunded > 0) {
|
||||||
// }
|
m_pp.aapoints += refunded;
|
||||||
//
|
SaveAA();
|
||||||
// if(refunded) {
|
Save();
|
||||||
// SaveAA();
|
}
|
||||||
// Save();
|
|
||||||
// // Kick();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AA_SwarmPetInfo::AA_SwarmPetInfo()
|
AA_SwarmPetInfo::AA_SwarmPetInfo()
|
||||||
|
|||||||
@ -389,6 +389,7 @@ void MapOpcodes()
|
|||||||
ConnectedOpcodes[OP_XTargetRequest] = &Client::Handle_OP_XTargetRequest;
|
ConnectedOpcodes[OP_XTargetRequest] = &Client::Handle_OP_XTargetRequest;
|
||||||
ConnectedOpcodes[OP_YellForHelp] = &Client::Handle_OP_YellForHelp;
|
ConnectedOpcodes[OP_YellForHelp] = &Client::Handle_OP_YellForHelp;
|
||||||
ConnectedOpcodes[OP_ZoneChange] = &Client::Handle_OP_ZoneChange;
|
ConnectedOpcodes[OP_ZoneChange] = &Client::Handle_OP_ZoneChange;
|
||||||
|
ConnectedOpcodes[OP_ResetAA] = &Client::Handle_OP_ResetAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearMappedOpcode(EmuOpcode op)
|
void ClearMappedOpcode(EmuOpcode op)
|
||||||
@ -14163,9 +14164,12 @@ void Client::Handle_OP_YellForHelp(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void Client::Handle_OP_ResetAA(const EQApplicationPacket *app)
|
||||||
void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app)
|
|
||||||
{
|
{
|
||||||
|
if(Admin() >= 50) {
|
||||||
|
Message(0, "Resetting AA points.");
|
||||||
|
ResetAA();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|||||||
@ -295,3 +295,4 @@
|
|||||||
void Handle_OP_XTargetRequest(const EQApplicationPacket *app);
|
void Handle_OP_XTargetRequest(const EQApplicationPacket *app);
|
||||||
void Handle_OP_YellForHelp(const EQApplicationPacket *app);
|
void Handle_OP_YellForHelp(const EQApplicationPacket *app);
|
||||||
void Handle_OP_ZoneChange(const EQApplicationPacket *app);
|
void Handle_OP_ZoneChange(const EQApplicationPacket *app);
|
||||||
|
void Handle_OP_ResetAA(const EQApplicationPacket *app);
|
||||||
|
|||||||
@ -332,7 +332,7 @@ int command_init(void) {
|
|||||||
command_add("reloadzonepoints", "- Reload zone points from database", 150, command_reloadzps) ||
|
command_add("reloadzonepoints", "- Reload zone points from database", 150, command_reloadzps) ||
|
||||||
command_add("reloadzps", nullptr,0, command_reloadzps) ||
|
command_add("reloadzps", nullptr,0, command_reloadzps) ||
|
||||||
command_add("repop", "[delay] - Repop the zone with optional delay", 100, command_repop) ||
|
command_add("repop", "[delay] - Repop the zone with optional delay", 100, command_repop) ||
|
||||||
command_add("resetaa", "- Resets a Player's AA in their profile and refunds spent AA's to unspent, disconnects player.", 200, command_resetaa) ||
|
command_add("resetaa", "- Resets a Player's AA in their profile and refunds spent AA's to unspent, may disconnect player.", 200, command_resetaa) ||
|
||||||
command_add("revoke", "[charname] [1/0] - Makes charname unable to talk on OOC", 200, command_revoke) ||
|
command_add("revoke", "[charname] [1/0] - Makes charname unable to talk on OOC", 200, command_revoke) ||
|
||||||
command_add("rules", "(subcommand) - Manage server rules", 250, command_rules) ||
|
command_add("rules", "(subcommand) - Manage server rules", 250, command_rules) ||
|
||||||
command_add("save", "- Force your player or player corpse target to be saved to the database", 50, command_save) ||
|
command_add("save", "- Force your player or player corpse target to be saved to the database", 50, command_save) ||
|
||||||
@ -672,20 +672,12 @@ void command_incstat(Client* c, const Seperator* sep){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void command_resetaa(Client* c,const Seperator *sep) {
|
void command_resetaa(Client* c,const Seperator *sep) {
|
||||||
|
if(c->GetTarget() && c->GetTarget()->IsClient()){
|
||||||
//if(sep->IsNumber(1) && atoi(sep->arg[1]) == 1) {
|
c->GetTarget()->CastToClient()->ResetAA();
|
||||||
// c->SendAlternateAdvancement(2, 2);
|
c->Message(13,"Successfully reset %s's AAs", c->GetTarget()->GetName());
|
||||||
//}
|
}
|
||||||
//else if(sep->IsNumber(1) && atoi(sep->arg[1]) == 2) {
|
else
|
||||||
// c->SendAlternateAdvancement(2, 3);
|
c->Message(0,"Usage: Target a client and use #resetaa to reset the AA data in their Profile.");
|
||||||
//}
|
|
||||||
|
|
||||||
//if(c->GetTarget()!=0 && c->GetTarget()->IsClient()){
|
|
||||||
// c->GetTarget()->CastToClient()->ResetAA();
|
|
||||||
// c->Message(13,"Successfully reset %s's AAs", c->GetTarget()->GetName());
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
// c->Message(0,"Usage: Target a client and use #resetaa to reset the AA data in their Profile.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void command_help(Client *c, const Seperator *sep)
|
void command_help(Client *c, const Seperator *sep)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user