void SummonBeams()
 {
     Creature* beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0);
     if (beamer)
     {
         beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
         beamer->SetDisplayId(11686);  //invisible
         beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
         beams[0]=beamer->GetGUID();
     }
     beamer = beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0);
     if (beamer)
     {
         beamer->CastSpell(me,SPELL_BLUE_BEAM,true);
         beamer->SetDisplayId(11686);  //invisible
         beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
         beams[1]=beamer->GetGUID();
     }
 }
Example #2
0
bool GOHello_go_scourge_enclosure(Player *pPlayer, GameObject *pGO)
{
    Creature *pGymerDummy;
    if (pPlayer->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE &&
            (pGymerDummy = pGO->FindNearestCreature(NPC_GYMER_DUMMY,20.0f)))
    {
        pGO->UseDoorOrButton();
        pPlayer->KilledMonsterCredit(pGymerDummy->GetEntry(),pGymerDummy->GetGUID());
        pGymerDummy->CastSpell(pGymerDummy, 55529, true);
        pGymerDummy->DisappearAndDie();
    }
    return true;
}
 void StartEvent()
 {
     Step = 1;
     EventStarted = true;
     Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
     if (!Arcanagos)
         return;
     ArcanagosGUID = Arcanagos->GetGUID();
     Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
     (*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]);
     Arcanagos->SetOrientation(ArcanagosPos[3]);
     me->SetOrientation(MedivPos[3]);
     YellTimer = 10000;
 }
void WorldSession::HandleQuestgiverStatusQueryMultipleOpcode(WorldPacket& /*recvPacket*/)
{
    sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY");

    uint32 count = 0;

    WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4);
    data << uint32(count);                                  // placeholder

    for (Player::ClientGUIDs::iterator itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr)
    {
        uint8 questStatus = DIALOG_STATUS_NONE;
        uint8 defstatus = DIALOG_STATUS_NONE;

        if (IS_CREATURE_GUID(*itr))
        {
            Creature *questgiver = GetPlayer()->GetMap()->GetCreature(*itr);
            if (!questgiver || questgiver->IsHostileTo(_player))
                continue;
            if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
                continue;
            questStatus = sScriptMgr.GetDialogStatus(_player, questgiver);
            if (questStatus > 6)
                questStatus = getDialogStatus(_player, questgiver, defstatus);

            data << uint64(questgiver->GetGUID());
            data << uint8(questStatus);
            ++count;
        }
        else if (IS_GAMEOBJECT_GUID(*itr))
        {
            GameObject *questgiver = GetPlayer()->GetMap()->GetGameObject(*itr);
            if (!questgiver)
                continue;
            if (questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
                continue;
            questStatus = sScriptMgr.GetDialogStatus(_player, questgiver);
            if (questStatus > 6)
                questStatus = getDialogStatus(_player, questgiver, defstatus);

            data << uint64(questgiver->GetGUID());
            data << uint8(questStatus);
            ++count;
        }
    }

    data.put<uint32>(0, count);                             // write real count
    SendPacket(&data);
}
Example #5
0
        bool CanStartEvent(Player* player)
        {
            if (!isEvent)
            {
                Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f);
                if (!ardonis)
                    return false;

                ardonisGUID = ardonis->GetGUID();
                PlayerGUID = player->GetGUID();

                isEvent = true;

                Turn_to_eachother();
                return true;
            }

            sLog->outDebug(LOG_FILTER_TSCR, "npc_commander_dawnforge event already in progress, need to wait.");
            return false;
        }
void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
{
    if (!i_path || i_path->empty())
        return;
    if (m_isArrivalDone)
        return;

    creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE);
    m_isArrivalDone = true;

    if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
    {
        sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
        creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL);
    }

    // Inform script
    MovementInform(creature);
    creature.UpdateWaypointID(i_currentNode);
    Stop(i_path->at(i_currentNode)->delay);
}
Example #7
0
        void UpdateAI(const uint32 diff)
        {
            if (_phase != PHASE_OUTRO)
                return;

            _events.Update(diff);

            while (uint32 eventId = _events.ExecuteEvent())
            {
                switch (eventId)
                {
                case EVENT_OUTRO_1:
                {
                    if (Creature* temp = me->GetCreature(*me, _instanceScript->GetData64(DATA_JAINA_SYLVANAS_1)))
                        temp->DespawnOrUnsummon();

                    Creature* jainaOrSylvanas = NULL;
                    if (_instanceScript->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
                        jainaOrSylvanas = me->SummonCreature(NPC_JAINA_PART1, outroPos[2], TEMPSUMMON_MANUAL_DESPAWN);
                    else
                        jainaOrSylvanas = me->SummonCreature(NPC_SYLVANAS_PART1, outroPos[2], TEMPSUMMON_MANUAL_DESPAWN);

                    if (jainaOrSylvanas)
                    {
                        jainaOrSylvanas->GetMotionMaster()->MovePoint(0, outroPos[3]);
                        _outroNpcGUID = jainaOrSylvanas->GetGUID();
                    }
                    _events.ScheduleEvent(EVENT_OUTRO_2, 6000);
                    break;
                }
                case EVENT_OUTRO_2:
                    if (Creature* jainaOrSylvanas = ObjectAccessor::GetCreature(*me, _outroNpcGUID))
                    {
                        jainaOrSylvanas->SetFacingToObject(me);
                        me->SetFacingToObject(jainaOrSylvanas);
                        if (_instanceScript->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
                            jainaOrSylvanas->AI()->Talk(SAY_JAYNA_OUTRO_2);
                        else
                            jainaOrSylvanas->AI()->Talk(SAY_SYLVANAS_OUTRO_2);
                    }
                    _events.ScheduleEvent(EVENT_OUTRO_3, 5000);
                    break;
                case EVENT_OUTRO_3:
                    Talk(SAY_KRICK_OUTRO_3);
                    _events.ScheduleEvent(EVENT_OUTRO_4, 18000);
                    break;
                case EVENT_OUTRO_4:
                    if (Creature* jainaOrSylvanas = ObjectAccessor::GetCreature(*me, _outroNpcGUID))
                    {
                        if (_instanceScript->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
                            jainaOrSylvanas->AI()->Talk(SAY_JAYNA_OUTRO_4);
                        else
                            jainaOrSylvanas->AI()->Talk(SAY_SYLVANAS_OUTRO_4);
                    }
                    _events.ScheduleEvent(EVENT_OUTRO_5, 5000);
                    break;
                case EVENT_OUTRO_5:
                    Talk(SAY_KRICK_OUTRO_5);
                    _events.ScheduleEvent(EVENT_OUTRO_6, 1000);
                    break;
                case EVENT_OUTRO_6:
                    if (Creature* tyrannus = me->GetCreature(*me, _instanceScript->GetData64(DATA_TYRANNUS_EVENT)))
                    {
                        tyrannus->SetSpeed(MOVE_FLIGHT, 3.5f, true);
                        tyrannus->GetMotionMaster()->MovePoint(1, outroPos[4]);
                        _tyrannusGUID = tyrannus->GetGUID();
                    }
                    _events.ScheduleEvent(EVENT_OUTRO_7, 5000);
                    break;
                case EVENT_OUTRO_7:
                    if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
                        tyrannus->AI()->Talk(SAY_TYRANNUS_OUTRO_7);
                    _events.ScheduleEvent(EVENT_OUTRO_8, 5000);
                    break;
                case EVENT_OUTRO_8:
                    //! HACK: Creature's can't have MOVEMENTFLAG_FLYING
                    me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
                    me->GetMotionMaster()->MovePoint(0, outroPos[5]);
                    DoCast(me, SPELL_STRANGULATING);
                    _events.ScheduleEvent(EVENT_OUTRO_9, 2000);
                    break;
                case EVENT_OUTRO_9:
                    Talk(SAY_KRICK_OUTRO_8);
                    // TODO: Tyrannus starts killing Krick.
                    // there shall be some visual spell effect
                    if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
                        tyrannus->CastSpell(me, SPELL_NECROMANTIC_POWER, true);  //not sure if it's the right spell :/
                    _events.ScheduleEvent(EVENT_OUTRO_10, 1000);
                    break;
                case EVENT_OUTRO_10:
                    //! HACK: Creature's can't have MOVEMENTFLAG_FLYING
                    me->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
                    me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR);
                    me->GetMotionMaster()->MovePoint(0, outroPos[6]);
                    _events.ScheduleEvent(EVENT_OUTRO_11, 2000);
                    break;
                case EVENT_OUTRO_11:
                    DoCast(me, SPELL_KRICK_KILL_CREDIT); // don't really know if we need it
                    me->SetStandState(UNIT_STAND_STATE_DEAD);
                    me->SetHealth(0);
                    _events.ScheduleEvent(EVENT_OUTRO_12, 3000);
                    break;
                case EVENT_OUTRO_12:
                    if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
                        tyrannus->AI()->Talk(SAY_TYRANNUS_OUTRO_9);
                    _events.ScheduleEvent(EVENT_OUTRO_13, 2000);
                    break;
                case EVENT_OUTRO_13:
                    if (Creature* jainaOrSylvanas = ObjectAccessor::GetCreature(*me, _outroNpcGUID))
                    {
                        if (_instanceScript->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
                            jainaOrSylvanas->AI()->Talk(SAY_JAYNA_OUTRO_10);
                        else
                            jainaOrSylvanas->AI()->Talk(SAY_SYLVANAS_OUTRO_10);
                    }
                    // End of OUTRO. for now...
                    _events.ScheduleEvent(EVENT_OUTRO_END, 3000);
                    if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
                        tyrannus->GetMotionMaster()->MovePoint(0, outroPos[7]);
                    break;
                case EVENT_OUTRO_END:
                    if (Creature* tyrannus = ObjectAccessor::GetCreature(*me, _tyrannusGUID))
                        tyrannus->DespawnOrUnsummon();

                    me->DisappearAndDie();
                    break;
                default:
                    break;
                }
            }
        }