mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
Fixed the buff database entries and updated database migrations
This commit is contained in:
+82
-39
@@ -2381,6 +2381,7 @@ void ZoneDatabase::SaveMercenaryBuffs(Merc* m)
|
||||
e.CasterLevel = buffs[slot_id].casterlevel;
|
||||
e.DurationFormula = spells[buffs[slot_id].spellid].buff_duration_formula;
|
||||
e.TicsRemaining = buffs[slot_id].ticsremaining;
|
||||
e.InitialDuration = buffs[slot_id].initialduration;
|
||||
e.PoisonCounters = CalculatePoisonCounters(buffs[slot_id].spellid) > 0 ? buffs[slot_id].counters : 0;
|
||||
e.DiseaseCounters = CalculateDiseaseCounters(buffs[slot_id].spellid) > 0 ? buffs[slot_id].counters : 0;
|
||||
e.CurseCounters = CalculateCurseCounters(buffs[slot_id].spellid) > 0 ? buffs[slot_id].counters : 0;
|
||||
@@ -2392,8 +2393,9 @@ void ZoneDatabase::SaveMercenaryBuffs(Merc* m)
|
||||
e.caston_x = buffs[slot_id].caston_x;
|
||||
e.caston_y = buffs[slot_id].caston_y;
|
||||
e.caston_z = buffs[slot_id].caston_z;
|
||||
e.Persistent = buffs[slot_id].persistant_buff ? 1 : 0;
|
||||
e.Persistent = buffs[slot_id].persistent_buff ? 1 : 0;
|
||||
e.ExtraDIChance = buffs[slot_id].ExtraDIChance;
|
||||
e.instrument_mod = buffs[slot_id].instrument_mod;
|
||||
|
||||
v.emplace_back(e);
|
||||
}
|
||||
@@ -2430,6 +2432,7 @@ void ZoneDatabase::LoadMercenaryBuffs(Merc* m)
|
||||
buffs[slot_id].spellid = e.SpellId;
|
||||
buffs[slot_id].casterlevel = e.CasterLevel;
|
||||
buffs[slot_id].ticsremaining = e.TicsRemaining;
|
||||
buffs[slot_id].initialduration = e.InitialDuration;
|
||||
buffs[slot_id].hit_number = e.HitCount;
|
||||
buffs[slot_id].melee_rune = e.MeleeRune;
|
||||
buffs[slot_id].magic_rune = e.MagicRune;
|
||||
@@ -2439,7 +2442,8 @@ void ZoneDatabase::LoadMercenaryBuffs(Merc* m)
|
||||
buffs[slot_id].caston_z = e.caston_z;
|
||||
buffs[slot_id].casterid = 0;
|
||||
buffs[slot_id].ExtraDIChance = e.ExtraDIChance;
|
||||
buffs[slot_id].persistant_buff = e.Persistent;
|
||||
buffs[slot_id].persistent_buff = e.Persistent;
|
||||
buffs[slot_id].instrument_mod = e.instrument_mod;
|
||||
|
||||
if (CalculatePoisonCounters(buffs[slot_id].spellid) > 0) {
|
||||
buffs[slot_id].counters = e.PoisonCounters;
|
||||
@@ -2926,23 +2930,24 @@ void ZoneDatabase::SaveBuffs(Client *client)
|
||||
continue;
|
||||
}
|
||||
|
||||
e.character_id = client->CharacterID();
|
||||
e.slot_id = slot_id;
|
||||
e.spell_id = buffs[slot_id].spellid;
|
||||
e.caster_level = buffs[slot_id].casterlevel;
|
||||
e.caster_name = buffs[slot_id].caster_name;
|
||||
e.ticsremaining = buffs[slot_id].ticsremaining;
|
||||
e.counters = buffs[slot_id].counters;
|
||||
e.numhits = buffs[slot_id].hit_number;
|
||||
e.melee_rune = buffs[slot_id].melee_rune;
|
||||
e.magic_rune = buffs[slot_id].magic_rune;
|
||||
e.persistent = buffs[slot_id].persistant_buff;
|
||||
e.dot_rune = buffs[slot_id].dot_rune;
|
||||
e.caston_x = buffs[slot_id].caston_x;
|
||||
e.caston_y = buffs[slot_id].caston_y;
|
||||
e.caston_z = buffs[slot_id].caston_z;
|
||||
e.ExtraDIChance = buffs[slot_id].ExtraDIChance;
|
||||
e.instrument_mod = buffs[slot_id].instrument_mod;
|
||||
e.character_id = client->CharacterID();
|
||||
e.slot_id = slot_id;
|
||||
e.spell_id = buffs[slot_id].spellid;
|
||||
e.caster_level = buffs[slot_id].casterlevel;
|
||||
e.caster_name = buffs[slot_id].caster_name;
|
||||
e.ticsremaining = buffs[slot_id].ticsremaining;
|
||||
e.initialduration = buffs[slot_id].initialduration;
|
||||
e.counters = buffs[slot_id].counters;
|
||||
e.numhits = buffs[slot_id].hit_number;
|
||||
e.melee_rune = buffs[slot_id].melee_rune;
|
||||
e.magic_rune = buffs[slot_id].magic_rune;
|
||||
e.persistent = buffs[slot_id].persistent_buff;
|
||||
e.dot_rune = buffs[slot_id].dot_rune;
|
||||
e.caston_x = buffs[slot_id].caston_x;
|
||||
e.caston_y = buffs[slot_id].caston_y;
|
||||
e.caston_z = buffs[slot_id].caston_z;
|
||||
e.ExtraDIChance = buffs[slot_id].ExtraDIChance;
|
||||
e.instrument_mod = buffs[slot_id].instrument_mod;
|
||||
|
||||
v.emplace_back(e);
|
||||
}
|
||||
@@ -3000,11 +3005,12 @@ void ZoneDatabase::LoadBuffs(Client *client)
|
||||
}
|
||||
|
||||
buffs[e.slot_id].ticsremaining = e.ticsremaining;
|
||||
buffs[e.slot_id].initialduration = e.initialduration;
|
||||
buffs[e.slot_id].counters = e.counters;
|
||||
buffs[e.slot_id].hit_number = e.numhits;
|
||||
buffs[e.slot_id].melee_rune = e.melee_rune;
|
||||
buffs[e.slot_id].magic_rune = e.magic_rune;
|
||||
buffs[e.slot_id].persistant_buff = e.persistent ? true : false;
|
||||
buffs[e.slot_id].persistent_buff = e.persistent ? true : false;
|
||||
buffs[e.slot_id].dot_rune = e.dot_rune;
|
||||
buffs[e.slot_id].caston_x = e.caston_x;
|
||||
buffs[e.slot_id].caston_y = e.caston_y;
|
||||
@@ -3030,7 +3036,7 @@ void ZoneDatabase::LoadBuffs(Client *client)
|
||||
}
|
||||
|
||||
if (IsEffectInSpell(buffs[slot_id].spellid, SpellEffect::Illusion)) {
|
||||
if (buffs[slot_id].persistant_buff) {
|
||||
if (buffs[slot_id].persistent_buff) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3139,14 +3145,25 @@ void ZoneDatabase::SavePetInfo(Client *client)
|
||||
continue;
|
||||
}
|
||||
|
||||
pet_buff.char_id = client->CharacterID();
|
||||
pet_buff.pet = pet_info_type;
|
||||
pet_buff.slot = slot_id;
|
||||
pet_buff.spell_id = p->Buffs[slot_id].spellid;
|
||||
pet_buff.caster_level = p->Buffs[slot_id].level;
|
||||
pet_buff.ticsremaining = p->Buffs[slot_id].duration;
|
||||
pet_buff.counters = p->Buffs[slot_id].counters;
|
||||
pet_buff.instrument_mod = p->Buffs[slot_id].bard_modifier;
|
||||
pet_buff.character_id = client->CharacterID();
|
||||
pet_buff.pet = pet_info_type;
|
||||
pet_buff.slot_id = slot_id;
|
||||
pet_buff.spell_id = p->Buffs[slot_id].spellid;
|
||||
pet_buff.caster_level = p->Buffs[slot_id].casterlevel;
|
||||
pet_buff.caster_name = p->Buffs[slot_id].caster_name;
|
||||
pet_buff.ticsremaining = p->Buffs[slot_id].ticsremaining;
|
||||
pet_buff.initialduration = p->Buffs[slot_id].initialduration;
|
||||
pet_buff.counters = p->Buffs[slot_id].counters;
|
||||
pet_buff.numhits = p->Buffs[slot_id].hit_number;
|
||||
pet_buff.melee_rune = p->Buffs[slot_id].melee_rune;
|
||||
pet_buff.magic_rune = p->Buffs[slot_id].magic_rune;
|
||||
pet_buff.persistent = p->Buffs[slot_id].persistent_buff;
|
||||
pet_buff.dot_rune = p->Buffs[slot_id].dot_rune;
|
||||
pet_buff.caston_x = p->Buffs[slot_id].caston_x;
|
||||
pet_buff.caston_y = p->Buffs[slot_id].caston_y;
|
||||
pet_buff.caston_z = p->Buffs[slot_id].caston_z;
|
||||
pet_buff.ExtraDIChance = p->Buffs[slot_id].ExtraDIChance;
|
||||
pet_buff.instrument_mod = p->Buffs[slot_id].instrument_mod;
|
||||
|
||||
pet_buffs.push_back(pet_buff);
|
||||
}
|
||||
@@ -3200,7 +3217,7 @@ void ZoneDatabase::SavePetInfo(Client *client)
|
||||
CharacterPetBuffsRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`char_id` = {}",
|
||||
"`character_id` = {}",
|
||||
client->CharacterID()
|
||||
)
|
||||
);
|
||||
@@ -3299,7 +3316,7 @@ void ZoneDatabase::LoadPetInfo(Client *client)
|
||||
const auto& buffs = CharacterPetBuffsRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`char_id` = {}",
|
||||
"`character_id` = {}",
|
||||
client->CharacterID()
|
||||
)
|
||||
);
|
||||
@@ -3314,7 +3331,7 @@ void ZoneDatabase::LoadPetInfo(Client *client)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (e.slot >= RuleI(Spells, MaxTotalSlotsPET)) {
|
||||
if (e.slot_id >= RuleI(Spells, MaxTotalSlotsPET)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3322,13 +3339,39 @@ void ZoneDatabase::LoadPetInfo(Client *client)
|
||||
continue;
|
||||
}
|
||||
|
||||
p->Buffs[e.slot].spellid = e.spell_id;
|
||||
p->Buffs[e.slot].level = e.caster_level;
|
||||
p->Buffs[e.slot].player_id = 0;
|
||||
p->Buffs[e.slot].effect_type = BuffEffectType::Buff;
|
||||
p->Buffs[e.slot].duration = e.ticsremaining;
|
||||
p->Buffs[e.slot].counters = e.counters;
|
||||
p->Buffs[e.slot].bard_modifier = e.instrument_mod;
|
||||
Client* c = entity_list.GetClientByName(e.caster_name.c_str());
|
||||
|
||||
p->Buffs[e.slot_id].spellid = e.spell_id;
|
||||
p->Buffs[e.slot_id].casterlevel = e.caster_level;
|
||||
|
||||
if (c) {
|
||||
p->Buffs[e.slot_id].casterid = c->GetID();
|
||||
p->Buffs[e.slot_id].client = true;
|
||||
|
||||
strncpy(p->Buffs[e.slot_id].caster_name, c->GetName(), 64);
|
||||
} else {
|
||||
p->Buffs[e.slot_id].casterid = 0;
|
||||
p->Buffs[e.slot_id].client = false;
|
||||
|
||||
strncpy(p->Buffs[e.slot_id].caster_name, "", 64);
|
||||
}
|
||||
|
||||
p->Buffs[e.slot_id].ticsremaining = e.ticsremaining;
|
||||
p->Buffs[e.slot_id].initialduration = e.initialduration;
|
||||
p->Buffs[e.slot_id].counters = e.counters;
|
||||
p->Buffs[e.slot_id].hit_number = e.numhits;
|
||||
p->Buffs[e.slot_id].melee_rune = e.melee_rune;
|
||||
p->Buffs[e.slot_id].magic_rune = e.magic_rune;
|
||||
p->Buffs[e.slot_id].persistent_buff = e.persistent ? true : false;
|
||||
p->Buffs[e.slot_id].dot_rune = e.dot_rune;
|
||||
p->Buffs[e.slot_id].caston_x = e.caston_x;
|
||||
p->Buffs[e.slot_id].caston_y = e.caston_y;
|
||||
p->Buffs[e.slot_id].caston_z = e.caston_z;
|
||||
p->Buffs[e.slot_id].ExtraDIChance = e.ExtraDIChance;
|
||||
p->Buffs[e.slot_id].RootBreakChance = 0;
|
||||
p->Buffs[e.slot_id].virus_spread_time = 0;
|
||||
p->Buffs[e.slot_id].UpdateClient = false;
|
||||
p->Buffs[e.slot_id].instrument_mod = e.instrument_mod;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user