mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-20 13:44:21 +00:00
feat: enemies now use weights on their attacks (#2004)
* feat: enemies now use weights on their attacks tested that 8 times out of 10, in close range, spiders did a web attack instead of a melee attack, vs the prior behavior of always following a pattern fixes #2002 * feedback
This commit is contained in:
@@ -38,3 +38,11 @@ std::vector<CDObjectSkills> CDObjectSkillsTable::Query(std::function<bool(CDObje
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
std::vector<CDObjectSkills> CDObjectSkillsTable::Get(const LOT lot) const {
|
||||
std::vector<CDObjectSkills> toReturn;
|
||||
for (const auto& entry : GetEntries()) {
|
||||
if (entry.objectTemplate == lot) toReturn.push_back(entry);
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
#include "CDTable.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
struct CDObjectSkills {
|
||||
uint32_t objectTemplate; //!< The LOT of the item
|
||||
uint32_t skillID; //!< The Skill ID of the object
|
||||
uint32_t castOnType; //!< ???
|
||||
uint32_t AICombatWeight; //!< ???
|
||||
int32_t AICombatWeight; //!< ???
|
||||
};
|
||||
|
||||
class CDObjectSkillsTable : public CDTable<CDObjectSkillsTable, std::vector<CDObjectSkills>> {
|
||||
@@ -17,5 +18,6 @@ public:
|
||||
void LoadValuesFromDatabase();
|
||||
// Queries the table with a custom "where" clause
|
||||
std::vector<CDObjectSkills> Query(std::function<bool(CDObjectSkills)> predicate);
|
||||
std::vector<CDObjectSkills> Get(const LOT lot) const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user