[LUA] Custom NPC's don't cast spells or talk menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Custom NPC's don't cast spells or talk

    Hello there. For some reason, my LUA scripts doesn't work as they are supposed to do. When I make an boss, it's not always they talk or cast spells. But those few bosses that cast spells, attack they're selves with it!! Any idea why?
    Will +Rep if someone helps me.


    - Buffy

    [LUA] Custom NPC's don't cast spells or talk
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would help if you showed us the LUA scripts.

  3. #3
    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)
    Well, you need to enable LUA scripts (which you prolly did) and use a good repack..
    And for the spells they cast on themselves that is a
    Code:
    Unit:CastSpell(ID)
    Needs to be
    Code:
    Unit:CastSpellOnTarget(ID, GetRandomPlayer(0))

  4. #4
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function Foji_OnCombat(Unit, Event)
    pUnit:SendChatMessage(12, 0, "Haha!You small useless slaves..I've been waiting for this day, and finaly it's here! ")
    pUnit:RegisterEvent("Foji_SpellCrushing", 14000, 0)
    pUnit:RegisterEvent("Foji_SpellBolt", 15000, 0)
    pUnit:RegisterEvent("Foji_SpellPain", 17000, 0)
    pUnit:RegisterEvent("Foji_SpellDragonsBreath", 14500, 0)
    pUnit:RegisterEvent("Foji_SpellSteal", 12450, 0)
    end

    function Foji_SpellCrushing(pUnit,Event)
    pUnit:CastSpellOnTarget(53408,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellBolt(pUnit,Event)
    pUnit:CastSpellOnTarget(59172,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellPain(pUnit,Event)
    pUnit:CastSpellOnTarget(60043,pUnit:GetMainTank())
    end

    function Foji_SpellSteal(pUnit,Event)
    pUnit:CastSpellOnTarget(30449,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellConeofCold(pUnit,Event)
    pUnit:CastSpell42931(44799,pUnit:GetClosestPlayer())
    end

    function Foji_SpellThe Claw(pUnit,Event)
    pUnit:CastSpellOnTarget(35055,pUnit:GetMainTank())
    end

    function Foji_SpellCone(pUnit,Event)
    pUnit:CastSpellOnTarget(10159,pUnit:GetClosestPlayer())
    end

    function Foji_SpellPlague(pUnit,Event)
    pUnit:CastSpellOnTarget(40351,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellBlackCleave(pUnit,Event)
    pUnit:CastSpellOnTarget(33480,pUnit:GetMainTank())
    end

    function Foji_SpellDevastate(pUnit,Event)
    pUnit:CastSpellOnTarget(47498, 5,pUnit:GetMainTank())
    end

    function Foji_SpellRend(pUnit,Event)
    pUnit:CastSpellOnTarget(25208,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellAgony(pUnit,Event)
    pUnit:CastSpellOnTarget(36836,pUnit:GetRandomPlayer(0))
    end
    end

    function Foji_OnLeaveCombat(Unit, Event)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(12, 0, "I shall not be defeated! The Loocuz Kii can not be defeated!")
    end

    function Foji_OnDied(Unit, Event)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(12, 0, "I see you've Defeated me! You're quite a good champion my friend, fighting for such a long time just to defeat me. I wish you luck and fortune!")
    end

    function Foji_OnKilledTarget(Unit, Event)
    pUnit:SendChatMessage(12, 0, "You were to weak from the start, I never want to see you in this world EVER!")
    end

    RegisterUnitEvent(555665, 1, "Foji_OnCombat")
    RegisterUnitEvent(555665, 2, "Foji_OnLeaveCombat")
    RegisterUnitEvent(555665, 3, "Foji_OnKilledTarget")
    RegisterUnitEvent(555665, 4, "Foji_OnDied")
    One of the scripts is the one above, for some reason it doesn't say or cast spells it's supposed to do. LUA is enabled on our server, where I execute / upload them to our ftp.

  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)
    Code:
    function Foji_SpellConeofCold(pUnit,Event)
    pUnit:CastSpell42931(44799,pUnit:GetClosestPlayer())
    end
    
    function Foji_SpellThe Claw(pUnit,Event)
    pUnit:CastSpellOnTarget(35055,pUnit:GetMainTank())
    end
    
    function Foji_SpellCone(pUnit,Event)
    pUnit:CastSpellOnTarget(10159,pUnit:GetClosestPlayer())
    end
    
    function Foji_SpellPlague(pUnit,Event)
    pUnit:CastSpellOnTarget(40351,pUnit:GetRandomPlayer(0))
    end
    
    function Foji_SpellBlackCleave(pUnit,Event)
    pUnit:CastSpellOnTarget(33480,pUnit:GetMainTank())
    end
    
    function Foji_SpellDevastate(pUnit,Event)
    pUnit:CastSpellOnTarget(47498, 5,pUnit:GetMainTank())
    end
    
    function Foji_SpellRend(pUnit,Event)
    pUnit:CastSpellOnTarget(25208,pUnit:GetRandomPlayer(0))
    end
    
    function Foji_SpellAgony(pUnit,Event)
    pUnit:CastSpellOnTarget(36836,pUnit:GetRandomPlayer(0))
    end
    end
    Those spells aint registered anywhere.
    Last edited by Mildan; 04-05-2009 at 09:01 AM.

  6. #6
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okey, I will try it. =)

    function Foji_SpellCrushing(pUnit,Event)
    pUnit:CastSpellOnTarget(53408,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellBolt(pUnit,Event)
    pUnit:CastSpellOnTarget(59172,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellPain(pUnit,Event)
    pUnit:CastSpellOnTarget(60043,pUnit:GetMainTank())
    end

    function Foji_SpellSteal(pUnit,Event)
    pUnit:CastSpellOnTarget(30449,pUnit:GetRandomPlayer(0))
    This is how it is now, should I change it to this?

    function Foji_SpellCrushing(pUnit,Event)
    pUnit:CastSpellOnTarget(53408, pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellBolt(pUnit,Event)
    pUnit:CastSpellOnTarget(59172, pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellPain(pUnit,Event)
    pUnit:CastSpellOnTarget(60043, pUnit:GetMainTank())
    end

    function Foji_SpellSteal(pUnit,Event)
    pUnit:CastSpellOnTarget(30449, pUnit:GetRandomPlayer(0))

  7. #7
    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)
    ´No you shouldnt, they are registered in the OnCombat.
    You just need to register the rest too.

  8. #8
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I understand what you mean. =)

  9. #9
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function Foji_OnCombat(Unit, Event)
    pUnit:SendChatMessage(12, 0, "Haha!You small useless slaves..I've been waiting for this day, and finaly it's here! ")
    pUnit:RegisterEvent("Foji_SpellCrushing", 14000, 5)
    pUnit:RegisterEvent("Foji_SpellBolt", 15000, 7)
    pUnit:RegisterEvent("Foji_SpellPain", 17000, 2)
    pUnit:RegisterEvent("Foji_SpellSteal", 12450, 6)
    pUnit:RegisterEvent("Foji_SpellTheClaw", 16000, 3)
    pUnit:RegisterEvent("Foji_SpellCone", 13000, 4)
    pUnit:RegisterEvent("Foji_SpellPlague", 14500, 0)
    pUnit:RegisterEvent("Foji_SpellBlackCleave", 15500, 5)
    pUnit:RegisterEvent("Foji_SpellDevastate", 13500, 3)
    pUnit:RegisterEvent("Foji_SpellRend", 16500, 3)
    pUnit:RegisterEvent("Foji_SpellAgony", 14250, 4)

    end

    function Foji_SpellCrushing(pUnit,Event)
    pUnit:CastSpellOnTarget(53408,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellBolt(pUnit,Event)
    pUnit:CastSpellOnTarget(59172,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellPain(pUnit,Event)
    pUnit:CastSpellOnTarget(60043,pUnit:GetMainTank())
    end

    function Foji_SpellSteal(pUnit,Event)
    pUnit:CastSpellOnTarget(30449,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellTheClaw(pUnit,Event)
    pUnit:CastSpellOnTarget(35055,pUnit:GetMainTank())
    end

    function Foji_SpellCone(pUnit,Event)
    pUnit:CastSpellOnTarget(10159,pUnit:GetClosestPlayer())
    end

    function Foji_SpellPlague(pUnit,Event)
    pUnit:CastSpellOnTarget(40351,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellBlackCleave(pUnit,Event)
    pUnit:CastSpellOnTarget(33480,pUnit:GetMainTank())
    end

    function Foji_SpellDevastate(pUnit,Event)
    pUnit:CastSpellOnTarget(47498, 5,pUnit:GetMainTank())
    end

    function Foji_SpellRend(pUnit,Event)
    pUnit:CastSpellOnTarget(25208,pUnit:GetRandomPlayer(0))
    end

    function Foji_SpellAgony(pUnit,Event)
    pUnit:CastSpellOnTarget(36836,pUnit:GetRandomPlayer(0))
    end
    end

    function Foji_OnLeaveCombat(Unit, Event)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(12, 0, "I shall not be defeated! The Loocuz Kii can not be defeated!")
    end

    function Foji_OnDied(Unit, Event)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(12, 0, "I see you've Defeated me! You're quite a good champion my friend, fighting for such a long time just to defeat me. I wish you luck and fortune!")
    end

    function Foji_OnKilledTarget(Unit, Event)
    pUnit:SendChatMessage(12, 0, "You were to weak from the start, I never want to see you in this world EVER!")
    end

    RegisterUnitEvent(555665, 1, "Foji_OnCombat")
    RegisterUnitEvent(555665, 2, "Foji_OnLeaveCombat")
    RegisterUnitEvent(555665, 3, "Foji_OnKilledTarget")
    RegisterUnitEvent(555665, 4, "Foji_OnDied")
    Is this what you mean? Now I've registered the rest of the spells + I've changed so that it says how many times it should cast each spell during the fight.

  10. #10
    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)
    I wasnt thinking that is why I edited my post, 0 is for unlimited so it doesnt matter if its0... I think it was just you needed to register the other spells/abilities

  11. #11
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ooh, Okey.. Well, I will test this out on my server later on. And I will give +Rep if it works. =)

  12. #12
    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)
    Im just glad to help

  13. #13
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does he send the initial "Haha!You small useless slaves..I've been waiting for this day, and finaly it's here! " message?

  14. #14
    Evilbuffy's Avatar Member
    Reputation
    38
    Join Date
    Mar 2009
    Posts
    185
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, he doesn't say anything. Or he didn't, I'm gonna test him now, after I've changed some stuff.

  15. #15
    XxCyanidexX's Avatar Member
    Reputation
    56
    Join Date
    Nov 2008
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is your LUAScripting.dll loading correctly?

Page 1 of 2 12 LastLast

Similar Threads

  1. [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
  2. [Guide]How to make NPC casting spells(LUA)
    By paulbechtold in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 12-30-2009, 07:44 PM
  3. LUA Player Cast Spell
    By Bapesy in forum World of Warcraft Emulator Servers
    Replies: 11
    Last Post: 06-01-2008, 01:32 AM
  4. [question] how to make an custom npc cast spells?
    By INS4N3K1LL in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-18-2008, 07:45 AM
  5. 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
All times are GMT -5. The time now is 06:11 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