Jump to content
  • NPC not able to randomly choose text to use


    Chucksta
    • Status: Completed
      Main Category: Database
      Sub-Category: NPC
      Version: 2.0.11 Milestone: 20 Priority: Low
      Implemented Version: 0.20

    If an NPC has a choice of more than one text to say, it always chooses the same one.

    This thread has been raised for my own records, so that I do not forget about it. If anyone does know the answer though, please jump in.

    [COLOR="#FF0000"][SIZE=3]THE ISSUE[/SIZE][/COLOR]

    [SIZE=3][COLOR="#0000FF"]Test Case[/COLOR][/SIZE]

    Terl Arakor - Wetlands (Entry 2153)

    This NPC has the following responses (there are more) when a player character interacts with him:

    TEXT 1
    [QUOTE]This is MY WAGON

    MINE![/QUOTE]

    TEXT 2
    [QUOTE]On my way down here from Dun Algaz I saw a gnoll hunting Threshadons in the middle of a lake. If you've never seen a dog try to use a spear, you're in for a treat![/QUOTE]

    If you add these to the npc_text table and link them to the NPC via the gossip_menu table, the NPC should pick one based on the probability value set in the prob0 field (0 to 1) of the records in the npc_text table. That's how I see it, anyway; I could be wrong.

    This is not working; it just picks the same text every time.

    npc_text (see prob0 field description):
    [url]https://github.com/cmangos/issues/wiki/npc_text[/url]


    User Feedback

    Recommended Comments

    Probably fixed already then, if you have seen it working on other NPCs. This was posted in November, so quite old.

    Thanks for the input :)

    "beware of cmangos doku its wrong for our DB sometimes"

    noted :)

    Link to comment
    Share on other sites

    Tried it again, and it does not work.

    I added the 2nd text to my system.

    Actually, I can't see how it would work. I thought the probability field may have something to do with it, but it seems not.

    Link to comment
    Share on other sites

    Solved it, at least for myself, and MEGA [B][SIZE=5]D'OH[/SIZE][/B]

    For a choice of text to be displayed, you use the fields in the npc_text table: text0_0, text1_0, text,2_0, etc

    So, I now need to add the 2nd text to the text1_0 of that NPC's npc_text record.

    [COLOR="#0000FF"]UPDATE npc_text SET `prob0`='0.5', `text1_1`='On my way down here from Dun Algaz I saw a gnoll hunting Threshadons in the middle of a lake. If you\'ve never seen a dog try to use a spear, you\'re in for a treat!', `prob1`='0.5' WHERE `ID`='16528';[/COLOR]

    Now to find out what else the NPC says.

    [B]NOTE:[/B] chat text is missing completely from One and Two for this NPC

    [B]NOTE 2[/B]: NPC should do the following:

    After the "Wetlands is under attack!" message is broadcast, the NPC says
    [QUOTE]WHERE IN WETLANDS? Maybe next time you could just warn me "Azeroth is under attack, somewhere!"[/QUOTE]

    [url]http://www.wowhead.com/npc=2153/terl-arakor#comments[/url]


    Blimey, this guy says tons of things!!!

    [QUOTE]I was up at Whelgar's a few days ago attempting to...er...liberate...some titan relics from the bones of the dead raptors, and I saw him! Sarltooth lives! Well, he's undead, so I guess he doesn't live, but he exists. Sarltooth exists![/QUOTE]

    [QUOTE]They say that the raptor matriarch lives deep within Raptor Ridge, protecting her clutch of eggs.[/QUOTE]

    Okay, not tons of things, just one more... :p

    [QUOTE]The Dragonmaw are attempting to push out of the Angerfang Encampment and are already raiding the caravan to the east. They've called in two powerful warriors who are leading the charge. If you're up for a challenge, you might find them at the Encampment, planning and strategizing and doing other evil Orcish things.[/QUOTE]

    Link to comment
    Share on other sites

    [B][SIZE=3][COLOR="#008000"]FIXES:[/COLOR][/SIZE][/B]

    [B]MaNGOS Zero[/B]

    [B][COLOR="#0000FF"]UPDATE npc_text SET `prob0`='1', `text1_1`='On my way down here from Dun Algaz I saw a gnoll hunting Threshadons in the middle of a lake. If you\'ve never seen a dog try to use a spear, you\'re in for a treat!', `prob1`='1', `text2_1`='I was up at Whelgar\'s a few days ago attempting to...er...liberate...some titan relics from the bones of the dead raptors, and I saw him! Sarltooth lives! Well, he\'s undead, so I guess he doesn\'t live, but he exists. Sarltooth exists!', `prob2`='1', `text3_0`='They say that the raptor matriarch lives deep within Raptor Ridge, protecting her clutch of eggs.', `prob3`='1', `text4_0`='The Dragonmaw are attempting to push out of the Angerfang Encampment and are already raiding the caravan to the east. They\'ve called in two powerful warriors who are leading the charge. If you\'re up for a challenge, you might find them at the Encampment, planning and strategizing and doing other evil Orcish things.', `prob4`='1' WHERE `ID`='16528';[/COLOR][/B]


    [B]MaNGOS One and ManGOS Two[/B]

    -- Link gossip text to NPC
    [B][COLOR="#0000FF"]UPDATE creature_template SET `GossipMenuId`='11788' WHERE `Entry`='2153';[/COLOR][/B]

    -- gossip_menu
    [B][COLOR="#0000FF"]DELETE FROM gossip_menu WHERE entry = 11788;[/COLOR][/B]
    [B][COLOR="#0000FF"]INSERT INTO gossip_menu (`entry`, `text_id`, `script_id`, `condition_id`) VALUES ('11788', '16528', '0', '0');[/COLOR][/B]

    -- npc_text
    [B][COLOR="#0000FF"]DELETE FROM npc_text WHERE ID = 16528;[/COLOR][/B]
    [B][COLOR="#0000FF"]INSERT INTO npc_text (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`, `text1_0`, `text1_1`, `lang1`, `prob1`, `em1_0`, `em1_1`, `em1_2`, `em1_3`, `em1_4`, `em1_5`, `text2_0`, `text2_1`, `lang2`, `prob2`, `em2_0`, `em2_1`, `em2_2`, `em2_3`, `em2_4`, `em2_5`, `text3_0`, `text3_1`, `lang3`, `prob3`, `em3_0`, `em3_1`, `em3_2`, `em3_3`, `em3_4`, `em3_5`, `text4_0`, `text4_1`, `lang4`, `prob4`, `em4_0`, `em4_1`, `em4_2`, `em4_3`, `em4_4`, `em4_5`, `text5_0`, `text5_1`, `lang5`, `prob5`, `em5_0`, `em5_1`, `em5_2`, `em5_3`, `em5_4`, `em5_5`, `text6_0`, `text6_1`, `lang6`, `prob6`, `em6_0`, `em6_1`, `em6_2`, `em6_3`, `em6_4`, `em6_5`, `text7_0`, `text7_1`, `lang7`, `prob7`, `em7_0`, `em7_1`, `em7_2`, `em7_3`, `em7_4`, `em7_5`) VALUES ('16528', 'This is MY WAGON!$B$BMINE!', '', '0', '1', '0', '0', '0', '0', '0', '0', '', 'On my way down here from Dun Algaz I saw a gnoll hunting Threshadons in the middle of a lake. If you\'ve never seen a dog try to use a spear, you\'re in for a treat!', '0', '1', '0', '0', '0', '0', '0', '0', '', 'I was up at Whelgar\'s a few days ago attempting to...er...liberate...some titan relics from the bones of the dead raptors, and I saw him! Sarltooth lives! Well, he\'s undead, so I guess he doesn\'t live, but he exists. Sarltooth exists!', '0', '1', '0', '0', '0', '0', '0', '0', 'They say that the raptor matriarch lives deep within Raptor Ridge, protecting her clutch of eggs.', '', '0', '1', '0', '0', '0', '0', '0', '0', 'The Dragonmaw are attempting to push out of the Angerfang Encampment and are already raiding the caravan to the east. They\'ve called in two powerful warriors who are leading the charge. If you\'re up for a challenge, you might find them at the Encampment, planning and strategizing and doing other evil Orcish things.', '', '0', '1', '0', '0', '0', '0', '0', '0', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '', '', '0', '0', '0', '0', '0', '0', '0', '0');[/COLOR][/B]

    Link to comment
    Share on other sites

    [B][SIZE=3]**** [COLOR="#008000"]FIXES APPLIED[/COLOR] ****[/SIZE][/B]

    [B]MaNGOS Zero[/B]

    [url]https://github.com/mangoszero/database/pull/9[/url]

    [B]MaNGOS One[/B]

    [url]https://github.com/mangosone/database/pull/14[/url]

    [B]MaNGOS Two[/B]

    [url]https://github.com/mangostwo/database/pull/28[/url]

    ===========================================================================


    [B][COLOR="#800080"]For the WIKI – entry in the npc_text table's page, for randon gossip text.[/COLOR][/B]


    [B]Version 1[/B]

    Random gossip text
    This table allows an NPC to have a choice of what to say when interacted with by a character player, such as for Terl Arakor in the Wetlands. This is done by entering each choice of text into the following fields:

    text0_0, text1_0, text2_0, text3_0, text4_0, text5_0, text6_0, text7_0 for a male NPC
    or
    text0_1, text1_1, text2_1, text3_1, text4_1, text5_1, text6_1, text7_1 for a female NPC

    As can be seen, an NPC can have a choice of up to 8 different things to say.

    [B]Version 2[/B]

    Random gossip text
    The fields text0_0 to text7_0 (male NPC) and text0_1 to text7_1 (female NPC), can be used to give the NPC a choice of what to say when interacted with by a player character. An example of use can be found with the NPC, Terl Arakor, in the Wetlands.

    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