Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[Quest\Zul'Drak]Lab Work #2382

Closed
Bezo opened this Issue Jul 23, 2011 · 13 comments

Comments

Projects
None yet
10 participants
Contributor

Bezo commented Jul 23, 2011

how it should work:
you get the items by loot them from the gameobjects.

how it work now:
no loot from the objects.

ids:
[Lab Work] - http://old02.wowhead.com/quest=12557
[Muddy Mire Maggot] - Object: 190478 , item: 38386
[Withered Batwing] - Object: 190473, item: 38339
[Amberseed] - Object: 190459, item: 38340
[Chilled Serpent Mucus] - Object: 190462, item: 38346

Core Info:
6f30f16 With TDB 335.11.41+
Linux
Trinichat2, AC1, AHBot, WG patch.

Script was written in a separate file

include "ScriptPCH.h"

enum eNums {
    LAB_WORK_QUEST            = 12557,

    MUDDY_MIRE_MAGGOT         = 38386,
    WITHERED_BATWING          = 38339,
    AMBERSEED                 = 38340,
    CHILLED_SERPENT_MUCUS     = 38346,

    MAGGOT_NPC                = 28293,
    BATWING_NPC               = 28294,
    AMBERSEED_NPC             = 28295,
    MUCUS_NPC                 = 28296
};

class go_finklesteins_cauldron : public GameObjectScript
{
    public:

        go_finklesteins_cauldron() : GameObjectScript("go_finklesteins_cauldron") { }

        bool OnGossipHello(Player* player, GameObject* /*go*/)
        {
            if (player->GetQuestStatus(LAB_WORK_QUEST) == QUEST_STATUS_INCOMPLETE) {
                int32 item_npc = 0;

                if (player->HasItemCount(MUDDY_MIRE_MAGGOT, 1)) {
                    item_npc = MAGGOT_NPC;
                    player->DestroyItemCount(MUDDY_MIRE_MAGGOT, 1, true);
                } else if (player->HasItemCount(WITHERED_BATWING, 1)) {
                    item_npc = BATWING_NPC;
                    player->DestroyItemCount(WITHERED_BATWING, 1, true);
                } else if (player->HasItemCount(AMBERSEED, 1)) {
                    item_npc = AMBERSEED_NPC;
                    player->DestroyItemCount(AMBERSEED, 1, true);
                } else if (player->HasItemCount(CHILLED_SERPENT_MUCUS, 1)) {
                    item_npc = MUCUS_NPC;
                    player->DestroyItemCount(CHILLED_SERPENT_MUCUS, 1, true);
                } else {
                    return false;
                }

                Quest const* pQuest = sObjectMgr->GetQuestTemplate(LAB_WORK_QUEST);
                for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
                {
                    int32 creature = pQuest->ReqCreatureOrGOId[i];

                    if (creature == item_npc) {
                        if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature))
                            player->KilledMonster(cInfo, 0);
                        } else {
                            continue;
                        }
                    }

                    // Funny bug where if batwing or amberseed are last objects quest isn't marked complete (hack fix for now)
                    if (pQuest->ReqCreatureOrGOCount[0] == 1 && pQuest->ReqCreatureOrGOCount[1] == 1 && pQuest->ReqCreatureOrGOCount[2] == 1 && pQuest->ReqCreatureOrGOCount[3] == 1)
                        player->SendQuestComplete(LAB_WORK_QUEST);

                    return true;
                }
            return false;
        }
};


void AddSC_go_finklesteins_cauldron()
{
    new go_finklesteins_cauldron;
}

And of course the SQL:

-- Delete --
DELETE FROM `gameobject_loot_template` WHERE `entry`=190459 AND `item`=38340;
DELETE FROM `gameobject_loot_template` WHERE `entry`=190462 AND `item`=38346;
DELETE FROM `gameobject_loot_template` WHERE `entry`=190473 AND `item`=38339;
DELETE FROM `gameobject_loot_template` WHERE `entry`=190478 AND `item`=38386;
-- Insert --
INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) 
VALUES
(190459, 38340, -100, 1, 0, 1, 1),
(190462, 38346, -100, 1, 0, 1, 1),
(190473, 38339, -100, 1, 0, 1, 1),
(190478, 38386, -100, 1, 0, 1, 1);
-- Update --
# Link items to quest so they drop
UPDATE `quest_template` SET `ReqSourceId1` =  '38386', `ReqSourceId2` =  '38339', `ReqSourceId3` =  '38340', `ReqSourceId4` =  '38346', `ReqSourceCount1` =  '0', `ReqSourceCount2` =  '0', `ReqSourceCount3` =  '0', `ReqSourceCount4` =  '0' WHERE `entry` =12557;

# Update script name so GO triggers script
UPDATE `gameobject_template` SET `ScriptName`='go_finklesteins_cauldron' WHERE `entry`=190498;
Contributor

Bezo commented Aug 25, 2011

i guess its need to add to Zuldrak.cpp file for push.

@Bezo Bezo closed this Aug 25, 2011

@Bezo Bezo reopened this Aug 25, 2011

peycho commented Mar 27, 2012

Confirmed.

Missing kill credits when loot:
Muddy Mire Maggot
Withered Batwing
Amberseed
Chilled Serpent Mucus

TrinityCore rev. (90cacb9+) (Unix, Release)
TDB 335.11.46+

Contributor

ZxBiohazardZx commented Apr 19, 2012

modifiying the quest_template is a hackfix

This quest is part of a 4 part quest and breaks the chain making the whole thing bugged.

Contributor

ZxBiohazardZx commented May 14, 2012

DB loot is already existing, cpp didnt make sense --> closed issue

Hmm, I don't see a commit saying this is fixed... Is this fixed or just closed because you don't like the posted code?

It is not fixed confirmed.

Trinity Revison 66ce5a1 Database TDB 335.11.47

DB Loot is wrong and not working as intended. Although your cpp and your SQL is one big hack. This can be solved with a new ItemScript hook OnCreate.

Contributor

nelegalno commented Dec 4, 2012

Confirmed not working on TDB49 up to 2dc72ec

AnTOLI commented Feb 25, 2013

Not working quest .

Contributor

Pitcrawler commented Apr 4, 2013

Regarding the loot this should fix it

DELETE FROM `gameobject_loot_template` WHERE `entry`=24320 AND `item` IN (38340,38341,38397);
DELETE FROM `gameobject_loot_template` WHERE `entry`=24326 AND `item`=38397;
DELETE FROM `gameobject_loot_template` WHERE `entry`=24330 AND `item`=38335;

UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=100 WHERE `entry` BETWEEN 24319 AND 24340;
Contributor

Pitcrawler commented Apr 4, 2013

Each of the items required for the quest is supposed to cast its spell like http://www.wowhead.com/spell=51068 when looted. These spells have to trigger their credit spells on hit like http://www.wowhead.com/spell=51227.

@raczman raczman pushed a commit to raczman/TrinityCore that referenced this issue Apr 20, 2014

Pitcrawler DB/Quests: Fix Pa'Troll and Lab Work, closes #5910 and really closes #… cea4e59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment