C++ > npc_cork_gizelton

Titrenpc_cork_gizelton
Postée le07-01-2012
Affichée75
Mini-lien
Description

Script

EtatNe contient pas d'erreurs. Ne contient pas d'erreurs.
Code d'insertion
Options
Afficher les numéros de lignes  Mettre la source en plein ecran  Selectionner la source  Partager sur Facebook 
Téléchargement Telecharger en format txt  Telecharger en format pdf  Telecharger en format cpp
Plein ecran
#include "precompiled.h"
#include "escort_ai.h"

enum
{
        //Quete
        QUEST_GARDES_DU_CORPS       = 5821,
       
        //Donneur de quete
    NPC_CORK_GIZELTON           = 11625,
       
        //Mob
        NPC_MOB_1                                       = 4636, //Mob cac
        NPC_MOB_2                                       = 4635  //Mob caster
};

struct MANGOS_DLL_DECL npc_cork_gizeltonAI : public npc_escortAI
{
    npc_cork_gizeltonAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); }
       
        void WaypointReached(uint32 WP)
    {
        switch (WP)
        {
            case 8:
                m_creature->SummonCreature(NPC_MOB_1, -969.05f, 1174.91f, 90.39f, 2.17f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_2, -985.71f, 1173.95f, 91.02f, 1.16f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_1, -983.01f, 1192.88f, 90.01f, 5.42f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                                m_creature->SummonCreature(NPC_MOB_2, -965.51f, 1193.58f, 92.15f, 3.88f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                break;
                               
            case 16:
                m_creature->SummonCreature(NPC_MOB_1, -1147.83f, 1180.87f, 91.38f, 2.13f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_2, -1163.96f, 1183.72f, 93.79f, 0.84f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_1, -1160.97f, 1201.36f, 93.15f, 5.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                                m_creature->SummonCreature(NPC_MOB_2, -1146.20f, 1199.75f, 91.37f, 4.03f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                break;

            case 21:
                m_creature->SummonCreature(NPC_MOB_1, -1277.78f, 1218.56f, 109.30f, 1.99f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_2, -1292.65f, 1221.28f, 109.99f, 0.73f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_1, -1289.25f, 1239.20f, 108.79f, 5.26f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                m_creature->SummonCreature(NPC_MOB_2, -1272.91f, 1234.39f, 108.14f, 3.83f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
                break;
            case 48:
                if (Player* pPlayer = GetPlayerForEscort())
                    pPlayer->GroupEventHappens(QUEST_GARDES_DU_CORPS, m_creature);
                break;
        }
    }
       
            void Reset()
    {
    }

    void Aggro(Unit* who)
    {
    }

    void JustSummoned(Creature* summoned)
    {
        summoned->AI()->AttackStart(m_creature);
    }
};

CreatureAI* GetAI_npc_cork_gizelton(Creature* pCreature)
{
    return new npc_cork_gizeltonAI(pCreature);
}

bool QuestAccept_npc_cork_gizelton(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
    if (pQuest->GetQuestId() == QUEST_GARDES_DU_CORPS)
    {
                pCreature->SetStandState(UNIT_STAND_STATE_STAND);
               
        if (pPlayer->GetTeam() == ALLIANCE)
            pCreature->setFaction(FACTION_ESCORT_A_PASSIVE);

        if (pPlayer->GetTeam() == HORDE)
            pCreature->setFaction(FACTION_ESCORT_H_PASSIVE);

        if (npc_cork_gizeltonAI* pEscortAI = dynamic_cast<npc_cork_gizeltonAI*>(pCreature->AI()))
            pEscortAI->Start(false, pPlayer, pQuest);
    }
    return true;
}

void AddSC_npc_cork_gizelton()
{
        Script* pNewScript;
    pNewScript = new Script;
    pNewScript->Name = "npc_cork_gizelton";
    pNewScript->GetAI = &GetAI_npc_cork_gizelton;
    pNewScript->pQuestAcceptNPC = &QuestAccept_npc_cork_gizelton;
    pNewScript->RegisterSelf();
}


//////////////////////
//////////////////////
//////////////////////
//////////////////////

INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`)
VALUES
('139347','0','-847.221','1188.78','99','0',''),
('139347','1','-847.221','1188.78','99','0',''),
('139347','2','-857.324','1187.98','99','0',''),
('139347','3','-869.854','1186.48','98','0',''),
('139347','4','-883.781','1185.01','97','0',''),
('139347','5','-904.03','1183.5','95','0',''),
('139347','6','-935.499','1182.24','91','0',''),
('139347','7','-958.267','1182.92','89','0',''),
('139347','8','-974.384','1182.91','89','1000','Attaque 1'),
('139347','9','-995.034','1177.64','89','0',''),
('139347','10','-1009.27','1177.46','89','0',''),
('139347','11','-1025.51','1181.81','89','0',''),
('139347','12','-1056.65','1186.35','89','0',''),
('139347','13','-1084.96','1184.87','89','0',''),
('139347','14','-1098.32','1187.53','89','0',''),
('139347','15','-1112.01','1190.48','89','0',''),
('139347','16','-1153.93','1192.36','92','1000',' Attaque 2'),
('139347','17','-1170.62','1195.64','94','0',''),
('139347','18','-1195.94','1208.73','98','0',''),
('139347','19','-1206.27','1209.18','100','0',''),
('139347','20','-1227.62','1205.96','103','0',''),
('139347','21','-1282.13','1228.26','108','0',''),
('139347','22','-1306.17','1233.9','109','1000',' Attaque 3'),
('139347','23','-1317.72','1233.58','110','0',''),
('139347','24','-1343.73','1228.03','111','0',''),
('139347','25','-1373.84','1218.94','111','0',''),
('139347','26','-1412.23','1205.42','111','0',''),
('139347','27','-1417.17','1202.14','111','0',''),
('139347','28','-1446.66','1189.42','111','0',''),
('139347','29','-1467.95','1185.75','110','0',''),
('139347','30','-1485.08','1188.79','107','0',''),
('139347','31','-1492.79','1191.12','105','0',''),
('139347','32','-1505.44','1200.36','100','0',''),
('139347','33','-1514.29','1213.33','94','0',''),
('139347','34','-1521.29','1232.28','87','0',''),
('139347','35','-1523.64','1246.41','82','0',''),
('139347','36','-1521.45','1259.16','77','0',''),
('139347','37','-1517.39','1273.3','71','0',''),
('139347','38','-1513.56','1304.56','63','0',''),
('139347','39','-1512.08','1325.5','60','0',''),
('139347','40','-1502.82','1346.56','58','0',''),
('139347','41','-1488.55','1384.94','58','0',''),
('139347','42','-1485.31','1407.55','58','0',''),
('139347','43','-1487.64','1438.56','58','0',''),
('139347','44','-1490.62','1459.35','58','0',''),
('139347','45','-1476.09','1496.85','58','0',''),
('139347','46','-1457.39','1511.91','59','0',''),
('139347','47','-1446.92','1514.49','59','0',''),
('139347','48','-1426.87','1508.7','59','0','Quete validé'),
('139347','49','-1410.16','1499.86','59','15000','');