[Question] Quest Trigger > Lua Event menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] Quest Trigger > Lua Event

    Is it possible to create a script that triggers from a quest? Ya know, where you hand in the quest then the Lua event happens. Like a little scene between a couple Npcs talking and one of the kills one, something like that.

    If so, how would I set up the function to start the function and register it?

    [Question] Quest Trigger > Lua Event
  2. #2
    TheNacho's Avatar Member
    Reputation
    12
    Join Date
    Apr 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function QUESTNAME_OnComplete (pUnit, Event)
    	(DO STUFF HERE)
    end
    
    RegisterQuestEvent(QUESTID, 1, "QUESTNAME_OnComplete")
    Mess around with this.

  3. #3
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, I tried doing a little thing, and it didn't work the way I wanted it to.

    I encountered a problem. How would I set up the script for the Npc that is standing next to the quest giver would say something? Because all the registers I can think of at the moment are the typical ones, combat, death, kill, etc. What I am talking about is the

    Code:
    RegisterUnitEvent(ID, ?, Name_?)
    Like, what would be the number for him just to talk? Seeing as he doesn't go in combat or anything. Also, I'm just gonna guess that the Name_? would be whatever I give it, like Name_Talk or something.

    I thought about this some more, and I'm not completely sure how this is actually linked with the quest, just that under the quest function I would put
    Code:
    pUnit:RegisterEvent("Name_Talk, 5000, 1)
    I think thats right, right?

  4. #4
    TheNacho's Avatar Member
    Reputation
    12
    Join Date
    Apr 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you give me what the you want the NPCs to say? I could script it for you.

  5. #5
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, what I plan on doing will be more than just 1 Npc talking. There is going to be needed waypoints and crap added so they move, and overall this whole thing might take 5 minutes, lol. I probably shouldn't be trying this as a noob scripter, but I'm getting better with trying this.

    So, I really don't want you to script it for me, I would just like you to look at this.


    Code:
    function Name_OnComplete(pUnit, Event)
    	pUnit:RegisterEvent("Name_TalkPhase", 5000, 1)
    	end
    end
    
    function Name_TalkPhase(pUnit, Event)
    	pUnit:PlaySoundToSet(will change)
    	pUnit:SendChatMessage(14, 0, "blah blah blah")
    	pUnit:RegisterEvent("Name_Yell1", 6000, 1)
    	end
    
    function Name_Yell1(pUnit, Event)
    	pUnit:PlaySoundToSet(will change)
    	pUnit:SendChatMessage(14, 0, "blah blah blah!")
    	end
    end
    
    RegisterQuestEvent(will change, 1, "Name_OnComplete")
    RegisterUnitEvent(will change, ?, "Name_TalkPhase")
    I imagine it would be looking like this, but again, what ID for the type of register would it be?

    If I am wrong, please enlighten me.

  6. #6
    TheNacho's Avatar Member
    Reputation
    12
    Join Date
    Apr 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Name_TalkPhase shouldn't need to be registered since it's activated by Name_OnComplete, or is that what went wrong? (Also, you should probably add a pUnit:RemoveEvents() at the start of Name_TalkPhase.)

  7. #7
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it doesn't need to be registered, how will the Npc next to the quest giver talk?

    I have an easier way to discuss this. Add me on MSN - [email protected]

    That is, if you would like to participate on this project with me.

  8. #8
    Zudrik's Avatar Member
    Reputation
    52
    Join Date
    Dec 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the double post, but I still need some help on this. I tried so much different crap and only got just a bit closer to starting it, lol. I've been getting errors like 'invalid Lua function' or the Npc doesn't send a chat message, you only hear a sound.

    Oh and, for the

    Code:
    RegisterQuestEvent(QUESTID, 1, "QUESTNAME_OnComplete")
    Apparently on the server I'm on, 1 is on accept and 2 is on complete. Lol

Similar Threads

  1. Replies: 3
    Last Post: 02-01-2013, 03:34 AM
  2. [Help] Two Questions (Quest & Lua)
    By Zudrik in forum WoW EMU Questions & Requests
    Replies: 15
    Last Post: 01-30-2009, 02:22 AM
  3. [Question]Problem with enabling lua
    By Corosive720 in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 01-23-2008, 12:01 PM
  4. a Navicat question--->Quest
    By secretdragon008 in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 12-09-2007, 01:06 AM
  5. [QUESTION] Quest marks
    By Eepi in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 11-10-2007, 06:04 AM
All times are GMT -5. The time now is 05:16 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search