AAs should load from character data now, though will be fucked up if you already had stacked aas.

This commit is contained in:
KimLS 2015-06-10 22:46:57 -07:00
parent 8422ce6f25
commit 1589169200
25 changed files with 3318 additions and 3805 deletions

View File

@ -4243,7 +4243,7 @@ struct AARankInfo_Struct
int32 total_cost; int32 total_cost;
int32 expansion; int32 expansion;
int32 category; int32 category;
uint8 charges; uint32 charges;
uint8 grant_only; uint8 grant_only;
uint32 total_effects; uint32 total_effects;
uint32 total_prereqs; uint32 total_prereqs;

View File

@ -2466,7 +2466,8 @@ namespace RoF2
outapp->WriteUInt32(emu->lastlogin); outapp->WriteUInt32(emu->lastlogin);
outapp->WriteUInt32(emu->timePlayedMin); outapp->WriteUInt32(emu->timePlayedMin);
outapp->WriteUInt32(emu->timeentitledonaccount); outapp->WriteUInt32(emu->timeentitledonaccount);
outapp->WriteUInt32(0x0007ffff); // Expansion bitmask outapp->WriteUInt32(emu->expansions);
//outapp->WriteUInt32(0x0007ffff); // Expansion bitmask
outapp->WriteUInt32(structs::MAX_PP_LANGUAGE); outapp->WriteUInt32(structs::MAX_PP_LANGUAGE);

View File

@ -1677,8 +1677,8 @@ namespace SoD
OUT(copper_bank); OUT(copper_bank);
OUT(platinum_shared); OUT(platinum_shared);
// OUT(unknown13156[84]); // OUT(unknown13156[84]);
//OUT(expansions); OUT(expansions);
eq->expansions = 16383; //eq->expansions = 16383;
// OUT(unknown13244[12]); // OUT(unknown13244[12]);
OUT(autosplit); OUT(autosplit);
// OUT(unknown13260[16]); // OUT(unknown13260[16]);

View File

@ -1335,8 +1335,8 @@ namespace SoF
OUT(copper_bank); OUT(copper_bank);
OUT(platinum_shared); OUT(platinum_shared);
// OUT(unknown13156[84]); // OUT(unknown13156[84]);
//OUT(expansions); OUT(expansions);
eq->expansions = 16383; //eq->expansions = 16383;
// OUT(unknown13244[12]); // OUT(unknown13244[12]);
OUT(autosplit); OUT(autosplit);
// OUT(unknown13260[16]); // OUT(unknown13260[16]);

View File

@ -1804,15 +1804,13 @@ namespace UF
// OUT(unknown00224[48]); // OUT(unknown00224[48]);
//NOTE: new client supports 300 AAs, our internal rep/PP //NOTE: new client supports 300 AAs, our internal rep/PP
//only supports 240.. //only supports 240..
//for (r = 0; r < MAX_PP_AA_ARRAY; r++) { for (r = 0; r < MAX_PP_AA_ARRAY; r++) {
// OUT(aa_array[r].AA); eq->aa_array[r].AA = emu->aa_array[r].AA;
// OUT(aa_array[r].value); eq->aa_array[r].value = emu->aa_array[r].value;
// OUT(aa_array[r].charges); eq->aa_array[r].charges = emu->aa_array[r].charges;
//} }
// OUT(unknown02220[4]);
eq->aa_array[0].AA = 6; // OUT(unknown02220[4]);
eq->aa_array[0].value = 5;
OUT(mana); OUT(mana);
OUT(cur_hp); OUT(cur_hp);
@ -1943,8 +1941,8 @@ namespace UF
OUT(copper_bank); OUT(copper_bank);
OUT(platinum_shared); OUT(platinum_shared);
// OUT(unknown13156[84]); // OUT(unknown13156[84]);
//OUT(expansions); OUT(expansions);
eq->expansions = 0xffff; //eq->expansions = 0x1ffff;
// OUT(unknown13244[12]); // OUT(unknown13244[12]);
OUT(autosplit); OUT(autosplit);
// OUT(unknown13260[16]); // OUT(unknown13260[16]);
@ -2149,7 +2147,6 @@ namespace UF
ENCODE(OP_SendAATable) ENCODE(OP_SendAATable)
{ {
#if 1
EQApplicationPacket *inapp = *p; EQApplicationPacket *inapp = *p;
*p = nullptr; *p = nullptr;
AARankInfo_Struct *emu = (AARankInfo_Struct*)inapp->pBuffer; AARankInfo_Struct *emu = (AARankInfo_Struct*)inapp->pBuffer;
@ -2180,8 +2177,8 @@ namespace UF
eq->last_id = emu->prev_id; eq->last_id = emu->prev_id;
eq->next_id = emu->next_id; eq->next_id = emu->next_id;
eq->cost2 = emu->total_cost; eq->cost2 = emu->total_cost;
eq->grant_only = emu->grant_only > 0 ? true : false; eq->grant_only = emu->grant_only;
eq->expendable_charges = emu->charges ? 1 : 0; eq->expendable_charges = emu->charges;
eq->aa_expansion = emu->expansion; eq->aa_expansion = emu->expansion;
eq->special_category = emu->category; eq->special_category = emu->category;
eq->total_abilities = emu->total_effects; eq->total_abilities = emu->total_effects;
@ -2194,65 +2191,13 @@ namespace UF
} }
if(emu->total_prereqs > 0) { if(emu->total_prereqs > 0) {
eq->prereq_skill = -(int)inapp->ReadUInt32(); eq->prereq_skill = inapp->ReadUInt32();
eq->prereq_minpoints = inapp->ReadUInt32(); eq->prereq_minpoints = inapp->ReadUInt32();
} }
Log.Out(Logs::General, Logs::Status, "%s", DumpPacketToString(outapp).c_str()); //Log.Out(Logs::General, Logs::Status, "%s", DumpPacketToString(outapp).c_str());
dest->FastQueuePacket(&outapp); dest->FastQueuePacket(&outapp);
delete inapp; delete inapp;
#else
ENCODE_LENGTH_ATLEAST(SendAA_Struct);
SETUP_VAR_ENCODE(SendAA_Struct);
ALLOC_VAR_ENCODE(structs::SendAA_Struct, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability));
// Check clientver field to verify this AA should be sent for SoF
// clientver 1 is for all clients and 6 is for Underfoot
if(emu->clientver <= 6)
{
OUT(id);
eq->unknown004 = 1;
//eq->hotkey_sid = (emu->hotkey_sid==4294967295UL)?0:(emu->id - emu->current_level + 1);
//eq->hotkey_sid2 = (emu->hotkey_sid2==4294967295UL)?0:(emu->id - emu->current_level + 1);
//eq->title_sid = emu->id - emu->current_level + 1;
//eq->desc_sid = emu->id - emu->current_level + 1;
eq->hotkey_sid = (emu->hotkey_sid == 4294967295UL) ? 0 : (emu->sof_next_skill);
eq->hotkey_sid2 = (emu->hotkey_sid2 == 4294967295UL) ? 0 : (emu->sof_next_skill);
eq->title_sid = emu->sof_next_skill;
eq->desc_sid = emu->sof_next_skill;
OUT(class_type);
OUT(cost);
OUT(seq);
OUT(current_level);
OUT(prereq_skill);
OUT(prereq_minpoints);
eq->type = emu->sof_type;
OUT(spellid);
OUT(spell_type);
OUT(spell_refresh);
OUT(classes);
//OUT(berserker);
//eq->max_level = emu->sof_max_level;
OUT(max_level);
OUT(last_id);
OUT(next_id);
OUT(cost2);
eq->aa_expansion = emu->aa_expansion;
eq->special_category = emu->special_category;
eq->expendable_charges = emu->special_category == 7 ? 1 : 0; // temp hack, this can actually be any number
OUT(total_abilities);
unsigned int r;
for(r = 0; r < emu->total_abilities; r++) {
OUT(abilities[r].skill_id);
OUT(abilities[r].base1);
OUT(abilities[r].base2);
OUT(abilities[r].slot);
}
}
Log.Out(Logs::General, Logs::Status, "%s", DumpPacketToString(__packet).c_str());
FINISH_ENCODE();
#endif
} }
ENCODE(OP_SendCharInfo) ENCODE(OP_SendCharInfo)

View File

@ -139,8 +139,4 @@ protected:
std::map<pTimerType, PersistentTimer *> _list; std::map<pTimerType, PersistentTimer *> _list;
}; };
//code prettying macros
#define AA_Choose3(val, v1, v2, v3) (val==1?v1:(val==2?v2:v3))
#define AA_Choose5(val, v1, v2, v3, v4, v5) (val==1?v1:(val==2?v2:(val==3?v3:(val==4?v4:v5))))
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -2137,17 +2137,6 @@ struct AALevelCost_Struct
uint32 Cost; uint32 Cost;
}; };
//assumes that no activatable aa.has more than 5 ranks
#define MAX_AA_ACTION_RANKS 20
extern AA_DBAction AA_Actions[aaHighestID][MAX_AA_ACTION_RANKS]; //[aaid][rank]
extern std::map<uint16, AA_SwarmPet> AA_SwarmPets; //key=spell_id
#define AA_Choose3(val, v1, v2, v3) (val==1?v1:(val==2?v2:v3))
extern std::map<uint32,SendAA_Struct*>aas_send;
extern std::map<uint32, std::map<uint32, AA_Ability> > aa_effects;
extern std::map<uint32, AALevelCost_Struct> AARequiredLevelAndCost;
enum { //values of AA_Action.action enum { //values of AA_Action.action
aaActionActivate = 0, aaActionActivate = 0,
aaActionSetEXP = 1, aaActionSetEXP = 1,

View File

@ -43,6 +43,7 @@ public:
Rank *prev; Rank *prev;
int next_id; int next_id;
Rank *next; Rank *next;
int current_value;
int expansion; int expansion;
uint32 account_time_required; uint32 account_time_required;
int total_cost; int total_cost;

View File

@ -4659,38 +4659,39 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui
proc_spell_id = 0; proc_spell_id = 0;
ProcMod = 0; ProcMod = 0;
std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aaid); //old AA
if(find_iter == aa_effects.end()) //std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aaid);
break; //if(find_iter == aa_effects.end())
// break;
for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) { //for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) {
effect = iter->second.skill_id; // effect = iter->second.skill_id;
base1 = iter->second.base1; // base1 = iter->second.base1;
base2 = iter->second.base2; // base2 = iter->second.base2;
slot = iter->second.slot; // slot = iter->second.slot;
//
if (effect == SE_SkillProc || effect == SE_SkillProcSuccess) { // if (effect == SE_SkillProc || effect == SE_SkillProcSuccess) {
proc_spell_id = base1; // proc_spell_id = base1;
ProcMod = static_cast<float>(base2); // ProcMod = static_cast<float>(base2);
} // }
//
else if (effect == SE_LimitToSkill && base1 <= HIGHEST_SKILL) { // else if (effect == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
//
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) { // if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f); // float final_chance = chance * (ProcMod / 100.0f);
//
if (zone->random.Roll(final_chance)) { // if (zone->random.Roll(final_chance)) {
ExecWeaponProc(nullptr, proc_spell_id, on); // ExecWeaponProc(nullptr, proc_spell_id, on);
CanProc = false; // CanProc = false;
break; // break;
} // }
} // }
} // }
else { // else {
proc_spell_id = 0; // proc_spell_id = 0;
ProcMod = 0; // ProcMod = 0;
} // }
} //}
} }
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -448,8 +448,6 @@ public:
bool IsBotWISCaster() { return (GetClass() == CLERIC || GetClass() == DRUID || GetClass() == SHAMAN); } bool IsBotWISCaster() { return (GetClass() == CLERIC || GetClass() == DRUID || GetClass() == SHAMAN); }
bool CanHeal(); bool CanHeal();
int GetRawACNoShield(int &shield_ac); int GetRawACNoShield(int &shield_ac);
void LoadAAs();
uint32 GetAA(uint32 aa_id);
void ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon); void ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon);
bool GetHasBeenSummoned() { return _hasBeenSummoned; } bool GetHasBeenSummoned() { return _hasBeenSummoned; }
const glm::vec3 GetPreSummonLocation() const { return m_PreSummonLocation; } const glm::vec3 GetPreSummonLocation() const { return m_PreSummonLocation; }

View File

@ -439,7 +439,7 @@ void Client::SendZoneInPackets()
//Send AA Exp packet: //Send AA Exp packet:
if (GetLevel() >= 51) if (GetLevel() >= 51)
SendAAStats(); SendAlternateAdvancementStats();
// Send exp packets // Send exp packets
outapp = new EQApplicationPacket(OP_ExpUpdate, sizeof(ExpUpdate_Struct)); outapp = new EQApplicationPacket(OP_ExpUpdate, sizeof(ExpUpdate_Struct));
@ -8040,56 +8040,6 @@ void Client::TryItemTimer(int slot)
} }
} }
void Client::RefundAA() {
int cur = 0;
bool refunded = false;
for(int x = 0; x < aaHighestID; x++) {
cur = GetAA(x);
if(cur > 0){
SendAA_Struct* curaa = zone->FindAA(x);
if(cur){
SetAA(x, 0);
for(int j = 0; j < cur; j++) {
m_pp.aapoints += curaa->cost + (curaa->cost_inc * j);
refunded = true;
}
}
else
{
m_pp.aapoints += cur;
SetAA(x, 0);
refunded = true;
}
}
}
if(refunded) {
SaveAA();
Save();
// Kick();
}
}
void Client::IncrementAA(int aa_id) {
SendAA_Struct* aa2 = zone->FindAA(aa_id);
if(aa2 == nullptr)
return;
if(GetAA(aa_id) == aa2->max_level)
return;
SetAA(aa_id, GetAA(aa_id) + 1);
SaveAA();
SendAA(aa_id);
SendAATable();
SendAAStats();
CalcBonuses();
}
void Client::SendItemScale(ItemInst *inst) { void Client::SendItemScale(ItemInst *inst) {
int slot = m_inv.GetSlotByItemInst(inst); int slot = m_inv.GetSlotByItemInst(inst);
if(slot != -1) { if(slot != -1) {

View File

@ -762,9 +762,16 @@ public:
//New AA Methods //New AA Methods
void SendAlternateAdvancementRank(int aa_id, int level); void SendAlternateAdvancementRank(int aa_id, int level);
void SendAlternateAdvancementTable(); void SendAlternateAdvancementTable();
void SendAlternateAdvancementStats();
void PurchaseAlternateAdvancementRank(int rank_id);
void SendAlternateAdvancementPoints();
void SetAAPoints(uint32 points) { m_pp.aapoints = points; SendAlternateAdvancementStats(); }
void AddAAPoints(uint32 points) { m_pp.aapoints += points; SendAlternateAdvancementStats(); }
int GetAAPoints() { return m_pp.aapoints; }
int GetSpentAA() { return m_pp.aapoints_spent; }
//old AA Methods //old AA Methods
void SendAAList();
void ResetAA(); void ResetAA();
void SendClearAA(); void SendClearAA();
void SendAA(uint32 id, int seq=1); void SendAA(uint32 id, int seq=1);
@ -776,7 +783,6 @@ public:
void SetTitleSuffix(const char *txt); void SetTitleSuffix(const char *txt);
inline uint32 GetMaxAAXP(void) const { return max_AAXP; } inline uint32 GetMaxAAXP(void) const { return max_AAXP; }
inline uint32 GetAAXP() const { return m_pp.expAA; } inline uint32 GetAAXP() const { return m_pp.expAA; }
void SendAAStats();
void SendAATable(); void SendAATable();
void SendAATimers(); void SendAATimers();
int GetAATimerID(aaID activate); int GetAATimerID(aaID activate);
@ -790,10 +796,6 @@ public:
inline uint32 GetAAPointsSpent() { return m_pp.aapoints_spent; } inline uint32 GetAAPointsSpent() { return m_pp.aapoints_spent; }
int16 CalcAAFocusEffect(focusType type, uint16 focus_spell, uint16 spell_id); int16 CalcAAFocusEffect(focusType type, uint16 focus_spell, uint16 spell_id);
int16 CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id); int16 CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id);
void SetAAPoints(uint32 points) { m_pp.aapoints = points; SendAAStats(); }
void AddAAPoints(uint32 points) { m_pp.aapoints += points; SendAAStats(); }
int GetAAPoints() { return m_pp.aapoints; }
int GetSpentAA() { return m_pp.aapoints_spent; }
void RefundAA(); void RefundAA();
void IncrementAA(int aa_id); void IncrementAA(int aa_id);
int32 GetAAEffectDataBySlot(uint32 aa_ID, uint32 slot_id, bool GetEffect, bool GetBase1, bool GetBase2); int32 GetAAEffectDataBySlot(uint32 aa_ID, uint32 slot_id, bool GetEffect, bool GetBase1, bool GetBase2);

View File

@ -1152,7 +1152,7 @@ void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app)
void Client::Handle_Connect_OP_UpdateAA(const EQApplicationPacket *app) void Client::Handle_Connect_OP_UpdateAA(const EQApplicationPacket *app)
{ {
SendAATable(); SendAlternateAdvancementPoints();
} }
void Client::Handle_Connect_OP_WearChange(const EQApplicationPacket *app) void Client::Handle_Connect_OP_WearChange(const EQApplicationPacket *app)
@ -1439,61 +1439,9 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (m_pp.ldon_points_tak < 0 || m_pp.ldon_points_tak > 2000000000){ m_pp.ldon_points_tak = 0; } if (m_pp.ldon_points_tak < 0 || m_pp.ldon_points_tak > 2000000000){ m_pp.ldon_points_tak = 0; }
if (m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 2000000000){ m_pp.ldon_points_available = 0; } if (m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 2000000000){ m_pp.ldon_points_available = 0; }
/* Initialize AA's : Move to function eventually */ if(!database.LoadAlternateAdvancement(this)) {
//aa old Log.Out(Logs::General, Logs::Error, "Error loading AA points for %s", GetName());
//for (uint32 a = 0; a < MAX_PP_AA_ARRAY; a++) }
// aa[a] = &m_pp.aa_array[a];
//query = StringFormat(
// "SELECT "
// "slot, "
// "aa_id, "
// "aa_value, "
// "charges "
// "FROM "
// "`character_alternate_abilities` "
// "WHERE `id` = %u ORDER BY `slot`", this->CharacterID());
//results = database.QueryDatabase(query); i = 0;
//int offset = 0; // offset to fix the hole from expendables
//for (auto row = results.begin(); row != results.end(); ++row) {
// i = atoi(row[0]) - offset;
// m_pp.aa_array[i].AA = atoi(row[1]);
// m_pp.aa_array[i].value = atoi(row[2]);
// m_pp.aa_array[i].charges = atoi(row[3]);
// /* A used expendable could cause there to be a "hole" in the array, this is very bad. Bad things like keeping your expendable after use.
// We could do a few things, one of them being reshuffling when the hole is created or defer the fixing until a later point, like during load!
// Or just never making a hole in the array and just have hacks every where. Fixing the hole at load really just keeps 1 hack in Client::SendAATable
// and keeping this offset that will cause the next AA to be pushed back over the hole. We also need to clean up on save so we don't have multiple
// entries for a single AA.
// */
// if (m_pp.aa_array[i].value == 0)
// offset++;
//}
//for (uint32 a = 0; a < MAX_PP_AA_ARRAY; a++){
// uint32 id = aa[a]->AA;
// //watch for invalid AA IDs
// if (id == aaNone)
// continue;
// if (id >= aaHighestID) {
// aa[a]->AA = aaNone;
// aa[a]->value = 0;
// continue;
// }
// if (aa[a]->value == 0) {
// aa[a]->AA = aaNone;
// continue;
// }
// if (aa[a]->value > HIGHEST_AA_VALUE) {
// aa[a]->AA = aaNone;
// aa[a]->value = 0;
// continue;
// }
//
// //aa old
// // if (aa[a]->value > 1) /* hack in some stuff for sony's new AA method (where each level of each aa.has a seperate ID) */
// // aa_points[(id - aa[a]->value + 1)] = aa[a]->value;
// // else
// // aa_points[id] = aa[a]->value;
//}
if (SPDAT_RECORDS > 0) { if (SPDAT_RECORDS > 0) {
for (uint32 z = 0; z<MAX_PP_MEMSPELL; z++) { for (uint32 z = 0; z<MAX_PP_MEMSPELL; z++) {
@ -1618,9 +1566,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (IsLFP()) { UpdateLFP(); } if (IsLFP()) { UpdateLFP(); }
/* Get Expansions from variables table and ship via PP */ /* Get Expansions from variables table and ship via PP */
char val[20] = { 0 }; m_pp.expansions = RuleI(World, ExpansionSettings);
if (database.GetVariable("Expansions", val, 20)){ m_pp.expansions = atoi(val); }
else{ m_pp.expansions = 0x3FF; }
p_timers.SetCharID(CharacterID()); p_timers.SetCharID(CharacterID());
if (!p_timers.Load(&database)) { if (!p_timers.Load(&database)) {
@ -1796,38 +1742,39 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app)
Log.Out(Logs::Detail, Logs::AA, "Received OP_AAAction"); Log.Out(Logs::Detail, Logs::AA, "Received OP_AAAction");
if (app->size != sizeof(AA_Action)){ if (app->size != sizeof(AA_Action)){
printf("Error! OP_AAAction size didnt match!\n"); Log.Out(Logs::General, Logs::AA, "Error! OP_AAAction size didnt match!");
return; return;
} }
AA_Action* action = (AA_Action*)app->pBuffer; AA_Action* action = (AA_Action*)app->pBuffer;
if (action->action == aaActionActivate) {//AA Hotkey if (action->action == aaActionActivate) {//AA Hotkey
Log.Out(Logs::Detail, Logs::AA, "Activating AA %d", action->ability); Log.Out(Logs::Detail, Logs::AA, "Activating AA %d", action->ability);
ActivateAA((aaID)action->ability); //ActivateAlternateAdvancementAbility(action->ability);
} }
else if (action->action == aaActionBuy) { else if (action->action == aaActionBuy) {
BuyAA(action); PurchaseAlternateAdvancementRank(action->ability);
} }
else if (action->action == aaActionDisableEXP){ //Turn Off AA Exp else if (action->action == aaActionDisableEXP){ //Turn Off AA Exp
if (m_epp.perAA > 0) if (m_epp.perAA > 0)
Message_StringID(0, AA_OFF); Message_StringID(0, AA_OFF);
m_epp.perAA = 0; m_epp.perAA = 0;
SendAAStats(); SendAlternateAdvancementStats();
} }
else if (action->action == aaActionSetEXP) { else if (action->action == aaActionSetEXP) {
if (m_epp.perAA == 0) if (m_epp.perAA == 0)
Message_StringID(0, AA_ON); Message_StringID(0, AA_ON);
m_epp.perAA = action->exp_value; m_epp.perAA = action->exp_value;
if (m_epp.perAA<0 || m_epp.perAA>100) m_epp.perAA = 0; // stop exploit with sanity check if (m_epp.perAA < 0 || m_epp.perAA > 100)
m_epp.perAA = 0; // stop exploit with sanity check
// send an update // send an update
SendAAStats(); SendAlternateAdvancementStats();
SendAATable(); SendAlternateAdvancementTable();
} }
else { else {
printf("Unknown AA action: %u %u 0x%x %d\n", action->action, action->ability, action->unknown08, action->exp_value); Log.Out(Logs::General, Logs::AA, "Unknown AA action : %u %u 0x%x %d", action->action, action->ability, action->unknown08, action->exp_value);
} }
return;
} }
void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app)

View File

@ -5600,8 +5600,8 @@ void command_setaapts(Client *c, const Seperator *sep)
t->SetLeadershipEXP(t->GetGroupEXP(), atoi(sep->arg[2])*RAID_EXP_PER_POINT); t->SetLeadershipEXP(t->GetGroupEXP(), atoi(sep->arg[2])*RAID_EXP_PER_POINT);
} else { } else {
t->SetEXP(t->GetEXP(),t->GetMaxAAXP()*atoi(sep->arg[2]),false); t->SetEXP(t->GetEXP(),t->GetMaxAAXP()*atoi(sep->arg[2]),false);
t->SendAAStats(); t->SendAlternateAdvancementStats();
t->SendAATable(); t->SendAlternateAdvancementTable();
} }
} }
@ -7684,54 +7684,55 @@ void command_reloadtitles(Client *c, const Seperator *sep)
} }
//old aa, probably to be removed
void command_altactivate(Client *c, const Seperator *sep){ void command_altactivate(Client *c, const Seperator *sep){
if(sep->arg[1][0] == '\0'){ // if(sep->arg[1][0] == '\0'){
c->Message(10, "Invalid argument, usage:"); // c->Message(10, "Invalid argument, usage:");
c->Message(10, "#altactivate list - lists the AA ID numbers that are available to you"); // c->Message(10, "#altactivate list - lists the AA ID numbers that are available to you");
c->Message(10, "#altactivate time [argument] - returns the time left until you can use the AA with the ID that matches the argument."); // c->Message(10, "#altactivate time [argument] - returns the time left until you can use the AA with the ID that matches the argument.");
c->Message(10, "#altactivate [argument] - activates the AA with the ID that matches the argument."); // c->Message(10, "#altactivate [argument] - activates the AA with the ID that matches the argument.");
return; // return;
} // }
if(!strcasecmp(sep->arg[1], "help")){ // if(!strcasecmp(sep->arg[1], "help")){
c->Message(10, "Usage:"); // c->Message(10, "Usage:");
c->Message(10, "#altactivate list - lists the AA ID numbers that are available to you"); // c->Message(10, "#altactivate list - lists the AA ID numbers that are available to you");
c->Message(10, "#altactivate time [argument] - returns the time left until you can use the AA with the ID that matches the argument."); // c->Message(10, "#altactivate time [argument] - returns the time left until you can use the AA with the ID that matches the argument.");
c->Message(10, "#altactivate [argument] - activates the AA with the ID that matches the argument."); // c->Message(10, "#altactivate [argument] - activates the AA with the ID that matches the argument.");
return; // return;
} // }
if(!strcasecmp(sep->arg[1], "list")){ // if(!strcasecmp(sep->arg[1], "list")){
c->Message(10, "You have access to the following AA Abilities:"); // c->Message(10, "You have access to the following AA Abilities:");
int x, val; // int x, val;
SendAA_Struct* saa = nullptr; // SendAA_Struct* saa = nullptr;
for(x = 0; x < aaHighestID; x++){ // for(x = 0; x < aaHighestID; x++){
if(AA_Actions[x][0].spell_id || AA_Actions[x][0].action){ //if there's an action or spell associated we assume it's a valid // if(AA_Actions[x][0].spell_id || AA_Actions[x][0].action){ //if there's an action or spell associated we assume it's a valid
val = 0; //and assume if they don't have a value for the first rank then it isn't valid for any rank // val = 0; //and assume if they don't have a value for the first rank then it isn't valid for any rank
saa = nullptr; // saa = nullptr;
val = c->GetAA(x); // val = c->GetAA(x);
if(val){ // if(val){
saa = zone->FindAA(x); // saa = zone->FindAA(x);
c->Message(10, "%d: %s %d", x, saa->name, val); // c->Message(10, "%d: %s %d", x, saa->name, val);
} // }
} // }
} // }
} // }
else if(!strcasecmp(sep->arg[1], "time")){ // else if(!strcasecmp(sep->arg[1], "time")){
int ability = atoi(sep->arg[2]); // int ability = atoi(sep->arg[2]);
if(c->GetAA(ability)){ // if(c->GetAA(ability)){
int remain = c->GetPTimers().GetRemainingTime(pTimerAAStart + ability); // int remain = c->GetPTimers().GetRemainingTime(pTimerAAStart + ability);
if(remain) // if(remain)
c->Message(10, "You may use that ability in %d minutes and %d seconds.", (remain/60), (remain%60)); // c->Message(10, "You may use that ability in %d minutes and %d seconds.", (remain/60), (remain%60));
else // else
c->Message(10, "You may use that ability now."); // c->Message(10, "You may use that ability now.");
} // }
else{ // else{
c->Message(10, "You do not have access to that ability."); // c->Message(10, "You do not have access to that ability.");
} // }
} // }
else // else
{ // {
c->ActivateAA((aaID) atoi(sep->arg[1])); // c->ActivateAA((aaID) atoi(sep->arg[1]));
} // }
} }
void command_traindisc(Client *c, const Seperator *sep) void command_traindisc(Client *c, const Seperator *sep)

View File

@ -515,7 +515,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
if (GetLevel() < 51) { if (GetLevel() < 51) {
m_epp.perAA = 0; // turn off aa exp if they drop below 51 m_epp.perAA = 0; // turn off aa exp if they drop below 51
} else } else
SendAAStats(); //otherwise, send them an AA update SendAlternateAdvancementStats(); //otherwise, send them an AA update
//send the expdata in any case so the xp bar isnt stuck after leveling //send the expdata in any case so the xp bar isnt stuck after leveling
uint32 tmpxp1 = GetEXPForLevel(GetLevel()+1); uint32 tmpxp1 = GetEXPForLevel(GetLevel()+1);

View File

@ -958,7 +958,8 @@ public:
//aa new //aa new
uint32 GetAA(uint32 rank_id) const; uint32 GetAA(uint32 rank_id) const;
bool SetAA(uint32 rank_id, uint32 new_value); bool SetAA(uint32 rank_id, uint32 new_value, uint32 charges = 0);
void ClearAAs() { aa_ranks.clear(); }
bool CanUseAlternateAdvancementRank(AA::Rank *rank); bool CanUseAlternateAdvancementRank(AA::Rank *rank);
bool CanPurchaseAlternateAdvancementRank(AA::Rank *ran); bool CanPurchaseAlternateAdvancementRank(AA::Rank *ran);
@ -1316,7 +1317,7 @@ protected:
bool bEnraged; bool bEnraged;
bool destructibleobject; bool destructibleobject;
std::unordered_map<uint32, uint32> aa_ranks; std::unordered_map<uint32, std::pair<uint32, uint32>> aa_ranks;
private: private:
void _StopSong(); //this is not what you think it is void _StopSong(); //this is not what you think it is

View File

@ -248,9 +248,6 @@ int main(int argc, char** argv) {
Log.Out(Logs::General, Logs::Zone_Server, "Loading titles"); Log.Out(Logs::General, Logs::Zone_Server, "Loading titles");
title_manager.LoadTitles(); title_manager.LoadTitles();
Log.Out(Logs::General, Logs::Zone_Server, "Loading AA effects");
database.LoadAAEffects();
Log.Out(Logs::General, Logs::Zone_Server, "Loading tributes"); Log.Out(Logs::General, Logs::Zone_Server, "Loading tributes");
database.LoadTributes(); database.LoadTributes();

View File

@ -4077,33 +4077,34 @@ XS(XS_Client_RefundAA) {
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
int curpt = 0; //old aa
bool refunded = false; //int curpt = 0;
//bool refunded = false;
for(int x1=0;x1<aaHighestID;x1++){ //
curpt = THIS->GetAA(x1); //for(int x1=0;x1<aaHighestID;x1++){
if(curpt > 0){ // curpt = THIS->GetAA(x1);
SendAA_Struct* curaa = zone->FindAA(x1); // if(curpt > 0){
if(curaa){ // SendAA_Struct* curaa = zone->FindAA(x1);
THIS->SetAA(x1, 0); // if(curaa){
for(int x2=0;x2<curpt;x2++){ //add up all the AA points pt by pt to get the correct cost // THIS->SetAA(x1, 0);
THIS->GetPP().aapoints += curaa->cost + (curaa->cost_inc * x2); // for(int x2=0;x2<curpt;x2++){ //add up all the AA points pt by pt to get the correct cost
refunded = true; // THIS->GetPP().aapoints += curaa->cost + (curaa->cost_inc * x2);
} // refunded = true;
} // }
else //aa doesn't exist.. but if they bought it then it had at least a cost of 1 point each // }
{ //so give back what we can // else //aa doesn't exist.. but if they bought it then it had at least a cost of 1 point each
THIS->GetPP().aapoints += curpt; // { //so give back what we can
THIS->SetAA(x1, 0); // THIS->GetPP().aapoints += curpt;
refunded = true; // THIS->SetAA(x1, 0);
} // refunded = true;
} // }
} // }
//}
if(refunded){ //
THIS->Save(); //save of course //if(refunded){
THIS->Kick(); //client gets all buggy if we don't immediatly relog so just force it on them // THIS->Save(); //save of course
} // THIS->Kick(); //client gets all buggy if we don't immediatly relog so just force it on them
//}
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }

View File

@ -4157,30 +4157,30 @@ int32 Client::GetAAEffectDataBySlot(uint32 aa_ID, uint32 slot_id, bool GetEffect
int32 base2 = 0; int32 base2 = 0;
uint32 slot = 0; uint32 slot = 0;
//old aa
std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aa_ID); //std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aa_ID);
if(find_iter == aa_effects.end()) //if(find_iter == aa_effects.end())
return 0; // return 0;
//
for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter) //for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter)
{ //{
effect = iter->second.skill_id; // effect = iter->second.skill_id;
base1 = iter->second.base1; // base1 = iter->second.base1;
base2 = iter->second.base2; // base2 = iter->second.base2;
slot = iter->second.slot; // slot = iter->second.slot;
//
if (slot && slot == slot_id) { // if (slot && slot == slot_id) {
//
if (GetEffect) // if (GetEffect)
return effect; // return effect;
//
if (GetBase1) // if (GetBase1)
return base1; // return base1;
//
if (GetBase2) // if (GetBase2)
return base2; // return base2;
} // }
} //}
return 0; return 0;
} }
@ -4214,431 +4214,432 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
*/ */
int FocusCount = 0; int FocusCount = 0;
std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aa_ID); //old AA
if(find_iter == aa_effects.end()) //std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aa_ID);
{ //if(find_iter == aa_effects.end())
return 0; //{
} // return 0;
//}
for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter) //
{ //for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aa_ID].begin(); iter != aa_effects[aa_ID].end(); ++iter)
effect = iter->second.skill_id; //{
base1 = iter->second.base1; // effect = iter->second.skill_id;
base2 = iter->second.base2; // base1 = iter->second.base1;
slot = iter->second.slot; // base2 = iter->second.base2;
// slot = iter->second.slot;
/* //
AA Foci's can contain multiple focus effects within the same AA. // /*
To handle this we will not automatically return zero if a limit is found. // AA Foci's can contain multiple focus effects within the same AA.
Instead if limit is found and multiple focus effects, we will reset the limit check // To handle this we will not automatically return zero if a limit is found.
when the next valid focus effect is found. // Instead if limit is found and multiple focus effects, we will reset the limit check
*/ // when the next valid focus effect is found.
// */
if (IsFocusEffect(0, 0, true,effect) || (effect == SE_TriggerOnCast)){ //
FocusCount++; // if (IsFocusEffect(0, 0, true,effect) || (effect == SE_TriggerOnCast)){
//If limit found on prior check next, else end loop. // FocusCount++;
if (FocusCount > 1){ // //If limit found on prior check next, else end loop.
// if (FocusCount > 1){
for(int e = 0; e < MaxLimitInclude; e+=2) { //
if (LimitInclude[e] && !LimitInclude[e+1]) // for(int e = 0; e < MaxLimitInclude; e+=2) {
LimitFailure = true; // if (LimitInclude[e] && !LimitInclude[e+1])
} // LimitFailure = true;
// }
if (LimitFailure){ //
value = 0; // if (LimitFailure){
LimitFailure = false; // value = 0;
// LimitFailure = false;
for(int e = 0; e < MaxLimitInclude; e++) { //
LimitInclude[e] = false; //Reset array // for(int e = 0; e < MaxLimitInclude; e++) {
} // LimitInclude[e] = false; //Reset array
} // }
// }
else{ //
break; // else{
} // break;
} // }
} // }
// }
//
switch (effect) //
{ // switch (effect)
case SE_Blank: // {
break; // case SE_Blank:
// break;
//Handle Focus Limits //
// //Handle Focus Limits
case SE_LimitResist: //
if(base1 < 0){ // case SE_LimitResist:
if(spell.resisttype == -base1) //Exclude // if(base1 < 0){
LimitFailure = true; // if(spell.resisttype == -base1) //Exclude
} // LimitFailure = true;
else { // }
LimitInclude[0] = true; // else {
if (spell.resisttype == base1) //Include // LimitInclude[0] = true;
LimitInclude[1] = true; // if (spell.resisttype == base1) //Include
} // LimitInclude[1] = true;
break; // }
// break;
case SE_LimitInstant: //
if(base1 == 1 && spell.buffduration) //Fail if not instant // case SE_LimitInstant:
LimitFailure = true; // if(base1 == 1 && spell.buffduration) //Fail if not instant
if(base1 == 0 && (spell.buffduration == 0)) //Fail if instant // LimitFailure = true;
LimitFailure = true; // if(base1 == 0 && (spell.buffduration == 0)) //Fail if instant
// LimitFailure = true;
break; //
// break;
case SE_LimitMaxLevel: //
spell_level = spell.classes[(GetClass()%16) - 1]; // case SE_LimitMaxLevel:
lvldiff = spell_level - base1; // spell_level = spell.classes[(GetClass()%16) - 1];
//every level over cap reduces the effect by base2 percent unless from a clicky when ItemCastsUseFocus is true // lvldiff = spell_level - base1;
if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) { // //every level over cap reduces the effect by base2 percent unless from a clicky when ItemCastsUseFocus is true
if(base2 > 0){ // if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) {
lvlModifier -= base2*lvldiff; // if(base2 > 0){
if(lvlModifier < 1) // lvlModifier -= base2*lvldiff;
LimitFailure = true; // if(lvlModifier < 1)
} // LimitFailure = true;
else // }
LimitFailure = true; // else
} // LimitFailure = true;
break; // }
// break;
case SE_LimitMinLevel: //
if((spell.classes[(GetClass()%16) - 1]) < base1) // case SE_LimitMinLevel:
LimitFailure = true; // if((spell.classes[(GetClass()%16) - 1]) < base1)
break; // LimitFailure = true;
// break;
case SE_LimitCastTimeMin: //
if (static_cast<int32>(spell.cast_time) < base1) // case SE_LimitCastTimeMin:
LimitFailure = true; // if (static_cast<int32>(spell.cast_time) < base1)
break; // LimitFailure = true;
// break;
case SE_LimitCastTimeMax: //
if (static_cast<int32>(spell.cast_time) > base1) // case SE_LimitCastTimeMax:
LimitFailure = true; // if (static_cast<int32>(spell.cast_time) > base1)
break; // LimitFailure = true;
// break;
case SE_LimitSpell: //
if(base1 < 0) { //Exclude // case SE_LimitSpell:
if (spell_id == -base1) // if(base1 < 0) { //Exclude
LimitFailure = true; // if (spell_id == -base1)
} // LimitFailure = true;
else { // }
LimitInclude[2] = true; // else {
if (spell_id == base1) //Include // LimitInclude[2] = true;
LimitInclude[3] = true; // if (spell_id == base1) //Include
} // LimitInclude[3] = true;
break; // }
// break;
case SE_LimitMinDur: //
if (base1 > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration)) // case SE_LimitMinDur:
LimitFailure = true; // if (base1 > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration))
// LimitFailure = true;
break; //
// break;
case SE_LimitEffect: //
if(base1 < 0){ // case SE_LimitEffect:
if(IsEffectInSpell(spell_id,-base1)) //Exclude // if(base1 < 0){
LimitFailure = true; // if(IsEffectInSpell(spell_id,-base1)) //Exclude
} // LimitFailure = true;
else{ // }
LimitInclude[4] = true; // else{
if(IsEffectInSpell(spell_id,base1)) //Include // LimitInclude[4] = true;
LimitInclude[5] = true; // if(IsEffectInSpell(spell_id,base1)) //Include
} // LimitInclude[5] = true;
break; // }
// break;
case SE_LimitSpellType: //
switch(base1) // case SE_LimitSpellType:
{ // switch(base1)
case 0: // {
if (!IsDetrimentalSpell(spell_id)) // case 0:
LimitFailure = true; // if (!IsDetrimentalSpell(spell_id))
break; // LimitFailure = true;
case 1: // break;
if (!IsBeneficialSpell(spell_id)) // case 1:
LimitFailure = true; // if (!IsBeneficialSpell(spell_id))
break; // LimitFailure = true;
} // break;
break; // }
// break;
case SE_LimitManaMin: //
if(spell.mana < base1) // case SE_LimitManaMin:
LimitFailure = true; // if(spell.mana < base1)
break; // LimitFailure = true;
// break;
case SE_LimitTarget: //
if (base1 < 0) { // case SE_LimitTarget:
if (-base1 == spell.targettype) //Exclude // if (base1 < 0) {
LimitFailure = true; // if (-base1 == spell.targettype) //Exclude
} // LimitFailure = true;
else { // }
LimitInclude[6] = true; // else {
if (base1 == spell.targettype) //Include // LimitInclude[6] = true;
LimitInclude[7] = true; // if (base1 == spell.targettype) //Include
} // LimitInclude[7] = true;
break; // }
// break;
case SE_LimitCombatSkills: //
if (base1 == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) //Exclude Discs / Procs // case SE_LimitCombatSkills:
LimitFailure = true; // if (base1 == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) //Exclude Discs / Procs
else if (base1 == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) //Exclude Spells // LimitFailure = true;
LimitFailure = true; // else if (base1 == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) //Exclude Spells
// LimitFailure = true;
break; //
// break;
case SE_LimitSpellGroup: //
if(base1 < 0) { // case SE_LimitSpellGroup:
if (-base1 == spell.spellgroup) //Exclude // if(base1 < 0) {
LimitFailure = true; // if (-base1 == spell.spellgroup) //Exclude
} // LimitFailure = true;
else { // }
LimitInclude[8] = true; // else {
if (base1 == spell.spellgroup) //Include // LimitInclude[8] = true;
LimitInclude[9] = true; // if (base1 == spell.spellgroup) //Include
} // LimitInclude[9] = true;
break; // }
// break;
case SE_LimitCastingSkill: //
if(base1 < 0) { // case SE_LimitCastingSkill:
if(-base1 == spell.skill) // if(base1 < 0) {
LimitFailure = true; // if(-base1 == spell.skill)
} // LimitFailure = true;
else { // }
LimitInclude[10] = true; // else {
if(base1 == spell.skill) // LimitInclude[10] = true;
LimitInclude[11] = true; // if(base1 == spell.skill)
} // LimitInclude[11] = true;
break; // }
// break;
case SE_LimitSpellClass: //
if(base1 < 0) { //Exclude // case SE_LimitSpellClass:
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)) // if(base1 < 0) { //Exclude
return(0); // if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass))
} // return(0);
else { // }
LimitInclude[12] = true; // else {
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)) //Include // LimitInclude[12] = true;
LimitInclude[13] = true; // if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)) //Include
} // LimitInclude[13] = true;
break; // }
// break;
case SE_LimitSpellSubclass: //
if(base1 < 0) { //Exclude // case SE_LimitSpellSubclass:
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)) // if(base1 < 0) { //Exclude
return(0); // if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass))
} // return(0);
else { // }
LimitInclude[14] = true; // else {
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)) //Include // LimitInclude[14] = true;
LimitInclude[15] = true; // if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)) //Include
} // LimitInclude[15] = true;
break; // }
// break;
case SE_LimitClass: //
//Do not use this limit more then once per spell. If multiple class, treat value like items would. // case SE_LimitClass:
if (!PassLimitClass(base1, GetClass())) // //Do not use this limit more then once per spell. If multiple class, treat value like items would.
LimitFailure = true; // if (!PassLimitClass(base1, GetClass()))
break; // LimitFailure = true;
// break;
case SE_LimitRace: //
if (base1 != GetRace()) // case SE_LimitRace:
LimitFailure = true; // if (base1 != GetRace())
break; // LimitFailure = true;
// break;
case SE_LimitUseMin: //
if (base1 > spell.numhits) // case SE_LimitUseMin:
LimitFailure = true; // if (base1 > spell.numhits)
break; // LimitFailure = true;
// break;
case SE_LimitUseType: //
if (base1 != spell.numhitstype) // case SE_LimitUseType:
LimitFailure = true; // if (base1 != spell.numhitstype)
break; // LimitFailure = true;
// break;
//Handle Focus Effects //
case SE_ImprovedDamage: // //Handle Focus Effects
if (type == focusImprovedDamage && base1 > value) // case SE_ImprovedDamage:
value = base1; // if (type == focusImprovedDamage && base1 > value)
break; // value = base1;
// break;
case SE_ImprovedHeal: //
if (type == focusImprovedHeal && base1 > value) // case SE_ImprovedHeal:
value = base1; // if (type == focusImprovedHeal && base1 > value)
break; // value = base1;
// break;
case SE_ReduceManaCost: //
if (type == focusManaCost) // case SE_ReduceManaCost:
value = base1; // if (type == focusManaCost)
break; // value = base1;
// break;
case SE_IncreaseSpellHaste: //
if (type == focusSpellHaste && base1 > value) // case SE_IncreaseSpellHaste:
value = base1; // if (type == focusSpellHaste && base1 > value)
break; // value = base1;
// break;
case SE_IncreaseSpellDuration: //
if (type == focusSpellDuration && base1 > value) // case SE_IncreaseSpellDuration:
value = base1; // if (type == focusSpellDuration && base1 > value)
break; // value = base1;
// break;
case SE_SpellDurationIncByTic: //
if (type == focusSpellDurByTic && base1 > value) // case SE_SpellDurationIncByTic:
value = base1; // if (type == focusSpellDurByTic && base1 > value)
break; // value = base1;
// break;
case SE_SwarmPetDuration: //
if (type == focusSwarmPetDuration && base1 > value) // case SE_SwarmPetDuration:
value = base1; // if (type == focusSwarmPetDuration && base1 > value)
break; // value = base1;
// break;
case SE_IncreaseRange: //
if (type == focusRange && base1 > value) // case SE_IncreaseRange:
value = base1; // if (type == focusRange && base1 > value)
break; // value = base1;
// break;
case SE_ReduceReagentCost: //
if (type == focusReagentCost && base1 > value) // case SE_ReduceReagentCost:
value = base1; // if (type == focusReagentCost && base1 > value)
break; // value = base1;
// break;
case SE_PetPowerIncrease: //
if (type == focusPetPower && base1 > value) // case SE_PetPowerIncrease:
value = base1; // if (type == focusPetPower && base1 > value)
break; // value = base1;
// break;
case SE_SpellResistReduction: //
if (type == focusResistRate && base1 > value) // case SE_SpellResistReduction:
value = base1; // if (type == focusResistRate && base1 > value)
break; // value = base1;
// break;
case SE_SpellHateMod: //
if (type == focusSpellHateMod ) { // case SE_SpellHateMod:
if(value != 0) { // if (type == focusSpellHateMod ) {
if(value > 0){ // if(value != 0) {
if(base1 > value) // if(value > 0){
value = base1; // if(base1 > value)
} // value = base1;
else{ // }
if(base1 < value) // else{
value = base1; // if(base1 < value)
} // value = base1;
} // }
else // }
value = base1; // else
} // value = base1;
break; // }
// break;
case SE_ReduceReuseTimer: //
if(type == focusReduceRecastTime) // case SE_ReduceReuseTimer:
value = base1 / 1000; // if(type == focusReduceRecastTime)
break; // value = base1 / 1000;
// break;
case SE_TriggerOnCast: //
if(type == focusTriggerOnCast){ // case SE_TriggerOnCast:
if(zone->random.Roll(base1)) { // if(type == focusTriggerOnCast){
value = base2; // if(zone->random.Roll(base1)) {
} else { // value = base2;
value = 0; // } else {
LimitFailure = true; // value = 0;
} // LimitFailure = true;
break; // }
} // break;
// }
case SE_FcSpellVulnerability: //
if(type == focusSpellVulnerability) // case SE_FcSpellVulnerability:
value = base1; // if(type == focusSpellVulnerability)
break; // value = base1;
// break;
case SE_BlockNextSpellFocus: //
if(type == focusBlockNextSpell){ // case SE_BlockNextSpellFocus:
if(zone->random.Roll(base1)) // if(type == focusBlockNextSpell){
value = 1; // if(zone->random.Roll(base1))
} // value = 1;
break; // }
// break;
case SE_FcTwincast: //
if(type == focusTwincast) // case SE_FcTwincast:
value = base1; // if(type == focusTwincast)
break; // value = base1;
// break;
//Note if using these as AA, make sure this is first focus used. //
case SE_SympatheticProc: // //Note if using these as AA, make sure this is first focus used.
if(type == focusSympatheticProc) // case SE_SympatheticProc:
value = base2; // if(type == focusSympatheticProc)
break; // value = base2;
// break;
case SE_FcDamageAmt: //
if(type == focusFcDamageAmt) // case SE_FcDamageAmt:
value = base1; // if(type == focusFcDamageAmt)
break; // value = base1;
// break;
case SE_FcDamageAmtCrit: //
if(type == focusFcDamageAmtCrit) // case SE_FcDamageAmtCrit:
value = base1; // if(type == focusFcDamageAmtCrit)
break; // value = base1;
// break;
case SE_FcDamageAmtIncoming: //
if(type == focusFcDamageAmtIncoming) // case SE_FcDamageAmtIncoming:
value = base1; // if(type == focusFcDamageAmtIncoming)
break; // value = base1;
// break;
case SE_FcHealAmtIncoming: //
if(type == focusFcHealAmtIncoming) // case SE_FcHealAmtIncoming:
value = base1; // if(type == focusFcHealAmtIncoming)
break; // value = base1;
// break;
case SE_FcHealPctCritIncoming: //
if (type == focusFcHealPctCritIncoming) // case SE_FcHealPctCritIncoming:
value = base1; // if (type == focusFcHealPctCritIncoming)
break; // value = base1;
// break;
case SE_FcHealAmtCrit: //
if(type == focusFcHealAmtCrit) // case SE_FcHealAmtCrit:
value = base1; // if(type == focusFcHealAmtCrit)
break; // value = base1;
// break;
case SE_FcHealAmt: //
if(type == focusFcHealAmt) // case SE_FcHealAmt:
value = base1; // if(type == focusFcHealAmt)
break; // value = base1;
// break;
case SE_FcHealPctIncoming: //
if(type == focusFcHealPctIncoming) // case SE_FcHealPctIncoming:
value = base1; // if(type == focusFcHealPctIncoming)
break; // value = base1;
// break;
case SE_FcBaseEffects: //
if (type == focusFcBaseEffects) // case SE_FcBaseEffects:
value = base1; // if (type == focusFcBaseEffects)
break; // value = base1;
// break;
case SE_FcDamagePctCrit: //
if(type == focusFcDamagePctCrit) // case SE_FcDamagePctCrit:
value = base1; // if(type == focusFcDamagePctCrit)
break; // value = base1;
// break;
case SE_FcIncreaseNumHits: //
if(type == focusIncreaseNumHits) // case SE_FcIncreaseNumHits:
value = base1; // if(type == focusIncreaseNumHits)
break; // value = base1;
// break;
case SE_FcLimitUse: //
if(type == focusFcLimitUse) // case SE_FcLimitUse:
value = base1; // if(type == focusFcLimitUse)
break; // value = base1;
// break;
case SE_FcMute: //
if(type == focusFcMute) // case SE_FcMute:
value = base1; // if(type == focusFcMute)
break; // value = base1;
// break;
case SE_FcStunTimeMod: //
if(type == focusFcStunTimeMod) // case SE_FcStunTimeMod:
value = base1; // if(type == focusFcStunTimeMod)
break; // value = base1;
// break;
} //
} // }
//}
for(int e = 0; e < MaxLimitInclude; e+=2) { for(int e = 0; e < MaxLimitInclude; e+=2) {
if (LimitInclude[e] && !LimitInclude[e+1]) if (LimitInclude[e] && !LimitInclude[e+1])

View File

@ -804,8 +804,6 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
weather_intensity = 0; weather_intensity = 0;
blocked_spells = nullptr; blocked_spells = nullptr;
totalBS = 0; totalBS = 0;
aas = nullptr;
totalAAs = 0;
zone_has_current_time = false; zone_has_current_time = false;
Instance_Shutdown_Timer = nullptr; Instance_Shutdown_Timer = nullptr;
@ -864,16 +862,6 @@ Zone::~Zone() {
safe_delete(qGlobals); safe_delete(qGlobals);
safe_delete_array(adv_data); safe_delete_array(adv_data);
safe_delete_array(map_name); safe_delete_array(map_name);
if(aas != nullptr) {
int r;
for(r = 0; r < totalAAs; r++) {
uchar *data = (uchar *) aas[r];
safe_delete_array(data);
}
safe_delete_array(aas);
}
safe_delete(GuildBanks); safe_delete(GuildBanks);
} }
@ -952,9 +940,6 @@ bool Zone::Init(bool iStaticZone) {
zone->LoadAlternateCurrencies(); zone->LoadAlternateCurrencies();
zone->LoadNPCEmotes(&NPCEmoteList); zone->LoadNPCEmotes(&NPCEmoteList);
//Load AA information
LoadAAs();
LoadAlternateAdvancement(); LoadAlternateAdvancement();
//Load merchant data //Load merchant data

View File

@ -120,14 +120,7 @@ public:
AA::Ability *GetAlternateAdvancementAbilityByRank(int rank_id); AA::Ability *GetAlternateAdvancementAbilityByRank(int rank_id);
AA::Rank *GetAlternateAdvancementRank(int rank_id); AA::Rank *GetAlternateAdvancementRank(int rank_id);
//old AA void LoadZoneDoors(const char* zone, int16 version);
void LoadAAs();
int GetTotalAAs() { return totalAAs; }
SendAA_Struct* GetAABySequence(uint32 seq) { return aas[seq]; }
SendAA_Struct* FindAA(uint32 id);
uint8 GetTotalAALevels(uint32 skill_id);
void LoadZoneDoors(const char* zone, int16 version);
bool LoadZoneObjects(); bool LoadZoneObjects();
bool LoadGroundSpawns(); bool LoadGroundSpawns();
void ReloadStaticData(); void ReloadStaticData();
@ -202,6 +195,10 @@ public:
char *adv_data; char *adv_data;
bool did_adventure_actions; bool did_adventure_actions;
//new AA
std::unordered_map<int, std::unique_ptr<AA::Ability>> aa_abilities;
std::unordered_map<int, std::unique_ptr<AA::Rank>> aa_ranks;
void DoAdventureCountIncrease(); void DoAdventureCountIncrease();
void DoAdventureAssassinationCountIncrease(); void DoAdventureAssassinationCountIncrease();
void DoAdventureActions(); void DoAdventureActions();
@ -322,17 +319,6 @@ private:
int totalBS; int totalBS;
ZoneSpellsBlocked *blocked_spells; ZoneSpellsBlocked *blocked_spells;
public:
//new AA
std::unordered_map<int, std::unique_ptr<AA::Ability>> aa_abilities;
std::unordered_map<int, std::unique_ptr<AA::Rank>> aa_ranks;
private:
//old AA
int totalAAs;
SendAA_Struct **aas; //array of AA structs
/* /*
Spawn related things Spawn related things
*/ */

View File

@ -343,18 +343,7 @@ public:
/* AAs New */ /* AAs New */
bool LoadAlternateAdvancementAbilities(std::unordered_map<int, std::unique_ptr<AA::Ability>> &abilities, bool LoadAlternateAdvancementAbilities(std::unordered_map<int, std::unique_ptr<AA::Ability>> &abilities,
std::unordered_map<int, std::unique_ptr<AA::Rank>> &ranks); std::unordered_map<int, std::unique_ptr<AA::Rank>> &ranks);
bool LoadAlternateAdvancement(Client *c);
/* AAs Old */
bool LoadAAEffects();
bool LoadAAEffects2();
bool LoadSwarmSpells();
SendAA_Struct*GetAASkillVars(uint32 skill_id);
uint8 GetTotalAALevels(uint32 skill_id);
uint32 GetSizeAA();
uint32 CountAAs();
void LoadAAs(SendAA_Struct **load);
uint32 CountAAEffects();
void FillAAEffects(SendAA_Struct* aa_struct);
/* Zone related */ /* Zone related */
bool GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct *data, bool &can_bind, bool &can_combat, bool &can_levitate, bool &can_castoutdoor, bool &is_city, bool &is_hotzone, bool &allow_mercs, uint8 &zone_type, int &ruleset, char **map_filename); bool GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct *data, bool &can_bind, bool &can_combat, bool &can_levitate, bool &can_castoutdoor, bool &is_city, bool &is_hotzone, bool &allow_mercs, uint8 &zone_type, int &ruleset, char **map_filename);