[Script a Mob to cast spells] Guide menu

User Tag List

Results 1 to 8 of 8
  1. #1
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Script a Mob to cast spells] Guide

    How to script a npc so that it casts spells. And yells out stuff.

    First were gonna start out with a basic variable. Note that "99999" can be changed to what ever the mob's id is.

    Code:
    local npcid = 99999
    This says that npcid is the same thing as the id. So if we later on write npcid it will think its 99999.

    Next up.

    Note that NPCName_SpellName is changeable, NPCName SpellName too. Put the Spell ID in SpellID. And put a message which you want him to say in; You shall die slowly..

    Code:
    function NPCName_SpellName(Unit, event, miscunit, misc)
    	print "NPCName SpellName"
    	Unit:FullCastSpellOnTarget(SpellID,Unit:GetClosestPlayer())
    	Unit:SendChatMessage(11, 0, "You shall die slowly..")
    end
    Note that you can repeat this command over and over again. As long as the NPCName_SpellName is different every time.

    And at the end, put this.

    Code:
    RegisterUnitEvent(npcid,1,"NPC Name")
    And then its done. Now save the document as a .lua, and then your done.

    Hope this helped.

    The final script should look like this:

    Code:
    local npcid = 99999
    
    function NPCName_SpellName(Unit, event, miscunit, misc)
    	print "NPCName SpellName"
    	Unit:FullCastSpellOnTarget(SpellID,Unit:GetClosestPlayer())
    	Unit:SendChatMessage(11, 0, "You shall die slowly..")
    end
    
    RegisterUnitEvent(npcid,1,"NPC Name")
    Please report any buggs or questions.

    Over and out, P1raten.
    Last edited by P1raten; 03-18-2009 at 02:02 PM.

    [Script a Mob to cast spells] Guide
  2. #2
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh cmon guys, i thought that many would appreciate this. -.-

  3. #3
    Kirsebaer's Avatar Banned
    Reputation
    6
    Join Date
    Nov 2008
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha, well.
    Maybe if you made a bigger LUA tutorial.
    Bet there is many tutorials like this here.

  4. #4
    jordddm's Avatar Member
    Reputation
    11
    Join Date
    Nov 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is epic thnx alot xD

  5. #5
    Mildan's Avatar Member
    Reputation
    10
    Join Date
    Feb 2009
    Posts
    80
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be better if you taught on like WHEN the mob will use the spell or ability, and how to make the mob make a buff pop on on himself, or maybe even give some spell IDs
    But it looks good in general. + rep.

  6. #6
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx for the feedback, this was my first lua guide ever. So ive been inspired to make more.

  7. #7
    slapaf's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Agree with MaxLundell to many of these guides make it more explainable and such! as newbeginners need more help than pros.

  8. #8
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by slapaf View Post
    Agree with MaxLundell to many of these guides make it more explainable and such! as newbeginners need more help than pros.
    If you just reply and tell me what you dont understand, then i will be more than happy to help.

Similar Threads

  1. Custom Mobs dont cast spells - Quince
    By handofoberon in forum WoW EMU Questions & Requests
    Replies: 12
    Last Post: 12-14-2009, 03:12 AM
  2. [Lua] Mobs always cast spells on themselves. Not the target
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 08-17-2009, 09:12 AM
  3. LUA scripting -- Making game objects cast spells.
    By Jotox in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 05-08-2008, 03:44 PM
  4. [Question] hmm, how do i make a mob rapidly cast spells?
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 12-27-2007, 10:38 AM
  5. [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
    By Greed in forum WoW EMU Guides & Tutorials
    Replies: 6
    Last Post: 12-10-2007, 07:51 PM
All times are GMT -5. The time now is 10:03 PM. 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