aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/mangos.sql9
-rw-r--r--sql/mangos_spell_check.sql2
-rw-r--r--src/game/Player.cpp39
-rw-r--r--src/game/Player.h3
-rw-r--r--src/game/Unit.cpp1
-rw-r--r--src/game/Unit.h1
6 files changed, 43 insertions, 12 deletions
diff --git a/sql/mangos.sql b/sql/mangos.sql
index 90ff12ab883..731ff4e7e22 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
- `required_8213_01_mangos_spell_bonus_data` bit(1) default NULL
+ `required_8227_01_mangos_spell_proc_event` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@@ -17667,8 +17667,15 @@ INSERT INTO `spell_proc_event` VALUES
(63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+<<<<<<< HEAD:sql/mangos.sql
(63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);
>>>>>>> 4386e1133bd161f1b3a8d378e567b3d61f83ce89:sql/mangos.sql
+=======
+(63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
+(63730, 0x00000000, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(63733, 0x00000000, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0),
+(63737, 0x00000000, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);
+>>>>>>> ee001a20a10446a8936bec95b7680b50319ac61d:sql/mangos.sql
/*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql
index 73c84ee6701..14a5c2689db 100644
--- a/sql/mangos_spell_check.sql
+++ b/sql/mangos_spell_check.sql
@@ -249,6 +249,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(50246,-1, -1, -1, -1, -1, -1, -1, -1,-1,'01001000', 'Spell::EffectDummy'),
(50286, 7,0x0000000000000000,0x00000100, -1, -1, -1, 3, -1,-1,'Starfall', 'Spell::EffectDummy'),
(50288,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Starfall', 'Spell::EffectDummy'),
+(51209,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Hungering Cold', 'Spell::EffectDummy'),
(51582, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rocket Boots Engaged', 'Spell::EffectDummy'),
(51592, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Pickup Primordial Hatchling', 'Spell::EffectDummy'),
(52025,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cleansing Totem Effect', 'Spell::EffectDummy'),
@@ -318,6 +319,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
( 0,11,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Healing Stream Totem', 'Spell::EffectDummy'),
( 0, 4,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Heroic Throw', 'Spell::EffectSchoolDMG'),
( 0,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'),
+( 0,15,0x0000100000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Hungering Cold', 'Spell::EffectDummy'),
( 0, 5,0x0000000000000004,0x00000000, -1, -1, -1, -1, 3,-1,'Immolate', 'Spell::EffectSchoolDMG'),
(0, 5, -1, -1, 208, -1, -1, -1, 4,-1,'Improved Life Tap', 'Spell::EffectDummy'),
( 0, 5,0x0000004000000000,0x00000000,2128, -1, -1, 2, -1,-1,'Incinerate', 'Spell::EffectSchoolDMG'),
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 1535290af27..5659f14f28a 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1329,8 +1329,8 @@ void Player::Update( uint32 p_time )
{
if (p_time >= m_DetectInvTimer)
{
- m_DetectInvTimer = 3000;
HandleStealthedUnitsDetection();
+ m_DetectInvTimer = 3000;
}
else
m_DetectInvTimer -= p_time;
@@ -17552,19 +17552,38 @@ void Player::HandleStealthedUnitsDetection()
Trinity::UnitListSearcher<Trinity::AnyStealthedCheck > searcher(this, stealthedUnits, u_check);
VisitNearbyObject(World::GetMaxVisibleDistance(), searcher);
- for (std::list<Unit*>::iterator i = stealthedUnits.begin(); i != stealthedUnits.end(); ++i)
+ for (std::list<Unit*>::const_iterator i = stealthedUnits.begin(); i != stealthedUnits.end(); ++i)
{
- if (!HaveAtClient(*i) && canSeeOrDetect(*i, true))
+ if((*i)==this)
+ continue;
+
+ bool hasAtClient = HaveAtClient((*i));
+ bool hasDetected = canSeeOrDetect(*i, true);
+
+ if (hasDetected)
{
- (*i)->SendUpdateToPlayer(this);
- m_clientGUIDs.insert((*i)->GetGUID());
+ if(!hasAtClient)
+ {
+ (*i)->SendUpdateToPlayer(this);
+ m_clientGUIDs.insert((*i)->GetGUID());
- #ifdef TRINITY_DEBUG
- if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
- sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i));
- #endif
+ #ifdef MANGOS_DEBUG
+ if((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES)==0)
+ sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i));
+ #endif
- SendInitialVisiblePackets(*i);
+ // target aura duration for caster show only if target exist at caster client
+ // send data at target visibility change (adding to client)
+ SendInitialVisiblePackets(*i);
+ }
+ }
+ else
+ {
+ if(hasAtClient)
+ {
+ (*i)->DestroyForPlayer(this);
+ m_clientGUIDs.erase((*i)->GetGUID());
+ }
}
}
}
diff --git a/src/game/Player.h b/src/game/Player.h
index 744e4e0cc3c..85faad96407 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2051,7 +2051,6 @@ class TRINITY_DLL_SPEC Player : public Unit
void UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObject*>& visibleNow);
// Stealth detection system
- uint32 m_DetectInvTimer;
void HandleStealthedUnitsDetection();
uint8 m_forced_speed_changes[MAX_MOVE_TYPE];
@@ -2404,6 +2403,8 @@ class TRINITY_DLL_SPEC Player : public Unit
bool m_bCanDelayTeleport;
bool m_bHasDelayedTeleport;
+ uint32 m_DetectInvTimer;
+
// Temporary removed pet cache
uint32 m_temporaryUnsummonedPetNumber;
uint32 m_oldpetspell;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 117dbe0e1da..111538040f8 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10905,6 +10905,7 @@ bool Unit::canDetectStealthOf(Unit const* target, float distance) const
//-Stealth Mod(positive like Master of Deception) and Stealth Detection(negative like paranoia)
//based on wowwiki every 5 mod we have 1 more level diff in calculation
visibleDistance += (float)(GetTotalAuraModifier(SPELL_AURA_MOD_DETECT) - target->GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH_LEVEL)) / 5.0f;
+ visibleDistance = visibleDistance > MAX_PLAYER_STEALTH_DETECT_RANGE ? MAX_PLAYER_STEALTH_DETECT_RANGE : visibleDistance;
return distance < visibleDistance;
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 3488c9b8f14..85f2ed154dd 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1012,6 +1012,7 @@ enum ReactiveType
// delay time next attack to prevent client attack animation problems
#define ATTACK_DISPLAY_DELAY 200
+#define MAX_PLAYER_STEALTH_DETECT_RANGE 45.0f // max distance for detection targets by player
struct SpellProcEventEntry; // used only privately