Results 1 to 7 of 7
  1. #1
    New User

    Reputation
    4
    Join Date
    Sep 2006
    Location
    The Barrens
    Posts
    121
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)

    [FIX] This Lua. Script plzzzZ?



    Donate to Remove Ads, Get ShoutBawx - Elite Forum Access
    Code:
    function Ro_OnCombat(pUnit, event)
    Unit:SendChatMessage(14, 0, "Wanna play with cold You will get frozen")
    end
    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    function Ro_CastFrostbolt(pUnit, event)
    Unit:FullCastSpellOnTarget(61594, pUnit:GetRandomPlayer(0))
    Unit:SendChatMessage(14, 0, "Frost vaess! Wux geou lapiet malrak ias Ro uikulph arcaniss!")
    end
    RegisterUnitEvent(99008, 1, "Ro_CastFrostbolt")
    function Ro_OnCombat(pUnit, event)
    Unit:RegisterEvent("Ro_CastFrostbolt", 180000, 1)
    end
    function Ro_SummonGulSpeak1(pUnit, event) 
    if Unit:GetHealthPct() <= 75 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak1")
    function Ro_SummonGul1(pUnit, event) 
    if Unit:GetHealthPct() <= 75 then
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGul1")
    function Ro_SummonGulSpeak2(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak2")
    function Ro_SummonGul2(pUnit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGul2")
    function Ro_SummonGulSpeak3(pUnit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak3") 
    function Ro_SummonGul3(pUnit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end
    RegisterUnitEvent(99008, 1, "Ro_SummonGul3")
    Whats wrong??? I was having a "unable to load" arcemu.world error, then I chnged it this way and loads fine but ..... THE DAMN NPC doesn't do anything!!! I'm getting crazy!

    Please somebody have mercy and tell me what's wrong >.<

  2. #2
    Legendary Gastricpenguin's Avatar
    Reputation
    980
    Join Date
    Feb 2007
    Location
    EST
    Posts
    2,252
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    Why are you registering every function for the oncombat hook? Ie:
    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    RegisterUnitEvent(99008, 1, "Ro_CastFrostbolt")
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak1")
    RegisterUnitEvent(99008, 1, "Ro_SummonGul3")
    etc
    etc
    etc

  3. #3
    Master Sergeant Mircast's Avatar
    Reputation
    14
    Join Date
    Sep 2008
    Location
    London
    Posts
    139
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    Quote Originally Posted by Gastricpenguin View Post
    Why are you registering every function for the oncombat hook? Ie:
    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    RegisterUnitEvent(99008, 1, "Ro_CastFrostbolt")
    RegisterUnitEvent(99008, 1, "Ro_SummonGulSpeak1")
    RegisterUnitEvent(99008, 1, "Ro_SummonGul3")
    etc
    etc
    etc
    I'm guessing he hasn't learned lua completely.

  4. #4
    Contributor
    y2kss66's Avatar
    Reputation
    104
    Join Date
    Jan 2008
    Location
    127.0.0.1
    Posts
    778
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    you are registering all of the phases in no mans land basically.

    you need to register the events inside the end statements.


  5. #5
    New User

    Reputation
    4
    Join Date
    Sep 2006
    Location
    The Barrens
    Posts
    121
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    humm .... yea I'm new to lua. scripting sorry .... I didn't understand well what you guys said =S could you maybe post an exemple of how it should looks like? Thanks!

  6. #6
    Contributor

    CoreCoins User

    Linkn's Avatar
    Reputation
    90
    Join Date
    Mar 2009
    Location
    Middle Earth
    Posts
    296
    CoreCoins
    1001

    Trade Feedbacks

    Status
    Superior trader
    Positive
    1 (100%)
    Negative
    0 (0%)
    Try this

    function Ro_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Wanna play with cold, You will get frozen")
    Unit:RegisterEvent("Ro_CastFrostbolt", 9000, 0)
    end

    function Ro_CastFrostbolt(Unit, Event)
    Unit:FullCastSpellOnTarget(61594, Unit:GetRandomPlayer(0))
    Unit:SendChatMessage(14, 0, "Frost vaess! Wux geou lapiet malrak ias Ro uikulph arcaniss!")
    Unit:RegisterEvent("Ro_SummonGul1", 1000, 0)
    end

    function Ro_SummonGul1(Unit, event)
    if Unit:GetHealthPct() <= 75 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    Unit:RegisterEvent("Ro_SummonGul2", 1000, 0)
    end
    end

    function Ro_SummonGul2(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    Unit:RegisterEvent("Ro_SummonGul3", 1000, 0)
    end
    end

    function Ro_SummonGul3(Unit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SendChatMessage(14, 0, "De wer veditoa part di wer malrunwa, sI symmn thes Gul!")
    Unit:SpawnCreature(99009, -6.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -6.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -7.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.53875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -8.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -9.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.63875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -10.93875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -11.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.03875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.33875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.73875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -12.83875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.13875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.43875, 156.701659, 40.384003)
    Unit:SpawnCreature(99009, -13.73875, 156.701659, 40.384003)
    end
    end

    function Ro_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end

    function Ro_OnKilledTarget(Unit, Event)
    end

    function Ro_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end

    RegisterUnitEvent(99008, 1, "Ro_OnCombat")
    RegisterUnitEvent(99008, 2, "Ro_OnLeaveCombat")
    RegisterUnitEvent(99008, 3, "Ro_OnKilledTarget")
    RegisterUnitEvent(99008, 4, "Ro_OnDied")

  7. #7
    New User

    Reputation
    4
    Join Date
    Sep 2006
    Location
    The Barrens
    Posts
    121
    CoreCoins
    0

    Trade Feedbacks

    Status
    n/a
    Positive
    0 (0%)
    Negative
    0 (0%)
    YeA i managed to make it work ^^ I'm using "local x: Get Unit x" (or somethin like that you know?) ... sounds easier and quite better, but the problem is that all NPCs spawns at the smae point >.< and to make them not to occupe the same spot, I'm looking after on how to enable COLLISION .... I made another thread about it, If you got any information plzz help me there =/

    Thanks you all ^^"

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -4. The time now is 06:09 AM. Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search