Пример #1
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        npc_barnesAI* pBarnesAI = ENSURE_AI(npc_barnes::npc_barnesAI, creature->AI());

        switch (action)
        {
            case GOSSIP_ACTION_INFO_DEF+1:
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
                SendGossipMenuFor(player, 8971, creature->GetGUID());
                break;
            case GOSSIP_ACTION_INFO_DEF+2:
                CloseGossipMenuFor(player);
                pBarnesAI->StartEvent();
                break;
            case GOSSIP_ACTION_INFO_DEF+3:
                CloseGossipMenuFor(player);
                pBarnesAI->m_uiEventId = EVENT_OZ;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str());
                break;
            case GOSSIP_ACTION_INFO_DEF+4:
                CloseGossipMenuFor(player);
                pBarnesAI->m_uiEventId = EVENT_HOOD;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str());
                break;
            case GOSSIP_ACTION_INFO_DEF+5:
                CloseGossipMenuFor(player);
                pBarnesAI->m_uiEventId = EVENT_RAJ;
                TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str());
                break;
        }

        return true;
    }
Пример #2
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        InstanceScript* instance = creature->GetInstanceScript();
        switch (action)
        {
            case GOSSIP_ACTION_INFO_DEF+1:
                CloseGossipMenuFor(player);
                if (instance)
                {
                    instance->SetData(TYPE_THRALL_EVENT, IN_PROGRESS);
                    instance->SetData(TYPE_THRALL_PART1, IN_PROGRESS);
                }

                creature->AI()->Talk(SAY_TH_START_EVENT_PART1);

                if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI()))
                    pEscortAI->Start(true, true, player->GetGUID());

                ENSURE_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far
                ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtEnd(false);
                ENSURE_AI(npc_escortAI, (creature->AI()))->SetDespawnAtFar(false);
                break;

            case GOSSIP_ACTION_INFO_DEF+2:
                AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
                SendGossipMenuFor(player, GOSSIP_ID_SKARLOC2, creature->GetGUID());
                break;

            case GOSSIP_ACTION_INFO_DEF+20:
                SendGossipMenuFor(player, GOSSIP_ID_SKARLOC3, creature->GetGUID());
                creature->SummonCreature(SKARLOC_MOUNT, 2038.81f, 270.26f, 63.20f, 5.41f, TEMPSUMMON_TIMED_DESPAWN, 12000);
                if (instance)
                    instance->SetData(TYPE_THRALL_PART2, IN_PROGRESS);

                creature->AI()->Talk(SAY_TH_START_EVENT_PART2);

                ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI())->StartWP();
                break;

            case GOSSIP_ACTION_INFO_DEF+3:
                CloseGossipMenuFor(player);
                if (instance)
                    instance->SetData(TYPE_THRALL_PART3, IN_PROGRESS);
                ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, creature->AI())->StartWP();
                break;
        }
        return true;
    }
 bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
 {
     CloseGossipMenuFor(player);
     me->StopMoving();
     StartFight(player);
     return true;
 }
 bool OnGossipHello(Player* player, Creature* creature) override
 {
     player->RemoveAurasDueToSpell(creature->GetAI()->GetData(ESSENCE_REMOVE));
     player->CastSpell(player, creature->GetAI()->GetData(ESSENCE_APPLY), true);
     CloseGossipMenuFor(player);
     return true;
 }
Пример #5
0
 void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
 {
     _events.ScheduleEvent(EVENT_RECRUIT_1, 100);
     CloseGossipMenuFor(player);
     me->CastSpell(player, SPELL_QUEST_CREDIT, true);
     me->SetFacingToObject(player);
 }
Пример #6
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        InstanceScript* instance = creature->GetInstanceScript();
        if (action == GOSSIP_ACTION_INFO_DEF+1)
        {
            AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
            SendGossipMenuFor(player, GOSSIP_ID_EPOCH2, creature->GetGUID());
        }
        if (action == GOSSIP_ACTION_INFO_DEF+2)
        {
            CloseGossipMenuFor(player);

            if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
            {
                instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
                if (instance->GetGuidData(DATA_EPOCH).IsEmpty())
                     creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);

                if (Creature* thrall = (ObjectAccessor::GetCreature(*creature, instance->GetGuidData(DATA_THRALL))))
                    ENSURE_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP();
            }
        }
        return true;
    }
Пример #7
0
 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override
 {
     CloseGossipMenuFor(player);
     creature->StopMoving();
     ENSURE_AI(npc_magister_aledis::npc_magister_aledisAI, creature->AI())->StartFight(player);
     return true;
 }
 bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
 {
     CloseGossipMenuFor(player);
     me->SetFaction(FACTION_MONSTER);
     me->Attack(player, true);
     return false;
 }
 bool GossipHello(Player* player) override
 {
     player->RemoveAurasDueToSpell(GetData(ESSENCE_REMOVE));
     player->CastSpell(player, GetData(ESSENCE_APPLY), true);
     CloseGossipMenuFor(player);
     return true;
 }
Пример #10
0
 void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
 {
     CloseGossipMenuFor(player);
     me->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
     MustDieTimer = 3000;
     MustDie = true;
 }
Пример #11
0
 void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == GOSSIP_MENU_OPTION_INSPECT_BODY && gossipListId == GOSSIP_OPTION_ID_BEATEN_CORPSE)
     {
         CloseGossipMenuFor(player);
         player->TalkedToCreature(me->GetEntry(), me->GetGUID());
     }
 }
Пример #12
0
 void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override
 {
     CloseGossipMenuFor(player);
     DoCast(player, SPELL_ALCHEMIST_APPRENTICE_INVISBUFF);
     _playerGUID = player->GetGUID();
     _getingredienttry = 1;
     _events.ScheduleEvent(EVENT_EASY_123, 100);
 }
 void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == MENU_OPTION_YOU_CHALLENGED_US && gossipListId == OPTION_ID_YOU_CHALLENGED_US)
     {
         CloseGossipMenuFor(player);
         DoAction(ACTION_START_RAGNAROS);
     }
 }
Пример #14
0
 void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == GOSSIP_ID && gossipListId == 0)
     {
         CloseGossipMenuFor(player);
         BeginSpeech(player);
     }
 }
Пример #15
0
 void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == GOSSIP_ID && gossipListId == GOSSIP_OPTION_ID)
     {
         CloseGossipMenuFor(player);
         Talk(SAY_GAMESBEGIN_1);
         BeginEvent(player);
     }
 }
Пример #16
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        if (action == GOSSIP_ACTION_INFO_DEF + 1 && IsHolidayActive(HOLIDAY_HALLOWS_END) && !player->HasAura(SPELL_TRICK_OR_TREATED))
        {
            player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);

            if (urand(0, 1))
                player->CastSpell(player, SPELL_TREAT, true);
            else
            {
                uint32 trickspell = 0;
                switch (urand(0, 13))
                {
                    case 0: trickspell = 24753; break; // cannot cast, random 30sec
                    case 1: trickspell = 24713; break; // lepper gnome costume
                    case 2: trickspell = 24735; break; // male ghost costume
                    case 3: trickspell = 24736; break; // female ghostcostume
                    case 4: trickspell = 24710; break; // male ninja costume
                    case 5: trickspell = 24711; break; // female ninja costume
                    case 6: trickspell = 24708; break; // male pirate costume
                    case 7: trickspell = 24709; break; // female pirate costume
                    case 8: trickspell = 24723; break; // skeleton costume
                    case 9: trickspell = 24753; break; // Trick
                    case 10: trickspell = 24924; break; // Hallow's End Candy
                    case 11: trickspell = 24925; break; // Hallow's End Candy
                    case 12: trickspell = 24926; break; // Hallow's End Candy
                    case 13: trickspell = 24927; break; // Hallow's End Candy
                }
                player->CastSpell(player, trickspell, true);
            }
            CloseGossipMenuFor(player);
            return true;
        }

        CloseGossipMenuFor(player);

        switch (action)
        {
            case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); break;
            case GOSSIP_ACTION_INN: player->SetBindPoint(creature->GetGUID()); break;
        }
        return true;
    }
Пример #17
0
    bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
    {
        switch (menuId)
        {
            case MENUID_NORTHREND_BEASTS:
                if (gossipListId == GOSSIPID_FAIL)
                    SendActionToTirion(ACTION_START_GORMOK_FAIL);
                else
                    SendActionToTirion(ACTION_START_GORMOK);
                break;
            case MENUID_JARAXXUS:
                if (gossipListId == GOSSIPID_FAIL)
                {
                    if (Creature* jaraxxus = _instance->GetCreature(DATA_JARAXXUS))
                        jaraxxus->AI()->DoAction(ACTION_JARAXXUS_ENGAGE);
                    me->GetMotionMaster()->MoveAlongSplineChain(POINT_BARRETT_DESPAWN, SPLINE_INITIAL_MOVEMENT, false);
                    CloseGossipMenuFor(player);
                    return true;
                }
                else
                    SendActionToTirion(ACTION_START_JARAXXUS_EVENT);
                break;
            case MENUID_FACTION_CHAMPIONS:
                if (gossipListId == GOSSIPID_FAIL)
                    SendActionToTirion(ACTION_START_CHAMPIONS_ENGAGE);
                else
                    SendActionToTirion(ACTION_START_CHAMPIONS);
                break;
            case MENUID_VALKYR:
                if (gossipListId == GOSSIPID_FAIL)
                    SendActionToTirion(ACTION_START_VALKYR_ENGAGE);
                else
                    SendActionToTirion(ACTION_START_VALKYR);
                break;
            case MENUID_LK:
                SendActionToTirion(ACTION_START_LK_EVENT);
                break;
            default:
                return false;
        }

        CloseGossipMenuFor(player);
        return true;
    }
 bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
 {
     if (menuId == GOSSIP_MENU_HUMMEL && gossipListId == GOSSIP_OPTION_START)
     {
         me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
         CloseGossipMenuFor(player);
         DoAction(ACTION_START_EVENT);
     }
     return false;
 }
Пример #19
0
 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
 {
     ClearGossipMenuFor(player);
     if (action == GOSSIP_ACTION_INFO_DEF)
     {
         CloseGossipMenuFor(player);
         creature->setFaction(FACTION_HOSTILE_CO);
         creature->AI()->AttackStart(player);
     }
     return true;
 }
Пример #20
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
    {
        ClearGossipMenuFor(player);
        if (action == GOSSIP_ACTION_INFO_DEF+1)
        {
            CloseGossipMenuFor(player);

            if (npc_escortAI* pEscortAI = CAST_AI(npc_shadowfang_prisoner::npc_shadowfang_prisonerAI, creature->AI()))
                pEscortAI->Start(false, false);
        }
        return true;
    }
Пример #21
0
 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
 {
     ClearGossipMenuFor(player);
     switch (action)
     {
         case GOSSIP_ACTION_INFO_DEF:
             CloseGossipMenuFor(player);
             ENSURE_AI(npc_expedition_commanderAI, creature->AI())->Phase = 1;
             break;
     }
     return true;
 }
Пример #22
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
    {
        ClearGossipMenuFor(player);

        switch(uiAction)
        {
            case GOSSIP_ACTION_INFO_DEF+1:
                CloseGossipMenuFor(player);
                if (InstanceScript *pInstance = creature->GetInstanceScript())
                    pInstance->SetData(DATA_START_INSTANCE, 1);
                break;
            case GOSSIP_ACTION_INFO_DEF+2:
                SendGossipMenuFor(player, 13854, creature->GetGUID());
                break;
            case GOSSIP_ACTION_INFO_DEF+3:
                player->NearTeleportTo(playerTeleportPosition.GetPositionX(), playerTeleportPosition.GetPositionY(), playerTeleportPosition.GetPositionZ(), playerTeleportPosition.GetOrientation(), true);
                CloseGossipMenuFor(player);
                break;
        }
        return true;
    }
Пример #23
0
 bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
 {
     uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
     ClearGossipMenuFor(player);
     if (action == GOSSIP_ACTION_INFO_DEF + 1)
     {
         CloseGossipMenuFor(player);
         //here we make him run to door, set the charge and run away off to nowhere
         DestroyDoor();
     }
     return true;
 }
Пример #24
0
 bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
 {
     uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
     ClearGossipMenuFor(player);
     if (action == GOSSIP_ACTION_INFO_DEF + 1)
     {
         CloseGossipMenuFor(player);
         PlayerGUID = player->GetGUID();
         DoAction(0);
     }
     return true;
 }
Пример #25
0
 bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
 {
     switch (action)
     {
         case GOSSIP_ACTION_INFO_DEF:
             CloseGossipMenuFor(player);
             creature->SetUInt32Value(UNIT_NPC_FLAGS, 0);
             creature->AI()->SetData(ACTION_SHANDY_INTRO, 0);
             break;
     }
     return true;
 }
Пример #26
0
 bool OnGossipSelect(Player *player, Creature *_creature, uint32 sender, uint32 action)
 {
 player->PlayerTalkClass->ClearMenus();
 if (sender != GOSSIP_SENDER_MAIN)
 return false;

 switch (action)
 {
 case ACTION_TELE:
 //teleport player to GH
 CloseGossipMenuFor(player);;
 teleportPlayerToGuildHouse(player, _creature);
 break;
 case ACTION_SHOW_BUYLIST:
 //show list of GHs which currently not occupied
 showBuyList(player, _creature);
 break;
 case ACTION_SELL_GUILDHOUSE:
  sellGuildhouse(player, _creature);
  CloseGossipMenuFor(player);;
 break;
 default:
 if (action > OFFSET_SHOWBUY_FROM)
 {
 showBuyList(player, _creature, action - OFFSET_SHOWBUY_FROM);
 }
 else if (action > OFFSET_GH_ID_TO_ACTION)
 {
 //player clicked on buy list
 CloseGossipMenuFor(player);;

 //get guildhouseId from action
 //guildhouseId = action - OFFSET_GH_ID_TO_ACTION
 buyGuildhouse(player, _creature, action - OFFSET_GH_ID_TO_ACTION);
 }
 break;
 }

 return true;
 }
Пример #27
0
bool showBuyList(Player *player, Creature *_creature, uint32 showFromId = 0)
{
 //show not occupied guildhouses

 QueryResult result;
 result = WorldDatabase.PQuery("SELECT `id`, `comment` FROM `guildhouses` WHERE `guildId` = 0 AND `id` > %u ORDER BY `id` ASC LIMIT %u",
 showFromId, GOSSIP_COUNT_MAX);

 if (result)
 {
 uint32 guildhouseId = 0;
 std::string comment = "";
 do
 {
 Field *fields = result->Fetch();
 guildhouseId = fields[0].GetInt32();
 comment = fields[1].GetString();

 //send comment as a gossip item
 //transmit guildhouseId in Action variable
 AddGossipItemFor(player, ICON_GOSSIP_TABARD, comment, GOSSIP_SENDER_MAIN,
 guildhouseId + OFFSET_GH_ID_TO_ACTION);
 }
 while (result->NextRow());

 if (result->GetRowCount() == GOSSIP_COUNT_MAX)
 {
 //assume that we have additional page
 //add link to next GOSSIP_COUNT_MAX items
 AddGossipItemFor(player, ICON_GOSSIP_BALOONDOTS, MSG_GOSSIP_NEXTPAGE, GOSSIP_SENDER_MAIN,
 guildhouseId + OFFSET_SHOWBUY_FROM);
 }

 SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());

 return true;
 }
 else if (!result)
 {
 //all guildhouses are occupied
 _creature->Whisper(MSG_NOFREEGH, LANG_UNIVERSAL, player);
 CloseGossipMenuFor(player);;
 }
 else
 {
 //this condition occurs when COUNT(guildhouses) % GOSSIP_COUNT_MAX == 0
 //just show GHs from beginning
 showBuyList(player, _creature, 0);
 }

 return false;
}
Пример #28
0
            bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
            {
                if (menuId == OPTION_WHAT_PHAT_LEWTS_YOU_HAVE && gossipListId == 0)
                {
                    CloseGossipMenuFor(player);

                    if (Creature* pBigBadWolf = me->SummonCreature(CREATURE_BIG_BAD_WOLF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS))
                        pBigBadWolf->AI()->AttackStart(player);

                    me->DespawnOrUnsummon();
                }
                return false;
            }
Пример #29
0
 void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
 {
     ClearGossipMenuFor(player);
     switch (gossipListId)
     {
         case 1:
             CloseGossipMenuFor(player);
             me->AI()->Talk(SAY_BARADA_1);
             me->AI()->DoAction(ACTION_START_EVENT);
             break;
         default:
             break;
     }
 }
Пример #30
0
        bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
        {
            uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
            ClearGossipMenuFor(player);
            if (action == GOSSIP_ACTION_INFO_DEF + 1)
            {
                CloseGossipMenuFor(player);

                Talk(EMOTE_START);
                StartFollow(player);
            }

            return true;
        }