Nubish Lua question menu

User Tag List

Results 1 to 3 of 3
  1. #1
    hexonflux's Avatar Member
    Reputation
    10
    Join Date
    Mar 2007
    Posts
    40
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Nubish Lua question

    I've been searching and trying to find a way to greet the user when they first login.

    I know that you can alter the greeting message using C++ but I'm looking
    for something in Lua. Ultimately I'd like for the script to briefly greet the
    user and give them a few selected items, talent points, and spells.

    I guess I need a script that will look for when people login and go from
    there. I'd provide a sample of what I've been working on but I've yet
    to find anything to begin with.... they are all based on NPC or item
    scripting, not anything global such as a user logging in.

    Thanks in advance,
    - Hex

    Nubish Lua question
  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)
    What I do is this:

    Spawn npc next to spawning location
    On npc spawn, he is a variable.
    On player enter world, disable controll and wait 3 seconds (chance to load npc).
    Npc do stuff.
    Npc do some more stuff.
    Player enable controll.

    Here is an example script of me doing this:

    Code:
    local PlayerA = nil
    local NPC_SPAWNER_A = nil
    local NPC_SPAWNER_B = nil
    
    local PlayerB = nil
    local NPC_A = nil
    local NPC_B = nil
    
    function NPCGIA_GJOEAOJG_HXOJ(pUnit, Event)
        NPC_SPAWNER_A = pUnit
    end
    
    RegisterUnitEvent(99955, 18, "NPCGIA_GJOEAOJG_HXOJ")
    
    function NPCGIA_GJOEAOJG_HXOJ_Z(pUnit, Event)
        NPC_SPAWNER_B = pUnit
    end
    
    RegisterUnitEvent(99954, 18, "NPCGIA_GJOEAOJG_HXOJ_Z")
    
    function zzz_OnFirstEnterWorld(event, pPlayer)
        pPlayer:CastSpell(50010)
        if PlayerA == nil then
        PlayerA = pPlayer
                    local race = PlayerA:GetPlayerRace()
                    if race == 1 or race == 3 or race == 4 or race == 7 or race == 11 then 
            PlayerA:SetPlayerLock(1)
            PlayerA:MovePlayerTo(PlayerA:GetX(),PlayerA:GetY(),PlayerA:GetZ()+2, PlayerA:GetO(), 12288)
            PlayerA:CastSpell(50010)
            PlayerA:CastSpell(28330)
            PlayerA:CastSpell(53658)
            RegisterTimedEvent("TesttestTesttestTest_zzogje", 4000, 1)
            else
            PlayerA = nil
            end
        else
        pPlayer:RemoveAura(63752)
        pPlayer:RemoveAura(28330)
        pPlayer:RemoveAura(53658)
        end
    end
    
    function TesttestTesttestTest_zzogje(pUnit, Event)
        NPC_SPAWNER_A:SendChatMessage(12,0,"We got another live one!")
        NPC_SPAWNER_A:ChannelSpell(51361, PlayerA)
        NPC_SPAWNER_B:ChannelSpell(51361, PlayerA)
        NPC_SPAWNER_A:RegisterEvent("SayHelloToMyLittleFriend_Z_z_Z", 5000, 1)
    end
    
    RegisterServerHook(3, "zzz_OnFirstEnterWorld")
    
    function SayHelloToMyLittleFriend_Z_z_Z(pUnit, Event)
        local Name = PlayerA:GetName()
        NPC_SPAWNER_B:SendChatMessage(12, 0, "Woah, are you alright "..Name.."? Your lucky to be alive! Here let me give you a hand.")
        NPC_SPAWNER_A:RegisterEvent("CastReviveVisualThingyTeheTeheTehe", 4000, 1)
    end
    
    function CastReviveVisualThingyTeheTeheTehe(pUnit, Event)
        NPC_SPAWNER_A:StopChannel()
        NPC_SPAWNER_B:StopChannel()
        NPC_SPAWNER_B:FullCastSpellOnTarget(37755, PlayerA)
        NPC_SPAWNER_A:RegisterEvent("LetPlayerMoveaogyaohea", 2400, 1)
    end
    
    function LetPlayerMoveaogyaohea(pUnit, Event)
        PlayerA:SetPlayerLock(0)
        PlayerA:CastSpell(21074)
        PlayerA:RemoveAura(50010)
        PlayerA:RemoveAura(28330)
        PlayerA:RemoveAura(53658)
        NPC_SPAWNER_A:SendChatMessage(12, 0, "There we go! You should go see if you can help around the camp now.")
        NPC_SPAWNER_A:RegisterEvent("MassDespawnAndResetoajphae", 1000, 1)
    end
    
    function MassDespawnAndResetoajphae(pUnit, Event)
        PlayerA = nil
    end
    See if you can figure it out.

  3. #3
    SupernovaHH's Avatar Member
    Reputation
    12
    Join Date
    May 2008
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use stoneharry's idea or use this one. I've used this one before and it works really well. What it does is greet you on start and puts your name in a list so its not repeated. it also heals you if your near him and you have low health.

    http://www.mmowned.com/forums/emulat...ion-1-0-a.html

    Enjoy!
    Last edited by SupernovaHH; 11-14-2009 at 09:20 AM.

Similar Threads

  1. [LUA] Question
    By Algorithm in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 04-14-2008, 02:50 PM
  2. [LUA Question] Is it possible..?
    By Greeko in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 04-14-2008, 02:49 PM
  3. LUA Question (advanced?)
    By CairiFEA in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 04-13-2008, 01:57 AM
  4. LUA Question
    By CairiFEA in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 04-10-2008, 08:10 PM
  5. script lua question
    By onilank in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-21-2007, 06:58 PM
All times are GMT -5. The time now is 06:49 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