Core/Players

* Add liquid special aura only if player is in it (not when above)
* Use CastSpell instead of AddAura - checks all dbc conditions on spell
This commit is contained in:
Shauren
2012-03-07 18:57:47 +01:00
parent 2e58d7b515
commit a1a7a2d7c0
4 changed files with 18 additions and 2 deletions
@@ -30,6 +30,7 @@
#include <ace/Null_Mutex.h> #include <ace/Null_Mutex.h>
#include <ace/Singleton.h> #include <ace/Singleton.h>
#include "DisableMgr.h" #include "DisableMgr.h"
#include "DBCStores.h"
using G3D::Vector3; using G3D::Vector3;
@@ -234,7 +235,7 @@ namespace VMAP
floor = info.ground_Z; floor = info.ground_Z;
ASSERT(floor < std::numeric_limits<float>::max()); ASSERT(floor < std::numeric_limits<float>::max());
type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc
if (reqLiquidType && !(type & reqLiquidType)) if (reqLiquidType && !(GetLiquidFlags(type) & reqLiquidType))
return false; return false;
if (info.hitInstance->GetLiquidLevel(pos, info, level)) if (info.hitInstance->GetLiquidLevel(pos, info, level))
return true; return true;
+8
View File
@@ -864,6 +864,14 @@ uint32 const* GetTalentTabPages(uint8 cls)
return sTalentTabPages[cls]; return sTalentTabPages[cls];
} }
uint32 GetLiquidFlags(uint32 liquidType)
{
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
return 1 << liq->Type;
return 0;
}
// script support functions // script support functions
DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore() { return &sSoundEntriesStore; } DBCStorage <SoundEntriesEntry> const* GetSoundEntriesStore() { return &sSoundEntriesStore; }
DBCStorage <SpellRangeEntry> const* GetSpellRangeStore() { return &sSpellRangeStore; } DBCStorage <SpellRangeEntry> const* GetSpellRangeStore() { return &sSpellRangeStore; }
+2
View File
@@ -60,6 +60,8 @@ MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &di
uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls); uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls);
uint32 GetLiquidFlags(uint32 liquidType);
PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id);
+6 -1
View File
@@ -23075,7 +23075,12 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z)
RemoveAurasDueToSpell(_lastLiquid->SpellId); RemoveAurasDueToSpell(_lastLiquid->SpellId);
if (liquid && liquid->SpellId) if (liquid && liquid->SpellId)
AddAura(liquid->SpellId, this); {
if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK))
CastSpell(this, liquid->SpellId, this);
else
RemoveAurasDueToSpell(liquid->SpellId);
}
_lastLiquid = liquid; _lastLiquid = liquid;
} }