Deaths Lua Guide for Teleporters,Custom Bosses and Item scripts! menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Deathbringer123's Avatar Master Sergeant
    Reputation
    25
    Join Date
    Oct 2010
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Deaths Lua Guide for Teleporters,Custom Bosses and Item scripts!

    Hey i decided to make a Lua Guide as im bored and got noting else to do enjoy

    1.0 making an NPC Speak
    2.0 Making a Custom Teleporter
    3.0 Making a Boss Cast Spells
    3.1 Making a Phase for a Boss
    4.0 Item Scripting


    1.0 Make an NPC Speak
    Ok First Thing is to Open up Notepad
    and Type the Following
    function NPC_OnCombat(Unit, Event)
    Ok this is the Function we use for when we want the NPC to do things when it enters Combat so to make it say Somthing we type
    Unit:SendChatMessage(12, 0, "Type you text Here")
    The Yellow bit is the Language they say it in
    here is a list of Languag Ids
    0 = UNIVERSAL
    1 = ORCISH
    2 = DARNASSIAN
    3 = TAURAHE
    6 = DWARVISH
    7 = COMMON
    8 = DEMONIC
    9 = TITAN
    10 = THELASSIAN
    11 = DRACONIC
    12 = KALIMAG
    13 = GNOMISH
    14 = TROLL
    33 = GUTTERSPEAK
    35 = DRAENEI
    The Red is the channel they say it in
    Say : 12
    Yell : 14
    Whisper: 13
    Once you have done that you should have somthing that looks like this
    function NPC_OnCombat(Unit, Event)
    Unit:SendChatMessage(12, 0, "Type your text Here")
    now put an End on the end so it looks like this
    function NPC_OnCombat(Unit, Event)
    Unit:SendChatMessage(12, 0, "Type your text Here")
    end
    And Finally you need to Register the function you do this by Typing
    RegisterUnitEvent(NPC Spawn Id, 1, "The Function Name")
    2.0 Making a Custom Teleporter
    Ok so we made our NPC Speak Lets make it so that when you click on him he Teleports you Somwhere Open up Notepad and Type this
    Function NPC_OnGossip(Unit, Event, Player)
    Unit:GossipCreateMenu(100, Player, 0)
    Unit:GossipMenuAddItem(9, "To Ironforge Please Sir", 0, 0)
    Unit:GossipSendMenu(player)
    end
    Ok so the Yellow bit is the Id of the Menu which can be any high number you want
    The Red bit is the Icon it will have next to it here is a list of the diff Icons you can have

    The Olive bit is Id of that Item so its id is 0
    After you done that make sure there is an End at the end and type this
    function Gossip_Submenu(pUnit, Event, Player, Id, Intid, Code)
    if (intid == 0) then
    Player:Teleport( Map id, x Coordinate, y coordinate, z coordinate)
    Player:GossipComplete()
    end
    end
    The "Player:Teleport( Map id, x, y, z)"
    will teleport the player to the location you want, to find the coordinates you need go to the location, target yourslef and type .gps
    The Olive bit is the Item Id so what its saying is If Item 0 is click then do this
    The Yellow bit will close the Gossip Menu for the Player

    3.0 Make a Custom Boss Cast Spells
    Ok Start from Fresh and Open Notepad and type all this out or just copy and Paste
    function Boss_OnCombat(pUnit, event)

    end

    function Boss_LeaveCombat(Unit, Event)

    end

    function Boss_OnDied(Unit, Event)

    end

    function Boss_OnKilledTarget(Unit, Event)

    end

    RegisterUnitEvent(Boss Spawn Id, 1, "Boss_OnCombat")
    RegisterUnitEvent(Boss Spawn Id, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(Boss Spawn Id, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(Boss Spawn Id, 4, "Boss_OnDied")
    The Functions Are Self Explanatory i think on what they do
    The Yellow Bits are the Bosses Spawn id

    So Lets Say we want the boss to cast Blessing of Kings on himself when he Enters combat so we do

    function Boss_OnCombat(Unit, event)
    Unit:CastSpell(20217)
    end

    function Boss_OnLeaveCombat(Unit, Event)

    end

    function Boss_OnDied(Unit, Event)

    end

    function Boss_OnKilledTarget(Unit, Event)

    end

    RegisterUnitEvent(Boss Spawn Id, 1, "Boss_OnCombat")
    RegisterUnitEvent(Boss Spawn Id, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(Boss Spawn Id, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(Boss Spawn Id, 4, "Boss_OnDied")
    Yes its Really that simple
    The Yellow Bit is the Spell Id
    And now for the Boring bit add this to these fucntions
    function Boss_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end

    Function Boss_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    This is Just to stop and Errors/Bugs happening when he Dies or leaves combat

    3.1 Making a Boss with Phases
    Ok so So Far We Have This
    function Boss_OnCombat(Unit, event)
    Unit:CastSpell(20217)
    end

    function Boss_OnLeaveCombat(Unit, Event)

    end

    function Boss_OnDied(Unit, Event)

    end

    function Boss_OnKilledTarget(Unit, Event)

    end

    RegisterUnitEvent(Boss Spawn Id, 1, "Boss_OnCombat")
    RegisterUnitEvent(Boss Spawn Id, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(Boss Spawn Id, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(Boss Spawn Id, 4, "Boss_OnDied")
    Which is a bit boring so lets add Some Phases
    Create a New Function lets call it Boss_Phase1
    Function Boss_Phase1(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(12, 0, "Prepare your Selfs")
    Unit:CastSpell(1535)
    end
    Ok so we have made our Phase 1 which will happen when we lower the bosses HP Down to 50% but we have to Register the Function and not like we normally do
    function Boss_OnCombat(pUnit, event)
    Unit:CastSpell(20217)
    Unit:RegisterEvent("Boss_Phase1", 1000, 0)
    end

    function Boss_OnLeaveCombat(Unit, Event)

    end

    function Boss_OnDied(Unit, Event)

    end

    function Boss_OnKilledTarget(Unit, Event)

    end

    Function Boss_Phase1(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(12, 0, "Prepare your Selfs")
    Unit:CastSpell(1535)
    end

    RegisterUnitEvent(Boss Spawn Id, 1, "Boss_OnCombat")
    RegisterUnitEvent(Boss Spawn Id, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(Boss Spawn Id, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(Boss Spawn Id, 4, "Boss_OnDied")
    The Yellow Bit is just the Spell Id for Fire Nova
    The Olive Bit is the name of the Function
    So What This is going to do is
    1. When he Enters Combat he Will Cast Blessing of Kings
    2. When you lower his HP to 50% he will say somthing and cast Fire Nova

    4.0 Item Scripting
    Remeber the Custom Teleporter we made ??
    Well there is not alot of Difference between that one with an NPC and the one were about to make with an Item
    Remeber the Function we used for the NPC Teleporter well there is a Difference betwen the Two a Item Gossip Function needs to look like this
    function OnGossipTalk(item, event, player, pMisc)
    item:GossipCreateMenu(102, player, 0)
    item:GossipMenuAddItem(3, "Take me to the Dream", 1, 0)
    item:GossipSendMenu(player)
    end
    See instead of using Unit: we use Item: thats really the only difference for that bit and the submenus look like this
    function OnGossipSelect(item, event, player, id, intid, code, pMisc)
    Im Sure if you have read the whole guide you should understand what to do with those functions and the Final Thing is the Registration of the Functions which look like this
    RegisterItemGossipEvent(6, 1, "OnGossipTalk")
    RegisterItemGossipEvent(6, 2, "OnGossipSelect")
    The Yellow is the Item Id
    Now the MOST Important thing of all is the Actual Item creation itself
    when you create it and i would suggest going to WoW-V.com in the On use: Section put in this Spell id 37745 it is what we call a "Dummy" spell it does nothing and is the Most Important part as without that part on your Item the Script will not work


    Thanks and Hope you Enjoyed
    Last edited by Deathbringer123; 04-25-2011 at 02:16 AM.

    Deaths Lua Guide for Teleporters,Custom Bosses and Item scripts!
  2. #2
    Deathbringer123's Avatar Master Sergeant
    Reputation
    25
    Join Date
    Oct 2010
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Over 100 views yet no comments ? atleast say thanks

  3. #3
    Vandy1111's Avatar Private
    Reputation
    1
    Join Date
    Apr 2011
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am reading it for first time, awesome tutorial +Rep. Wish I could really give you the rep.

  4. #4
    Deathbringer123's Avatar Master Sergeant
    Reputation
    25
    Join Date
    Oct 2010
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Vandy1111 Thanks

  5. #5
    SpellEffects's Avatar Sergeant
    Reputation
    64
    Join Date
    Apr 2011
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Deathbringer123 View Post
    The Red is the channel they say it in
    Correction: It is not which channel they say it in, it is how they say it. E.g "Say", "Yell" and "Whisper". I do not quite think that it should be defined as channels.
    Originally Posted by Deathbringer123 View Post
    This is Just to stop and Errors/Bugs happening when he Dies or leaves combat
    And by Errors/Bugs I hope you are referring to the fact that the event may repeat itself even though it should not. I.e the Boss casting spells whilst dead etc.
    Originally Posted by Deathbringer123 View Post

    function Boss_OnCombat(pUnit, event)
    Unit:CastSpell(20217)
    Unit:RegisterEvent("Boss_Phase1", 1000, 0)
    end
    This you are doing several times; you are including "pUnit" in the function, but using Unit? Why? It might just be a typo, and if it is; I suggest you correct it

    Aside from that a pretty decent tutorial.

    I'd like to see more advanced Lua tutorials.

  6. #6
    Deathbringer123's Avatar Master Sergeant
    Reputation
    25
    Join Date
    Oct 2010
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by SpellEffects View Post
    And by Errors/Bugs I hope you are referring to the fact that the event may repeat itself even though it should not. I.e the Boss casting spells whilst dead etc.

    This you are doing several times; you are including "pUnit" in the function, but using Unit? Why? It might just be a typo, and if it is; I suggest you correct it

    Aside from that a pretty decent tutorial.

    I'd like to see more advanced Lua tutorials.
    Thanks SpellEffects
    I Have Updated it know and yes i am refering to the Boss Casting spells when he shouldt be ie Dead

  7. #7
    Zazi529's Avatar Sergeant
    Reputation
    7
    Join Date
    Oct 2011
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for this, +rep

Similar Threads

  1. Guide for how to create your items and put it in game
    By Miziki in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 07-13-2010, 07:51 AM
  2. [Guide] How to make custom vendors and items!
    By Azshaz in forum WoW EMU Guides & Tutorials
    Replies: 11
    Last Post: 07-31-2009, 04:31 PM
  3. Quick guide for making custom quests Easy-Step
    By keazain in forum WoW EMU Guides & Tutorials
    Replies: 6
    Last Post: 02-20-2009, 05:35 PM
  4. [GUIDE] How to create boss and fight
    By WinKIller0 in forum WoW EMU Guides & Tutorials
    Replies: 17
    Last Post: 06-13-2008, 03:20 PM
  5. LUA guide for ppl who want to learn lua not just copy
    By runiker in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 02-20-2008, 01:54 AM
All times are GMT -5. The time now is 07:22 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