Changeset 180
- Timestamp:
- 11/19/08 13:43:57 (17 years ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
r178 r180 385 385 void Reset(); 386 386 387 void JustSummoned(Creature* summon) 388 { 389 if(summon->GetCreatureInfo()->Entry == SHADOW_DEMON) 390 { 391 Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); 392 if(target && target->GetTypeId() == TYPEID_PLAYER) // only on players. 393 { 394 summon->AddThreat(target, 5000000.0f); 395 summon->AI()->AttackStart(target); 396 } 397 DoZoneInCombat(summon); 398 } 399 } 387 void JustSummoned(Creature* summon); 400 388 401 389 void SummonedCreatureDespawn(Creature* summon) … … 781 769 case EVENT_FLAME_CRASH: 782 770 DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH); 783 Timer[EVENT_FLAME_CRASH] = 3 5000;771 Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; 784 772 break; 785 773 … … 790 778 if(target) 791 779 m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); 780 Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; 792 781 }break; 793 782 … … 798 787 case EVENT_DRAW_SOUL: 799 788 DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL); 800 Timer[EVENT_DRAW_SOUL] = 5 5000;789 Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; 801 790 break; 802 791 … … 1060 1049 1061 1050 void Aggro(Unit *who) {} 1051 void MoveInLineOfSight(Unit *) {} 1062 1052 1063 1053 void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} … … 1691 1681 uint64 TargetGUID; 1692 1682 1693 void Aggro(Unit *who) { }1683 void Aggro(Unit *who) {DoZoneInCombat();} 1694 1684 1695 1685 void Reset() 1696 1686 { 1697 1687 TargetGUID = 0; 1698 DoCast(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true);1688 m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); 1699 1689 } 1700 1690 1701 1691 void JustDied(Unit *killer) 1702 1692 { 1703 Unit* target = Unit::GetUnit((*m_creature), TargetGUID); 1704 if(target) 1693 if(Unit* target = Unit::GetUnit((*m_creature), TargetGUID)) 1705 1694 target->RemoveAurasDueToSpell(SPELL_PARALYZE); 1706 1695 } … … 1708 1697 void UpdateAI(const uint32 diff) 1709 1698 { 1710 if(!m_creature->SelectHostilTarget() ||!m_creature->getVictim()) return;1699 if(!m_creature->SelectHostilTarget() && !m_creature->getVictim()) return; 1711 1700 1712 1701 if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. … … 1935 1924 m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); 1936 1925 m_creature->setActive(false); 1926 } 1927 1928 void boss_illidan_stormrageAI::JustSummoned(Creature* summon) 1929 { 1930 switch(summon->GetEntry()) 1931 { 1932 case SHADOW_DEMON: 1933 { 1934 if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. 1935 { 1936 summon->AddThreat(target, 5000000.0f); 1937 summon->AI()->AttackStart(target); 1938 } 1939 }break; 1940 case MAIEV_SHADOWSONG: 1941 { 1942 summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk 1943 summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 1944 MaievGUID = summon->GetGUID(); 1945 ((boss_maievAI*)summon->AI())->GetIllidanGUID(m_creature->GetGUID()); 1946 ((boss_maievAI*)summon->AI())->EnterPhase(PHASE_TALK_SEQUENCE); 1947 }break; 1948 default: 1949 break; 1950 } 1937 1951 } 1938 1952 … … 2095 2109 void boss_illidan_stormrageAI::SummonMaiev() 2096 2110 { 2097 DoCast(m_creature, SPELL_SHADOW_PRISON, true); 2098 Creature* Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0); 2099 if(Maiev) 2100 { 2101 Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk 2102 Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 2103 MaievGUID = Maiev->GetGUID(); 2104 ((boss_maievAI*)Maiev->AI())->GetIllidanGUID(m_creature->GetGUID()); 2105 ((boss_maievAI*)Maiev->AI())->EnterPhase(PHASE_TALK_SEQUENCE); 2106 } 2107 else // If Maiev cannot be summoned, reset the encounter and post some errors to the console. 2111 m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true); 2112 m_creature->CastSpell(m_creature, 40403, true); 2113 if(!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. 2108 2114 { 2109 2115 EnterEvadeMode(); -
trunk/src/game/Spell.cpp
r176 r180 982 982 983 983 // Recheck immune (only for delayed spells) 984 if( m_spellInfo->speed && ( 985 unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) || 984 if( m_spellInfo->speed && 985 !(m_spellInfo->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) 986 && (unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo),true) || 986 987 unit->IsImmunedToSpell(m_spellInfo,true) )) 987 988 { -
trunk/src/game/SpellEffects.cpp
r178 r180 2634 2634 { 2635 2635 float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); 2636 2637 if(Player* modOwner = m_caster->GetSpellModOwner()) 2636 Unit *caster = m_originalCasterGUID ? m_originalCaster : m_caster; 2637 2638 if(Player* modOwner = caster->GetSpellModOwner()) 2638 2639 modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_RADIUS, radius); 2639 2640 2640 2641 int32 duration = GetSpellDuration(m_spellInfo); 2641 2642 DynamicObject* dynObj = new DynamicObject; 2642 if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius))2643 if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) 2643 2644 { 2644 2645 delete dynObj; … … 2648 2649 dynObj->SetUInt32Value(GAMEOBJECT_DISPLAYID, 368003); 2649 2650 dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x01eeeeee); 2650 m_caster->AddDynObject(dynObj);2651 caster->AddDynObject(dynObj); 2651 2652 MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj); 2652 2653 }