[LUA] Let a mob cast a spell, On another mob menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Skatee's Avatar Member
    Reputation
    12
    Join Date
    May 2009
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Let a mob cast a spell, On another mob

    Hello all,

    I'm making a tutorial about mobs who cast a spell on a mob. Most people got trouble with this because they didn't know how to let a NPC cast a spell on a NPC. Well, I'm going to show you how to do that and it is very simple if you read the things good. I am not explaining the basic things about what is function etc. because you should know that before reading this tutorial.

    Ok, the plan what I want to do is to let a NPC channel a spell on another NPC. How to do that? Simple.

    First of all, I'm going to define the bosses name to "Unit".
    function BossName_Define(Unit, Event)
    BossName = Unit
    end

    RegisterUnitEvent(EntryID, 18, "BossName_Define")
    Now I defined that BossName = Unit. Meaning with "function BossName_Define", you can simple way remove define, because it is actually OnSpawned. I just did define to make it look easier. 18 is the number of the registering event "OnSpawned".

    Now, we should define the mob who casts a spell on the BossName. You must do this in one script
    function BossName_Define(Unit, Event)
    BossName = Unit
    end

    RegisterUnitEvent(EntryID, 18, "BossName_Define")

    function MobName_Define(Unit, Event)
    MobName = Unit
    end

    RegisterUnitEvent(EntryID, 18, "MobName_Define")
    Now we defined that BossName = Unit and MobName = Unit. I'm going to show now how to let the mob cast a spell on the boss.

    function BossName_Define(Unit, Event)
    BossName = Unit
    end

    RegisterUnitEvent(EntryID, 18, "BossName_Define")

    function MobName_Define(Unit, Event)
    MobName = Unit
    MobName:RegisterEvent("MobName_Channel", 10, 1)
    end

    function MobName_Channel(Unit, Event)
    MobName:FullCastSpellOnTarget(30402, BossName)
    end

    RegisterUnitEvent(EntryID, 18, "MobName_Define)
    As you can see, I'm using "MobName:RegisterEvent("MobName_Channel", 10, 1)" Instead of "Unit:RegisterEvent("MobName_Channel", 10, 1)". Why? Because we just defined that MobName = Unit, so we are not using Unit anymore, only at the start of functions with "function MobName_Channel(Unit, Event).

    Well, this is all what you should know to make a mob cast a spell on a mob. I hope you enjoined this tutorial and if you have further questions, don't be afraid to ask

    [LUA] Let a mob cast a spell, On another mob
  2. #2
    Dibes's Avatar Active Member
    Reputation
    18
    Join Date
    May 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is a decent tutorial but can be cut down to a much slimmer more understandable guide, i will +rep because it is good to know but put in a few colors and space it out so its mroe eye - pleasing,
    best of luck,
    Dibes

  3. #3
    Confucius's Avatar Super Moderator Don't Look Back in Anger

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1418
    Join Date
    Oct 2007
    Posts
    2,808
    Thanks G/R
    302/311
    Trade Feedback
    7 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Good job, +rep2x no longer are you new user!

  4. #4
    Skatee's Avatar Member
    Reputation
    12
    Join Date
    May 2009
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you

Similar Threads

  1. [Question] Make a Mob Cast a Spell When Critted?
    By kevinno in forum World of Warcraft Emulator Servers
    Replies: 17
    Last Post: 05-27-2008, 07:10 PM
  2. Creature wont cast his spells [Lua Script]
    By bill45 in forum World of Warcraft Emulator Servers
    Replies: 13
    Last Post: 05-26-2008, 08:29 PM
  3. Question How do I make a mob stand still casting a spell?
    By jakjaklol1337 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 04-26-2008, 03:53 PM
  4. LUA help, how to make npc cast a spell at a certain HP???
    By pioneer1337 in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-30-2008, 06:27 PM
  5. [Guide][LUA] Make a mob speak/use spell on a %!
    By Meltoor in forum WoW EMU Guides & Tutorials
    Replies: 14
    Last Post: 02-29-2008, 10:41 PM
All times are GMT -5. The time now is 05:58 PM. 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