aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorBrian <runningnak3d@gmail.com>2010-07-02 06:06:40 -0600
committerBrian <runningnak3d@gmail.com>2010-07-02 06:06:40 -0600
commita52233f40eaed23623b8a4be93d9b513997f0f53 (patch)
treeac1bfc0056981b1f79067253f14bd5302247778f /src/server/game
parentbaf108e5ccc0ee42efcefa4a87e2784421df15c5 (diff)
parente0e36b5db5777a08660d1c2c243afd8f60b49a43 (diff)
* Merge public repo
--HG-- branch : trunk
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Addons/AddonMgr.cpp3
-rw-r--r--src/server/game/Addons/AddonMgr.h3
-rw-r--r--src/server/game/Combat/ThreatManager.cpp5
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp28
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
6 files changed, 22 insertions, 21 deletions
diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp
index 9bc28f845ac..830d439bfdd 100644
--- a/src/server/game/Addons/AddonMgr.cpp
+++ b/src/server/game/Addons/AddonMgr.cpp
@@ -1,8 +1,7 @@
/*
+ * Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/server/game/Addons/AddonMgr.h b/src/server/game/Addons/AddonMgr.h
index 90232cc3f2b..112415e5b40 100644
--- a/src/server/game/Addons/AddonMgr.h
+++ b/src/server/game/Addons/AddonMgr.h
@@ -1,8 +1,7 @@
/*
+ * Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
- * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 52f02f0f66d..fbf5a80d42b 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -36,8 +36,13 @@
float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float fThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell)
{
if (pThreatSpell)
+ {
+ if (pThreatSpell->AttributesEx & SPELL_ATTR_EX_NO_THREAT)
+ return 0.0f;
+
if (Player* modOwner = pHatedUnit->GetSpellModOwner())
modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, fThreat);
+ }
return pHatedUnit->ApplyTotalThreatModifier(fThreat, schoolMask);
}
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 362ccbf582d..e85dd8968dc 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -7335,27 +7335,25 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
sLog.outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
return false;
}
- // No thread generated mod
- // TODO: exist special flag in spell attributes for this, need found and use!
- SpellModifier *mod = new SpellModifier;
- mod->op = SPELLMOD_THREAT;
- mod->value = -100;
- mod->type = SPELLMOD_PCT;
- mod->spellId = dummySpell->Id;
- mod->mask[0] = 0x02;
- mod->mask[2] = 0x00;
- this->ToPlayer()->AddSpellMod(mod, true);
-
- // Remove cooldown (Chain Lightning - have Category Recovery time)
+
+ // Chain Lightning
if (procSpell->SpellFamilyFlags[0] & 0x2)
+ {
+ // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit.
+ // A maxed LO would have a 33% / 3 = 11% chance to proc of each target.
+ // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets]
+ float chance = 100.0f / procSpell->EffectChainTarget[effIndex];
+ if (!roll_chance_f(chance))
+ return false;
+
+ // Remove cooldown (Chain Lightning - have Category Recovery time)
ToPlayer()->RemoveSpellCooldown(spellId);
+ }
CastSpell(pVictim, spellId, true, castItem, triggeredByAura);
- this->ToPlayer()->AddSpellMod(mod, false);
-
if (cooldown && GetTypeId() == TYPEID_PLAYER)
- ToPlayer()->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown);
+ ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown);
return true;
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index c7ed4cfb330..ae8dd503caa 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -8266,7 +8266,7 @@ void ObjectMgr::LoadGossipMenuItems()
QueryResult_AutoPtr result = WorldDatabase.Query(
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, "
"action_menu_id, action_poi_id, action_script_id, box_coded, box_money, box_text "
- "FROM gossip_menu_option");
+ "FROM gossip_menu_option ORDER BY menu_id, id");
if (!result)
{
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index a9ae3bc4cc0..a1692794ca8 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -287,7 +287,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
#define SPELL_ATTR_EX_NEGATIVE 0x00000080 // 7
#define SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET 0x00000100 // 8 Spell req target not to be in combat state
#define SPELL_ATTR_EX_UNK9 0x00000200 // 9 melee spells
-#define SPELL_ATTR_EX_UNK10 0x00000400 // 10 no generates threat on cast 100%? (old NO_INITIAL_AGGRO)
+#define SPELL_ATTR_EX_NO_THREAT 0x00000400 // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO)
#define SPELL_ATTR_EX_UNK11 0x00000800 // 11 aura
#define SPELL_ATTR_EX_UNK12 0x00001000 // 12
#define SPELL_ATTR_EX_UNK13 0x00002000 // 13