*Minor Request*  Make my NPC cast this spell every 30 seconds when not in combat menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    *Minor Request* Make my NPC cast this spell every 30 seconds when not in combat

    Well I want to make my NPC (ID = "4") [called PurpleWorks] cast the spell (30161) [the spell is a firework spell, no target required] every (30) seconds. It does NOT have to be in combat or anything, just every 30 seconds if it is alive, cast the spell. (Will not be killable anyhow)

    It seems like a simple script - I've had a look at some other threads based on lua timer but I seriously don't get them :[

    So could someone please give me a script that would do that? +Rep is definate, if it works. (I am currently working on arcemu rev 1055)



    EDIT:

    Solution Found:
    Code:
     function PurpleWorks_OnSpawn(pUnit,Event)
    pUnit:RegisterEvent("PurpleWorks_FireWork", 20000, 0)
    end
    
    function PurpleWorks_FireWork(Unit, Event)
    Unit:CastSpell(30161)
    end
    
    RegisterUnitEvent(4, 6, "PurpleWorks_OnSpawn")
    Last edited by Pretzal; 09-21-2008 at 10:23 PM.

    *Minor Request*  Make my NPC cast this spell every 30 seconds when not in combat
  2. #2
    RyeRye's Avatar Contributor
    Reputation
    240
    Join Date
    Aug 2008
    Posts
    996
    Thanks G/R
    0/1
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just make a LUA script :P



  3. #3
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hang on a second ill do you an LUA.


  4. #4
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats what I need - i tried one myself but i couldnt of done worse... I know a little about lua but im clueless on this.

    EDIT: Yoikes that was quick. lol hardly got time to reply O.O

  5. #5
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try This:

    (Sorry if any mistakes. Im tired :P)

    Code:
    --[[ FireworkNPC.lua
    
    This script was written and is protected
    by the GPL v2. This script was released
    by Performer of the Blua Scripting
    Project. Please give proper accredidations
    when re-releasing or sharing this script
    with others in the emulation community.
    
    ~~End of License Agreement
    -- Performer, September 21st, 2008. ]]
    
    function PurpleWorks_OnSpawn(pUnit, event)
        pUnit:RegisterEvent("PurpleWorks_Firework", 30000, 0)
    end
    
    function PurpleWorks_Firework
        pUnit:CastSpell(30161)
    end
    
    function PurpleWorks_OnDied(pUnit, event)
        pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(4, 1, "PurpleWorks_OnSpawn")
    RegisterUnitEvent(4, 2, "PurpleWorks_OnDied")
    Last edited by Performer; 09-20-2008 at 07:17 PM.


  6. #6
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Scripts\fireworks.lua:18: '(' expected near 'pUnit'

    gives me that error in arcemu-world.exe =[

  7. #7
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ooops noob mistake 2 secs. Sorry im half asleep.

    Code:
    --[[ FireworkNPC.lua
    
    This script was written and is protected
    by the GPL v2. This script was released
    by Performer of the Blua Scripting
    Project. Please give proper accredidations
    when re-releasing or sharing this script
    with others in the emulation community.
    
    ~~End of License Agreement
    -- Performer, September 21st, 2008. ]]
    
    function PurpleWorks_OnSpawn(pUnit, event)
        pUnit:RegisterEvent("PurpleWorks_Firework", 30000, 0)
    end
    
    function PurpleWorks_Firework(pUnit, event)
        pUnit:CastSpell(30161)
    end
    
    function PurpleWorks_OnDied(pUnit, event)
        pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(4, 1, "PurpleWorks_OnSpawn")
    RegisterUnitEvent(4, 2, "PurpleWorks_OnDied")



  8. #8
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well now it loads in world.exe perfectly; however the NPC doesan't do anything. >.<

  9. #9
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strange it should work :S Cant see any errors in it.


  10. #10
    Pretzal's Avatar Member
    Reputation
    8
    Join Date
    Aug 2008
    Posts
    57
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm would it be possible to do something like this to get it to work?


    Code:
    function PurpleWorks_Firework(pUnit, event)
    	if pUnit:GetHealthPct() == 100 then
        pUnit:CastSpell(30161)
    end
    end

Similar Threads

  1. [Trinity] How do I make a NPC cast some spell on his Summoner
    By chaplisimo in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 08-29-2014, 05:48 PM
  2. [Guide] How to make a NPC cast spells. NO LUA!
    By Power of Illuminati in forum WoW EMU Guides & Tutorials
    Replies: 52
    Last Post: 05-06-2011, 07:13 AM
  3. [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
  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. [Help] Making a NPC Teach you spells
    By Haza in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-18-2007, 11:45 AM
All times are GMT -5. The time now is 03:17 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