aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/389_world.sql6
-rw-r--r--sql/updates/455_world.sql4
-rw-r--r--sql/updates/615_world.sql7
-rw-r--r--src/game/Creature.cpp3
-rw-r--r--src/game/SharedDefines.h3
-rw-r--r--src/game/Spell.cpp15
-rw-r--r--src/game/SpellAuras.cpp2
-rw-r--r--src/game/SpellMgr.cpp1
-rw-r--r--src/game/Unit.cpp27
-rw-r--r--src/game/WaypointManager.cpp3
-rw-r--r--src/game/WaypointMovementGenerator.cpp17
11 files changed, 58 insertions, 30 deletions
diff --git a/sql/updates/389_world.sql b/sql/updates/389_world.sql
index bbe7fb6fcc6..89094143f64 100644
--- a/sql/updates/389_world.sql
+++ b/sql/updates/389_world.sql
@@ -3,5 +3,7 @@ INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `commen
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-24132, 24134, 0, 'Wyvern Sting');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-24133, 24135, 0, 'Wyvern Sting');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-27068, 27069, 0, 'Wyvern Sting');
-INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49011, 49009, 0, 'Wyvern Sting');
-INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49012, 49010, 0, 'Wyvern Sting');
+-- Rank 5 (not available till wotlk)
+-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49011, 49009, 0, 'Wyvern Sting');
+-- Rank 6 (not available till wotlk)
+-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49012, 49010, 0, 'Wyvern Sting');
diff --git a/sql/updates/455_world.sql b/sql/updates/455_world.sql
index a40de1b77f3..a5a23c5f5d6 100644
--- a/sql/updates/455_world.sql
+++ b/sql/updates/455_world.sql
@@ -5,8 +5,8 @@ UPDATE `creature_template` SET spell1 = 43218, flags_extra = 128, ScriptName = '
-- Broggok Poison Cloud
UPDATE `creature_template` SET spell1 = 30914, flags_extra = 128, ScriptName = '' WHERE entry = 17662;
-
-INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43468, 44007, 1, 'Storm Eye Safe Zone');
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (43468, 43648, 43658, 43658, 43658, 43658, 43658);
+INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43648, 44007, 1, 'Storm Eye Safe Zone');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43653, 0, 'Electrical Arc Visual');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43654, 0, 'Electrical Arc Visual');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43655, 0, 'Electrical Arc Visual');
diff --git a/sql/updates/615_world.sql b/sql/updates/615_world.sql
new file mode 100644
index 00000000000..28512e8511e
--- /dev/null
+++ b/sql/updates/615_world.sql
@@ -0,0 +1,7 @@
+-- Wyvern Sting rank 5 and 6 not avail. till wotlk
+DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (-49011, -49012);
+
+-- typo
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (43468, 43648);
+INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43648, 44007, 1, 'Storm Eye Safe Zone');
+
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index c0065212207..c57b8a27fb9 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -219,7 +219,8 @@ void Creature::RemoveCorpse()
float x,y,z,o;
GetRespawnCoord(x, y, z, &o);
- GetMap()->CreatureRelocation(this,x,y,z,o);
+ SetHomePosition(x,y,z,o);
+ GetMap()->CreatureRelocation(this,x,y,z,o);
}
/**
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index bf23a724520..51fba0b48ed 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -868,8 +868,7 @@ enum Targets
TARGET_DEST_TARGET_ENEMY = 53,
TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54,
TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell
- TARGET_RANDOM_RAID_MEMBER = 56,
- //TARGET_UNIT_AREA_RAID
+ TARGET_UNIT_RAID = 56,
TARGET_SINGLE_FRIEND_2 = 57,
TARGET_UNIT_TARGET_RAID = 57,
TARGET_UNIT_CONE_ALLY = 59,
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index ffac28c7c58..b3930a85520 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1473,6 +1473,12 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
case TARGET_UNIT_PARTY_CASTER:
m_caster->GetPartyMember(TagUnitMap, radius);
break;
+ case TARGET_UNIT_RAID:
+ if(Unit *target = m_targets.getUnitTarget())
+ TagUnitMap.push_back(target);
+ else
+ m_caster->GetRaidMember(TagUnitMap, radius);
+ break;
}
}break;
@@ -1759,13 +1765,6 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
TagUnitMap.push_back(m_caster);
break;
}
-
- case TARGET_RANDOM_RAID_MEMBER:
- {
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- if(Player* target = ((Player*)m_caster)->GetNextRandomRaidMember(radius))
- TagUnitMap.push_back(target);
- }break;
case TARGET_CHAIN_HEAL:
{
Unit* pUnitTarget = m_targets.getUnitTarget();
@@ -3914,7 +3913,7 @@ uint8 Spell::CanCast(bool strict)
SkillValue = 0;
// add the damage modifier from the spell casted (cheat lock / skeleton key etc.) (use m_currentBasePoints, CalculateDamage returns wrong value)
- SkillValue += m_currentBasePoints[i]+1;
+ SkillValue += m_currentBasePoints[i]/*+1*/;
// get the required lock value
int32 ReqValue=0;
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 36feb9b9375..1597b4a2b25 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -342,7 +342,7 @@ m_periodicTimer(0), m_PeriodicEventId(0), m_AuraDRGroup(DIMINISHING_NONE)
if(!caster)
{
m_caster_guid = target->GetGUID();
- damage = m_currentBasePoints+1; // stored value-1
+ //damage = m_currentBasePoints+1; // stored value-1
m_maxduration = target->CalculateSpellDuration(m_spellProto, m_effIndex, target);
}
else
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 432682d618e..705a69ea2a4 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -81,6 +81,7 @@ SpellMgr::SpellMgr()
case TARGET_UNIT_MASTER:
case TARGET_UNIT_PET:
case TARGET_UNIT_PARTY_CASTER:
+ case TARGET_UNIT_RAID:
SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER;
break;
case TARGET_UNIT_MINIPET:
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e00b2446010..86d1d23be75 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12943,8 +12943,25 @@ bool Unit::IsInRaidWith(Unit const *unit) const
return false;
}
-void Unit::GetRaidMember(std::list<Unit*> &TagUnitMap, float radius)
+void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
{
+ Player *owner = GetCharmerOrOwnerPlayerOrPlayerItself();
+ if(!owner)
+ return;
+
+ Group *pGroup = owner->GetGroup();
+ if(!pGroup)
+ return;
+
+ for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
+ {
+ Player* Target = itr->getSource();
+
+ // IsHostileTo check duel and controlled by enemy
+ if( Target && Target != this && Target->isAlive()
+ && IsWithinDistInMap(Target, radius) && !IsHostileTo(Target) )
+ nearMembers.push_back(Target);
+ }
}
void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
@@ -12986,17 +13003,23 @@ void Unit::GetPartyMember(std::list<Unit*> &TagUnitMap, float radius)
void Unit::AddAura(uint32 spellId, Unit* target)
{
- if(!target)
+ if(!target || !target->isAlive())
return;
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if(!spellInfo)
return;
+ if (target->IsImmunedToSpell(spellInfo))
+ return;
+
for(uint32 i = 0; i < 3; ++i)
{
if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA)
{
+ if(target->IsImmunedToSpellEffect(spellInfo->Effect[i], spellInfo->EffectMechanic[i]))
+ continue;
+
if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER)
{
Aura *Aur = CreateAura(spellInfo, i, NULL, this, this);
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index c18c09bcc17..fc0ca9e8007 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -34,7 +34,7 @@ void WaypointStore::Free()
void WaypointStore::Load()
{
- QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data");
+ QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data`");
if(!result)
{
sLog.outError(" an error occured while loading the table `waypoint_data` ( maybe it doesn't exist ?)\n");
@@ -44,7 +44,6 @@ void WaypointStore::Load()
records = (*result)[0].GetUInt32();
delete result;
-
result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`");
if(!result)
{
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 71d05d073d2..85ef44b51be 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -15,24 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-//Basic header
-#include <ctime>
-
+//Basic headers
#include "WaypointMovementGenerator.h"
#include "DestinationHolderImp.h"
-//Accessors
-#include "Database/DatabaseEnv.h"
+//Extended headers
#include "ObjectMgr.h"
#include "World.h"
//Creature-specific headers
#include "Creature.h"
#include "CreatureAI.h"
-//Player-Specific
+//Player-specific
#include "Player.h"
-//Visual
-#include "ProgressBar.h"
-#include "MapManager.h"
template<class T>
void
@@ -42,6 +35,8 @@ template<>
void
WaypointMovementGenerator<Creature>::Initialize(Creature &u)
{
+ u.StopMoving();
+ i_nextMoveTime.Reset(0);
i_currentNode = -1;
if(!path_id)
path_id = u.GetWaypointPath();
@@ -160,6 +155,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
i_currentNode = 0; //Start moving all over again
else
{
+ unit.SetHomePosition(node.x, node.y, node.z, unit.GetOrientation());
unit.GetMotionMaster()->Initialize();
return false; //Clear the waypoint movement
}
@@ -184,6 +180,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
MovementInform(unit);
unit.UpdateWaypointID(i_currentNode);
unit.clearUnitState(UNIT_STAT_MOVING);
+ unit.Relocate(node.x, node.y, node.z);
}
}
else