Gossip Lua menu

User Tag List

Thread: Gossip Lua

Results 1 to 13 of 13
  1. #1
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gossip Lua

    How can i make a npc talk ? lets say Topper Mcnabb



    Code:
    --Topper McNabb(1402)
    local cry_delay = 90000
    local announces = {}
    local announcei = 6 --The number of announces
    local choice = 1
    
    RegisterUnitEvent(5109, 6, "topper_Setup")
    announces[1] = "Alms for the poor?"
    announces[2] = "Help a poor bloke out?"
    announces[3] = "Could ye spare some coin?"
    announces[4] = "Shine yer armor for a copper."
    announces[5] = "I will gladly pay you on Tuesday for a hamburger today."
    announces[6] = "Spare some change for a poor blind man? …What do you mean I'm not blind? …I'M NOT BLIND! I CAN SEE!! It's a miracle!"
    
    
    function topper_Tick(pUnit, Event)
       choice = math.random(1, announcei)
       pUnit:SendChatMessage(12, 0, announces[choice])
    end

    And its not working, did i misspelled the lua ? or must i modify something in the database ?



    Using ArcEmu 844 and WhyDB 217


    i will +2+Rep who helps me

    Gossip Lua
  2. #2
    azeon's Avatar Banned
    Reputation
    29
    Join Date
    Sep 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this

    Code:
        local timebetweenannounce = 10000 --Time between messeges the NPC sends
        local restarttime = 25000 --How long you want until it restarts all over again.
        local npcid = ENTRYID --The NPC's ID
    
        --Change the folowing text to whatever you want
        local message1 = "Alms for the poor?"
        local message2 = "Help a poor bloke out?"
        local message3 = "could ye spare some coin?"
        local message4 = "Shine yer armor for a copper."
        local message5 = "I will gladly pay you on Tuesday for a hamburger today."
        local message5 = "Spare some change for a poor blind man? …What do you mean I'm not blind? …I'M NOT BLIND! I CAN SEE!! It's a miracle!"
    
    
        function Announcer_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message1)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer2_Yell", timebetweenannounce, 0)
        end
    
        function Announcer2_Yell(pUnit, Event)
           pUnit:SendChatMessage(12 ,0, message2)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer3_Yell", timebetweenannounce, 0)
        end
    
        function Announcer3_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message3)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer4_Yell", timebetweenannounce, 0)
        end
    
        function Announcer4_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message4)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer5_Yell", timebetweenannounce, 0)
        end
    
        function Announcer5_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message5)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer2_Yell", restarttime, 0)
        end
    
        function Announcer6_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message5)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer2_Yell", restarttime, 0)
        end
    
        function Announcer_Start(pUnit, Event)
           pUnit:RegisterEvent("Announcer_Yell", 1000, 0)
        end
        RegisterUnitEvent(ENTRYID, 6, "Announcer_Start")

  3. #3
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by azeon View Post
    try this

    Code:
        local timebetweenannounce = 10000 --Time between messeges the NPC sends
        local restarttime = 25000 --How long you want until it restarts all over again.
        local npcid = ENTRYID --The NPC's ID
    
        --Change the folowing text to whatever you want
        local message1 = "Alms for the poor?"
        local message2 = "Help a poor bloke out?"
        local message3 = "could ye spare some coin?"
        local message4 = "Shine yer armor for a copper."
        local message5 = "I will gladly pay you on Tuesday for a hamburger today."
        local message5 = "Spare some change for a poor blind man? …What do you mean I'm not blind? …I'M NOT BLIND! I CAN SEE!! It's a miracle!"
    
    
        function Announcer_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message1)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer2_Yell", timebetweenannounce, 0)
        end
    
        function Announcer2_Yell(pUnit, Event)
           pUnit:SendChatMessage(12 ,0, message2)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer3_Yell", timebetweenannounce, 0)
        end
    
        function Announcer3_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message3)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer4_Yell", timebetweenannounce, 0)
        end
    
        function Announcer4_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message4)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer5_Yell", timebetweenannounce, 0)
        end
    
        function Announcer5_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message5)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer2_Yell", restarttime, 0)
        end
    
        function Announcer6_Yell(pUnit, Event)
           pUnit:SendChatMessage(12, 0, message5)
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("Announcer2_Yell", restarttime, 0)
        end
    
        function Announcer_Start(pUnit, Event)
           pUnit:RegisterEvent("Announcer_Yell", 1000, 0)
        end
        RegisterUnitEvent(ENTRYID, 6, "Announcer_Start")

    nothing happens

  4. #4
    azeon's Avatar Banned
    Reputation
    29
    Join Date
    Sep 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did you made a sql for the npc?

  5. #5
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by azeon View Post
    did you made a sql for the npc?

    like ?ops:

    edit- npc flags ?

    http://www.mmowned.com/forums/emulat...ery-handy.html

  6. #6
    azeon's Avatar Banned
    Reputation
    29
    Join Date
    Sep 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    copy past the lua script into a text editor and save it as a .lua file and put it in the folder called "scripts"

    copy past the sql file into a text editor and save it as a .sql and execute it into the database.

    sql file: (change the red text like you want, same for the lua file, make sure the ENTRY ID is the same in both files)
    Code:
    INSERT INTO creature_proto (entry, minlevel, maxlevel, faction, minhealth, maxhealth, mana, scale, npcflags, attacktime, mindamage, maxdamage, rangedattacktime, rangedmindamage, rangedmaxdamage, mountdisplayid, equipmodel1, equipinfo1, equipslot1, equipmodel2, equipinfo2, equipslot2, equipmodel3, equipinfo3, equipslot3, respawntime, armor, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, combat_reach, bounding_radius, auras, boss, money, invisibility_type, death_state)
    VALUES (ENTRYID, 72, 72, 814,  999999,  999999,  999999,  1, 128, 1800, 150, 250, 1800, 500, 650, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36000, 0, 0, 0, 0, 0, 0, 0, 1, 0, "MEMO", 0, 0, 0, 0);
    INSERT INTO creature_names (entry, `name`, Subname, Flags1, type, Family, Rank, unk4, SpellDataID, male_displayid, female_displayid, unknown_float1, unknown_float2, Civilian, Leader, info_str)
    VALUES (ENTRYID,"NAME","GUILDNAME",0,0,0,0,0,NULL,16754,16754,1, 1,1,NULL, '');

  7. #7
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  8. #8
    azeon's Avatar Banned
    Reputation
    29
    Join Date
    Sep 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok ok then in the lua script change the red text into his entry id, in this case it's 1402
    and put the lua script in the folder called scripts

  9. #9
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by azeon View Post
    ok ok then in the lua script change the red text into his entry id, in this case it's 1402
    and put the lua script in the folder called scripts

    im not that stupid :whythis:
    already did when you posted the script

  10. #10
    azeon's Avatar Banned
    Reputation
    29
    Join Date
    Sep 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok well sorry, you never know ^^

  11. #11
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i found this

    --ARCANE GUARDIAN
    local cry_delay = 90000
    local announces = {}
    local announcei = 4 --The number of announces
    local choice = 1

    RegisterUnitEvent(18103, 6, "ArcaneGuardian_Setup")
    announces[1] = "Remain strong. Kael'thas will - error - Lor'themar will lead you to power and glory!"
    announces[2] = "Obey the laws of silvermoon. Failure to do so will result in termination."
    announces[3] = "Do not disturb the serenity of the city. Peace must be upheld."
    announces[4] = "Maintain order within these walls."

    function ArcaneGuardian_Tick(pUnit, Event)
    choice = math.random(1, announcei)
    pUnit:SendChatMessage(12, 0, announces[choice])
    end

    function ArcaneGuardian_Setup(pUnit, Event)
    pUnit:RegisterEvent("ArcaneGuardian_Tick", cry_delay, 0)
    end

    maybe this should work (modified , of course)

  12. #12
    azeon's Avatar Banned
    Reputation
    29
    Join Date
    Sep 2007
    Posts
    163
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    don't think that will work... are you sure the script i gave isn't working?
    make sure the entry id are the same

    make sure you enabled lua in your config file :P

  13. #13
    ucigashu's Avatar Member
    Reputation
    22
    Join Date
    Aug 2007
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by azeon View Post
    don't think that will work... are you sure the script i gave isn't working?
    make sure the entry id are the same

    make sure you enabled lua in your config file :P

    :whythis::whythis::whythis::whythis::whythis::whythis::whythis:

    already did it

Similar Threads

  1. Gossip Lua + Gossip Text
    By cello1993 in forum WoW EMU Questions & Requests
    Replies: 17
    Last Post: 05-12-2009, 07:29 PM
  2. wierd none of my gossip lua wont work(anyone help)?
    By Flake0207 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 02-03-2009, 04:00 PM
  3. Need help with Gossip Lua with Functions (3 rep to whoever fixes)
    By stoneharry in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 12-14-2008, 03:30 PM
  4. LUA: Understanding Gossip Menus
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 46
    Last Post: 08-16-2008, 09:27 AM
  5. Unit Event Lua Question (Gossip Talk)
    By moongo in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 05-22-2008, 07:49 PM
All times are GMT -5. The time now is 11:24 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search