How to script LUA complete tut. menu

These ads disappear when you log in.

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Found's Avatar Banned
    Reputation
    239
    Join Date
    Mar 2009
    Posts
    642
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)

    How to script LUA complete tut.

    In this guide i'll show you to do most things with LUA. Ill be showing you how to:

    ----------

    0. Getting sun++ Lua Engine (Only if you allready compiled your core)

    1. Script Custom Mobs

    1.1 Say something
    1.2 Cast spells
    1.3 Summon other mobs
    1.4 Make phases (Change its scale, displayid Etc includet)

    2. Script GO's

    2.1 Portal

    3. Script a Global NPC

    3.1 Teleporter NPC
    3.2 Buffer
    3.3 Healer
    3.4 Morpher

    4. Script a Lua item (Credits: Roguezor - Kinda looked into his guide and rewrote)

    4.1 Warpstone (Under construction)


    ----------

    Ill be keeping this guide updated!

    Ok, now, let's start!

    0.

    Ok, here i will give the credits to Cele! And give you the link to his great guide on how to get Sun++:

    How To Patch Sun++ For Arcemu

    Note: It would be a realy good idea if you get Sun++ since this will give you way more options than with ArcEmu's original one!

    And now, let's continue to the "Real" Lua scripting:

    1.

    1.1

    When you script a mob your script should look like this:

    Code:

    Code:
    function Nameofthefunction(Unit, Event)
    end
    Now let's pretend that my NPC is called "Evilguy" and this script is supposed to make him do something on combat!

    Then the script should look like this:

    Code:

    Code:
    function Evilguy_OnCombat(Unit, Event)
    end
    Red: As you see this is the name of my NPC
    Blue: This is OnCombat

    Note: Nameofthefunction could be anything meaning that this could ex be: "Iamsocool" - it doesen't realy matter! To make it easier for you i think should do like me: "YourNpcNamegoesHere_OnCombat"

    Now, let's continue:

    To make the Npc something say when you approach it we will use this code:

    Code:

    Code:
    Unit:SendChatMessage(12, 0, "Here you write what ever you want your NPC to say")
    Red: 12 means that when you approach your npc the npc will "SAY" not yell or whisper.

    Here are some codes you can choose as well:

    Code:

    12 – npc say
    13 – npc whisper
    14 - npc yell

    Blue: This is for the language, 0 means "universal" which all races can understand!

    Here are some language codes you can choose as well:

    Code:

    Code:
    0 = Universal
    1 = Orcish
    2 = Darnassian
    3 = Tauron
    6 = Dwarfs
    7 = Common
    8 = Demonic
    9 = Titans
    13 = Gnomish
    14 = Troll language
    33 = Gutterspeak
    35 = Dranie or whatever the **** that is
    Now, let's add the function to my script:

    Code:

    Code:
    function Evilguy_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I Will Kill You!")
    end
    Now this makes my NPC yell "I will kill you!" in Universal - meaning that everybody can understand it

    Now we need to register the function.
    Hit enter two times and write in this:

    Code:

    Code:
    RegisterUnitEvent(YourNpcSpawnIDGoesHere, 1, "Nameofthefunction")
    Red: This is the name of the function, mine was "Evilguy_OnCombat"

    Blue: 1 is the code for, that this function will register on combat!

    Here are some other options you can use:

    Code:

    Code:
    1 = Enter combat
    2 = Leave combat
    3 = Killed target
    4 = When Npc is dead
    6 = Spawn
    7 = Gossip talk
    8 = Reach waypoint
    10 = When player enters range
    Let's pretend that my Npc's spawn ID is "9995", and now let's look at the whole script:

    Code:

    Code:
    function Evilguy_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I Will Kill You!")
    end
    
    RegisterUnitEvent(9995, 1, "Evilguy_OnCombat")
    Here is something you wanna add to your script as well:

    Code:

    f
    Code:
    unction Evilguy_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents() 
    end
    
    function Evilguy_OnKilledTarget(Unit, Event)
    end
    
    function Evilguy_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end
    Red: This pretty much talks for it self, anyway! Let's pretend that you made this realy huge boss scripts, with lots of phases and stuff like that. Then when your NPC got killed or left combat, ofc you want your NPC to get back to normal size and normel DisplayID. Therefore this "RemoveEvents"

    Blue: This is when your NPC kills a target. You can ex make your NPC yell "Hahaha, i told you!"!

    And then to register theese functions:

    Code:

    Code:
    RegisterUnitEvent(YourNpcSpawnIDGoesHere, 2, "_OnLeaveCombat")
    RegisterUnitEvent(YourNpcSpawnIDGoesHere, 3, "_OnKilledTarget")
    RegisterUnitEvent(YourNpcSpawnIDGoesHere, 4, "_OnDied")
    And now to put all this together in one script:

    Code:

    Code:
    function Evilguy_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I Will Kill You!")
    end
    Code:
    function Evilguy_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents() 
    end
    
    function Evilguy_OnKilledTarget(Unit, Event)
    end
    
    function Evilguy_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(9995, 1, "Evilguy_OnCombat")
    RegisterUnitEvent(9995, 2, "Evilguy_OnLeaveCombat")
    RegisterUnitEvent(9995, 3, "Evilguy_OnKilledTarget")
    RegisterUnitEvent(9995, 4, "Evilguy_OnDied")
    1.2

    Now, just to make a NPC say something is kinda boring, let's add a spell:

    To make the NPC cast a spell we will need another function, so just start to write:

    Code:

    Code:
    function Nameofthefunction(Unit, Event)
    end
    Note: To make it easyer remember i will make the function name to: "Evilguy_Spell1":


    Code:
    function Evilguy_Spell1(Unit, Event)
    end
    Code:
    Unit:FullCastSpellOnTarget(spellid, Unit:Target)
    Target could be some of the following:

    Code:

    Code:
    - GetRandomPlayer(0) = Will make the mob target a random player
    - GetRandomPlayer(1) = Target random player in short range
    - GetRandomPlayer(2) = Target random player in medium range
    - GetRandomPlayer(3) = Target random player in long range
    - GetRandomPlayer(4) = Target random player with mana
    - GetRandomPlayer(5) = Target random player with rage
    - GetRandomPlayer(6) = Target random player with energy
    - GetRandomPlayer(7) = Target random player, main tank won't be targeted
    - GetMainTank() = Talks for itself
    - GetClosestPlayer() = Talks for itself :P
    So let's say that my NPC will cast its spell on the main tank, then my script would look like this:

    Code:

    Code:
    function Evilguy_Spell1(Unit, Event)
    Unit:FullCastSpellOnTarget(5, Unit:GetMainTank())
    end
    Red:This spell is Death Touch (Uhh, evil )

    And now, we want this to be registeret in combat, therefore we will use this code:

    Code:

    Code:
    Unit:RegisterEvent("nameofthefunction", timeinmiliseconds, howmanytimes)
    Now, ill make it look like this:

    Code:

    Code:
    Unit:RegisterEvent("Evilguy_Spell1", 60000, 2)
    This will make the NPC cast the spell 2 times during 60 seconds.

    Now we want this to be registered OnCombat, so the whole script should now look like this:

    Code:

    Code:
    function Evilguy_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I Will Kill You!")
    Unit:RegisterEvent("Evilguy_Spell1", 60000, 2) <-------- (This is where your supposed to put your "RegisterEvent" when your want it registered on combat)
    end
    
    function Evilguy_Spell1(Unit, Event)
    Unit:FullCastSpellOnTarget(5, Unit:GetMainTank())
    end
    
    function Evilguy_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents() 
    end
    
    function Evilguy_OnKilledTarget(Unit, Event)
    end
    
    function Evilguy_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(9995, 1, "Evilguy_OnCombat")
    RegisterUnitEvent(9995, 2, "Evilguy_OnLeaveCombat")
    RegisterUnitEvent(9995, 3, "Evilguy_OnKilledTarget")
    RegisterUnitEvent(9995, 4, "Evilguy_OnDied")
    1.3

    LUA scripting guide! (Part 1.3 - 1.4)

    1.4

    LUA scripting guide! (Part 1.3 - 1.4)

    2.

    2.1

    Now i will teach you how to script a portal:

    The script itself looks like this:

    Code:

    Code:
    function ScriptName(pUnit, Event, pMisc)
               pMisc:Teleport(MapID, X-Coord, Y-Coord, Z-Coord)
    end
    Code:
    RegisterGameObjectEvent(GameObjectsENTRYID, 2, "ScriptName")
    Now, look at the first line:

    Code:

    Code:
    function ScriptName(pUnit, Event, pMisc)
    Red: Replace this with the name of your Script. It could be anything!

    EX:

    Code:

    Code:
    function Teleportwhenclicked(pUnit, Event, pMisc)
    Now to the next line:

    Code:

    Code:
    pMisc:Teleport(MapID, X-Coord, Y-Coord, Z-Coord)
    Now, that pretty much tells what to do itself. Simply replace the MapID, X-Coord, Y-Coord and Z-Coord with your .gps details

    Now end it with an:

    Code:

    Code:
    end
    And ofc to register the event:

    Code:

    Code:
    RegisterGameObjectEvent(GameObjectsENTRYID, 2, "ScriptName")
    Green: Change this into the spawn ID of your gameobject
    Red: This should be the same scriptname as the name you chose on the first line

    Now mine looks like this:

    Code:
    function PvPArena2(pUnit, Event, pMisc)
               pMisc:Teleport(530, -2009.403320, 6590.512695, 12.360116)
    end
    RegisterGameObjectEvent(999998, 2, "PvPArena2")


    This will teach you how to make a Teleporter NPC

    Start with

    Code:

    Code:
    function On_Gossip(unit, event, player)
    Under that write:

    Code:

    Code:
    unit:GossipCreateMenu(Any high number, player, 0)
    And now we need to write what the options should be, ex:

    Code:

    Code:
    unit:GossipMenuAddItem(0,"Alliance Locations", 0, 0)
    What the collors mean:

    Red: This is the menu, meaning that when u click this, you will go to a submenu, where you can click ex. "Ironforge", and it will port you to ironforge(i will tell you how to that later in the guide)

    Blue: You could call this the menu number, meaning that all menu's(including submenu's) should have a different number. You can't have two menu's having the same number. Then it won't work

    Okay then, end this function by writting:

    Code:

    Code:
    	
    unit:GossipSendMenu(player)
    end
    Here is mine:

    Code:

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Alliance Locations", 0, 0)
    unit:GossipSendMenu(player)
    end
    Now to the Submenu's:
    Start with:

    Code:

    Code:
    function Gossip_Submenus(unit, event, player, id, intid, code)
    And now we will edit the alliance locations, so that it will port us to ex Ironforge:

    write this:

    Code:

    Code:
    if(intid == 0) then
    (Blue: As you see it's a zero(0). Now, go look at alliance locations. Alliance Locations are having a 0 as the menu number, now what we just wrote, means, that if you press "Alliance Locations" you will be transfered to a submenu, where to options: Darnassus, Ironforge etc etc are.)

    Now under this write:

    Code:

    Code:
    unit:GossipCreateMenu(Any high number(Not the same as the first GossipCreateMenu, player, 0)
    And now we will start to add the locations, write:

    Code:

    Code:
    unit:GossipMenuAddItem(0,"Darnasuss", 50, 0)
    unit:GossipMenuAddItem(0,"Ironforge", 51, 0)
    unit:GossipMenuAddItem(0,"Stormwind", 52, 0)
    unit:GossipMenuAddItem(0,"Exodar", 53, 0)
    unit:GossipSendMenu(player)
    end
    Now mine looks like this:

    Code:

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Alliance Locations", 0, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    if(intid == 0) then
    unit:GossipCreateMenu(101, player, 0)
    unit:GossipMenuAddItem(0,"Darnasuss", 50, 0)
    unit:GossipMenuAddItem(0,"Ironforge", 51, 0)
    unit:GossipMenuAddItem(0,"Stormwind", 52, 0)
    unit:GossipMenuAddItem(0,"Exodar", 53, 0)
    unit:GossipSendMenu(player)
    end
    Now to make the options port you where you wanna go!

    Note: You can see that the menu number of Darnasuss is 50, Ironforge is 51, Stormwind is 52, Exodar is 53.

    Now write this:

    Code:

    Code:
    if(intid == 50) then
    player:Teleport(1, 9985.907227, 1971.155640, 1326.815674)
    end

    Blue: 50 is the menu number of Darnassus.

    And then you will have to repeat this until all your options will port you where they are supposed to port you!

    Finnish everything off with an extra:

    Code:

    end

    And ofc to register the events write:

    Code:

    Code:
    RegisterUnitGossipEvent(Your NPC Spawn ID, 1, "On_Gossip")
    RegisterUnitGossipEvent(Your NPC Spawn ID, 2, "Gossip_Submenus")
    So now mine looks like this:

    Code:

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Alliance Locations", 0, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    if(intid == 0) then
    unit:GossipCreateMenu(101, player, 0)
    unit:GossipMenuAddItem(0,"Darnasuss", 50, 0)
    unit:GossipMenuAddItem(0,"Ironforge", 51, 0)
    unit:GossipMenuAddItem(0,"Stormwind", 52, 0)
    unit:GossipMenuAddItem(0,"Exodar", 53, 0)
    unit:GossipSendMenu(player)
    end
    if(intid == 50) then
    player:Teleport(1, 9985.907227, 1971.155640, 1326.815674)
    end
    if(intid == 51) then
    player:Teleport(0, -5028.265137, -825.976563, 495.301575)
    end
    if(intid == 52) then
    player:Teleport(0, -9100.480469, 406.950745, 92.594185)
    end
    if(intid == 53) then
    player:Teleport(530, -4072.202393, -12014.337891, -1.277277)
    end
    end
    Code:
    RegisterUnitGossipEvent(5, 1, "On_Gossip")
    RegisterUnitGossipEvent(5, 2, "Gossip_Submenus")
    3.2 and 3.3

    Making a healer and a buffer is about the same thing, therefore i will mix theese two!

    We are also using about the same functions as when you make a warper!

    Okay, let's start!

    Start with this function:

    Code:

    Code:
    function Buff_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Buffs", 0, 0)
    unit:GossipMenuAddItem(0,"Heals", 1, 0)
    unit:GossipSendMenu(player)
    end
    Red: Now Buff_Gossip is the function name, but since you allready know what that is
    Blue: This is the menu name, this could be anything.
    Yellow: This is the menu number. If you follow the guide on how to make a teleporter NPC you should know what this is! (If you didn't follow the guide on how to teleporter NPC you should know that all menu's should have >>>DIFFERENT<< numbers, it's very important that you do not make two menu's with the same menu number)

    And now to the submenus:

    Code:

    Code:
    function Buff_Submenus(unit, event, player, id, intid, code)
    Now we need to add this line bellow:

    Code:

    Code:
    if(intid == 0) then
    Red: As you see, "0" is the number that the menu "Buffs" has as menu number. This means that something happends, when u press "Buffs".

    Now let's add, WHAT is supposed to happend when you press "Buffs" (0)

    Note: You could make the NPC show you more menu's, so you had different choises on which buff you want, but i will just show you how to make the function buff you. If you followed the guide on how to make a teleporter NPC you should know how to make the function give you more menu's.

    To make the NPC buff you (this is also used when you want the NPC to heal you) we will use this line:

    Code:

    Code:
    Unit:FullCastSpellOnTarget(SpellID, player)
    Note: I will use "
    Code:
    20217
    " as my spell ID (Songflower Serenade)

    Bellow that add this:

    Code:

    Code:
    player:GossipComplete()
    end
    Then hit enter two times and register the functions:

    Code:

    Code:
    RegisterUnitGossipEvent(YourNPC'sSpawnID, 1, "Buff_Gossip")
    RegisterUnitGossipEvent(YourNPC'sSpawnID, 2, "Buff_Submenus")
    Note: I will use 5600 as my NPC's spawn ID!

    And now let's put it all together!:

    Code:

    Code:
    function Buff_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Buffs", 0, 0)
    unit:GossipMenuAddItem(0,"Heals", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    function Buff_Submenus(unit, event, player, id, intid, code)
    if(intid == 0) then
    Unit:FullCastSpellOnTarget(20217, player)
    player:GossipComplete()
    end
    Code:
    RegisterUnitGossipEvent(5600, 1, "Buff_Gossip")
    RegisterUnitGossipEvent(5600, 2, "Buff_Submenus")
    To make the NPC cast a healing spell we will use the same function as when you want the NPC to buff you:

    Code:
    Code:
    if(intid == 1) then
    Unit:FullCastSpellOnTarget(SpellID, player)
    player:GossipComplete()
    end
    
    Red: As you see, "1" is the number that the menu "Heals" has as menu number. This means that something happends, when u press "Heals".
    Blue: Instead of placing a buff spell ID you just place a healing spell id here! Simpel! Isen't it?
    
    Note: I will use "27136" as my healing spell.
    
    Now let's add this to the script:
    
    Code:
    
    function Buff_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Buffs", 0, 0)
    unit:GossipMenuAddItem(0,"Heals", 1, 0)
    unit:GossipSendMenu(player)
    end
    
    function Buff_Submenus(unit, event, player, id, intid, code)
    if(intid == 0) then
    Unit:FullCastSpellOnTarget(20217, player)
    player:GossipComplete()
    end
    if(intid == 1) then
    Unit:FullCastSpellOnTarget(27136, player)
    player:GossipComplete()
    end
    Code:
    RegisterUnitGossipEvent(5600, 1, "Buff_Gossip")
    RegisterUnitGossipEvent(5600, 2, "Buff_Submenus")
    Red: This is were to place the healing function!

    3.4

    This will show you how to make a morpher:

    I will be using the script from before:

    Code:
    Code:
    function Buff_Gossip(unit, event, player)
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(0,"Buffs", 0, 0)
    unit:GossipMenuAddItem(0,"Heals", 1, 0)
    unit:GossipMenuAddItem(0,"Morph Me", 2, 0)
    unit:GossipSendMenu(player)
    end
    
    function Buff_Submenus(unit, event, player, id, intid, code)
    if(intid == 0) then
    Unit:FullCastSpellOnTarget(20217, player)
    player:GossipComplete()
    end
    if(intid == 1) then
    Unit:FullCastSpellOnTarget(27136, player)
    player:GossipComplete()
    end
    if(intid == 2) then
    player:SetModel(DisplayIDGoesHere)
    player:GossipComplete()
    end
    Code:
    RegisterUnitGossipEvent(5600, 1, "Buff_Gossip")
    RegisterUnitGossipEvent(5600, 2, "Buff_Submenus")
    This is the new menu. As you see this has the number "2" as menu number!
    "player:SetModel(DisplayIDGoesHere)" is how the new function looks like. Just place your new displayid in "(DisplayIDGoesHere)" and it will transform you into the new displayid when you press "2"

    This will pretty much teach you how to make a morpher.


    Updated: 7/22/09

    Well thanks for reading I hope it helped
    Last edited by Found; 07-22-2009 at 12:53 PM. Reason: UpDaTeS

    These ads disappear when you log in.

  2. #2
    theironmaiden's Avatar Private
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Great Tut
    Rep+

  3. #3
    Madnesst's Avatar Private
    Reputation
    1
    Join Date
    Feb 2009
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    [gaminggu*ter.com/forum/f74/guide-lua-scripting-wow-private-servers-72892.html~>Guide - LUA scripting for WoW private servers]] repost? ;s :crap::tard:
    *=t

  4. #4
    theowner's Avatar Sergeant
    Reputation
    2
    Join Date
    May 2007
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    This guide helped me a lot more than that guide, this was a great guide. +repx2
    And theironmaiden thats a nice rep power you have there
    Are you dreaming ??

  5. #5
    Found's Avatar Banned
    Reputation
    239
    Join Date
    Mar 2009
    Posts
    642
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Thanks, needed the rep

  6. #6
    theironmaiden's Avatar Private
    Reputation
    1
    Join Date
    Nov 2008
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    haha i dont have rep cause i just develop for ,yself at, and cause i work for wow-pwnage ;p

  7. #7
    rysliv's Avatar Sergeant
    Reputation
    1
    Join Date
    Oct 2007
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    i made a teleporter

    and i made another one for guild house transportation

    that the guild house one

    is actually interconnected with the main teleporter and will not let me have two teleporters

    can you please! help me with this im pretty advanced with .lua scripts but i dont see how this is even possible to happen...! yes there is two different npc's one is 99875 and one is 99891

    wtf is going on!

    wow emulators are dumber than i thot!

  8. #8
    Found's Avatar Banned
    Reputation
    239
    Join Date
    Mar 2009
    Posts
    642
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    thats correct and sadly you can only have 1 LUA tele npc, although C++ is an option

  9. #9
    Ghostday's Avatar Sergeant CoreCoins User
    Reputation
    15
    Join Date
    Feb 2009
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    I need help, i wanna make an npc that gives you items and teaches you skills, how you do that?

  10. #10
    Ghostday's Avatar Sergeant CoreCoins User
    Reputation
    15
    Join Date
    Feb 2009
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    1337 scammer
    Need any help scamming PM me and I'll be glad to educate you
    Lol, nice, anyway, good guide +Rep

  11. #11
    Sensux's Avatar Private
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    I like this guide, I would like to use it on my site. With your permission of course.

  12. #12
    Jonthe838's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    but where is the guide for an item? :S
    Lines of Coding: |||||||||| Goal 1000
    Current: 677 Achived Goals: 500 Lines


  13. #13
    xpxd's Avatar Sergeant
    Reputation
    18
    Join Date
    Sep 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    to make an npc give u item just make the you now like

    unit:CreateMenu(50, player, 0)
    unit:MenuAddItem(1, "name", 45, 0)
    unit:GossipSendMenu(player)
    end
    ......
    ......
    .....

    if(intid == 45) then
    player:AddItem(ItemId, Number of times to add)
    unit:GossipComplete(player)

  14. #14
    Omie's Avatar Private
    Reputation
    1
    Join Date
    Mar 2009
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Awesome guide, + Rep.

    I was wondering if you can help me, I used your 'Making the NPC talk Guide' and this is what I've got:
    Code:
    function Mannoroth_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Your End is near, I shall tear you appart! I killed that feeble Orc, Grom and now I will kill you!")
    end
    
    function Mannoroth_OnLeaveCombat(Unit, Event) 
    Unit:SendChatMessage(14, 0, "Flee! Feed my soul wish your shame, pathetic things!")
    end
    
    function Mannoroth_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "DIE! How could you possibly think you beings can destroy me? I am a Pit Lord, I am Mannoroth!")
    end
    
    function Mannoroth_OnDied(Unit, Event)
    Unit:SendChatMessage(14, 0, "This Cannot be! I.. I am.. I am Mannoroth, Destroyer of Worlds, Champion of the Burning Legion! Avenge.. Me.. Sargeras..")
    end
    
    RegisterUnitEvent(87979, 1, "Mannoroth_OnCombat")
    RegisterUnitEvent(87979, 2, "Mannoroth_OnLeaveCombat")
    RegisterUnitEvent(87979, 3, "Mannoroth_OnKilledTarget")
    RegisterUnitEvent(87979, 4, "Mannoroth_OnDied")
    He'll say the first OnCombat line and won't say anything after, can anyone help?
    Thanks.

  15. #15
    Linkn's Avatar Contributor CoreCoins User
    Reputation
    90
    Join Date
    Mar 2009
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    HTML Code:
    http://www.ac-web.org/forum/tutorials/34266-mega-tutorial-lua-scripting-guide.html
    Exact re-post, give credits to Junni42 from AC-Web man!

Page 1 of 2 12 LastLast

Similar Threads

  1. [PQR] How to script (lua) Mana Sapphire for Mages (auto cast at low mana)
    By dealerx in forum WoW Bot Maps And Profiles
    Replies: 11
    Last Post: 10-11-2016, 08:34 AM
  2. [share] mini-tut on gossip scripts lua
    By b!atch in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 05-29-2008, 05:11 AM
  3. [TuT] How to enable LUA with Compile
    By LordJedi in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 03-21-2008, 12:06 AM
  4. How to make lua scripted portals
    By *Alexz* in forum WoW EMU Guides & Tutorials
    Replies: 9
    Last Post: 02-18-2008, 06:05 PM
  5. [GUIDE] How to activate LUA scripts
    By ~SaiLyn~ in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-25-2007, 11:52 AM
All times are GMT -5. The time now is 09:52 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search