void HandleScript(SpellEffIndex /*effIndex*/)
        {
            Creature* target = GetHitUnit()->ToCreature();
            if (!target)
                return;

            target->ExitVehicle();
            DynamicObject* dynamicObject = GetCaster()->GetDynObject(SPELL_SEISMIC_SHARD_TARGETING);
            target->CastSpell(dynamicObject->GetPositionX(), dynamicObject->GetPositionY(), dynamicObject->GetPositionZ(), SPELL_SEISMIC_SHARD_MISSLE, true);
        }
Пример #2
0
 void WaypointReached(uint32 i)
 {
     Player* pPlayer = GetPlayerForEscort();
     if (!pPlayer)
         return;
     switch (i)
     {
         case 9:
             Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 100.0f);
             break;
         case 10:
             if (Mrfloppy)
             {
                 DoScriptText(SAY_WORGHAGGRO1, m_creature);
                 m_creature->SummonCreature(NPC_HUNGRY_WORG,m_creature->GetPositionX()+5,m_creature->GetPositionY()+2,m_creature->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
             }
             break;
         case 11:
             Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
             break;
         case 17:
             Mrfloppy->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
             DoScriptText(SAY_WORGRAGGRO3, m_creature);
             RWORG = m_creature->SummonCreature(NPC_RAVENOUS_WORG,m_creature->GetPositionX()+10,m_creature->GetPositionY()+8,m_creature->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
             RWORG->setFaction(35);
             break;
         case 18:
             if (Mrfloppy)
             {
                 RWORG->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
                 DoCast(Mrfloppy,SPELL_MRFLOPPY);
             }
             break;
         case 19:
             if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0))
                 Mrfloppy->EnterVehicle(RWORG);
             break;
         case 20:
             if (Mrfloppy)
                 RWORG->HandleEmoteCommand(34);
             break;
         case 21:
             if (Mrfloppy)
             {
                 RWORG->Kill(Mrfloppy);
                 Mrfloppy->ExitVehicle();
                 RWORG->setFaction(14);
                 RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10,RWORG->GetPositionY()+80,RWORG->GetPositionZ());
                 DoScriptText(SAY_VICTORY2, m_creature);
             }
             break;
         case 22:
             if (Mrfloppy && Mrfloppy->isDead())
             {
                 RWORG->DisappearAndDie();
                 m_creature->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
                 Mrfloppy->setDeathState(ALIVE);
                 Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
                 DoScriptText(SAY_VICTORY3, m_creature);
             }
             break;
         case 24:
             if (pPlayer)
             {
                 Completed = true;
                 pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, m_creature);
                 DoScriptText(SAY_QUEST_COMPLETE, m_creature, pPlayer);
             }
             m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
             break;
         case 25:
             DoScriptText(SAY_VICTORY4, m_creature);
             break;
         case 27:
             m_creature->DisappearAndDie();
             if (Mrfloppy)
                 Mrfloppy->DisappearAndDie();
             break;
     }
 }