Get a script to run on NPC load... menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get a script to run on NPC load...

    Hey,

    I'm trying to make a little mini-script to give one of my NPCs a bit of movement, because emotes won't seem to work with waypoints for me I've decided to script it all. From what I know I'm pretty sure this script should work, but for some reason it doesen't. Any help is appreciated.

    Code:
    function SeanPinius_01(Sean, event)
    	Sean:MoveTo(1147.234985, -2513.346924, 62.106869, 4.014952)
    	Sean:RegisterEvent("SeanPinius_02", 2000, 1)
    end
    
    function SeanPinius_02(Sean, event)
    	Sean:Emote(173, 20000)
    	Sean:RegisterEvent("SeanPinius_03", 21000, 1)
    end
    
    function SeanPinius_03(Sean, event)
    	Sean:MoveTo(1139.066772, -2512.010986, 62.106483, 3.215648)
    	Sean:RegisterEvent("SeanPinius_04", 4000, 1)
    end
    
    function SeanPinius_04(Sean, event)
    	Sean:Emote(173, 15000)
    	Sean:RegisterEvent("SeanPinius_05", 16000, 1)
    end
    
    function SeanPinius_05(Sean, event)
    	Sean:MoveTo(1146.047485, -2504.617676, 62.073895, 1.256081)
    	Sean:RegisterEvent("SeanPinius_06", 7000, 1)
    end
    
    function SeanPinius_06(Sean, event)
    	Sean:Emote(173, 120000)
    	Sean:SendChatMessage(12, 7, "Work work...")
    	Sean:RegisterEvent("SeanPinius_07", 121000)
    end
    
    function SeanPinius_07(Sean, event)
    	Sean:MoveTo(1149.655029, -2512.616943, 62.107830, 2.235471)
    	Sean:RegisterEvent("SeanPinius_01", 120000, 1)
    end
    
    RegisterUnitEvent(90017, 18, function() return; end)

    Additional Information:
    -The NPCs ID is 90017
    -The NPC is located in Caer Darrow (Not scholomance, the town outside)

    Basically it makes Sean Pinius walk around, do the blacksmith emote on some anvils and a forge, then walks him back to his original position, then it loops.

    Get a script to run on NPC load...
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    RegisterUnitEvent(90017, 18, function() return; end)

    What?

    RegisterUnitEvent(90017, 18, "SeanPinius_01")

    Should work.

  3. #3
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RegisterUnitEvent(900017, 18, "SeanPinius_01") Worked, I still can't see why RegisterUnitEvent(90017, 28, function() return; end) didn't work. I've used RegisterUnitEvent(90017, 28, function() return; end) in another script to register a unit to most of my functions and it worked. =/
    Thanks for the help.

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The syntax is:

    (npcid, eventid, function)

    You can define a function in the hook or you can tell it to find a function name.

    function () return end <-- 3 lines effectively, which basically says when the function starts stop it... -.-

    If you put in the function name of the one that you want to do stuff in, then that will be the function called.

  5. #5
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RegisterUnitEvent(900017, 18, "SeanPinius_01") Worked, I still can't see why RegisterUnitEvent(90017, 28, function() return; end) didn't work. I've used RegisterUnitEvent(90017, 28, function() return; end) in another script to register a unit to most of my functions and it worked. =/
    Thanks for the help.

  6. #6
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Because here:

    900017, 18, "SeanPinius_01"

    You are saying npcID 900017, when he spawns call the function "SeanPinius01". It will look for this function in the script and then do it.

    "(90017, 28, function() return; end)"

    You are saying: npcID 90017, when he spawns call a new function, that does nothing, then end. You are defining the function in the hook rather than in a separate block.

Similar Threads

  1. Failing to get my scripts running
    By Peterk426 in forum Diablo 3 Bots Questions & Requests
    Replies: 1
    Last Post: 07-08-2012, 07:04 PM
  2. [How-To] Get your lua script to target the npc you want, with examples
    By choweyiii in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 08-27-2010, 08:22 AM
  3. [Release] Rin'ji Boss Script || V1 - Includes Teleporter NPC -
    By Bapesy in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 06-06-2008, 06:00 PM
  4. Need somone to help me get Boss scripts working.
    By controlsx2 in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 05-07-2008, 04:37 PM
  5. [priest] get attacked by your own factions npcs!
    By dylan in forum World of Warcraft Exploits
    Replies: 5
    Last Post: 12-30-2007, 09:14 PM
All times are GMT -5. The time now is 05:01 AM. 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