Quest Script Not Sure How to Code It menu

User Tag List

Results 1 to 2 of 2
  1. #1
    BanzBoyz77's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2010
    Posts
    258
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quest Script Not Sure How to Code It

    I'll just get to the point, I have a script
    function Thal(Unit, Event)
    Unit:RegisterEvent("Thal_Say", 90000, 0)
    end

    function Thal_Say(Unit, Event)
    local chance = math.random(1,3)
    if(chance == 1) then
    Unit:SendChatMessage(12, 0, "Cursed with what I fought against.")
    end
    if(chance == 2) then
    Unit:SendChatMessage(5, 0, "What difference is there between the Scourge and Forsaken?")
    end
    if(chance == 3) then
    Unit:SendChatMessage(12, 0, "The Holy Blade has been plagued. My soul... tainted. My body, rotten.")
    end
    if(chance == 4) then
    Unit:SendChatMessage(12, 0, "Betrayed by a friend. Forced to befriend monsters, and put in a situations with impossible outcomes. ")
    end
    if(chance == 5) then
    Unit:SendChatMessage(12, 0, "The oath of which we had together, is about to cause me great pain, Sylvanas.")
    end
    if(chance == 6) then
    Unit:SendChatMessage(5, 0, "This... Forsaken, will pay once this Scarlet problem is over.")
    end
    if(chance == 7) then
    Unit:SendChatMessage(12, 0, "The holy humans aren't so holy anymore.")
    end
    if(chance == then
    Unit:SendChatMessage(12, 0, "Is there meaning to this life?")
    end
    if(chance == 9) then
    Unit:SendChatMessage(12, 0, "Traped in a mountainous cage. What will happen if we lose this land?")
    end
    end

    function Thal_Died(Unit, Event)
    Unit:RemoveEvents()
    end

    RegisterUnitEvent(90010, 18, "Thal")
    RegisterUnitEvent(90010, 4, "Thal_Died")

    And I want to combine this script into a quest like form with times on when he npcs will talk say, with this dialouge.


    Quest Text~Sargearas~ I am sorry we must meet at such short terms, champion. I am affraid Kez's hobby of peaking will cost him greatly this time. Last we met, he closed the door to my tomb, but this time... I will introduce him to his resting place in imensive agony.

    Quest Text~Kez~ ARGHHH ARGHHH! GHH! Uh, Aghhhh!

    Quest Text~Sargearas~ This pitaful body of his. I shall relieve him of this pain....... NO, what are you doing. You hope to save your friend. Kez's faith is sealed. Your's is next. Argh..... Pitty that you managed to break the seal bound between us.

    Quest Text~ Kez~ Get Out Of My Body! Cleanse my soul of this cursed demonic spell! $n, toss that water on me. Break the bound completely.

    Quest Text~Sargearas~ You wretched living soul, the day I hold your body in my hands and evaporate you, will be the day this world burns in the flame of the Legion......... This......... Isn't....... OVER!

    Quest Text~Kez~ Uh, uh, ah. Finally a catch of air to clean my mind of what horrors we just witnessed. I must thank you $n, you saved me from the grasp of the most feared creature of this universe.

    Quest Text is the Dialouge, as to say. And I need it to be in a quest form with It starting on Quest accept and quest end at the end. How would I do it. Please Post an example with full details. I usually dont understand scripting without an example to go off of. People trying to explain it just confuses the heck out of me.

    Edit
    -----------
    Sargearas and Kez is one dialouge, one person. Kez is being possessed

    Quest Script Not Sure How to Code It
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You need to control two npc's through one function. There are two ways to do this:

    -Store each NPC as a variable on spawn
    -Get each npc and then save it into a variable when required

    The second method is probably the most effective.

    I use the first method in the following script: http://subversion.assembla.com/svn/K...dOrcRescue.lua

    When ArcEmu loads the script, I create a variable that is nothing.
    When the NPC is spawned, I take that variable and set it to pUnit (so now whenever I call that variable it will be that specific unit).

    I then use it when the other creature enters combat.

    The second method is like so:
    Code:
    function GetNPC(pUnit)
      local cpn = FlyingDude:GetCreatureNearestCoords(-7298, -1076, 283, 30117)
        if cpn ~= nil then
        FlyingDude:ChannelSpell(31324, cpn)
        end
    end
    FlyingUnit was another npc I already had defined. I had it get the creature nearest to some coords with a specific ID. The syntax is as follows:
    :GetCreatureNearestCoords(x,y,z,npcid)
    I then made sure that the creature was there and did not return null (nothing) and continued.

    Using this method you can have several functions which just have each creature send different messages after specific times. :)

Similar Threads

  1. Not sure how to handle resto druids 'germination' talent.
    By thrakmar in forum PE Support forum
    Replies: 19
    Last Post: 12-29-2014, 02:20 AM
  2. Bonus xp buf active in diablo not sure how long
    By 9ballfreak in forum Diablo 3 General
    Replies: 2
    Last Post: 03-03-2014, 09:32 PM
  3. Bonus xp buf active in diablo not sure how long
    By 9ballfreak in forum Diablo 3 General
    Replies: 3
    Last Post: 03-03-2014, 05:21 PM
  4. Replies: 7
    Last Post: 09-13-2013, 08:33 AM
All times are GMT -5. The time now is 11:33 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