aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-09 14:54:13 -0600
committermegamage <none@none>2008-11-09 14:54:13 -0600
commitee02a2fc84c564d82a062bd975281a4e4f0fefa0 (patch)
tree5bb99bbf8fae0f83fad278e766e1df2e80197be1
parent2c83fc42fc0bd963940047b1088f91c8b7474799 (diff)
[svn] Send AttackStart package when update visibility.
Update DoMeleeAttackIfReady to support dual wield. Show player modelid2 instead id3 of triggers. This should fix the bug that gameobject::castspell summon a human model. Remove the correct flag to make creature attackable. This should fix the bug that Illidan and Magtheridon are unattackable. Add NullCreatureAI for trinityscript. Fix channeler's soul transfer. Some update of black temple scripts. --HG-- branch : trunk
-rw-r--r--sql/updates/211_world_blacktemple.sql (renamed from sql/updates/194_world_blacktemple.sql)11
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp9
-rw-r--r--src/bindings/scripts/include/sc_creature.h16
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp16
-rw-r--r--src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp49
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp1
-rw-r--r--src/game/GameObject.cpp2
-rw-r--r--src/game/Object.cpp14
-rw-r--r--src/game/Player.cpp21
-rw-r--r--src/game/Spell.cpp2
-rw-r--r--src/game/Unit.h3
11 files changed, 82 insertions, 62 deletions
diff --git a/sql/updates/194_world_blacktemple.sql b/sql/updates/211_world_blacktemple.sql
index c2aab72d425..b99f6d05764 100644
--- a/sql/updates/194_world_blacktemple.sql
+++ b/sql/updates/211_world_blacktemple.sql
@@ -1,14 +1,15 @@
-DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (39992, 39835, 42052, -41914, 41126, -41376);
+DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (39992, 39835, 42052, -41914, -41917, 41126, -41376);
-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (39992, 39835, 1, 'Needle Spine');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (39835, 39968, 1, 'Needle Spine');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-41376, 41377, 0, 'Spite');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (41126, 41131, 1, 'Flame Crash');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-41914, 41915, 0, 'Summon Parasitic Shadowfiend');
+INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-41917, 41915, 0, 'Summon Parasitic Shadowfiend');
INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (39908, 40017, 1, 'Eye Blast');
-- molten_flame
-UPDATE creature_template SET flags_extra = 128, speed = 1.0 WHERE entry = 23095;
+UPDATE creature_template SET spell1 = 40980, flags_extra = 128, speed = 1.0, scriptname = 'molten_flame' WHERE entry = 23095;
-- volcano
UPDATE creature_template SET spell1 = 40117, flags_extra = 128, scriptname = '' WHERE entry = 23085;
-- flame crash
@@ -16,4 +17,8 @@ update creature_template set spell1 = 40836, flags_extra = 128, scriptname = ''
-- blaze
update creature_template set spell1 = 40610, flags_extra = 128, scriptname = '' where entry = 23259;
-- glaive
-update creature_template set scriptname = 'mob_blade_of_azzinoth' where entry = 22996; \ No newline at end of file
+update creature_template set scriptname = 'mob_blade_of_azzinoth' where entry = 22996;
+-- parasitic shadowfiend
+update creature_template set scriptname = 'mob_parasitic_shadowfiend' where entry = 23498;
+-- Maiev
+update creature_template set minlevel = 73, maxlevel = 73, minhealth = 500000, maxhealth = 500000, mindmg = 3000, maxdmg = 4000 where entry = 23197; \ No newline at end of file
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index 5848623ab2d..e4f90d5b40b 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -202,6 +202,15 @@ void ScriptedAI::DoMeleeAttackIfReady()
m_creature->resetAttackTimer();
}
}
+ if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->IsNonMeleeSpellCasted(false))
+ {
+ //If we are within range melee the target
+ if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
+ {
+ m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
+ m_creature->resetAttackTimer(OFF_ATTACK);
+ }
+ }
}
void ScriptedAI::DoStopAttack()
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h
index 82f44ef1e2f..99ca4672f65 100644
--- a/src/bindings/scripts/include/sc_creature.h
+++ b/src/bindings/scripts/include/sc_creature.h
@@ -181,4 +181,20 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
//Called at each attack of m_creature by any victim
void AttackStart(Unit *);
};
+
+struct TRINITY_DLL_DECL NullCreatureAI : public CreatureAI
+{
+ NullCreatureAI(Creature* c) : m_creature(c) {}
+ ~NullCreatureAI() {}
+
+ Creature *m_creature;
+
+ void MoveInLineOfSight(Unit *) {}
+ void AttackStart(Unit *) {}
+ void EnterEvadeMode() {}
+ bool IsVisible(Unit *) const { return false; }
+
+ void UpdateAI(const uint32) {}
+};
+
#endif
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
index 628329ab11b..a62ad8cae7c 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
@@ -71,6 +71,7 @@ EndScriptData */
#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him.
#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect)
#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off)
+#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic
#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :(
#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY
#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY
@@ -553,7 +554,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(Glaive)
{
GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
Glaive->setFaction(m_creature->getFaction());
DoCast(Glaive, SPELL_THROW_GLAIVE2);
@@ -570,7 +571,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(Glaive)
{
GlaiveGUID[i] = Glaive->GetGUID();
- Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
Glaive->setFaction(m_creature->getFaction());
DoCast(Glaive, SPELL_THROW_GLAIVE, true);
@@ -1337,6 +1338,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
Elite->AI()->AttackStart(m_creature);
Elite->AddThreat(m_creature, 1000000.0f);
AttackStart(Elite);
+ m_creature->AddThreat(Elite, 1000000.0f);
}
Timer = 10000 + rand()%6000;
GETUNIT(Illidan, IllidanGUID);
@@ -1349,7 +1351,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
}
}
- if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
+ if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
return;
if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
@@ -1741,9 +1743,9 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
{
if( m_creature->isAttackReady() && m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
{
- if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
+ if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
{
- m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true, 0, 0, IllidanGUID); //do not stack
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
}
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
@@ -1912,6 +1914,7 @@ void boss_illidan_stormrageAI::Reset()
TransformCount = 0;
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN2);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
@@ -1926,6 +1929,7 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
{
switch(summon->GetEntry())
{
+ case PARASITIC_SHADOWFIEND:
case SHADOW_DEMON:
{
if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players.
@@ -2158,7 +2162,7 @@ void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
Timer[EVENT_FLIGHT_SEQUENCE] = 1;
m_creature->RemoveAllAuras();
m_creature->InterruptNonMeleeSpells(false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->GetMotionMaster()->Clear(false);
m_creature->AttackStop();
}
diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
index 30570690540..d6b2e08fac0 100644
--- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
+++ b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
@@ -27,7 +27,7 @@ EndScriptData */
//Spells
#define SPELL_MOLTEN_PUNCH 40126
#define SPELL_HURTFUL_STRIKE 41926
-#define SPELL_MOLTEN_FLAME 40253
+#define SPELL_MOLTEN_FLAME 40980
#define SPELL_VOLCANIC_ERUPTION 40117
#define SPELL_VOLCANIC_SUMMON 40276
#define SPELL_BERSERK 45078
@@ -35,47 +35,14 @@ EndScriptData */
#define CREATURE_VOLCANO 23085
#define CREATURE_STALKER 23095
-struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI
+struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI
{
- molten_flameAI(Creature *c) : ScriptedAI(c)
+ molten_flameAI(Creature *c) : NullCreatureAI(c)
{
- FlameTimer = 0;
float x, y, z;
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->GetNearPoint(m_creature, x, y, z, 1, 50, M_PI*2*rand_norm());
m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
}
-
- uint32 FlameTimer;
-
- void Reset() {}
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit *who) {}
- void UpdateAI(const uint32 diff)
- {
- if(FlameTimer < diff)
- {
- m_creature->CastSpell(m_creature, SPELL_MOLTEN_FLAME, true);
- FlameTimer = 1000;
- }else FlameTimer -= diff;
- }
-};
-
-struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
-{
- npc_volcanoAI(Creature *c) : ScriptedAI(c)
- {
- m_creature->CastSpell(m_creature, SPELL_VOLCANIC_ERUPTION, false);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
- m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void Reset() {}
- void Aggro(Unit *who) {}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
- void UpdateAI(const uint32 diff) {}
};
struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
@@ -263,11 +230,6 @@ CreatureAI* GetAI_molten_flame(Creature *_Creature)
return new molten_flameAI (_Creature);
}
-CreatureAI* GetAI_npc_volcano(Creature *_Creature)
-{
- return new npc_volcanoAI (_Creature);
-}
-
void AddSC_boss_supremus()
{
Script *newscript;
@@ -280,9 +242,4 @@ void AddSC_boss_supremus()
newscript->Name="molten_flame";
newscript->GetAI = GetAI_molten_flame;
m_scripts[nrscripts++] = newscript;
-
- newscript = new Script;
- newscript->Name="npc_volcano";
- newscript->GetAI = GetAI_npc_volcano;
- m_scripts[nrscripts++] = newscript;
}
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
index 1424435354a..4d7fe35891d 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
@@ -227,6 +227,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN2);
m_creature->addUnitState(UNIT_STAT_STUNNED);
m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true);
}
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index fbeb30144bb..595759a5451 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1282,4 +1282,6 @@ void GameObject::CastSpell(Unit* target, uint32 spell)
trigger->setFaction(14);
trigger->CastSpell(target, spell, true);
}
+ //trigger->setDeathState(JUST_DIED);
+ //trigger->RemoveCorpse();
} \ No newline at end of file
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 568e9a90a31..0ceb71367ca 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -601,9 +601,19 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
if(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
{
if(target->isGameMaster())
- *data << cinfo->Modelid1;
+ {
+ if(cinfo->Modelid2)
+ *data << cinfo->Modelid1;
+ else
+ *data << 17519; // world invisible trigger's model
+ }
else
- *data << cinfo->Modelid3;
+ {
+ if(cinfo->Modelid2)
+ *data << cinfo->Modelid2;
+ else
+ *data << 11686; // world invisible trigger's model
+ }
}
else
*data << m_uint32Values[ index ];
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index b00dadc98dd..23aae2cd363 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -16406,7 +16406,16 @@ void Player::HandleStealthedUnitsDetection()
// target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
if((*i)!=this && (*i)->isType(TYPEMASK_UNIT))
+ {
SendAuraDurationsForTarget(*i);
+ //if(((Unit*)(*i))->isAlive()) //should be always alive
+ {
+ if((*i)->GetTypeId()==TYPEID_UNIT)
+ ((Creature*)(*i))->SendMonsterMoveWithSpeedToCurrentDestination(this);
+ if(((Unit*)(*i))->getVictim())
+ ((Unit*)(*i))->SendAttackStart(((Unit*)(*i))->getVictim());
+ }
+ }
i = stealthedUnits.erase(i);
continue;
@@ -17386,10 +17395,16 @@ void Player::UpdateVisibilityOf(WorldObject* target)
// target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
if(target!=this && target->isType(TYPEMASK_UNIT))
+ {
SendAuraDurationsForTarget((Unit*)target);
-
- if(target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->isAlive())
- ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this);
+ if(((Unit*)target)->isAlive())
+ {
+ if(target->GetTypeId()==TYPEID_UNIT)
+ ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this);
+ if(((Unit*)target)->getVictim())
+ ((Unit*)target)->SendAttackStart(((Unit*)target)->getVictim());
+ }
+ }
}
}
}
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4570e7590cc..95f315c5c13 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1012,7 +1012,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
// TODO: this cause soul transfer bugged
- if(m_spellInfo->speed > 0.0f && !IsPositiveSpell(m_spellInfo->Id))
+ if(m_spellInfo->speed > 0.0f && unit->GetTypeId() == TYPEID_PLAYER && !IsPositiveSpell(m_spellInfo->Id))
{
m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
return;
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 0f2949b6ee3..61dcaf0d1cd 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -942,6 +942,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void DeMorph();
+ void SendAttackStart(Unit* pVictim);
void SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo);
@@ -1352,7 +1353,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
private:
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
- void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
+ //void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask );
bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);