mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
refactor: item set passive abilities come from the CDClient and item scripts
The server hardcoded each item set's passives by set ID. They now come from data: - On-kill bonuses (Paradox imagination, Sentinel armor repair, Bat Lord heal) are the set's DarkInspiration skills in ItemSetSkills. The client turns those into a status effect that casts the behavior's action when the wearer kills something of a faction in faction_list; the server now runs the same behavior on the smashed enemy, so the amounts, faction check and extra effects (e.g. rank 3 Sorcerer team imagination) follow the data. A behavior repeated in a higher tier does not stack. - Low imagination / low armor skills are what the live equipmenttriggers item scripts do. Items link to those scripts through their ScriptComponent; the script vars (skill, items required, set, cooldown) only exist in the scripts, so they are mirrored in a small table keyed by script name. The Sentinel scripts have no cooldown (was 11s). - Knockback immunity while quickbuilding comes from the Immunity behavior's immune_quickbuild_interrupts (the 5 item Assembly rank 2/3 set skill) instead of a set ID list; ImmunityBehavior now pops its immunities when an equip skill is uncast. Removes eItemSetPassiveAbilityID and InventoryComponent::HasAnyPassive (unused now). Refs #691 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,8 +18,6 @@ ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) {
|
||||
this->m_ID = id;
|
||||
this->m_InventoryComponent = inventoryComponent;
|
||||
|
||||
this->m_PassiveAbilities = ItemSetPassiveAbility::FindAbilities(id, m_InventoryComponent->GetParent(), this);
|
||||
|
||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||
"SELECT skillSetWith2, skillSetWith3, skillSetWith4, skillSetWith5, skillSetWith6, itemIDs FROM ItemSets WHERE setID = ?;");
|
||||
query.bind(1, static_cast<int>(id));
|
||||
@@ -44,7 +42,7 @@ ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) {
|
||||
auto skillResult = skillQuery.execQuery();
|
||||
|
||||
if (skillResult.eof()) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
while (!skillResult.eof()) {
|
||||
@@ -96,6 +94,8 @@ ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) {
|
||||
if (validToken) m_Items.push_back(validToken.value());
|
||||
}
|
||||
|
||||
m_PassiveAbilities = ItemSetPassiveAbility::FindAbilities(id, m_Items, { m_SkillsWith2, m_SkillsWith3, m_SkillsWith4, m_SkillsWith5, m_SkillsWith6 }, m_InventoryComponent->GetParent(), this);
|
||||
|
||||
m_Equipped = {};
|
||||
|
||||
for (const auto item : m_Items) {
|
||||
|
||||
Reference in New Issue
Block a user