Jump to content
  • quest 3861 (Cluck!)


    madmax
    • Status: Completed
      Main Category: Quests
      Sub-Category: Quest
      Version: 0.20 Milestone: 20 Priority: Normal
      Implemented Version: 0.20

    quest 3861 (Cluck!)

    [QUOTE]The quest 3861 (Cluck!) Does show for me when I cluck at chickens but it does not accept the special chicken feed in my bags.[/QUOTE]

    Source: [url]http://www.covenant-wow.com/forums/index.php?topic=203.msg549#msg549[/url]


    User Feedback

    Recommended Comments

    Chicken turns friendly and the quest is enabled, but it does not recognize that I have a bag of feed in my inventory (button grayed out). Getting a second bag while the chicken was still friendly did not change a thing.

    Link to comment
    Share on other sites

    [B]FIX FOUND[/B]

    Issue is due to the quest's entry ([B]3861[/B]) in the [B][COLOR="#008000"]quest_template[/COLOR][/B] table

    The quest's [B][COLOR="#008000"]SpecialFlags [/COLOR][/B]field is set to[B][COLOR="#B22222"] 1[/COLOR][/B], when it should be [B][COLOR="#008000"]0[/COLOR][/B].

    I'll sort this out for all databases that will require it (Zero to Four).

    [B][SIZE=3][COLOR="#B22222"]Extra issue:[/COLOR][/SIZE][/B] the egg appears about 1 foot above a human's height in the air. I'll see what I can do about it. I guess its coordinates are scripted, seeing as the egg could appear anywhere a chicken is.
    I'll do a quick check on the coords issue, and if it's not an obvious/quick fix, I'll implement and PR the quest fix before looking into the coords one further.

    Link to comment
    Share on other sites

    I've found out how to resize the egg, which was wayyyyy too big

    UPDATE `mangos`.`gameobject_template` SET `size`='0.2' WHERE `entry`='161513';

    But it still spawns up high (accessible/clickable, though):

    [IMG]http://s29.postimg.org/bqy5u7zt3/floatingegg.jpg[/IMG]

    [B]EDIT (07 December 2014)[/B] - [COLOR="#FF0000"]This has been found to only happen on my machine!!! :( So not an issue! :)[/COLOR]

    Link to comment
    Share on other sites

    Still working on the spawn coordinates of the egg. This little is kinda annoying me .. oops, sorry, teddy :(

    The Z ordinate is obviously being incorrectly calculated, but I cannot locate where this is happening in the code, as yet. I will , little !!!!

    The coordinates are obviously based on the location of the player.

    Anyway, still at it. This quest will be doable once the commit I made is merged. Or action what I stated above, as to how to fix it.

    Link to comment
    Share on other sites

    Making a note here so that I can revisit this tomorrow...

    The issue of spawning of the object up in the sky may be due to the the rounding of the value passed in the Z variable (Foereeper's idea) - a good idea!

    Tracing back the code has taken me to the Create( ) function of the GameObject.cpp file.

    I will revisit this again tomorrow and run some tests on the contents of the variables.

    Link to comment
    Share on other sites

    I have created an Eluna script for the OnQuestReward event, which spawns the egg at ground surface level. I will do the same in SD2 ( /wink @ Xenithar).

    [SIZE=3][COLOR="#0000FF"][B]ELUNA SCRIPT[/B][/COLOR][/SIZE]

    local Chicken = {
    QuestId_Cluck = 3861,
    FarmChickenEgg = 161513,
    NPC_ID = 620,
    TimeTillDespawn = 60
    }


    function Chicken.OnQuestReward(event, player, creature, quest)
    if (quest:GetId() == Chicken.QuestId_Cluck) then
    local x, y, z = player:GetLocation();
    z = z - 1.85; -- adjustment made in order to force the spawning at ground surface level
    creature:SummonGameObject(Chicken.FarmChickenEgg, x, y, z, 0, TimeTillDespawn);
    end
    end


    RegisterCreatureEvent(Chicken.NPC_ID, 34, Chicken.OnQuestReward)


    I have also PR'd an SQL fix for the size of the egg, as it is currently about 2/3 the height of a human!
    [url]https://github.com/Chuck5ta/database/commit/670dd3c5ded38a5d419da75bfadc3cfa098d212e[/url]

    Link to comment
    Share on other sites

    [B][SIZE=4][COLOR="#008000"]SD2 SCRIPT FIX[/COLOR][/SIZE][/B]

    [B]File[/B]: npcs_special.cpp
    [B]Locatation[/B]: server/src/modules/SD2/scripts/world


    There is actually a QuestRewarded event/function written already; it just needed changing, plus a change required in the database.


    [B][SIZE=3][COLOR="#FF0000"]OLD FUNCTION[/COLOR][/SIZE][/B]
    bool QuestRewarded_npc_chicken_cluck(Player* /*pPlayer*/, Creature* pCreature, const Quest* pQuest)
    {
    if (pQuest->GetQuestId() == QUEST_CLUCK)
    {
    if (npc_chicken_cluckAI* pChickenAI = dynamic_cast(pCreature->AI()))
    {
    pChickenAI->Reset();
    }
    }

    return true;
    }



    [B][COLOR="#008000"][SIZE=3]NEW/FIXED FUNCTION[/SIZE][/COLOR][/B] plus related code
    // EGG and TimeTillDespawn are new, QUEST_CLUCK already exists in the script (along with other definitions)
    enum
    {
    QUEST_CLUCK = 3861, // this is already in the script
    EGG = 161513, // Egg (Farm Chicken Egg, Entry 161513)
    FACTION_FRIENDLY = 35,
    FACTION_CHICKEN = 31,
    TimeTillDespawn = 60 // despawn after 60 seconds
    };

    // This function is already in the code, but the contents of the function has been changed
    bool QuestRewarded_npc_chicken_cluck(Player* /*pPlayer*/, Creature* pCreature, const Quest* pQuest)
    {
    if (pQuest->GetQuestId() == QUEST_CLUCK)
    {
    float x = pPlayer->GetPositionX();
    float y = pPlayer->GetPositionY();
    float z = pPlayer->GetPositionZ();
    z -= 1.9; // ensures spawning of egg at ground surface level
    // spawn the egg
    GameObject* goEgg = pCreature->SummonGameObject(EGG, x, y, z, 0, TimeTillDespawn); // note despawn time does not work at present, so...
    goEgg->SetSpawnedByDefault(false);
    goEgg->SetRespawnTime(TimeTillDespawn);
    pCreature->setFaction(FACTION_CHICKEN);
    }
    return true;
    }


    void AddSC_npcs_special()
    {

    // Registering the event - this is already in the code/script
    pNewScript = new Script;
    pNewScript->Name = "npc_chicken_cluck";
    pNewScript->pQuestRewardedNPC = &QuestRewarded_npc_chicken_cluck;
    pNewScript->RegisterSelf();


    }



    [B]REQUIRED DATABASE CHANGES[/B]

    –- remove the spawning of the egg (13563) from the database
    [COLOR="#0000FF"]UPDATE quest_template SET RewSpellCast=0 WHERE entry=3861;[/COLOR]

    --------------------------------------------------------------

    The above has been tested and works on my current set up, but I now need to test this on a freshly cloned database, just to be sure it is working. Then I'll PR the SD2 script and the SQL script+DB core change.

    Link to comment
    Share on other sites

    Well thanks! Now here comes something I did not think of. I do intend on using just SD2 in the long-run (when Zero is 100% perfect and we're on One or Two), but I use both so I can report any issues with either. Due to this, how will this quest be handled since it is handled in SD2 AND Eluna? Will SD2 or Eluna take lead? Will they both fire? What about the situation where say SD2 kicks off the quest but for some reason I turn it in and Eluna handles the turn-in?

    Link to comment
    Share on other sites

    [quote=Xenithar]Well thanks! Now here comes something I did not think of. I do intend on using just SD2 in the long-run (when Zero is 100% perfect and we're on One or Two), but I use both so I can report any issues with either. Due to this, how will this quest be handled since it is handled in SD2 AND Eluna? Will SD2 or Eluna take lead? Will they both fire? What about the situation where say SD2 kicks off the quest but for some reason I turn it in and Eluna handles the turn-in?[/quote]

    When intending to use SD2, you'll need to move the contents of the [B]lua_scripts[/B] folder elsewhere. Then back again when testing the Eluna scripts.

    [B]lua_scripts[/B] folder location, e.g.
    My [B]lua_scripts[/B] folder is in the directory path:
    [COLOR="#800080"]MaNGOSZeroServer/run/lua_scripts[/COLOR]


    -----------------------------------------------------------------------------------
    ELUNA script for the Cluck! quest

    I forgot that Eluna overrides SD2 completely!!!

    [B][COLOR="#800080"]I will have to script the entire quest in Eluna[/COLOR][/B], not just the OnQuestReward part, otherwise the emotes are not required (/chicken /cheer).

    Which gives me a little issue of no easy means to remove and set the QUEST GIVER status of the chicken, but Rochet has said how this needs to be done. Nothing simple, though.

    ------------------------------------------------------------------------------------

    EGG SPAWNING

    I'm not happy with that. Further testing at different locations, and the egg appears at different heights - surface level, partially buried, 2 or 3 cm's above the ground!
    I'll take a look at how the GM command .gob achieves the spawning of game objects, as that is perfect every time!

    [B][COLOR="#008000"][SIZE=3]SOLVED[/SIZE][/COLOR][/B] (ish)
    You need to acquire the player characters's coordinates and spawn the game object there. use pPlayer/player not pCreature/creature

    Link to comment
    Share on other sites

    .gob command

    This uses the following to spawn a game object:

    [B]File:[/B] Level2.cpp
    [B]Function:[/B] HandleGameObjectAddCommand( )
    line 1060 onwards

    // spawn go
    bool ChatHandler::HandleGameObjectAddCommand(char* args)
    {


    I need to compare that with the SummonGameObject( ) function.

    -----------------------------------------------------------------------------------------

    [B][COLOR="#008000"][SIZE=3]SOLVED[/SIZE][/COLOR][/B] (ish)
    You need to acquire the player characters's coordinates and spawn the game object there. use pPlayer/player not pCreature/creature

    Link to comment
    Share on other sites

    Is there a way we can force one to override the other? In fact, maybe we should take this conversation to PM since it is not related to the quest Chucksta is working on. I would like to have Eluna override SD2 for a week, do my weekly build, then allow SD2 to be the library in use. This way I can get some time in using both. Perhaps a GM command which would switch libraries?

    Link to comment
    Share on other sites

    This would not be possible with the current script loading system. The entire scriptloader and manager would have to be rewritten. You can however just disable Eluna in the config files and SD2 will take precedence.

    Link to comment
    Share on other sites

    Alright, I can do that. I was hoping there would be a way we could switch in-game for testing purposes, but I can live with testing one all week and then the other the next week. Thanks! Now, can you get me more than say 30min a day to actually test the fixes? :p

    Link to comment
    Share on other sites

    [B][COLOR="#008000"][SIZE=4]ALL RESOLVED NOW[/SIZE][/COLOR][/B]

    The spawn in the sky only actually happens on my system!!! Damn gremlins :mad:

    Foereaper tested the egg spawning and it worked exactly as it should :rolleyes: :p

    [IMG]http://i.imgur.com/kJVXEk5.png[/IMG]

    As you can see, Foereeper himself, a typical Norwegian, long pointy ears and blue skin, with the egg spawned on the ground :eek: :confused: ;)

    Joking aside, Foereader spent quite a bit of time testing it, just to be sure, so I thankee :D

    Everything can stay as it currently is. No need to change or add scripts, Eluna or SD2.

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use