Changeset 203
- Timestamp:
- 11/19/08 13:45:59 (17 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 removed
- 10 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/include/sc_creature.cpp
r186 r203 201 201 m_creature->AttackerStateUpdate(m_creature->getVictim()); 202 202 m_creature->resetAttackTimer(); 203 } 204 } 205 if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->IsNonMeleeSpellCasted(false)) 206 { 207 //If we are within range melee the target 208 if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE)) 209 { 210 m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK); 211 m_creature->resetAttackTimer(OFF_ATTACK); 203 212 } 204 213 } -
trunk/src/bindings/scripts/include/sc_creature.h
r202 r203 182 182 void AttackStart(Unit *); 183 183 }; 184 185 struct TRINITY_DLL_DECL NullCreatureAI : public CreatureAI 186 { 187 NullCreatureAI(Creature* c) : m_creature(c) {} 188 ~NullCreatureAI() {} 189 190 Creature *m_creature; 191 192 void MoveInLineOfSight(Unit *) {} 193 void AttackStart(Unit *) {} 194 void EnterEvadeMode() {} 195 bool IsVisible(Unit *) const { return false; } 196 197 void UpdateAI(const uint32) {} 198 }; 199 184 200 #endif -
trunk/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp
r186 r203 72 72 #define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) 73 73 #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) 74 #define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic 74 75 #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 :( 75 76 #define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY … … 554 555 { 555 556 GlaiveGUID[i] = Glaive->GetGUID(); 556 Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NO N_ATTACKABLE);557 Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 557 558 Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); 558 559 Glaive->setFaction(m_creature->getFaction()); … … 571 572 { 572 573 GlaiveGUID[i] = Glaive->GetGUID(); 573 Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NO N_ATTACKABLE);574 Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 574 575 Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686); 575 576 Glaive->setFaction(m_creature->getFaction()); … … 1338 1339 Elite->AddThreat(m_creature, 1000000.0f); 1339 1340 AttackStart(Elite); 1341 m_creature->AddThreat(Elite, 1000000.0f); 1340 1342 } 1341 1343 Timer = 10000 + rand()%6000; … … 1350 1352 } 1351 1353 1352 if(!m_creature->SelectHostilTarget() ||!m_creature->getVictim())1354 if(!m_creature->SelectHostilTarget() && !m_creature->getVictim()) 1353 1355 return; 1354 1356 … … 1742 1744 if( m_creature->isAttackReady() && m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE)) 1743 1745 { 1744 if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) )1745 { 1746 m_creature-> getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true, 0, 0, IllidanGUID); //do not stack1746 if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0)) 1747 { 1748 m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack 1747 1749 } 1748 1750 m_creature->AttackerStateUpdate(m_creature->getVictim()); … … 1913 1915 1914 1916 m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135); 1917 m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN2); 1915 1918 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 1916 1919 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); … … 1927 1930 switch(summon->GetEntry()) 1928 1931 { 1932 case PARASITIC_SHADOWFIEND: 1929 1933 case SHADOW_DEMON: 1930 1934 { … … 2159 2163 m_creature->RemoveAllAuras(); 2160 2164 m_creature->InterruptNonMeleeSpells(false); 2161 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NO N_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);2165 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 2162 2166 m_creature->GetMotionMaster()->Clear(false); 2163 2167 m_creature->AttackStop(); -
trunk/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp
r160 r203 28 28 #define SPELL_MOLTEN_PUNCH 40126 29 29 #define SPELL_HURTFUL_STRIKE 41926 30 #define SPELL_MOLTEN_FLAME 40 25330 #define SPELL_MOLTEN_FLAME 40980 31 31 #define SPELL_VOLCANIC_ERUPTION 40117 32 32 #define SPELL_VOLCANIC_SUMMON 40276 … … 36 36 #define CREATURE_STALKER 23095 37 37 38 struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI 39 { 40 molten_flameAI(Creature *c) : ScriptedAI(c) 41 { 42 FlameTimer = 0; 38 struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI 39 { 40 molten_flameAI(Creature *c) : NullCreatureAI(c) 41 { 43 42 float x, y, z; 44 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);45 43 m_creature->GetNearPoint(m_creature, x, y, z, 1, 50, M_PI*2*rand_norm()); 46 44 m_creature->GetMotionMaster()->MovePoint(0, x, y, z); 47 45 } 48 49 uint32 FlameTimer;50 51 void Reset() {}52 void Aggro(Unit *who) {}53 void AttackStart(Unit* who) {}54 void MoveInLineOfSight(Unit *who) {}55 void UpdateAI(const uint32 diff)56 {57 if(FlameTimer < diff)58 {59 m_creature->CastSpell(m_creature, SPELL_MOLTEN_FLAME, true);60 FlameTimer = 1000;61 }else FlameTimer -= diff;62 }63 };64 65 struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI66 {67 npc_volcanoAI(Creature *c) : ScriptedAI(c)68 {69 m_creature->CastSpell(m_creature, SPELL_VOLCANIC_ERUPTION, false);70 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);71 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);72 }73 74 void Reset() {}75 void Aggro(Unit *who) {}76 void AttackStart(Unit* who) {}77 void MoveInLineOfSight(Unit* who) {}78 void UpdateAI(const uint32 diff) {}79 46 }; 80 47 … … 264 231 } 265 232 266 CreatureAI* GetAI_npc_volcano(Creature *_Creature)267 {268 return new npc_volcanoAI (_Creature);269 }270 271 233 void AddSC_boss_supremus() 272 234 { … … 281 243 newscript->GetAI = GetAI_molten_flame; 282 244 m_scripts[nrscripts++] = newscript; 283 284 newscript = new Script;285 newscript->Name="npc_volcano";286 newscript->GetAI = GetAI_npc_volcano;287 m_scripts[nrscripts++] = newscript;288 245 } -
trunk/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
r166 r203 228 228 m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); 229 229 m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); 230 m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN2); 230 231 m_creature->addUnitState(UNIT_STAT_STUNNED); 231 232 m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true); -
trunk/src/game/GameObject.cpp
r146 r203 1283 1283 trigger->CastSpell(target, spell, true); 1284 1284 } 1285 } 1285 //trigger->setDeathState(JUST_DIED); 1286 //trigger->RemoveCorpse(); 1287 } -
trunk/src/game/Object.cpp
r178 r203 602 602 { 603 603 if(target->isGameMaster()) 604 *data << cinfo->Modelid1; 604 { 605 if(cinfo->Modelid2) 606 *data << cinfo->Modelid1; 607 else 608 *data << 17519; // world invisible trigger's model 609 } 605 610 else 606 *data << cinfo->Modelid3; 611 { 612 if(cinfo->Modelid2) 613 *data << cinfo->Modelid2; 614 else 615 *data << 11686; // world invisible trigger's model 616 } 607 617 } 608 618 else -
trunk/src/game/Player.cpp
r200 r203 16407 16407 // send data at target visibility change (adding to client) 16408 16408 if((*i)!=this && (*i)->isType(TYPEMASK_UNIT)) 16409 { 16409 16410 SendAuraDurationsForTarget(*i); 16411 //if(((Unit*)(*i))->isAlive()) //should be always alive 16412 { 16413 if((*i)->GetTypeId()==TYPEID_UNIT) 16414 ((Creature*)(*i))->SendMonsterMoveWithSpeedToCurrentDestination(this); 16415 if(((Unit*)(*i))->getVictim()) 16416 ((Unit*)(*i))->SendAttackStart(((Unit*)(*i))->getVictim()); 16417 } 16418 } 16410 16419 16411 16420 i = stealthedUnits.erase(i); … … 17387 17396 // send data at target visibility change (adding to client) 17388 17397 if(target!=this && target->isType(TYPEMASK_UNIT)) 17398 { 17389 17399 SendAuraDurationsForTarget((Unit*)target); 17390 17391 if(target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->isAlive()) 17392 ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this); 17400 if(((Unit*)target)->isAlive()) 17401 { 17402 if(target->GetTypeId()==TYPEID_UNIT) 17403 ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this); 17404 if(((Unit*)target)->getVictim()) 17405 ((Unit*)target)->SendAttackStart(((Unit*)target)->getVictim()); 17406 } 17407 } 17393 17408 } 17394 17409 } -
trunk/src/game/Spell.cpp
r197 r203 1013 1013 // for delayed spells ignore negative spells (after duel end) for friendly targets 1014 1014 // TODO: this cause soul transfer bugged 1015 if(m_spellInfo->speed > 0.0f && !IsPositiveSpell(m_spellInfo->Id))1015 if(m_spellInfo->speed > 0.0f && unit->GetTypeId() == TYPEID_PLAYER && !IsPositiveSpell(m_spellInfo->Id)) 1016 1016 { 1017 1017 m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); -
trunk/src/game/Unit.h
r186 r203 943 943 void DeMorph(); 944 944 945 void SendAttackStart(Unit* pVictim); 945 946 void SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount); 946 947 void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false); … … 1353 1354 private: 1354 1355 void SendAttackStop(Unit* victim); // only from AttackStop(Unit*) 1355 void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)1356 //void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*) 1356 1357 1357 1358 void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask );