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 expansion;
int32 category;
uint8 charges;
uint32 charges;
uint8 grant_only;
uint32 total_effects;
uint32 total_prereqs;

View File

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

View File

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

View File

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

View File

@ -1804,15 +1804,13 @@ namespace UF
// OUT(unknown00224[48]);
//NOTE: new client supports 300 AAs, our internal rep/PP
//only supports 240..
//for (r = 0; r < MAX_PP_AA_ARRAY; r++) {
// OUT(aa_array[r].AA);
// OUT(aa_array[r].value);
// OUT(aa_array[r].charges);
//}
// OUT(unknown02220[4]);
for (r = 0; r < MAX_PP_AA_ARRAY; r++) {
eq->aa_array[r].AA = emu->aa_array[r].AA;
eq->aa_array[r].value = emu->aa_array[r].value;
eq->aa_array[r].charges = emu->aa_array[r].charges;
}
eq->aa_array[0].AA = 6;
eq->aa_array[0].value = 5;
// OUT(unknown02220[4]);
OUT(mana);
OUT(cur_hp);
@ -1943,8 +1941,8 @@ namespace UF
OUT(copper_bank);
OUT(platinum_shared);
// OUT(unknown13156[84]);
//OUT(expansions);
eq->expansions = 0xffff;
OUT(expansions);
//eq->expansions = 0x1ffff;
// OUT(unknown13244[12]);
OUT(autosplit);
// OUT(unknown13260[16]);
@ -2149,7 +2147,6 @@ namespace UF
ENCODE(OP_SendAATable)
{
#if 1
EQApplicationPacket *inapp = *p;
*p = nullptr;
AARankInfo_Struct *emu = (AARankInfo_Struct*)inapp->pBuffer;
@ -2180,8 +2177,8 @@ namespace UF
eq->last_id = emu->prev_id;
eq->next_id = emu->next_id;
eq->cost2 = emu->total_cost;
eq->grant_only = emu->grant_only > 0 ? true : false;
eq->expendable_charges = emu->charges ? 1 : 0;
eq->grant_only = emu->grant_only;
eq->expendable_charges = emu->charges;
eq->aa_expansion = emu->expansion;
eq->special_category = emu->category;
eq->total_abilities = emu->total_effects;
@ -2194,65 +2191,13 @@ namespace UF
}
if(emu->total_prereqs > 0) {
eq->prereq_skill = -(int)inapp->ReadUInt32();
eq->prereq_skill = 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);
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)

View File

@ -139,8 +139,4 @@ protected:
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

File diff suppressed because it is too large Load Diff

View File

@ -2137,17 +2137,6 @@ struct AALevelCost_Struct
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
aaActionActivate = 0,
aaActionSetEXP = 1,

View File

@ -43,6 +43,7 @@ public:
Rank *prev;
int next_id;
Rank *next;
int current_value;
int expansion;
uint32 account_time_required;
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;
ProcMod = 0;
std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aaid);
if(find_iter == aa_effects.end())
break;
//old AA
//std::map<uint32, std::map<uint32, AA_Ability> >::const_iterator find_iter = aa_effects.find(aaid);
//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) {
effect = iter->second.skill_id;
base1 = iter->second.base1;
base2 = iter->second.base2;
slot = iter->second.slot;
if (effect == SE_SkillProc || effect == SE_SkillProcSuccess) {
proc_spell_id = base1;
ProcMod = static_cast<float>(base2);
}
else if (effect == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
float final_chance = chance * (ProcMod / 100.0f);
if (zone->random.Roll(final_chance)) {
ExecWeaponProc(nullptr, proc_spell_id, on);
CanProc = false;
break;
}
}
}
else {
proc_spell_id = 0;
ProcMod = 0;
}
}
//for (std::map<uint32, AA_Ability>::const_iterator iter = aa_effects[aaid].begin(); iter != aa_effects[aaid].end(); ++iter) {
// effect = iter->second.skill_id;
// base1 = iter->second.base1;
// base2 = iter->second.base2;
// slot = iter->second.slot;
//
// if (effect == SE_SkillProc || effect == SE_SkillProcSuccess) {
// proc_spell_id = base1;
// ProcMod = static_cast<float>(base2);
// }
//
// else if (effect == SE_LimitToSkill && base1 <= HIGHEST_SKILL) {
//
// if (CanProc && base1 == skill && IsValidSpell(proc_spell_id)) {
// float final_chance = chance * (ProcMod / 100.0f);
//
// if (zone->random.Roll(final_chance)) {
// ExecWeaponProc(nullptr, proc_spell_id, on);
// CanProc = false;
// break;
// }
// }
// }
// else {
// proc_spell_id = 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 CanHeal();
int GetRawACNoShield(int &shield_ac);
void LoadAAs();
uint32 GetAA(uint32 aa_id);
void ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon);
bool GetHasBeenSummoned() { return _hasBeenSummoned; }
const glm::vec3 GetPreSummonLocation() const { return m_PreSummonLocation; }

View File

@ -439,7 +439,7 @@ void Client::SendZoneInPackets()
//Send AA Exp packet:
if (GetLevel() >= 51)
SendAAStats();
SendAlternateAdvancementStats();
// Send exp packets
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) {
int slot = m_inv.GetSlotByItemInst(inst);
if(slot != -1) {

View File

@ -762,9 +762,16 @@ public:
//New AA Methods
void SendAlternateAdvancementRank(int aa_id, int level);
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
void SendAAList();
void ResetAA();
void SendClearAA();
void SendAA(uint32 id, int seq=1);
@ -776,7 +783,6 @@ public:
void SetTitleSuffix(const char *txt);
inline uint32 GetMaxAAXP(void) const { return max_AAXP; }
inline uint32 GetAAXP() const { return m_pp.expAA; }
void SendAAStats();
void SendAATable();
void SendAATimers();
int GetAATimerID(aaID activate);
@ -790,10 +796,6 @@ public:
inline uint32 GetAAPointsSpent() { return m_pp.aapoints_spent; }
int16 CalcAAFocusEffect(focusType type, uint16 focus_spell, 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 IncrementAA(int aa_id);
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)
{
SendAATable();
SendAlternateAdvancementPoints();
}
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_available < 0 || m_pp.ldon_points_available > 2000000000){ m_pp.ldon_points_available = 0; }
/* Initialize AA's : Move to function eventually */
//aa old
//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(!database.LoadAlternateAdvancement(this)) {
Log.Out(Logs::General, Logs::Error, "Error loading AA points for %s", GetName());
}
if (SPDAT_RECORDS > 0) {
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(); }
/* Get Expansions from variables table and ship via PP */
char val[20] = { 0 };
if (database.GetVariable("Expansions", val, 20)){ m_pp.expansions = atoi(val); }
else{ m_pp.expansions = 0x3FF; }
m_pp.expansions = RuleI(World, ExpansionSettings);
p_timers.SetCharID(CharacterID());
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");
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;
}
AA_Action* action = (AA_Action*)app->pBuffer;
if (action->action == aaActionActivate) {//AA Hotkey
Log.Out(Logs::Detail, Logs::AA, "Activating AA %d", action->ability);
ActivateAA((aaID)action->ability);
//ActivateAlternateAdvancementAbility(action->ability);
}
else if (action->action == aaActionBuy) {
BuyAA(action);
PurchaseAlternateAdvancementRank(action->ability);
}
else if (action->action == aaActionDisableEXP){ //Turn Off AA Exp
if (m_epp.perAA > 0)
Message_StringID(0, AA_OFF);
m_epp.perAA = 0;
SendAAStats();
SendAlternateAdvancementStats();
}
else if (action->action == aaActionSetEXP) {
if (m_epp.perAA == 0)
Message_StringID(0, AA_ON);
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
SendAAStats();
SendAATable();
SendAlternateAdvancementStats();
SendAlternateAdvancementTable();
}
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)

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);
} else {
t->SetEXP(t->GetEXP(),t->GetMaxAAXP()*atoi(sep->arg[2]),false);
t->SendAAStats();
t->SendAATable();
t->SendAlternateAdvancementStats();
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){
if(sep->arg[1][0] == '\0'){
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 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.");
return;
}
if(!strcasecmp(sep->arg[1], "help")){
c->Message(10, "Usage:");
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 [argument] - activates the AA with the ID that matches the argument.");
return;
}
if(!strcasecmp(sep->arg[1], "list")){
c->Message(10, "You have access to the following AA Abilities:");
int x, val;
SendAA_Struct* saa = nullptr;
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
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;
val = c->GetAA(x);
if(val){
saa = zone->FindAA(x);
c->Message(10, "%d: %s %d", x, saa->name, val);
}
}
}
}
else if(!strcasecmp(sep->arg[1], "time")){
int ability = atoi(sep->arg[2]);
if(c->GetAA(ability)){
int remain = c->GetPTimers().GetRemainingTime(pTimerAAStart + ability);
if(remain)
c->Message(10, "You may use that ability in %d minutes and %d seconds.", (remain/60), (remain%60));
else
c->Message(10, "You may use that ability now.");
}
else{
c->Message(10, "You do not have access to that ability.");
}
}
else
{
c->ActivateAA((aaID) atoi(sep->arg[1]));
}
// if(sep->arg[1][0] == '\0'){
// 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 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.");
// return;
// }
// if(!strcasecmp(sep->arg[1], "help")){
// c->Message(10, "Usage:");
// 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 [argument] - activates the AA with the ID that matches the argument.");
// return;
// }
// if(!strcasecmp(sep->arg[1], "list")){
// c->Message(10, "You have access to the following AA Abilities:");
// int x, val;
// SendAA_Struct* saa = nullptr;
// 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
// 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;
// val = c->GetAA(x);
// if(val){
// saa = zone->FindAA(x);
// c->Message(10, "%d: %s %d", x, saa->name, val);
// }
// }
// }
// }
// else if(!strcasecmp(sep->arg[1], "time")){
// int ability = atoi(sep->arg[2]);
// if(c->GetAA(ability)){
// int remain = c->GetPTimers().GetRemainingTime(pTimerAAStart + ability);
// if(remain)
// c->Message(10, "You may use that ability in %d minutes and %d seconds.", (remain/60), (remain%60));
// else
// c->Message(10, "You may use that ability now.");
// }
// else{
// c->Message(10, "You do not have access to that ability.");
// }
// }
// else
// {
// c->ActivateAA((aaID) atoi(sep->arg[1]));
// }
}
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) {
m_epp.perAA = 0; // turn off aa exp if they drop below 51
} 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
uint32 tmpxp1 = GetEXPForLevel(GetLevel()+1);

View File

@ -958,7 +958,8 @@ public:
//aa new
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 CanPurchaseAlternateAdvancementRank(AA::Rank *ran);
@ -1316,7 +1317,7 @@ protected:
bool bEnraged;
bool destructibleobject;
std::unordered_map<uint32, uint32> aa_ranks;
std::unordered_map<uint32, std::pair<uint32, uint32>> aa_ranks;
private:
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");
title_manager.LoadTitles();
Log.Out(Logs::General, Logs::Zone_Server, "Loading AA effects");
database.LoadAAEffects();
Log.Out(Logs::General, Logs::Zone_Server, "Loading tributes");
database.LoadTributes();

View File

@ -4077,33 +4077,34 @@ XS(XS_Client_RefundAA) {
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
int curpt = 0;
bool refunded = false;
for(int x1=0;x1<aaHighestID;x1++){
curpt = THIS->GetAA(x1);
if(curpt > 0){
SendAA_Struct* curaa = zone->FindAA(x1);
if(curaa){
THIS->SetAA(x1, 0);
for(int x2=0;x2<curpt;x2++){ //add up all the AA points pt by pt to get the correct cost
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
THIS->GetPP().aapoints += curpt;
THIS->SetAA(x1, 0);
refunded = true;
}
}
}
if(refunded){
THIS->Save(); //save of course
THIS->Kick(); //client gets all buggy if we don't immediatly relog so just force it on them
}
//old aa
//int curpt = 0;
//bool refunded = false;
//
//for(int x1=0;x1<aaHighestID;x1++){
// curpt = THIS->GetAA(x1);
// if(curpt > 0){
// SendAA_Struct* curaa = zone->FindAA(x1);
// if(curaa){
// THIS->SetAA(x1, 0);
// for(int x2=0;x2<curpt;x2++){ //add up all the AA points pt by pt to get the correct cost
// 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
// THIS->GetPP().aapoints += curpt;
// THIS->SetAA(x1, 0);
// refunded = true;
// }
// }
//}
//
//if(refunded){
// 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;
}

View File

@ -4157,30 +4157,30 @@ int32 Client::GetAAEffectDataBySlot(uint32 aa_ID, uint32 slot_id, bool GetEffect
int32 base2 = 0;
uint32 slot = 0;
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;
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;
base2 = iter->second.base2;
slot = iter->second.slot;
if (slot && slot == slot_id) {
if (GetEffect)
return effect;
if (GetBase1)
return base1;
if (GetBase2)
return base2;
}
}
//old aa
//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;
//
//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;
// base2 = iter->second.base2;
// slot = iter->second.slot;
//
// if (slot && slot == slot_id) {
//
// if (GetEffect)
// return effect;
//
// if (GetBase1)
// return base1;
//
// if (GetBase2)
// return base2;
// }
//}
return 0;
}
@ -4214,431 +4214,432 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
*/
int FocusCount = 0;
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;
}
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;
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.
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 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])
LimitFailure = true;
}
if (LimitFailure){
value = 0;
LimitFailure = false;
for(int e = 0; e < MaxLimitInclude; e++) {
LimitInclude[e] = false; //Reset array
}
}
else{
break;
}
}
}
switch (effect)
{
case SE_Blank:
break;
//Handle Focus Limits
case SE_LimitResist:
if(base1 < 0){
if(spell.resisttype == -base1) //Exclude
LimitFailure = true;
}
else {
LimitInclude[0] = true;
if (spell.resisttype == base1) //Include
LimitInclude[1] = true;
}
break;
case SE_LimitInstant:
if(base1 == 1 && spell.buffduration) //Fail if not instant
LimitFailure = true;
if(base1 == 0 && (spell.buffduration == 0)) //Fail if instant
LimitFailure = true;
break;
case SE_LimitMaxLevel:
spell_level = spell.classes[(GetClass()%16) - 1];
lvldiff = spell_level - base1;
//every level over cap reduces the effect by base2 percent unless from a clicky when ItemCastsUseFocus is true
if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) {
if(base2 > 0){
lvlModifier -= base2*lvldiff;
if(lvlModifier < 1)
LimitFailure = true;
}
else
LimitFailure = true;
}
break;
case SE_LimitMinLevel:
if((spell.classes[(GetClass()%16) - 1]) < base1)
LimitFailure = true;
break;
case SE_LimitCastTimeMin:
if (static_cast<int32>(spell.cast_time) < base1)
LimitFailure = true;
break;
case SE_LimitCastTimeMax:
if (static_cast<int32>(spell.cast_time) > base1)
LimitFailure = true;
break;
case SE_LimitSpell:
if(base1 < 0) { //Exclude
if (spell_id == -base1)
LimitFailure = true;
}
else {
LimitInclude[2] = true;
if (spell_id == base1) //Include
LimitInclude[3] = true;
}
break;
case SE_LimitMinDur:
if (base1 > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration))
LimitFailure = true;
break;
case SE_LimitEffect:
if(base1 < 0){
if(IsEffectInSpell(spell_id,-base1)) //Exclude
LimitFailure = true;
}
else{
LimitInclude[4] = true;
if(IsEffectInSpell(spell_id,base1)) //Include
LimitInclude[5] = true;
}
break;
case SE_LimitSpellType:
switch(base1)
{
case 0:
if (!IsDetrimentalSpell(spell_id))
LimitFailure = true;
break;
case 1:
if (!IsBeneficialSpell(spell_id))
LimitFailure = true;
break;
}
break;
case SE_LimitManaMin:
if(spell.mana < base1)
LimitFailure = true;
break;
case SE_LimitTarget:
if (base1 < 0) {
if (-base1 == spell.targettype) //Exclude
LimitFailure = true;
}
else {
LimitInclude[6] = true;
if (base1 == spell.targettype) //Include
LimitInclude[7] = true;
}
break;
case SE_LimitCombatSkills:
if (base1 == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) //Exclude Discs / Procs
LimitFailure = true;
else if (base1 == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) //Exclude Spells
LimitFailure = true;
break;
case SE_LimitSpellGroup:
if(base1 < 0) {
if (-base1 == spell.spellgroup) //Exclude
LimitFailure = true;
}
else {
LimitInclude[8] = true;
if (base1 == spell.spellgroup) //Include
LimitInclude[9] = true;
}
break;
case SE_LimitCastingSkill:
if(base1 < 0) {
if(-base1 == spell.skill)
LimitFailure = true;
}
else {
LimitInclude[10] = true;
if(base1 == spell.skill)
LimitInclude[11] = true;
}
break;
case SE_LimitSpellClass:
if(base1 < 0) { //Exclude
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass))
return(0);
}
else {
LimitInclude[12] = true;
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)) //Include
LimitInclude[13] = true;
}
break;
case SE_LimitSpellSubclass:
if(base1 < 0) { //Exclude
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass))
return(0);
}
else {
LimitInclude[14] = true;
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)) //Include
LimitInclude[15] = true;
}
break;
case SE_LimitClass:
//Do not use this limit more then once per spell. If multiple class, treat value like items would.
if (!PassLimitClass(base1, GetClass()))
LimitFailure = true;
break;
case SE_LimitRace:
if (base1 != GetRace())
LimitFailure = true;
break;
case SE_LimitUseMin:
if (base1 > spell.numhits)
LimitFailure = true;
break;
case SE_LimitUseType:
if (base1 != spell.numhitstype)
LimitFailure = true;
break;
//Handle Focus Effects
case SE_ImprovedDamage:
if (type == focusImprovedDamage && base1 > value)
value = base1;
break;
case SE_ImprovedHeal:
if (type == focusImprovedHeal && base1 > value)
value = base1;
break;
case SE_ReduceManaCost:
if (type == focusManaCost)
value = base1;
break;
case SE_IncreaseSpellHaste:
if (type == focusSpellHaste && base1 > value)
value = base1;
break;
case SE_IncreaseSpellDuration:
if (type == focusSpellDuration && base1 > value)
value = base1;
break;
case SE_SpellDurationIncByTic:
if (type == focusSpellDurByTic && base1 > value)
value = base1;
break;
case SE_SwarmPetDuration:
if (type == focusSwarmPetDuration && base1 > value)
value = base1;
break;
case SE_IncreaseRange:
if (type == focusRange && base1 > value)
value = base1;
break;
case SE_ReduceReagentCost:
if (type == focusReagentCost && base1 > value)
value = base1;
break;
case SE_PetPowerIncrease:
if (type == focusPetPower && base1 > value)
value = base1;
break;
case SE_SpellResistReduction:
if (type == focusResistRate && base1 > value)
value = base1;
break;
case SE_SpellHateMod:
if (type == focusSpellHateMod ) {
if(value != 0) {
if(value > 0){
if(base1 > value)
value = base1;
}
else{
if(base1 < value)
value = base1;
}
}
else
value = base1;
}
break;
case SE_ReduceReuseTimer:
if(type == focusReduceRecastTime)
value = base1 / 1000;
break;
case SE_TriggerOnCast:
if(type == focusTriggerOnCast){
if(zone->random.Roll(base1)) {
value = base2;
} else {
value = 0;
LimitFailure = true;
}
break;
}
case SE_FcSpellVulnerability:
if(type == focusSpellVulnerability)
value = base1;
break;
case SE_BlockNextSpellFocus:
if(type == focusBlockNextSpell){
if(zone->random.Roll(base1))
value = 1;
}
break;
case SE_FcTwincast:
if(type == focusTwincast)
value = base1;
break;
//Note if using these as AA, make sure this is first focus used.
case SE_SympatheticProc:
if(type == focusSympatheticProc)
value = base2;
break;
case SE_FcDamageAmt:
if(type == focusFcDamageAmt)
value = base1;
break;
case SE_FcDamageAmtCrit:
if(type == focusFcDamageAmtCrit)
value = base1;
break;
case SE_FcDamageAmtIncoming:
if(type == focusFcDamageAmtIncoming)
value = base1;
break;
case SE_FcHealAmtIncoming:
if(type == focusFcHealAmtIncoming)
value = base1;
break;
case SE_FcHealPctCritIncoming:
if (type == focusFcHealPctCritIncoming)
value = base1;
break;
case SE_FcHealAmtCrit:
if(type == focusFcHealAmtCrit)
value = base1;
break;
case SE_FcHealAmt:
if(type == focusFcHealAmt)
value = base1;
break;
case SE_FcHealPctIncoming:
if(type == focusFcHealPctIncoming)
value = base1;
break;
case SE_FcBaseEffects:
if (type == focusFcBaseEffects)
value = base1;
break;
case SE_FcDamagePctCrit:
if(type == focusFcDamagePctCrit)
value = base1;
break;
case SE_FcIncreaseNumHits:
if(type == focusIncreaseNumHits)
value = base1;
break;
case SE_FcLimitUse:
if(type == focusFcLimitUse)
value = base1;
break;
case SE_FcMute:
if(type == focusFcMute)
value = base1;
break;
case SE_FcStunTimeMod:
if(type == focusFcStunTimeMod)
value = base1;
break;
}
}
//old AA
//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;
//}
//
//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;
// 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.
// 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 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])
// LimitFailure = true;
// }
//
// if (LimitFailure){
// value = 0;
// LimitFailure = false;
//
// for(int e = 0; e < MaxLimitInclude; e++) {
// LimitInclude[e] = false; //Reset array
// }
// }
//
// else{
// break;
// }
// }
// }
//
//
// switch (effect)
// {
// case SE_Blank:
// break;
//
// //Handle Focus Limits
//
// case SE_LimitResist:
// if(base1 < 0){
// if(spell.resisttype == -base1) //Exclude
// LimitFailure = true;
// }
// else {
// LimitInclude[0] = true;
// if (spell.resisttype == base1) //Include
// LimitInclude[1] = true;
// }
// break;
//
// case SE_LimitInstant:
// if(base1 == 1 && spell.buffduration) //Fail if not instant
// LimitFailure = true;
// if(base1 == 0 && (spell.buffduration == 0)) //Fail if instant
// LimitFailure = true;
//
// break;
//
// case SE_LimitMaxLevel:
// spell_level = spell.classes[(GetClass()%16) - 1];
// lvldiff = spell_level - base1;
// //every level over cap reduces the effect by base2 percent unless from a clicky when ItemCastsUseFocus is true
// if(lvldiff > 0 && (spell_level <= RuleI(Character, MaxLevel) || RuleB(Character, ItemCastsUseFocus) == false)) {
// if(base2 > 0){
// lvlModifier -= base2*lvldiff;
// if(lvlModifier < 1)
// LimitFailure = true;
// }
// else
// LimitFailure = true;
// }
// break;
//
// case SE_LimitMinLevel:
// if((spell.classes[(GetClass()%16) - 1]) < base1)
// LimitFailure = true;
// break;
//
// case SE_LimitCastTimeMin:
// if (static_cast<int32>(spell.cast_time) < base1)
// LimitFailure = true;
// break;
//
// case SE_LimitCastTimeMax:
// if (static_cast<int32>(spell.cast_time) > base1)
// LimitFailure = true;
// break;
//
// case SE_LimitSpell:
// if(base1 < 0) { //Exclude
// if (spell_id == -base1)
// LimitFailure = true;
// }
// else {
// LimitInclude[2] = true;
// if (spell_id == base1) //Include
// LimitInclude[3] = true;
// }
// break;
//
// case SE_LimitMinDur:
// if (base1 > CalcBuffDuration_formula(GetLevel(), spell.buffdurationformula, spell.buffduration))
// LimitFailure = true;
//
// break;
//
// case SE_LimitEffect:
// if(base1 < 0){
// if(IsEffectInSpell(spell_id,-base1)) //Exclude
// LimitFailure = true;
// }
// else{
// LimitInclude[4] = true;
// if(IsEffectInSpell(spell_id,base1)) //Include
// LimitInclude[5] = true;
// }
// break;
//
// case SE_LimitSpellType:
// switch(base1)
// {
// case 0:
// if (!IsDetrimentalSpell(spell_id))
// LimitFailure = true;
// break;
// case 1:
// if (!IsBeneficialSpell(spell_id))
// LimitFailure = true;
// break;
// }
// break;
//
// case SE_LimitManaMin:
// if(spell.mana < base1)
// LimitFailure = true;
// break;
//
// case SE_LimitTarget:
// if (base1 < 0) {
// if (-base1 == spell.targettype) //Exclude
// LimitFailure = true;
// }
// else {
// LimitInclude[6] = true;
// if (base1 == spell.targettype) //Include
// LimitInclude[7] = true;
// }
// break;
//
// case SE_LimitCombatSkills:
// if (base1 == 0 && (IsCombatSkill(spell_id) || IsCombatProc(spell_id))) //Exclude Discs / Procs
// LimitFailure = true;
// else if (base1 == 1 && (!IsCombatSkill(spell_id) || !IsCombatProc(spell_id))) //Exclude Spells
// LimitFailure = true;
//
// break;
//
// case SE_LimitSpellGroup:
// if(base1 < 0) {
// if (-base1 == spell.spellgroup) //Exclude
// LimitFailure = true;
// }
// else {
// LimitInclude[8] = true;
// if (base1 == spell.spellgroup) //Include
// LimitInclude[9] = true;
// }
// break;
//
// case SE_LimitCastingSkill:
// if(base1 < 0) {
// if(-base1 == spell.skill)
// LimitFailure = true;
// }
// else {
// LimitInclude[10] = true;
// if(base1 == spell.skill)
// LimitInclude[11] = true;
// }
// break;
//
// case SE_LimitSpellClass:
// if(base1 < 0) { //Exclude
// if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass))
// return(0);
// }
// else {
// LimitInclude[12] = true;
// if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)) //Include
// LimitInclude[13] = true;
// }
// break;
//
// case SE_LimitSpellSubclass:
// if(base1 < 0) { //Exclude
// if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass))
// return(0);
// }
// else {
// LimitInclude[14] = true;
// if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)) //Include
// LimitInclude[15] = true;
// }
// break;
//
// case SE_LimitClass:
// //Do not use this limit more then once per spell. If multiple class, treat value like items would.
// if (!PassLimitClass(base1, GetClass()))
// LimitFailure = true;
// break;
//
// case SE_LimitRace:
// if (base1 != GetRace())
// LimitFailure = true;
// break;
//
// case SE_LimitUseMin:
// if (base1 > spell.numhits)
// LimitFailure = true;
// break;
//
// case SE_LimitUseType:
// if (base1 != spell.numhitstype)
// LimitFailure = true;
// break;
//
// //Handle Focus Effects
// case SE_ImprovedDamage:
// if (type == focusImprovedDamage && base1 > value)
// value = base1;
// break;
//
// case SE_ImprovedHeal:
// if (type == focusImprovedHeal && base1 > value)
// value = base1;
// break;
//
// case SE_ReduceManaCost:
// if (type == focusManaCost)
// value = base1;
// break;
//
// case SE_IncreaseSpellHaste:
// if (type == focusSpellHaste && base1 > value)
// value = base1;
// break;
//
// case SE_IncreaseSpellDuration:
// if (type == focusSpellDuration && base1 > value)
// value = base1;
// break;
//
// case SE_SpellDurationIncByTic:
// if (type == focusSpellDurByTic && base1 > value)
// value = base1;
// break;
//
// case SE_SwarmPetDuration:
// if (type == focusSwarmPetDuration && base1 > value)
// value = base1;
// break;
//
// case SE_IncreaseRange:
// if (type == focusRange && base1 > value)
// value = base1;
// break;
//
// case SE_ReduceReagentCost:
// if (type == focusReagentCost && base1 > value)
// value = base1;
// break;
//
// case SE_PetPowerIncrease:
// if (type == focusPetPower && base1 > value)
// value = base1;
// break;
//
// case SE_SpellResistReduction:
// if (type == focusResistRate && base1 > value)
// value = base1;
// break;
//
// case SE_SpellHateMod:
// if (type == focusSpellHateMod ) {
// if(value != 0) {
// if(value > 0){
// if(base1 > value)
// value = base1;
// }
// else{
// if(base1 < value)
// value = base1;
// }
// }
// else
// value = base1;
// }
// break;
//
// case SE_ReduceReuseTimer:
// if(type == focusReduceRecastTime)
// value = base1 / 1000;
// break;
//
// case SE_TriggerOnCast:
// if(type == focusTriggerOnCast){
// if(zone->random.Roll(base1)) {
// value = base2;
// } else {
// value = 0;
// LimitFailure = true;
// }
// break;
// }
//
// case SE_FcSpellVulnerability:
// if(type == focusSpellVulnerability)
// value = base1;
// break;
//
// case SE_BlockNextSpellFocus:
// if(type == focusBlockNextSpell){
// if(zone->random.Roll(base1))
// value = 1;
// }
// break;
//
// case SE_FcTwincast:
// if(type == focusTwincast)
// value = base1;
// break;
//
// //Note if using these as AA, make sure this is first focus used.
// case SE_SympatheticProc:
// if(type == focusSympatheticProc)
// value = base2;
// break;
//
// case SE_FcDamageAmt:
// if(type == focusFcDamageAmt)
// value = base1;
// break;
//
// case SE_FcDamageAmtCrit:
// if(type == focusFcDamageAmtCrit)
// value = base1;
// break;
//
// case SE_FcDamageAmtIncoming:
// if(type == focusFcDamageAmtIncoming)
// value = base1;
// break;
//
// case SE_FcHealAmtIncoming:
// if(type == focusFcHealAmtIncoming)
// value = base1;
// break;
//
// case SE_FcHealPctCritIncoming:
// if (type == focusFcHealPctCritIncoming)
// value = base1;
// break;
//
// case SE_FcHealAmtCrit:
// if(type == focusFcHealAmtCrit)
// value = base1;
// break;
//
// case SE_FcHealAmt:
// if(type == focusFcHealAmt)
// value = base1;
// break;
//
// case SE_FcHealPctIncoming:
// if(type == focusFcHealPctIncoming)
// value = base1;
// break;
//
// case SE_FcBaseEffects:
// if (type == focusFcBaseEffects)
// value = base1;
// break;
//
// case SE_FcDamagePctCrit:
// if(type == focusFcDamagePctCrit)
// value = base1;
// break;
//
// case SE_FcIncreaseNumHits:
// if(type == focusIncreaseNumHits)
// value = base1;
// break;
//
// case SE_FcLimitUse:
// if(type == focusFcLimitUse)
// value = base1;
// break;
//
// case SE_FcMute:
// if(type == focusFcMute)
// value = base1;
// break;
//
// case SE_FcStunTimeMod:
// if(type == focusFcStunTimeMod)
// value = base1;
// break;
//
// }
//}
for(int e = 0; e < MaxLimitInclude; e+=2) {
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;
blocked_spells = nullptr;
totalBS = 0;
aas = nullptr;
totalAAs = 0;
zone_has_current_time = false;
Instance_Shutdown_Timer = nullptr;
@ -864,16 +862,6 @@ Zone::~Zone() {
safe_delete(qGlobals);
safe_delete_array(adv_data);
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);
}
@ -952,9 +940,6 @@ bool Zone::Init(bool iStaticZone) {
zone->LoadAlternateCurrencies();
zone->LoadNPCEmotes(&NPCEmoteList);
//Load AA information
LoadAAs();
LoadAlternateAdvancement();
//Load merchant data

View File

@ -120,14 +120,7 @@ public:
AA::Ability *GetAlternateAdvancementAbilityByRank(int rank_id);
AA::Rank *GetAlternateAdvancementRank(int rank_id);
//old AA
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);
void LoadZoneDoors(const char* zone, int16 version);
bool LoadZoneObjects();
bool LoadGroundSpawns();
void ReloadStaticData();
@ -202,6 +195,10 @@ public:
char *adv_data;
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 DoAdventureAssassinationCountIncrease();
void DoAdventureActions();
@ -322,17 +319,6 @@ private:
int totalBS;
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
*/

View File

@ -343,18 +343,7 @@ public:
/* AAs New */
bool LoadAlternateAdvancementAbilities(std::unordered_map<int, std::unique_ptr<AA::Ability>> &abilities,
std::unordered_map<int, std::unique_ptr<AA::Rank>> &ranks);
/* 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);
bool LoadAlternateAdvancement(Client *c);
/* 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);