Projekt

Allgemein

Profil

Fehler #7449 » body_of_evidence.diff

B2B-guelfey, 08.04.2016 12:07

Unterschiede anzeigen:

src/scriptdev2/scripts/outland/nagrand.cpp
546 546
    return new npc_rethhedronAI(pCreature);
547 547
}
548 548

  
549
enum
550
{
551
    EVENT_ID_DAMP_WOOLEN_BLANKET = 11675,
552
    QUEST_BODY_OF_PROOF = 9932,
553
    KILLCREDIT_BODY_OF_PROOF = 18395,
554
    NPC_SABOTEUR = 18396,
555
    NPC_CORPSE = 18397,
556

  
557
    //SPELL_SPEAR_THROW = 32248,
558

  
559
    OTHER_OGRE_START = 13,
560

  
561
    YELL_BOULDERFIST_SUMMON = -1001173,
562
    SAY_BOULDERFIST_INTRO_1 = -1001174,
563
    SAY_BOULDERFIST_INTRO_2 = -1001175,
564
    SAY_BOULDERFIST_INTRO_3 = -1001176,
565
    SAY_BOULDERFIST_CORPSE = -1001177,
566
    BOULDERFIST_CORPSETEXTS = 5,
567
    SAY_BOULDERFIST_EXIT = -1001182,
568
};
569

  
570
struct npc_boulderfist_saboteurAI : public npc_escortAI
571
{
572
    bool m_first;
573

  
574

  
575
    npc_boulderfist_saboteurAI(Creature* pCreature) : npc_escortAI(pCreature) {
576
        Reset();
577
        m_first = false;
578
    }
579

  
580
    void WaypointReached(uint32 i) override {
581
        // waypoints up to TODO are for ogre 1, other are for ogre 2
582
        Player *pPlayer = GetPlayerForEscort();
583
        switch (i) {
584
        case 2:
585
            SetRun(false);
586
            DoScriptText(SAY_BOULDERFIST_INTRO_1, m_creature);
587
            break;
588
        case 4:
589
            DoScriptText(SAY_BOULDERFIST_INTRO_3, m_creature);
590
            break;
591
        case 11:
592
            DoScriptText(SAY_BOULDERFIST_EXIT, m_creature);
593
            SetRun(true);
594
            if (pPlayer)
595
                pPlayer->KilledMonsterCredit(KILLCREDIT_BODY_OF_PROOF);
596
            break;
597
        case OTHER_OGRE_START - 1:
598
            if (m_first)
599
                m_creature->ForcedDespawn();
600
            break;
601
        case OTHER_OGRE_START:
602
            SetRun(false);
603
            break;
604
        case OTHER_OGRE_START + 1:
605
            m_creature->SetOrientation(3.67f);
606
            break;
607
        case OTHER_OGRE_START + 2:
608
            DoScriptText(SAY_BOULDERFIST_INTRO_2, m_creature);
609
            break;
610
        case 22:
611
            SetRun(true);
612
            break;
613
        }
614
        if ((i >= 6 && i <= 10) || (i >= 18 && i <= 22)) {
615
            DoScriptText(SAY_BOULDERFIST_CORPSE - urand(0, BOULDERFIST_CORPSETEXTS - 1), m_creature);
616
            Creature* corpse = DoSpawnCreature(NPC_CORPSE, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
617
            corpse->SetDeathState(JUST_DIED);
618
        }
619
    }
620

  
621
    void Aggro(Unit *pWho) override {
622
        DoCastSpellIfCan(pWho, SPELL_SPEAR_THROW);
623
    }
624

  
625
    void JustStartedEscort() override {
626
        if (!m_first) {
627
            SetEscortPaused(true);
628
            SetCurrentWaypoint(OTHER_OGRE_START);
629
            SetEscortPaused(false);
630
            DoScriptText(YELL_BOULDERFIST_SUMMON, m_creature);
631
        }
632
    }
633

  
634
    void JustDied(Unit*) override {
635
        Player *pPlayer = GetPlayerForEscort();
636
        pPlayer->FailQuest(QUEST_BODY_OF_PROOF);
637
    }
638

  
639
    void Reset() override {    }
640
};
641

  
642
CreatureAI* GetAI_npc_boulderfist_saboteur(Creature *pCreature)
643
{
644
    return new npc_boulderfist_saboteurAI(pCreature);
645
}
646

  
647
bool ProcessEventId_event_damp_woolen_blanket(uint32 uiEventId, Object *pSource, Object *pTarget, bool bIsStart)
648
{
649
    if (uiEventId == EVENT_ID_DAMP_WOOLEN_BLANKET)
650
    {
651
        Player* pPlayer = (Player*)pSource;
652
        if (pPlayer->GetQuestStatus(QUEST_BODY_OF_PROOF) == QUEST_STATUS_INCOMPLETE) {
653
            Creature* ogre1 = ((Player*)pSource)->SummonCreature(NPC_SABOTEUR, -902.2072, 7700.6089, 38.2642, 0.7703, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
654
            Creature* ogre2 = ((Player*)pSource)->SummonCreature(NPC_SABOTEUR, -898.8185, 7697.8662, 38.9290, 0.8921, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
655
            npc_boulderfist_saboteurAI* ai1 = (npc_boulderfist_saboteurAI*)ogre1->AI();
656
            npc_boulderfist_saboteurAI* ai2 = (npc_boulderfist_saboteurAI*)ogre2->AI();
657
            ai1->m_first = true;
658
            ai1->Start(true, pPlayer, nullptr);
659
            ai2->Start(true, pPlayer, nullptr);
660
        }
661
        return true;
662
    }
663
    return false;
664
}
665

  
549 666
void AddSC_nagrand()
550 667
{
551 668
    Script* pNewScript;
......
570 687
    pNewScript->Name = "npc_rethhedron";
571 688
    pNewScript->GetAI = &GetAI_npc_rethhedron;
572 689
    pNewScript->RegisterSelf();
690

  
691
    pNewScript = new Script;
692
    pNewScript->Name = "event_damp_woolen_blanket";
693
    pNewScript->pProcessEventId = &ProcessEventId_event_damp_woolen_blanket;
694
    pNewScript->RegisterSelf();
695

  
696
    pNewScript = new Script;
697
    pNewScript->Name = "npc_boulderfist_saboteur";
698
    pNewScript->GetAI = &GetAI_npc_boulderfist_saboteur;
699
    pNewScript->RegisterSelf();
573 700
}
(1-1/4)