aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp5
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp1
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp36
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp2
-rwxr-xr-xsrc/server/shared/Utilities/Util.cpp3
5 files changed, 28 insertions, 19 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index f37ae4fa60e..49023b2d5b5 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2821,9 +2821,10 @@ void SmartScript::InitTimer(SmartScriptHolder& e)
case SMART_EVENT_UPDATE:
case SMART_EVENT_UPDATE_IC:
case SMART_EVENT_UPDATE_OOC:
- case SMART_EVENT_OOC_LOS:
- case SMART_EVENT_IC_LOS:
RecalcTimer(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max);
+ case SMART_EVENT_IC_LOS:
+ case SMART_EVENT_OOC_LOS:
+ RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax);
break;
default:
e.active = true;
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index da6e4ef8407..c9874932e3e 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -217,7 +217,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
SetDisplayId(goinfo->displayId);
- m_model = GameObjectModel::Create(*this);
// GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3
SetGoType(GameobjectTypes(goinfo->type));
SetGoState(go_state);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 54559507cf4..76b9649f002 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2302,6 +2302,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
// Ranged attacks can only miss, resist and deflect
if (attType == RANGED_ATTACK)
{
+ canParry = false;
+ canDodge = false;
+
// only if in front
if (victim->HasInArc(M_PI, this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
{
@@ -6637,7 +6640,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false;
triggered_spell_id = 0;
Unit* beaconTarget = NULL;
- if (this->GetTypeId() != TYPEID_PLAYER)
+ if (GetTypeId() != TYPEID_PLAYER)
{
beaconTarget = triggeredByAura->GetBase()->GetCaster();
if (beaconTarget == this || !(beaconTarget->GetAura(53563, victim->GetGUID())))
@@ -6647,23 +6650,24 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
else
{ // Check Party/Raid Group
- if (Group *group = this->ToPlayer()->GetGroup())
+ if (Group* group = ToPlayer()->GetGroup())
{
- for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
- Player* Member = itr->getSource();
-
- // check if it was heal by paladin which casted this beacon of light
- if (Member->GetAura(53563, victim->GetGUID()))
+ if (Player* member = itr->getSource())
{
- // do not proc when target of beacon of light is healed
- if (Member == this)
- return false;
+ // check if it was heal by paladin which casted this beacon of light
+ if (member->GetAura(53563, victim->GetGUID()))
+ {
+ // do not proc when target of beacon of light is healed
+ if (member == this)
+ return false;
- beaconTarget = Member;
- basepoints0 = int32(damage);
- triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(635)) ? 53652 : 53654;
- break;
+ beaconTarget = member;
+ basepoints0 = int32(damage);
+ triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(635)) ? 53652 : 53654;
+ break;
+ }
}
}
}
@@ -6674,8 +6678,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura);
return true;
}
- else
- return false;
+
+ return false;
}
// Judgements of the Wise
if (dummySpell->SpellIconID == 3017)
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 9c922f2c6fb..9d0e084cfb8 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -32,6 +32,7 @@
enum HunterSpells
{
HUNTER_SPELL_READINESS = 23989,
+ DRAENEI_SPELL_GIFT_OF_THE_NAARU = 59543,
HUNTER_SPELL_BESTIAL_WRATH = 19574,
HUNTER_PET_SPELL_LAST_STAND_TRIGGERED = 53479,
HUNTER_PET_HEART_OF_THE_PHOENIX = 55709,
@@ -340,6 +341,7 @@ class spell_hun_readiness : public SpellScriptLoader
spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
spellInfo->Id != HUNTER_SPELL_READINESS &&
spellInfo->Id != HUNTER_SPELL_BESTIAL_WRATH &&
+ spellInfo->Id != DRAENEI_SPELL_GIFT_OF_THE_NAARU &&
spellInfo->GetRecoveryTime() > 0)
caster->RemoveSpellCooldown((itr++)->first, true);
else
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp
index 9778e86d444..0897c8814ab 100755
--- a/src/server/shared/Utilities/Util.cpp
+++ b/src/server/shared/Utilities/Util.cpp
@@ -28,16 +28,19 @@ static SFMTRandTSS sfmtRand;
int32 irand(int32 min, int32 max)
{
+ assert(max >= min);
return int32(sfmtRand->IRandom(min, max));
}
uint32 urand(uint32 min, uint32 max)
{
+ assert(max >= min);
return sfmtRand->URandom(min, max);
}
float frand(float min, float max)
{
+ assert(max >= min);
return float(sfmtRand->Random() * (max - min) + min);
}