AscendScripting

Would you like to react to this message? Create an account in a few clicks or log in to continue.
AscendScripting

AscendScripting is a Scripting Project that supports Aspire, ArcEmu, and Mangos. We strive for Blizz-Like!


3 posters

    Zaronz' App

    zaronz
    zaronz
    Developer of AscendScripting
    Developer of AscendScripting


    Posts : 3
    Join date : 2009-02-28

    Zaronz' App Empty Zaronz' App

    Post  zaronz Sat Feb 28, 2009 4:51 am

    1)What is your Name
    Kristoffer

    2)How old are you?
    17

    3)How long have you been working with Emulation?
    Since the early of Antrix

    4)How long have you been familiar with Lua?
    For about 1 year~

    5)Do you know Sql?
    Yes

    6)Have you been in recent or past scripting teams?
    No

    6a)If so, Please list some of them.
    N/A

    7)We are looking for advanced Lua Scripters, Show us your work.
    Code:
    -- Krik'thir the Gatewatcher

    -- Start
    RegisterUnitEvent(28684, 18, "Krikthir")


    function Krikthir(Unit, event, player)
    Unit:RegisterEvent("Krikthir_Say",33000, 0)
    end

    function Krikthir_Say(Unit, event, player)
    local chance = math.random(1,3)
    if(chance == 1) then
    Unit:SendChatMessage(12, 0, "Keep an eye on the tunnel. We must not let anyone through!")
    end
    if(chance == 2) then
    Unit:SendChatMessage(12, 0, "I hear footsteps. Be on your guard.")
    end
    if(chance == 3) then
    Unit:SendChatMessage(12, 0, "I sense the living. Be ready.")
    end
    end

    -- Combat


    function Krikthir_OnCombat(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "This kingdom belongs to the Scourge! Only the dead may enter.")
    Unit:PlaySoundToSet(14075)
    Unit:RegisterEvent("Krikthir_CurseofFatigue", math.random(15000, 38000), 0) -- 52592
    Unit:RegisterEvent("Krikthir_Mindflay", math.random(15000, 29000), 0) -- 52586
    Unit:RegisterEvent("Krikthir_Swarm", math.random(25000, 34000), 0)
    Unit:RegisterEvent("Frenzy", 1000, 0)
    end

    function Krikthir_OnKilledTarget(Unit, Event)
    local chance = math.random(1,2)
    if(chance == 1) then
    Unit:SendChatMessage(14, 0, "You were foolish to come.")
    Unit:PlaySoundToSet(14077)
    end
    if(chance == 2) then
    Unit:SendChatMessage(14, 0, "As Anub'Arak commands!")
    Unit:PlaySoundToSet(14078)
    end
    end

    function Krikthir_OnDeath(Unit, Event)
    Unit:SendChatMessage(14, 0, "I should be grateful. But I long ago lost the capacity.")
    Unit:PlaySoundToSet(14087)
    Unit:RemoveEvents()
    end

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

    function Frenzy(Unit)
     if Unit:GetHealthPct() < 10 then
     Unit:FullCastSpell(28747)
    end
    end

    function Krikthir_Mindflay(Unit)
    Unit:FullCastSpellOnTarget(52586, Unit:GetMainTank(0))
    end

    function Krikthir_CurseofFatigue(Unit)
    Unit:FullCastSpellOnTarget(52592, Unit:GetRandomPlayer(0))
    end


    RegisterUnitEvent(28684, 1, "Krikthir_OnCombat")
    RegisterUnitEvent(28684, 2, "Krikthir_OnLeaveCombat")
    RegisterUnitEvent(28684, 3, "Krikthir_OnKilledTarget")
    RegisterUnitEvent(28684, 4, "Krikthir_OnDeath")
    Note: i can do better then this, but currently this is the only script i got on my computer that is made by me.


    8)How and What are you able to do for AscendScripting?
    I can do SQL and Lua scripting i also got an retail account to try get things as much blizzlike as possible.

    9)Will you show dedication towards AscendScripting?
    I will try my best.

    10)Final Question:Do you know how to insert a Sql Code/Querie into your database from a Lua Script?
    Sorry, I'm new to that function but i will try to learn it.
    BrantX
    BrantX
    Leader and Developer of AscendScripting
    Leader and Developer of AscendScripting


    Posts : 16
    Join date : 2009-02-25
    Age : 29
    Location : Your Hardrive

    Zaronz' App Empty Re: Zaronz' App

    Post  BrantX Sat Feb 28, 2009 11:58 am

    zaronz wrote:1)What is your Name
    Kristoffer

    2)How old are you?
    17

    3)How long have you been working with Emulation?
    Since the early of Antrix

    4)How long have you been familiar with Lua?
    For about 1 year~

    5)Do you know Sql?
    Yes

    6)Have you been in recent or past scripting teams?
    No

    6a)If so, Please list some of them.
    N/A

    7)We are looking for advanced Lua Scripters, Show us your work.
    Code:
    -- Krik'thir the Gatewatcher

    -- Start
    RegisterUnitEvent(28684, 18, "Krikthir")


    function Krikthir(Unit, event, player)
    Unit:RegisterEvent("Krikthir_Say",33000, 0)
    end

    function Krikthir_Say(Unit, event, player)
    local chance = math.random(1,3)
    if(chance == 1) then
    Unit:SendChatMessage(12, 0, "Keep an eye on the tunnel. We must not let anyone through!")
    end
    if(chance == 2) then
    Unit:SendChatMessage(12, 0, "I hear footsteps. Be on your guard.")
    end
    if(chance == 3) then
    Unit:SendChatMessage(12, 0, "I sense the living. Be ready.")
    end
    end

    -- Combat


    function Krikthir_OnCombat(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "This kingdom belongs to the Scourge! Only the dead may enter.")
    Unit:PlaySoundToSet(14075)
    Unit:RegisterEvent("Krikthir_CurseofFatigue", math.random(15000, 38000), 0) -- 52592
    Unit:RegisterEvent("Krikthir_Mindflay", math.random(15000, 29000), 0) -- 52586
    Unit:RegisterEvent("Krikthir_Swarm", math.random(25000, 34000), 0)
    Unit:RegisterEvent("Frenzy", 1000, 0)
    end

    function Krikthir_OnKilledTarget(Unit, Event)
    local chance = math.random(1,2)
    if(chance == 1) then
    Unit:SendChatMessage(14, 0, "You were foolish to come.")
    Unit:PlaySoundToSet(14077)
    end
    if(chance == 2) then
    Unit:SendChatMessage(14, 0, "As Anub'Arak commands!")
    Unit:PlaySoundToSet(14078)
    end
    end

    function Krikthir_OnDeath(Unit, Event)
    Unit:SendChatMessage(14, 0, "I should be grateful. But I long ago lost the capacity.")
    Unit:PlaySoundToSet(14087)
    Unit:RemoveEvents()
    end

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

    function Frenzy(Unit)
     if Unit:GetHealthPct() < 10 then
     Unit:FullCastSpell(28747)
    end
    end

    function Krikthir_Mindflay(Unit)
    Unit:FullCastSpellOnTarget(52586, Unit:GetMainTank(0))
    end

    function Krikthir_CurseofFatigue(Unit)
    Unit:FullCastSpellOnTarget(52592, Unit:GetRandomPlayer(0))
    end


    RegisterUnitEvent(28684, 1, "Krikthir_OnCombat")
    RegisterUnitEvent(28684, 2, "Krikthir_OnLeaveCombat")
    RegisterUnitEvent(28684, 3, "Krikthir_OnKilledTarget")
    RegisterUnitEvent(28684, 4, "Krikthir_OnDeath")
    Note: i can do better then this, but currently this is the only script i got on my computer that is made by me.


    8)How and What are you able to do for AscendScripting?
    I can do SQL and Lua scripting i also got an retail account to try get things as much blizzlike as possible.

    9)Will you show dedication towards AscendScripting?
    I will try my best.

    10)Final Question:Do you know how to insert a Sql Code/Querie into your database from a Lua Script?
    Sorry, I'm new to that function but i will try to learn it.

    This is very, Also you need to learn "nil checks" incase the tank and/or a player is not available.

    Other than that its very good.
    Welcome to AscendScripting!
    PM'd
    zaronz
    zaronz
    Developer of AscendScripting
    Developer of AscendScripting


    Posts : 3
    Join date : 2009-02-28

    Zaronz' App Empty Re: Zaronz' App

    Post  zaronz Sat Feb 28, 2009 1:03 pm

    Awesome! Thank you very much Smile


    Also by "nil checks" do you mean like this?
    Code:
    local caster=Unit:GetRandomPlayer(4)
        local closest=Unit:GetClosestPlayer()
        local rand=Unit:GetRandomPlayer(0)
        local tank=Unit:GetMainTank()
    local target
    --now nil filter
    if(caster~=nil)then
            target=caster
        else
            if(closest~=nil)then
                target=closest
            else
                if(tank~=nil)then
                    target=tank
                else
                    if(rand~=nill)then
                                    target=rand
                                    else
                                      return end
                                    end
                end
            end
        end
    FullCastSpellOnTarget(xxxx,target)
    Well I got that one from the ArcEmu forums and i will use that for public scripting then if you mean that by nil checking Razz
    jokerofsouls
    jokerofsouls
    Developer of AscendScripting
    Developer of AscendScripting


    Posts : 7
    Join date : 2009-02-27

    Zaronz' App Empty Re: Zaronz' App

    Post  jokerofsouls Sat Feb 28, 2009 1:04 pm

    Yep that is a nil check

    Sponsored content


    Zaronz' App Empty Re: Zaronz' App

    Post  Sponsored content


      Current date/time is Thu Nov 21, 2024 2:42 am