mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Add Venture Vision Behavior (#609)
Add the Venture Vision behavior and associated functionality. Pet digs still do not show up however. The Kit bonus for factions have been tested and properly grant and take away the buff when it is casted and uncasted. Tested as well using multiple Venture Vision behaviors at once and the vision only went away when there were zero equipped at once. Remove extra includes Convert to Tabs Remove extra forward declaration
This commit is contained in:
@@ -785,3 +785,32 @@ ZoneStatistics& CharacterComponent::GetZoneStatisticsForMap(LWOMAPID mapID) {
|
||||
m_ZoneStatistics.insert({ mapID, {0, 0, 0, 0, 0 } });
|
||||
return m_ZoneStatistics.at(mapID);
|
||||
}
|
||||
|
||||
void CharacterComponent::AddVentureVisionEffect(std::string ventureVisionType) {
|
||||
const auto ventureVisionTypeIterator = m_ActiveVentureVisionEffects.find(ventureVisionType);
|
||||
|
||||
if (ventureVisionTypeIterator != m_ActiveVentureVisionEffects.end()) {
|
||||
ventureVisionTypeIterator->second = ++ventureVisionTypeIterator->second;
|
||||
} else {
|
||||
// If the effect it not found, insert it into the active effects.
|
||||
m_ActiveVentureVisionEffects.insert(std::make_pair(ventureVisionType, 1U));
|
||||
}
|
||||
|
||||
UpdateClientMinimap(true, ventureVisionType);
|
||||
}
|
||||
|
||||
void CharacterComponent::RemoveVentureVisionEffect(std::string ventureVisionType) {
|
||||
const auto ventureVisionTypeIterator = m_ActiveVentureVisionEffects.find(ventureVisionType);
|
||||
|
||||
if (ventureVisionTypeIterator != m_ActiveVentureVisionEffects.end()) {
|
||||
ventureVisionTypeIterator->second = --ventureVisionTypeIterator->second;
|
||||
UpdateClientMinimap(ventureVisionTypeIterator->second != 0U, ventureVisionType);
|
||||
}
|
||||
}
|
||||
|
||||
void CharacterComponent::UpdateClientMinimap(bool showFaction, std::string ventureVisionType) const {
|
||||
if (!m_Parent) return;
|
||||
AMFArrayValue arrayToSend;
|
||||
arrayToSend.InsertValue(ventureVisionType, showFaction ? static_cast<AMFValue*>(new AMFTrueValue()) : static_cast<AMFValue*>(new AMFFalseValue()));
|
||||
GameMessages::SendUIMessageServerToSingleClient(m_Parent, m_Parent ? m_Parent->GetSystemAddress() : UNASSIGNED_SYSTEM_ADDRESS, "SetFactionVisibility", &arrayToSend);
|
||||
}
|
||||
|
Reference in New Issue
Block a user