Item Search
     
BG-Wiki Search
Closed Thread
Page 54 of 302 FirstFirst ... 4 44 52 53 54 55 56 64 104 ... LastLast
Results 1061 to 1080 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #1061
    RIDE ARMOR
    Join Date
    Jun 2011
    Posts
    11
    BG Level
    1
    FFXI Server
    Sylph

    ranger doubleshot help

    im trying to work in doubleshot for my ranged attack to double shot if its not up and ready when i hit ranged attack now i got it to work but when i lose doubleshot and the timer is still up i get a timer in the chat log saying i have to wait then it fires my shot i understand why its doing that but mabe some one more knowledgeable can help me fix this heres waht i have

    -- if (spell.name == 'Ranged' and not buffactive['Double Shot'] and not buffactive.Amnesia and not buffactive.Obliviscence and not buffactive.Paralysis and windower.ffxi.get_ability_recasts()[1] < 1 ) then
    -- windower.send_command('Double Shot; wait 1; '..spell.name..' '..spell.target.raw)
    -- cancel_spell()
    -- return
    -- end
    elseif spell.name == 'Ranged' then
    equip(sets.precast.PreShot)

  2. #1062
    RIDE ARMOR
    Join Date
    Jun 2011
    Posts
    11
    BG Level
    1
    FFXI Server
    Sylph

    ahh make sense thanks for the redirect i dont know much about navigating these forums

  3. #1063

    Quote Originally Posted by theblackdeath View Post
    im trying to work in doubleshot for my ranged attack to double shot if its not up and ready when i hit ranged attack now i got it to work but when i lose doubleshot and the timer is still up i get a timer in the chat log saying i have to wait then it fires my shot i understand why its doing that but mabe some one more knowledgeable can help me fix this heres waht i have
    try this(i gave the functions that they should be put in)
    Code:
    function get_sets()
    	Ranged = {}
    	Ranged.buffcheck = S{'Double Shot','Amnesia','Obliviscence','Paralysis'}
    	
    function precast(spell)
    	if spell.name == 'Ranged' 
    		if buffactive ~= Ranged.buffcheck and windower.ffxi.get_ability_recasts()[1] < 1  then
    			windower.send_command('Double Shot; wait 1; '..spell.name..' '..spell.target.raw)
    			cancel_spell()
    			return
    		else
    			equip(sets.precast.PreShot)
    		end
    	end
    these are the only 2 im not sure about because i have never used them or used them this way
    windower.ffxi.get_ability_recasts()[1] < 1
    windower.send_command('Double Shot; wait 1; '..spell.name..' '..spell.target.raw)

    but i think this one is used this way[windower.send_command('Double Shot; wait 1; '..spell.name..' '..spell.target.raw)]
    send_command('input /ja "Double Shot" <me>; wait 1;/ra <t>')

  4. #1064
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by Motenten View Post
    However, yes, there are simpler ways for quick minor checks that fall outside the normal mappings. If you want to check for all forms of Drain Samba, you can use spell.english:startswith("Drain Samba") -- this is much faster than :contains(). If you want to check for all forms of Samba, you can check that spell.type == "Samba".
    Ah yes, because there's a preset category for Sambas, one for Jig I assume etc.
    Well, it would be awesome if there was another function similar to "startswith" ("endswith"? "includes"?)
    I'm not sure if these functions are basic lua stuff or gearswap things, but where can I find a full documentation of all the possible commands, functions and syntax for Gearswap? Checked Byrth's page on Github but I didn't find anything.

    I think I got how "contains" and strings work from your talk in the previous page but I don't really need that level of complexity for what I want to do, at least for now.



    Anyway, if someone is particularly bored, here is what I wrote as my first Lua. I tried to keep it as straightforward as possible.
    I'd love if people (with a lot of free time! ) could give some input about it.

    http://pastebin.com/UU2iwQsa

    Concerning the "toggle TP sets" thing I asked about in the previous pages in the end what I tried to do is something in-between. I will keybind a toggle command to cycle through 5 TP sets, and use direct keybinds to swap to PDT or MDT.
    I don't know if I'm gonna like it, need to try in-game.

    I'm also not sure about having double subsets for each WS.
    Like for Exenterator, I might want more than 2, but for the others given the situations where I'll use them, I might want a single set only to keep things even more simple.


    I still need to know how to handle a few situations for which I need support:
    Spoiler: show
    1. How can I handle Horos Tights? When buffactive = 'Saber Dance' I need Horos Tights to replace whatever my current sets has it for the Legs Slot.
      But things get more complicated because there have to be exceptions. For instance if the current set is PDT or MDT, then Horos Tights shouldn't override it.
      Furthermore, I might not need it now because my Horos Tights are still NQ, but once they're HQ I'm gonna need to override the WS settings for Exenterator for instance, and probably other WSs as well.
      This is starting to look very complicated with a lot of exceptions and situational things, how can I handle it? Or at least start from somewhere and then add exceptions on the run.
    2. When I toggle through my TP sets, I would like to automatize swapping sets for WS as well. For instance, when my TP_ind becomes "2" (accuracy set) I want my Exenterator_Ind (my other WS_Ind too if I decide to keep em) to change to "2" (accuracy subset). Likewise, when I swap my TP_ind back to another value, I want my weapon skill _ind to go back to 1. How can I automatize this so that I don't have to use a second toggle/keybind for WS sets cycling?

  5. #1065
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by theblackdeath View Post
    im trying to work in doubleshot for my ranged attack to double shot if its not up and ready when i hit ranged attack now i got it to work but when i lose doubleshot and the timer is still up i get a timer in the chat log saying i have to wait then it fires my shot i understand why its doing that but mabe some one more knowledgeable can help me fix this heres waht i have

    -- if (spell.name == 'Ranged' and not buffactive['Double Shot'] and not buffactive.Amnesia and not buffactive.Obliviscence and not buffactive.Paralysis and windower.ffxi.get_ability_recasts()[1] < 1 ) then
    -- windower.send_command('Double Shot; wait 1; '..spell.name..' '..spell.target.raw)
    -- cancel_spell()
    -- return
    -- end
    elseif spell.name == 'Ranged' then
    equip(sets.precast.PreShot)
    this is what I use on my RNG Mule the only issue w/ you code is that the index for Double Shot is 126 and not 1...

    Code:
    if spell.name == 'Ranged' and not buffactive.Amnesia and not buffactive.Paralyze then
    	        if windower.ffxi.get_ability_recasts()[52] < 1 and not buffactive.amnesia then
    			cancel_spell()
    		send_command('@input /ja "Decoy Shot" <me>--actually I use the name of my mule here, just not sure if <me> will work w/o any special wording')
    		elseif windower.ffxi.get_ability_recasts()[126] < 1 and not buffactive.amnesia and buffactive['Decoy Shot'] then
    			cancel_spell()
    		send_command('@input /ja "Double Shot" <me>')
    		end
    end
    Even got an auto WS code for when TP > to some presets values(100,125,150,200...)

  6. #1066
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Sechs View Post
    Ah yes, because there's a preset category for Sambas, one for Jig I assume etc.
    Well, it would be awesome if there was another function similar to "startswith" ("endswith"? "includes"?)
    I'm not sure if these functions are basic lua stuff or gearswap things, but where can I find a full documentation of all the possible commands, functions and syntax for Gearswap? Checked Byrth's page on Github but I didn't find anything.

    I think I got how "contains" and strings work from your talk in the previous page but I don't really need that level of complexity for what I want to do, at least for now.



    Anyway, if someone is particularly bored, here is what I wrote as my first Lua. I tried to keep it as straightforward as possible.
    I'd love if people (with a lot of free time! ) could give some input about it.

    http://pastebin.com/UU2iwQsa

    Concerning the "toggle TP sets" thing I asked about in the previous pages in the end what I tried to do is something in-between. I will keybind a toggle command to cycle through 5 TP sets, and use direct keybinds to swap to PDT or MDT.
    I don't know if I'm gonna like it, need to try in-game.

    I'm also not sure about having double subsets for each WS.
    Like for Exenterator, I might want more than 2, but for the others given the situations where I'll use them, I might want a single set only to keep things even more simple.


    I still need to know how to handle a few situations for which I need support:
    Spoiler: show
    1. How can I handle Horos Tights? When buffactive = 'Saber Dance' I need Horos Tights to replace whatever my current sets has it for the Legs Slot.
      But things get more complicated because there have to be exceptions. For instance if the current set is PDT or MDT, then Horos Tights shouldn't override it.
      Furthermore, I might not need it now because my Horos Tights are still NQ, but once they're HQ I'm gonna need to override the WS settings for Exenterator for instance, and probably other WSs as well.
      This is starting to look very complicated with a lot of exceptions and situational things, how can I handle it? Or at least start from somewhere and then add exceptions on the run.
    2. When I toggle through my TP sets, I would like to automatize swapping sets for WS as well. For instance, when my TP_ind becomes "2" (accuracy set) I want my Exenterator_Ind (my other WS_Ind too if I decide to keep em) to change to "2" (accuracy subset). Likewise, when I swap my TP_ind back to another value, I want my weapon skill _ind to go back to 1. How can I automatize this so that I don't have to use a second toggle/keybind for WS sets cycling?
    Will point out some fast improvement:

    you got " sets.precast.NoFootRise = {body="Horos Casaque"} "
    Almost sure NoFootRise have spaces but probably can work that way... but would put
    Code:
     sets.precast['No Foot Rise'] = {body="Horos Casaque"}
    The point is,
    ['Job Ability'] after the set means ".Job Ability", so still using NFR ex. that would be "sets.precast.No Foot Rise" so having this, with
    Code:
    function precast(spell,action)
    	if sets.precast[spell.english] then
    			equip(sets.precast[spell.english])
    	end
    end
    you can cover all these:
    Spoiler: show

    Code:
    function precast(spell)
            if spell.english = 'Trance' then
                    equip(sets.precast.Trance)
            end
           
            if spell.english = 'No Foot Rise' then
                    equip(sets.precast.NoFootRise)
            end
           
            if spell.english = 'Violent Flourish' then
                    equip(sets.precast.Violent)
            end
           
            if spell.english = 'Striking Flourish' then
                    equip(sets.precast.Striking)
            end
           
            if spell.english = 'Climatic Flourish' then
                    equip(sets.precast.Climatic)
            end
           
            if spell.english = 'Feather Step' then
                    equip(sets.precast.Feather)
            end
           
            if spell.english = 'Reverse Flourish' then
                    equip(sets.precast.Reverse)
            end
            if spell.english == 'Exenterator' then
                    equip(sets.Exenterator[sets.Exenterator.index[Exenterator_ind]])
            end
     
            if spell.english == 'Pyrrhic Kleos' then
                    equip(sets.Pyrrhic[sets.Pyrrhic.index[Pyrrhic_ind]])
            end
     
            if spell.english == 'Rudra's Storm' then
                    equip(sets.Rudra[sets.Rudra.index[Rudra_ind]])
            end
     
            if spell.english == 'Evisceration' then
                    equip(sets.Evisceration[sets.Evisceration.index[Evisceration_ind]])
            end
    end


    btw for those WS w/ index... hmmm actually use your old rules for that... dont know how to work w/ the short version and those index -_- lol(I have a work around for this w/o index.. but It's my solution that might be complicated...) so you precast would end like this:

    Code:
    function precast(spell,action)
    	if sets.precast[spell.english] then
    			equip(sets.precast[spell.english])
    
    	elseif spell.english == 'Exenterator' then
                equip(sets.Exenterator[sets.Exenterator.index[Exenterator_ind]])
        
    	elseif spell.english == 'Pyrrhic Kleos' then
                equip(sets.Pyrrhic[sets.Pyrrhic.index[Pyrrhic_ind]])
        
        elseif spell.english == 'Rudra's Storm' then
                equip(sets.Rudra[sets.Rudra.index[Rudra_ind]])
        
        elseif spell.english == 'Evisceration' then
                equip(sets.Evisceration[sets.Evisceration.index[Evisceration_ind]])
        end
    
    end


    Another tip, for things like Sambas and Waltz

    you can use instead:
    Code:
    		if string.find(spell.english,'Waltz') then
    			equip(sets.precast.Waltz)
                    end
    same for Sambas...

    and one last thing I see is an error in the code, that you have aftercast function inside the precast, is more like you did miss an 'end' before the aftercast function

  7. #1067
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by Sechs View Post
    Ah yes, because there's a preset category for Sambas, one for Jig I assume etc.
    Well, it would be awesome if there was another function similar to "startswith" ("endswith"? "includes"?)
    I'm not sure if these functions are basic lua stuff or gearswap things, but where can I find a full documentation of all the possible commands, functions and syntax for Gearswap? Checked Byrth's page on Github but I didn't find anything.

    I think I got how "contains" and strings work from your talk in the previous page but I don't really need that level of complexity for what I want to do, at least for now.



    Anyway, if someone is particularly bored, here is what I wrote as my first Lua. I tried to keep it as straightforward as possible.
    I'd love if people (with a lot of free time! ) could give some input about it.

    http://pastebin.com/UU2iwQsa

    Concerning the "toggle TP sets" thing I asked about in the previous pages in the end what I tried to do is something in-between. I will keybind a toggle command to cycle through 5 TP sets, and use direct keybinds to swap to PDT or MDT.
    I don't know if I'm gonna like it, need to try in-game.

    I'm also not sure about having double subsets for each WS.
    Like for Exenterator, I might want more than 2, but for the others given the situations where I'll use them, I might want a single set only to keep things even more simple.


    I still need to know how to handle a few situations for which I need support:
    Spoiler: show
    1. How can I handle Horos Tights? When buffactive = 'Saber Dance' I need Horos Tights to replace whatever my current sets has it for the Legs Slot.
      But things get more complicated because there have to be exceptions. For instance if the current set is PDT or MDT, then Horos Tights shouldn't override it.
      Furthermore, I might not need it now because my Horos Tights are still NQ, but once they're HQ I'm gonna need to override the WS settings for Exenterator for instance, and probably other WSs as well.
      This is starting to look very complicated with a lot of exceptions and situational things, how can I handle it? Or at least start from somewhere and then add exceptions on the run.
    2. When I toggle through my TP sets, I would like to automatize swapping sets for WS as well. For instance, when my TP_ind becomes "2" (accuracy set) I want my Exenterator_Ind (my other WS_Ind too if I decide to keep em) to change to "2" (accuracy subset). Likewise, when I swap my TP_ind back to another value, I want my weapon skill _ind to go back to 1. How can I automatize this so that I don't have to use a second toggle/keybind for WS sets cycling?
    In addition to what JSHidaka posted, you should watch out for this syntax error.
    Code:
     if spell.english == 'Rudra's Storm' then
    Lua thinks you're comparing against the string 'Rudra' followed by random characters, and then opened another string without closing it.

    There's two ways you could approach fixing this. You can escape the apostrophe used in Rudra's.
    Code:
     if spell.english == 'Rudra\'s Storm' then
    or wrap with double quotes, instead of single quotes.
    Code:
     if spell.english == "Rudra's Storm" then

  8. #1068
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Sechs
    Well, it would be awesome if there was another function similar to "startswith" ("endswith"? "includes"?)
    I'm not sure if these functions are basic lua stuff or gearswap things, but where can I find a full documentation of all the possible commands, functions and syntax for Gearswap? Checked Byrth's page on Github but I didn't find anything.
    All these functions are part of the lua libraries provided with Windower. Check addons/libs/ for all the classes, and strings.lua for things specific to strings.

    Quote Originally Posted by Sechs
    Anyway, if someone is particularly bored, here is what I wrote as my first Lua. I tried to keep it as straightforward as possible.
    I'd love if people (with a lot of free time! ) could give some input about it.
    Your entire precast section is clumsily over-complicated. You could replace the entire thing with this:
    Code:
    if sets.precast[spell.english] then
        equip(sets.precast[spell.english])
    elseif sets.precast[spell.type] then
        equip(sets.precast[spell.type])
    elseif sets.precast[spell.action_type] then
        equip(sets.precast[spell.action_type])
    elseif spell.type == 'WeaponSkill' then
        if spell[spell.english] then
            equip(sets[spell.english][sets[spell.english].index[spell.english:split("[ ']", 1, false, false)[1] .. "_ind"]])
        end
    end
    as long as you make sure the sets are named properly (eg: sets.precast['No Foot Rise'], not sets.precast.NoFootRise).

    Note: I got fancy with the weaponskill index variable to make it conform to how you were naming them.

    This syntax is wrong:
    Code:
    spell.english:startswith == 'Drain Samba'
    Should be:
    Code:
    spell.english:startswith('Drain Samba')
    Error: You don't appear to have marked the precast function's 'end' before you started the aftercast function.


    Quote Originally Posted by Sechs
    I'm also not sure about having double subsets for each WS.
    Like for Exenterator, I might want more than 2, but for the others given the situations where I'll use them, I might want a single set only to keep things even more simple.
    This goes back to how you define and map the modes. You used the syntax I suggested, for putting the .index value inside the set, but you didn't define it the way I was telling you to -- instead you created another table in .index and referred to that table with an external _ind variable. Thus you added the complications of both methods, without really gaining the benefits that either offered.

    The intent was that you use an index -value- (ie: the number '1') in -either- the .index entry of the weaponskill table, -or- the _ind variable, and that the options for weaponskill modes be another table altogether. (Even then, the use of .index was only an attempt to simplify what you were trying to do, not what I would have suggested you do.)

    Instead you've got a complicated mess where you can have a different mode for every single weaponskill, controlled by a different index for every weaponskill, referring to a different mode list table for every weaponskill. Really, it's a horrible approach.

    I'm going to step back from my normal approach, and just flat out tell you, don't do it this way.

    You need:

    1 (one) table that lists all weaponskill modes.
    1 (one) means of identifying which mode you're using, for -all- weaponskills (either an index number, or the name of the mode; either approach has advantages and drawbacks; you've been using the index number, while I prefer the mode name).
    1 (one) table for each weaponskill you specifically want to gear for.
    1 (one) table for each mode of any given weaponskill you want an alternate gear set to be used for.

    So, you might have:
    sets.Exenterator
    sets.Exenterator.Accuracy
    sets.Eviscaration
    sets["Rudra's Storm"]


    The above suggested precast code would then be modified to:

    Code:
    elseif spell.type == 'WeaponSkill' then
        if spell[spell.english] then
            local wsSet = spell[spell.english]
            if wsSet[weaponskillMode] then
                wsSet = wsSet[weaponskillMode]
            end
            equip(wsSet)
        end
    end
    Where weaponskillMode is your currently defined mode, and you can determine how you define that elsewhere.


    Quote Originally Posted by Sechs
    How can I handle Horos Tights? When buffactive = 'Saber Dance' I need Horos Tights to replace whatever my current sets has it for the Legs Slot.
    But things get more complicated because there have to be exceptions. For instance if the current set is PDT or MDT, then Horos Tights shouldn't override it.
    Furthermore, I might not need it now because my Horos Tights are still NQ, but once they're HQ I'm gonna need to override the WS settings for Exenterator for instance, and probably other WSs as well.
    This is starting to look very complicated with a lot of exceptions and situational things, how can I handle it? Or at least start from somewhere and then add exceptions on the run.
    There's a reason my include files got so large -- there's *lots* of ways for exceptions and situational behavior to complicate how you want things to work. It can also take a lot of code behind the scenes to make something the user directly sees, 'simple'.

    When you see something in one of my example files that looks simple, that's often because all the hard and complicated work is hidden away somewhere else.

    For your above example, just layer the equipment in this order:

    Code:
    equip(tp gear)
    if buffactive['Saber Dance'] then
        equip(saber dance gear)
    end
    if PDT then
        equip(PDT gear)
    end
    if MDT then
        equip(MDT gear)
    end
    Quote Originally Posted by Sechs
    When I toggle through my TP sets, I would like to automatize swapping sets for WS as well. For instance, when my TP_ind becomes "2" (accuracy set) I want my Exenterator_Ind (my other WS_Ind too if I decide to keep em) to change to "2" (accuracy subset). Likewise, when I swap my TP_ind back to another value, I want my weapon skill _ind to go back to 1. How can I automatize this so that I don't have to use a second toggle/keybind for WS sets cycling?
    Remember when I said that some things are easier with indexes, and some are easier with names? This is an example of things that are easier with names, unless you enforce that the weaponskill modes are exactly the same as the melee modes (ie: use the same table for both).

    For what you generally described, you'd see if the weaponskill mode is set to something other than the default. If so, use that. If it's on the default, see if the tp mode is something other than the default. If so, see if there's a weaponskill mode that matches the tp mode. If so, use that. Otherwise just use the default weaponskill mode.

  9. #1069
    Cerberus
    Join Date
    Aug 2010
    Posts
    446
    BG Level
    4
    FFXIV Character
    Alistrianna Galanodel
    FFXIV Server
    Hyperion

    Mote, been using your SCH lua and noticed that Dispel doesn't seem to use any midcast sets. Shouldn't it be using sets.midcast.IntEnfeebles?

    You can view the lua here.

  10. #1070
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Alistrianna View Post
    Mote, been using your SCH lua and noticed that Dispel doesn't seem to use any midcast sets. Shouldn't it be using sets.midcast.IntEnfeebles?

    You can view the lua here.
    You seem to be using a version that's over 5 weeks old, since that's when that problem was fixed. Update your base sch file, either full copy if you're using a sidecar, or check the file history and copy in the new updates.

  11. #1071
    Bitchfist
    The horn knows no mercy; only wrath

    Join Date
    Oct 2006
    Posts
    4,375
    BG Level
    7
    FFXIV Character
    Indalecia Salavachere
    FFXIV Server
    Midgardsormr
    FFXI Server
    Asura

    Ok, jumping in with both feet into the deep end. I'm slogging through this even though I know jack-all about code. My original plan was to do all my sets then try and work out BP's later. But then I ran into how I categorized my BP's over the standard file.

    So, 2 things:

    I need flaming crush to be its own set, but I figured leaving it in the pact.bp70 batches and just setup a sets.midcast.pet.FCBloodPactRage and just have the damn thing recognize it when I fire it off.

    Addendum to the above: my full sets(so far) are: BuffBloodPactWard, DebuffBloodPactWard, PhysicalBloodPactRage, MagicalBloodPactRage and FCBloodPactRage.
    I wasn't happy with how all Wards fell under the umbrella of Buff or nothin' when it came to gear selection.
    So short version, what do I need to shove in here for it to recognize everthing? I'm assuming a chunk of "else if's" or something but not sure of setup or position.

  12. #1072

    Motenten,

    With your SMN profile, I see
    Code:
    options.IdleModes = {'Normal'}
    But I'm wanting a few options to toggle through Avatar Melee modes, with options like melee,refresh and or perp cost or whatever I desire. Is this something you could add to your file easily, as I'm a bit clueless with what I've already tried.

    Thanks!

  13. #1073
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Indalecia View Post
    Ok, jumping in with both feet into the deep end. I'm slogging through this even though I know jack-all about code. My original plan was to do all my sets then try and work out BP's later. But then I ran into how I categorized my BP's over the standard file.

    So, 2 things:

    I need flaming crush to be its own set, but I figured leaving it in the pact.bp70 batches and just setup a sets.midcast.pet.FCBloodPactRage and just have the damn thing recognize it when I fire it off.

    Addendum to the above: my full sets(so far) are: BuffBloodPactWard, DebuffBloodPactWard, PhysicalBloodPactRage, MagicalBloodPactRage and FCBloodPactRage.
    I wasn't happy with how all Wards fell under the umbrella of Buff or nothin' when it came to gear selection.
    So short version, what do I need to shove in here for it to recognize everthing? I'm assuming a chunk of "else if's" or something but not sure of setup or position.
    From your description, I'm assuming you're using mine as a basis.


    Changes I'd make:

    1) Create a set named sets.midcast.Pet['Flaming Crush']

    2) Rewrite the job_pet_midcast function as follows:

    Code:
    function job_pet_midcast(spell, action, spellMap, eventArgs)
    	if spirits:contains(pet.name) then
    		classes.CustomClass = 'Spirit'
    	elseif spell.type == 'BloodPactRage' then
    		if magicalRagePacts:contains(spell.english) then
    			spellMap = 'MagicalBloodPactRage'
    		else
    			spellMap = 'PhysicalBloodPactRage'
    		end
    	end
    end
    Only change is using spellMap instead of classes.CustomClass. Set selection looks for spellMap -after- checking for the spell name (as opposed to CustomClass, which is searched for -before- the spell name), which means sets.midcast.Pet['Flaming Crush'] will be found (and used) before sets.midcast.Pet.MagicalBloodPactRage.

    If you want to refine the ward pacts' set selections, just do the same sort of splitup that I did for the rage pacts.

  14. #1074
    Bitchfist
    The horn knows no mercy; only wrath

    Join Date
    Oct 2006
    Posts
    4,375
    BG Level
    7
    FFXIV Character
    Indalecia Salavachere
    FFXIV Server
    Midgardsormr
    FFXI Server
    Asura

    Alright, thanks, I'll give it a whirl.

  15. #1075
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Sithel View Post
    Motenten,

    With your SMN profile, I see
    Code:
    options.IdleModes = {'Normal'}
    But I'm wanting a few options to toggle through Avatar Melee modes, with options like melee,refresh and or perp cost or whatever I desire. Is this something you could add to your file easily, as I'm a bit clueless with what I've already tried.

    Thanks!

    You can add extra modes there that you can cycle through, such as options.IdleModes = {'Normal', 'Perp', 'Refresh'}, or whatever. Those need to be defined as belonging to a lower level than the .Pet extension. IE:


    sets.idle = {}
    sets.idle.Pet = {}
    sets.idle.Pet.Engaged = {}
    sets.idle.Refresh = {}
    sets.idle.Refresh.Pet = {}
    sets.idle.Refresh.Pet.Engaged = {}
    etc.

    The sets.idle.Avatar.Favor type sets are applied on top of the original idle set. It's really kind of clumsily done, actually, but partly because of allowing for separation of avatars and spirits.

    I should probably do another review of pup and smn files, since they both have to deal with some variation based on type of pet.

  16. #1076
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    @JSHidaka, Orestes, Motenten
    First of all, thank you so very much for actually taking the time of reading my stuff and correcting me, teaching me how to do things better.
    Feels like I'm back in school again :D
    I don't know how to properly express my gratitude to you without sounding even more ridiculous, but I really really really apreciated what you people have been doing.

    That being said, I implemented fixes and changes, which I actually understood for once lol
    The "equip(sets.precast[spell.english]" general rule thing was awesome!
    A few more things now:

    Weapon Skills
    I think I see what you mean now Motenten, the current system I used for WS is overly convoluted and horrible.
    I tried changing to a different model for defining precast sets.
    set.precast.WS['ws name'] = ...
    And then subsets with ['ws name'].Acc, .Mod etc accordingly where I see fit.
    My questions now are these:

    1. Where do I define the available WSmodes? I suppose it should be a line similar to this that I've taken from one of your luas: "options.WeaponskillModes = {'Normal', 'Acc', 'Att', 'Mod'}"
      But where would I put such a line in a lua like mine?
    2. How do I modify the current WeaponskillMode? Do I treat it like an index var? Something like "WeaponskillMode = Acc" for instance?
    3. What happens if the current WeaponskillMode is not defined for the WS I'm using? It falls back to the default (Normal) set? For example let's say WeaponskillMode is currently set to '.Mod", but the WS I'm using only has a default and a .Acc modes defined. What's gonna happen?



    Ok that's it. I don't think I fully understood your Saber Dance example and I also have another similar question but one thing at a time, first I want to clear up these things concerning WSs and the rest in this post.

  17. #1077
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Sechs View Post
    1. Where do I define the available WSmodes? I suppose it should be a line similar to this that I've taken from one of your luas: "options.WeaponskillModes = {'Normal', 'Acc', 'Att', 'Mod'}"
      But where would I put such a line in a lua like mine?
    2. How do I modify the current WeaponskillMode? Do I treat it like an index var? Something like "WeaponskillMode = Acc" for instance?
    3. What happens if the current WeaponskillMode is not defined for the WS I'm using? It falls back to the default (Normal) set? For example let's say WeaponskillMode is currently set to '.Mod", but the WS I'm using only has a default and a .Acc modes defined. What's gonna happen?

    1) Define them in the same place you define your TP modes. Typically, set up all your configuration-type variables at the top of the get_sets() function (assuming you're building a new, plain lua file; if you're using my includes, I've constructed separate functions to isolate certain types of variable initialization).

    2) If you've looked at my lua files, you'll see that I've defined options.WeaponskillModes, and state.WeaponskillMode. The options variable lists all possible values that the mode can take, and the state variable contains the currently selected mode.

    I never use index values for mine, except to handle one little trick with cycling through the values (and that's far removed from any code you're likely to see from a casual perusal). If I want to set things to Acc mode, I can just do "gs c set WeaponskillMode Acc". That means that if I look at the macro or bind, I can immediately see what is being set (and don't have to guess what a given index value is supposed to mean), and when I assign the value I just have to check if "Acc" is a valid option in the list.

    Doing it this way, it's merely assigning the value to the correct variable. state.WeaponskillMode = arg[3] (after splitting the self-command, so you have arg = {"set", "WeaponskillMode", "Acc"}). With a few error checks added in, you could write it like this:

    Code:
    function self_command(command)
        local arg = command:split(" ")
        if arg[1] == 'set' then
            if #arg == 3 then
                if state[arg[2]] and options[arg[2]..'s'] then
                    if options[arg[2]..'s']:contains(arg[3]) then
                        state[arg[2]] = arg[3]
                    else
                        add_to_chat(123,'Invalid option value.')
                    end
                else
                    add_to_chat(123,'Unknown state/option type.')
                end
            else
                add_to_chat(123,'Invalid number of command arguments.')
            end
        else
            add_to_chat(123,'Unknown command.')
        end
    end
    This does make it slightly trickier to increment to the next mode in the list. If you're only ever explicitly assigning the mode, this is all you need. If you want to cycle, then you can add something like this to the self-command:

    Code:
        elseif arg[1] == 'cycle' and arg[2] then
            if state[arg[2]] and options[arg[2]..'s'] then
                local index = 0
                for k,v in pairs(options[arg[2]..'s']) do
                    if v == state[arg[2]] then
                        index = k
                        break
                    end
                end
                
                index = index + 1
                if index > #options[arg[2]..'s'] then
                    index = 1
                end
                
                state[arg[2]] = options[arg[2]..'s'][index]
            else
                add_to_chat(123,'Unknown state/option type.')
            end
    These are a bit more complicated than typical because they are designed to work with any state/option pairs, and there's a fair bit of error checking because this is being run off of user input, and user input is notoriously untrustworthy.


    3) Correct. Remember the order that the equipped set is defined in. Since you're adding in the .WS table, I'll add in one extra step:

    Note: This also fixes an error in the original example

    Code:
    elseif spell.type == 'WeaponSkill' then
        -- all weaponskills fall under this table
        local wsSet = sets.precast.WS
    
        -- if you defined a set for a specific weaponskill...
        if wsSet[spell.english] then
            -- then use that sub-table
            wsSet = wsSet[spell.english]
            
            -- if you defined a set for the current weaponskill mode for this weaponskill...
            if wsSet[weaponskillMode] then
                -- then use that sub-table
                wsSet = wsSet[weaponskillMode]
            end
        end
        
        -- equip whatever table we ended up finding
        equip(wsSet)
    end
    If you use Viper Bite, there won't be a sets.precast.WS['Viper Bite'] table, so it will just use sets.precast.WS.

    If you use Exenterator, and your current weaponskill mode is "Mod", but Exenterator doesn't have a Mod sub-table, it will use sets.precast.WS.Exenterator. Note that I typically take advantage of that and never define a 'Normal' table, and just let that be the standard default table for the weaponskill.

    If you use Exenterator, and your current weaponskill mode is "Acc", and you've also defined that subtable, it will equip sets.precast.WS.Exenterator.Acc.

  18. #1078
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Ok let's see if I got this right

    http://pastebin.com/Z4ygr3gC

    • I defined WeaponskillModes and assigned a default value to state.WeaponskillMode
    • I incorporated the first code for handling arg, since I didn't want/need to be able to cycle through WSmodes
    • I wrote a few lines of codes at the end, inside TP set cycling rule, to associate various WSmodes to specific TP sets. That way if I, say, cycle to Acc TPmode, state.WSmode should change as well, etc.


    Not sure if I handled state.WSmode the way it's meant to be, maybe I completely misunderstood.
    Hoping my lua is more or less "working" now, I have a few more things I need to understand how to do

    1. I need to handle an exception for Saber Dance.
      Spoiler: show

      Previously I said that I wanted Horos Tights to override whatever I have in the legs slot on the current TPset and WSset, unless I'm equipping tp_ind 6 (PDT) or 7 (MDT) sets.
      After doing some tests in the spreadsheet I noticed that Horos Tights during saber are not worth it over other options for Pyrrhic, Evis and Rudra, even the HQ version.
      It's barely better than Nahtirah, but the difference is so small I don't know if I want to bother now.
      I could say the same thing about the PDT/MDT exception. Once I have the HQ version it's actually going to be better than my 113 Iuitl Tights...
      tl;dr: fuck exceptions, they have very little relevance compared to the code-mess to handle them. I just want Horos Tights to be equipped when buffactive == 'Saber Dance', period.
    2. I'd love to handle a WS exception when buffactive == 'Sneak Attack" or 'Climatic Flourish'. In such a situation I'd love the current WSset, whichever it is, to be set_combined with another small set I already defined, called sets.precast.WS.Crit.
      How complicated would this be? If it's too complicated I'll just ignore it.
      It doesn't matter for Evisceration since the current Evis WSsets already include those items, but for the other WSs (especially Exenterator) I would normally have different items in those slots.

  19. #1079
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Sechs View Post
    1. I need to handle an exception for Saber Dance.
      Spoiler: show

      Previously I said that I wanted Horos Tights to override whatever I have in the legs slot on the current TPset and WSset, unless I'm equipping tp_ind 6 (PDT) or 7 (MDT) sets.
      After doing some tests in the spreadsheet I noticed that Horos Tights during saber are not worth it over other options for Pyrrhic, Evis and Rudra, even the HQ version.
      It's barely better than Nahtirah, but the difference is so small I don't know if I want to bother now.
      I could say the same thing about the PDT/MDT exception. Once I have the HQ version it's actually going to be better than my 113 Iuitl Tights...
      tl;dr: fuck exceptions, they have very little relevance compared to the code-mess to handle them. I just want Horos Tights to be equipped when buffactive == 'Saber Dance', period.
    2. I'd love to handle a WS exception when buffactive == 'Sneak Attack" or 'Climatic Flourish'. In such a situation I'd love the current WSset, whichever it is, to be set_combined with another small set I already defined, called sets.precast.WS.Crit.
      How complicated would this be? If it's too complicated I'll just ignore it.
      It doesn't matter for Evisceration since the current Evis WSsets already include those items, but for the other WSs (especially Exenterator) I would normally have different items in those slots.
    This is how I would do the Saber Dance Part...

    sets.precast['Saber Dance'] = saber dance set, when you active it will switch to that set. then to keep it up while saber dance is up.

    Code:
    function aftercast(spell)
    	if player.status == 'Engaged' then
    		if buffactive['Saber Dance'] then
    			equip(sets.TP[sets.TP.index[TP_ind]], set.precast['Saber Dance'])
    		else
    			equip(sets.TP[sets.TP.index[TP_ind]])
    		end
    	else
            equip(sets.Idle.Standard)
    	end
    end    
           
    function status_change(new,old)
        if new == 'Engaged' then
    		if buffactive['Saber Dance'] then
    			equip(sets.TP[sets.TP.index[TP_ind]], set.precast['Saber Dance'])
    		else
    			equip(sets.TP[sets.TP.index[TP_ind]])
    		end
        else
            equip(sets.Idle.Standard)
        end
    end
    for the sneak attack/Climatic
    I would add in the end of you precast code

    Code:
    	if spell.type == 'WeaponSkill' and (buffactive['Sneak Attack'] or buffactive['Climatic Flourish']) then
    		--equip the crit pieces you want
    	end
    not sure about the "or" for Sneak Attack and climatic... if just inside () will work with one or the other...

  20. #1080
    Melee Summoner
    Join Date
    Jan 2008
    Posts
    31
    BG Level
    1

    Hey, I'm having a problem with my mage gearswap lua's...

    I don't seem to be changing equipment when casting spells... Can anyone see something I'm doing wrong please? - I'm using Mote's lua files and includes/mappings etc..

    Spoiler: show
    -------------------------------------------------------------------------------------------------------------------
    -- Mappings, lists and sets to describe game relationships that aren't easily determinable otherwise.
    -------------------------------------------------------------------------------------------------------------------

    -------------------------------------------------------------------------------------------------------------------
    -- Elemental mappings for element relationships and certian types of spells.
    -------------------------------------------------------------------------------------------------------------------

    elements = {}

    elements.list = S{'Light','Dark','Fire','Ice','Wind','Earth','Ligh tning','Water'}

    elements.weak_to = {['Light']='Dark', ['Dark']='Light', ['Fire']='Ice', ['Ice']='Wind', ['Wind']='Earth', ['Earth']='Lightning',
    ['Lightning']='Water', ['Water']='Fire'}

    elements.strong_to = {['Light']='Dark', ['Dark']='Light', ['Fire']='Water', ['Ice']='Fire', ['Wind']='Ice', ['Earth']='Wind',
    ['Lightning']='Earth', ['Water']='Lightning'}

    elements.storm_of = {['Light']="Aurorastorm", ['Dark']="Voidstorm", ['Fire']="Firestorm", ['Earth']="Sandstorm",
    ['Water']="Rainstorm", ['Wind']="Windstorm", ['Ice']="Hailstorm", ['Lightning']="Thunderstorm"}

    elements.spirit_of = {['Light']="Light Spirit", ['Dark']="Dark Spirit", ['Fire']="Fire Spirit", ['Earth']="Earth Spirit",
    ['Water']="Water Spirit", ['Wind']="Air Spirit", ['Ice']="Ice Spirit", ['Lightning']="Thunder Spirit"}



    storms = S{"Aurorastorm", "Voidstorm", "Firestorm", "Sandstorm", "Rainstorm", "Windstorm", "Hailstorm", "Thunderstorm"}


    skillchain_elements = {}
    skillchain_elements.Light = S{'Light','Fire','Wind','Lightning'}
    skillchain_elements.Dark = S{'Dark','Ice','Earth','Water'}
    skillchain_elements.Fusion = S{'Light','Fire'}
    skillchain_elements.Fragmentation = S{'Wind','Lightning'}
    skillchain_elements.Distortion = S{'Ice','Water'}
    skillchain_elements.Gravitation = S{'Dark','Earth'}
    skillchain_elements.Transfixion = S{'Light'}
    skillchain_elements.Compression = S{'Dark'}
    skillchain_elements.Liquification = S{'Fire'}
    skillchain_elements.Induration = S{'Ice'}
    skillchain_elements.Detonation = S{'Wind'}
    skillchain_elements.Scission = S{'Earth'}
    skillchain_elements.Impaction = S{'Lightning'}
    skillchain_elements.Reverberation = S{'Water'}



    -- list of weaponskills that use ammo
    bow_gun_weaponskills = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Blast Arrow",
    "Arching Arrow", "Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance",
    "Hot Shot", "Split Shot", "Sniper Shot", "Slug Shot", "Blast Shot", "Heavy Shot", "Detonator",
    "Numbing Shot", "Last Stand", "Coronach", "Trueflight", "Leaden Salute", "Wildfire"}

    -- list of weaponskills that can be used at greater than melee range
    ranged_weaponskills = S{"Flaming Arrow", "Piercing Arrow", "Dulling Arrow", "Sidewinder", "Arching Arrow",
    "Empyreal Arrow", "Refulgent Arrow", "Apex Arrow", "Namas Arrow", "Jishnu's Radiance",
    "Hot Shot", "Split Shot", "Sniper Shot", "Slug Shot", "Heavy Shot", "Detonator", "Last Stand",
    "Coronach", "Trueflight", "Leaden Salute", "Wildfire",
    "Myrkr"}


    -------------------------------------------------------------------------------------------------------------------
    -- Spell mappings allow defining a general category or description that each of sets of related
    -- spells all fall under.
    -------------------------------------------------------------------------------------------------------------------

    spell_maps = {
    ['Cure']='Cure',['Cure II']='Cure',['Cure III']='Cure',['Cure IV']='Cure',['Cure V']='Cure',['Cure VI']='Cure',
    ['Cura']='Curaga',['Cura II']='Curaga',['Cura III']='Curaga',
    ['Curaga']='Curaga',['Curaga II']='Curaga',['Curaga III']='Curaga',['Curaga IV']='Curaga',['Curaga V']='Curaga',
    -- Status Removal doesn't include Esuna or Sacrifice, since they work differently than the rest
    ['Poisona']='StatusRemoval',['Paralyna']='StatusRemoval',['Silena']='StatusRemoval',['Blindna']='StatusRemoval',['Cursna']='StatusRemoval',
    ['Stona']='StatusRemoval',['Viruna']='StatusRemoval',['Erase']='StatusRemoval',
    ['Barfire']='BarElement',['Barstone']='BarElement',['Barwater']='BarElement',['Baraero']='BarElement',['Barblizzard']='BarElement',['Barthunder']='BarElement',
    ['Barfira']='BarElement',['Barstonra']='BarElement',['Barwatera']='BarElement',['Baraera']='BarElement',['Barblizzara']='BarElement',['Barthundra']='BarElement',
    ['Raise']='Raise',['Raise II']='Raise',['Raise III']='Raise',['Arise']='Raise',
    ['Reraise']='Reraise',['Reraise II']='Reraise',['Reraise III']='Reraise',
    ['Protect']='Protect',['Protect II']='Protect',['Protect III']='Protect',['Protect IV']='Protect',['Protect V']='Protect',
    ['Shell']='Shell',['Shell II']='Shell',['Shell III']='Shell',['Shell IV']='Shell',['Shell V']='Shell',
    ['Protectra']='Protectra',['Protectra II']='Protectra',['Protectra III']='Protectra',['Protectra IV']='Protectra',['Protectra V']='Protectra',
    ['Shellra']='Shellra',['Shellra II']='Shellra',['Shellra III']='Shellra',['Shellra IV']='Shellra',['Shellra V']='Shellra',
    ['Regen']='Regen',['Regen II']='Regen',['Regen III']='Regen',['Regen IV']='Regen',['Regen V']='Regen',
    ['Refresh']='Refresh',['Refresh II']='Refresh',
    ['Teleport-Holla']='Teleport',['Teleport-Dem']='Teleport',['Teleport-Mea']='Teleport',['Teleport-Altep']='Teleport',['Teleport-Yhoat']='Teleport',
    ['Teleport-Vahzl']='Teleport',['Recall-Pashh']='Teleport',['Recall-Meriph']='Teleport',['Recall-Jugner']='Teleport',
    ['Valor Minuet']='Minuet',['Valor Minuet II']='Minuet',['Valor Minuet III']='Minuet',['Valor Minuet IV']='Minuet',['Valor Minuet V']='Minuet',
    ["Knight's Minne"]='Minne',["Knight's Minne II"]='Minne',["Knight's Minne III"]='Minne',["Knight's Minne IV"]='Minne',["Knight's Minne V"]='Minne',
    ['Advancing March']='March',['Victory March']='March',
    ['Sword Madrigal']='Madrigal',['Blade Madrigal']='Madrigal',
    ["Hunter's Prelude"]='Prelude',["Archer's Prelude"]='Prelude',
    ['Sheepfoe Mambo']='Mambo',['Dragonfoe Mambo']='Mambo',
    ['Raptor Mazurka']='Mazurka',['Chocobo Mazurka']='Mazurka',
    ['Sinewy Etude']='Etude',['Dextrous Etude']='Etude',['Vivacious Etude']='Etude',['Quick Etude']='Etude',['Learned Etude']='Etude',['Spirited Etude']='Etude',['Enchanting Etude']='Etude',
    ['Herculean Etude']='Etude',['Uncanny Etude']='Etude',['Vital Etude']='Etude',['Swift Etude']='Etude',['Sage Etude']='Etude',['Logical Etude']='Etude',['Bewitching Etude']='Etude',
    ["Mage's Ballad"]='Ballad',["Mage's Ballad II"]='Ballad',["Mage's Ballad III"]='Ballad',
    ["Army's Paeon"]='Paeon',["Army's Paeon II"]='Paeon',["Army's Paeon III"]='Paeon',["Army's Paeon IV"]='Paeon',["Army's Paeon V"]='Paeon',["Army's Paeon VI"]='Paeon',
    ['Fire Carol']='Carol',['Ice Carol']='Carol',['Wind Carol']='Carol',['Earth Carol']='Carol',['Lightning Carol']='Carol',['Water Carol']='Carol',['Light Carol']='Carol',['Dark Carol']='Carol',
    ['Fire Carol II']='Carol',['Ice Carol II']='Carol',['Wind Carol II']='Carol',['Earth Carol II']='Carol',['Lightning Carol II']='Carol',['Water Carol II']='Carol',['Light Carol II']='Carol',['Dark Carol II']='Carol',
    ['Foe Lullaby']='Lullaby',['Foe Lullaby II']='Lullaby',['Horde Lullaby']='Lullaby',['Horde Lullaby II']='Lullaby',
    ['Fire Threnody']='Threnody',['Ice Threnody']='Threnody',['Wind Threnody']='Threnody',['Earth Threnody']='Threnody',['Lightning Threnody']='Threnody',['Water Threnody']='Threnody',['Light Threnody']='Threnody',['Dark Threnody']='Threnody',
    ['Battlefield Elegy']='Elegy',['Carnage Elegy']='Elegy',
    ['Foe Requiem']='Requiem',['Foe Requiem II']='Requiem',['Foe Requiem III']='Requiem',['Foe Requiem IV']='Requiem',['Foe Requiem V']='Requiem',['Foe Requiem VI']='Requiem',['Foe Requiem VII']='Requiem',
    ['Utsusemi: Ichi']='Utsusemi',['Utsusemi: Ni']='Utsusemi',
    ['Banish']='Banish',['Banish II']='Banish',['Banish III']='Banish',['Banishga']='Banish',['Banishga II']='Banish',
    ['Holy']='Holy',['Holy II']='Holy',['Drain']='Drain',['Drain II']='Drain',['Aspir']='Aspir',['Aspir II']='Aspir',
    ['Absorb-Str']='Absorb',['Absorb-Dex']='Absorb',['Absorb-Vit']='Absorb',['Absorb-Agi']='Absorb',['Absorb-Int']='Absorb',['Absorb-Mnd']='Absorb',['Absorb-Chr']='Absorb',
    ['Absorb-Acc']='Absorb',['Absorb-TP']='Absorb',['Absorb-Attri']='Absorb',
    ['Burn']='ElementalEnfeeble',['Frost']='ElementalEnfeeble',['Choke']='ElementalEnfeeble',['Rasp']='ElementalEnfeeble',['Shock']='ElementalEnfeeble',['Drown']='ElementalEnfeeble',
    ['Pyrohelix']='Helix',['Cryohelix']='Helix',['Anemohelix']='Helix',['Geohelix']='Helix',['Ionohelix']='Helix',['Hydrohelix']='Helix',['Luminohelix']='Helix',['Noctohelix']='Helix',
    ['Firestorm']='Storm',['Hailstorm']='Storm',['Windstorm']='Storm',['Sandstorm']='Storm',['Thunderstorm']='Storm',['Rainstorm']='Storm',['Aurorastorm']='Storm',['Voidstorm']='Storm',
    ['Fire Maneuver']='Maneuver',['Ice Maneuver']='Maneuver',['Wind Maneuver']='Maneuver',['Earth Maneuver']='Maneuver',['Thunder Maneuver']='Maneuver',
    ['Water Maneuver']='Maneuver',['Light Maneuver']='Maneuver',['Dark Maneuver']='Maneuver',
    ['Fire']='ElementalMagic',
    }

    no_skill_spells_list = S{'Haste', 'Refresh', 'Regen', 'Protect', 'Protectra', 'Shell', 'Shellra',
    'Raise', 'Reraise', 'Cursna', 'Sneak', 'Invisible', 'Deodorize'}


    -------------------------------------------------------------------------------------------------------------------
    -- Tables to specify general area groupings. Creates the 'areas' table to be referenced in job files.
    -- Zone names provided by world.area/world.zone are currently in all-caps, so defining the same way here.
    -------------------------------------------------------------------------------------------------------------------

    areas = {}

    -- City areas for town gear and behavior.
    areas.Cities = S{
    "Ru'Lude Gardens",
    "Upper Jeuno",
    "Lower Jeuno",
    "Port Jeuno",
    "Port Windurst",
    "Windurst Waters",
    "Windurst Woods",
    "Windurst Walls",
    "Heavens Tower",
    "Port San d'Oria",
    "Northern San d'Oria",
    "Southern San d'Oria",
    "Port Bastok",
    "Bastok Markets",
    "Bastok Mines",
    "Metalworks",
    "Aht Urhgan Whitegate",
    "Tavanazian Safehold",
    "Nashmau",
    "Selbina",
    "Mhaura",
    "Norg",
    "Eastern Adoulin",
    "Western Adoulin",
    "Kazham"
    }
    -- Adoulin areas, where Ionis will grant special stat bonuses.
    areas.Adoulin = S{
    "Yahse Hunting Grounds",
    "Ceizak Battlegrounds",
    "Foret de Hennetiel",
    "Morimar Basalt Fields",
    "Yorcia Weald",
    "Yorcia Weald [U]",
    "Cirdas Caverns",
    "Cirdas Caverns [U]",
    "Marjami Ravine",
    "Kamihr Drifts",
    "Sih Gates",
    "Moh Gates",
    "Dho Gates",
    "Woh Gates",
    "Rala Waterways",
    "Rala Waterways [U]",
    "Outer Ra'Kaznar",
    "Outer Ra'Kaznar [U]"
    }


    -------------------------------------------------------------------------------------------------------------------
    -- Lists of certain NPCs.
    -------------------------------------------------------------------------------------------------------------------

    npcs = {}
    npcs.Trust = S{'Ayame','Naji','Nanaa Mihgo','Tenzen','Volker','Zeid',
    'Ajido-Marujido','Shantotto','Curilla','Excenmille','Trio n','Valaineral',
    'Kupipi','Mihli Aliapoh','Joachim','Lion'}


    -------------------------------------------------------------------------------------------------------------------
    -- Mappings for elemental gear
    -------------------------------------------------------------------------------------------------------------------

    gear_map = {}

    gear_map.Obi = {['Light']='Korin Obi', ['Dark']='Anrin Obi', ['Fire']='Karin Obi', ['Ice']='Hyorin Obi', ['Wind']='Furin Obi',
    ['Earth']='Dorin Obi', ['Lightning']='Rairin Obi', ['Water']='Suirin Obi'}

    gear_map.Gorget = {['Light']='Light Gorget', ['Dark']='Shadow Gorget', ['Fire']='Flame Gorget', ['Ice']='Snow Gorget',
    ['Wind']='Breeze Gorget', ['Earth']='Soil Gorget', ['Lightning']='Thunder Gorget', ['Water']='Aqua Gorget'}

    gear_map.Belt = {['Light']='Light Belt', ['Dark']='Shadow Belt', ['Fire']='Flame Belt', ['Ice']='Snow Belt',
    ['Wind']='Breeze Belt', ['Earth']='Soil Belt', ['Lightning']='Thunder Belt', ['Water']='Aqua Belt'}

    gear_map.FastcastStaff = {['Light']='Arka I', ['Dark']='Xsaeta I', ['Fire']='Atar I', ['Ice']='Vourukasha I',
    ['Wind']='Vayuvata I', ['Earth']='Vishrava I', ['Lightning']='Apamajas I', ['Water']='Haoma I', ['Thunder']='Apamajas I'}

    gear_map.RecastStaff = {['Light']='Arka II', ['Dark']='Xsaeta II', ['Fire']='Atar II', ['Ice']='Vourukasha II',
    ['Wind']='Vayuvata II', ['Earth']='Vishrava II', ['Lightning']='Apamajas II', ['Water']='Haoma II', ['Thunder']='Apamajas II'}





    Spoiler: show
    -------------------------------------------------------------------------------------------------------------------
    -- Initialization function that defines sets and variables to be used.
    -------------------------------------------------------------------------------------------------------------------

    -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.

    -- Initialization function for this job file.
    function get_sets()
    -- Load and initialize the include file.
    include('Mote-Include.lua')
    end


    -- Setup vars that are user-independent.
    function job_setup()

    end


    -- Setup vars that are user-dependent. Can override this function in a sidecar file.
    function user_setup()
    -- Options: Override default values
    options.CastingModes = {'Normal', 'Resistant', 'Proc'}
    options.OffenseModes = {'None', 'Normal'}
    options.DefenseModes = {'Normal'}
    options.WeaponskillModes = {'Normal'}
    options.IdleModes = {'Normal', 'PDT'}
    options.RestingModes = {'Normal'}
    options.PhysicalDefenseModes = {'PDT'}
    options.MagicalDefenseModes = {'MDT'}

    state.Defense.PhysicalMode = 'PDT'
    state.OffenseMode = 'None'

    -- Default macro set/book
    set_macro_page(1, 3)
    end


    -- Called when this job file is unloaded (eg: job change)
    function file_unload()
    if binds_on_unload then
    binds_on_unload()
    end
    end


    -- Define sets and vars used by this job file.
    function init_gear_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------

    ---- Precast Sets ----

    -- Precast sets to enhance JAs
    sets.precast.JA['Mana Wall'] = {feet="Goetia Sabots +2"}

    sets.precast.JA.Manafont = {body="Sorcerer's Coat +2"}

    -- equip to maximize HP (for Tarus) and minimize MP loss before using convert
    sets.precast.JA.Convert = {}


    -- Fast cast sets for spells

    sets.precast.FC = {
    head="Nahtirah Hat",ear2="Loquacious Earring",
    body="Hagondes Coat",ring1="Prolix Ring",
    back="Swith Cape +1",legs="Artsieq Hose",feet="Hagondes Sabots"}

    sets.precast.FC.EnhancingMagic = set_combine(sets.precast.FC, {waist="Siegel Sash"})

    sets.precast.FC.ElementalMagic = set_combine(sets.precast.FC, {neck="Eddy Necklace"})

    sets.precast.FC.Cure = set_combine(sets.precast.FC, {body="Heka's Kalasiris", back="Pahtli Cape"})

    sets.precast.FC.Curaga = sets.precast.FC.Cure

    -- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {
    head="Hagondes Hat",
    body="Hagondes Coat",hands="Yaoyotl Gloves",ring2="Icesoul Ring",
    back="Refraction Cape",legs="Hagondes Pants",feet="Hagondes Sabots"}

    -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Vidohunir'] = {ammo="Witchstone",
    head="Hagondes Hat",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
    body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Toro Cape",waist="Thunder Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}



    ---- Midcast Sets ----

    sets.midcast.FastRecast = {
    head="Nahtirah Hat",ear2="Loquacious Earring",
    body="Hagondes Coat",hands="Hagondes Cuffs",ring1="Prolix Ring",
    back="Swith Cape +1",waist="Goading Belt",legs="Artsieq Hose",feet="Hagondes Sabots"}

    sets.midcast.Cure = {main="Tamaxchi",sub="Genbu's Shield",
    head="Nahtirah Hat",neck="Phalaina Locket",ear2="Loquacious Earring",
    body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Sangoma Ring",ring2="Sirona's Ring",
    back="Pahtli Cape",waist=gear.ElementalObi,legs="Hagondes Pants",feet="Hagondes Sabots"}

    sets.midcast.Curaga = sets.midcast.Cure

    sets.midcast.EnhancingMagic = {
    neck="Enhancing Torque",
    body="Manasa Chasuble",
    legs="Portent Pants"}

    sets.midcast.Stoneskin = set_combine(sets.midcast.EnhancingMagic, {waist="Siegel Sash"})

    sets.midcast.EnfeeblingMagic = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Oreiad's Tathlum",
    head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Artsieq Jubbah",hands="Yaoyotl Gloves",ring1="Maquette Ring",ring2="Sangoma Ring",
    back="Refraction Cape",legs="Artsieq Hose",feet="Artsieq Boots"}

    sets.midcast.ElementalEnfeeble = sets.midcast.EnfeeblingMagic

    sets.midcast.DarkMagic = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Oreiad's Tathlum",
    head="Nahtirah Hat",neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Artsieq Jubbah",hands="Yaoyotl Gloves",ring1="Maquette Ring",ring2="Sangoma Ring",
    back="Refraction Cape",waist="Goading Belt",legs="Artsieq Hose",feet="Artsieq Boots"}

    sets.midcast.Drain = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Oreiad's Tathlum",
    head="Nahtirah Hat",neck="Aesir Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Artsieq Jubbah",hands="Yaoyotl Gloves",ring1="Maquette Ring",ring2="Sangoma Ring",
    back="Refraction Cape",waist="Goading Belt",legs="Artsieq Hose",feet="Goetia Sabots +2"}

    sets.midcast.Aspir = sets.midcast.Drain

    sets.midcast.Stun = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Oreiad's Tathlum",
    head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Sangoma Ring",
    back="Refraction Cape",waist="Witful Belt",legs="Artsieq Hose",feet="Artsieq Boots"}

    sets.midcast.BardSong = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Oreiad's Tathlum",
    head="Nahtirah Hat",neck="Weike Torque",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Artsieq Jubbah",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Sangoma Ring",
    back="Refraction Cape",legs="Artsieq Hose",feet="Artsieq Boots"}


    -- Elemental Magic sets are default for handling low-tier nukes.
    sets.midcast.ElementalMagic = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Hagondes Sabots"}

    sets.midcast.ElementalMagic.Resistant = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Hagondes Coat",hands="Hagondes Cuffs",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Artsieq Boots"}

    -- Idle set when doing procs. Fast cast gear, minimal nuke gear. Won't change out of this for nukes.
    sets.midcast.ElementalMagic.Proc = {main="Terra's Staff", sub="Mephitis Grip",ammo="Impatiens",
    head="Nahtirah Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
    body="Manasa Chasuble",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
    back="Swith Cape +1",waist="Witful Belt",legs="Nares Trews",feet="Hagondes Sabots"}

    -- Custom classes for high-tier nukes.
    sets.midcast.HighTierNuke = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Hagondes Sabots"}

    sets.midcast.HighTierNuke.Resistant = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Artsieq Boots"}

    -- Custom classes for high-tier nukes in Adoulin areas (need more general magic accuracy).
    sets.midcast.AdoulinHighTierNuke = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Hagondes Sabots"}

    sets.midcast.AdoulinHighTierNuke.Resistant = {main="Ngqoqwanb",sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Psystorm Earring",ear2="Lifestorm Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Icesoul Ring",ring2="Strendu Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Artsieq Boots"}


    -- Sets to return to when not performing an action.

    -- Resting sets
    sets.resting = {main="Chatoyant Staff", sub="Oneiros Grip",ammo="Clarus Stone",
    head="Wivre Hairpin",neck="Grandiose Chain",
    body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
    waist="Austerity Belt",legs="Nares Trews",feet="Serpentes Sabots"}


    -- Idle sets

    -- Normal refresh idle set
    sets.idle = {main="Ngqoqwanb", sub="Oneiros Grip",ammo="Dosis Tathlum",
    head="Wivre Hairpin",neck="Wiglen Gorget",
    body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
    back="Cheviot Cape",waist="Hierarch Belt",legs="Nares Trews",feet="Hagondes Sabots"}

    -- Idle mode that keeps PDT gear on, but doesn't prevent normal gear swaps for precast/etc.
    sets.idle.PDT = {main="Terra's Staff", sub="Oneiros Grip",ammo="Dosis Tathlum",
    head="Nahtirah Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Dark Ring",ring2="Dark Ring",
    back="Cheviot Cape",waist="Hierarch Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}

    -- Idle mode scopes:
    -- Idle mode when weak.
    sets.idle.Weak = {main="Bolelabunga",sub="Genbu's Shield",ammo="Dosis Tathlum",
    head="Hagondes Hat",neck="Twilight Torque",ear1="Gifted Earring",ear2="Loquacious Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Dark Ring",ring2="Paguroidea Ring",
    back="Cheviot Cape",waist="Hierarch Belt",legs="Nares Trews",feet="Hagondes Sabots"}

    -- Town gear.
    sets.idle.Town = {main="Ngqoqwanb", sub="Mephitis Grip",ammo="Dosis Tathlum",
    head="Buremte Hat",neck="Eddy Necklace",ear1="Crematio Earring",ear2="Friomisi Earring",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Strendu Ring",ring2="Icesoul Ring",
    back="Bane Cape",waist="Sekhmet Corset",legs="Hagondes Pants",feet="Hagondes Sabots"}

    -- Defense sets

    sets.defense.PDT = {main="Terra's Staff",sub="Oneiros Grip",
    head="Nahtirah Hat",neck="Twilight Torque",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Dark Ring",ring2="Dark Ring",
    back="Cheviot Cape",waist="Hierarch Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}

    sets.defense.MDT = {ammo="Demonry Stone",
    head="Nahtirah Hat",neck="Twilight Torque",
    body="Hagondes Coat",hands="Otomi Gloves",ring1="Dark Ring",ring2="Dark Ring",
    back="Tuilha Cape",waist="Hierarch Belt",legs="Artsieq Hose",feet="Hagondes Sabots"}

    sets.Kiting = {feet="Herald's Gaiters"}


    -- Buff sets: Gear that needs to be worn to actively enhance a current player buff.

    sets.buff['Mana Wall'] = {feet="Goetia Sabots +2"}


    -- Engaged sets

    -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
    -- sets if more refined versions aren't defined.
    -- If you create a set with both offense and defense modes, the offense mode should be first.
    -- EG: sets.engaged.Dagger.Accuracy.Evasion

    -- Normal melee group
    sets.engaged = {
    head="Nahtirah Hat",
    body="Hagondes Coat",hands="Otomi Gloves",
    back="Cheviot Cape",waist="Goading Belt",legs="Hagondes Pants",feet="Hagondes Sabots"}



    lowTierNukes = S{'Stone', 'Water', 'Aero', 'Fire', 'Blizzard', 'Thunder',
    'Stone II', 'Water II', 'Aero II', 'Fire II', 'Blizzard II', 'Thunder II',
    'Stone III', 'Water III', 'Aero III', 'Fire III', 'Blizzard III', 'Thunder III',
    'Stonega', 'Waterga', 'Aeroga', 'Firaga', 'Blizzaga', 'Thundaga',
    'Stonega II', 'Waterga II', 'Aeroga II', 'Firaga II', 'Blizzaga II', 'Thundaga II'}
    end

    -------------------------------------------------------------------------------------------------------------------
    -- Job-specific hooks that are called to process player actions at specific points in time.
    -------------------------------------------------------------------------------------------------------------------

    -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
    -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
    function job_precast(spell, action, spellMap, eventArgs)
    if spellMap == 'Cure' or spellMap == 'Curaga' then
    gear.default.obi_waist = "Goading Belt"
    elseif spell.skill == 'ElementalMagic' then
    gear.default.obi_waist = "Sekhmet Corset"
    end
    end


    -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
    function job_midcast(spell, action, spellMap, eventArgs)
    if spell.action_type == 'Magic' then
    -- Default base equipment layer is fast recast.
    equip(sets.midcast.FastRecast)

    if spell.skill == 'ElementalMagic' then
    if state.CastingMode == 'Proc' then
    add_to_chat(15,'Proc mode, no damage gear for midcast.')
    eventArgs.handled = true
    else
    classes.CustomClass = get_nuke_class(spell, action, spellMap)
    end
    end
    end
    end


    function job_aftercast(spell, action, spellMap, eventArgs)
    -- Lock feet after using Mana Wall.
    if not spell.interrupted and spell.english == 'Mana Wall' and player.equipment.feet == "Goetia Sabots +2" then
    disable('feet')
    end
    end

    -------------------------------------------------------------------------------------------------------------------
    -- Customization hooks for idle and melee sets, after they've been automatically constructed.
    -------------------------------------------------------------------------------------------------------------------


    -------------------------------------------------------------------------------------------------------------------
    -- General hooks for other events.
    -------------------------------------------------------------------------------------------------------------------

    -- Called when a player gains or loses a buff.
    -- buff == buff gained or lost
    -- gain == true if the buff was gained, false if it was lost.
    function job_buff_change(buff, gain)
    -- Unlock feet when Mana Wall buff is lost.
    if buff == "Mana Wall" and not gain then
    enable('feet')
    handle_equipping_gear(player.status)
    end
    end


    -------------------------------------------------------------------------------------------------------------------
    -- User code that supplements self-commands.
    -------------------------------------------------------------------------------------------------------------------

    -- Handle notifications of general user state change.
    function job_state_change(stateField, newValue)
    if stateField == 'OffenseMode' then
    if newValue == 'Normal' then
    disable('main','sub')
    else
    enable('main','sub')
    end
    elseif stateField == 'Reset' then
    if state.OffenseMode == 'None' then
    enable('main','sub')
    end
    end
    end


    -- Function to display the current relevant user state when doing an update.
    -- Return true if display was handled, and you don't want the default info shown.
    function display_current_job_state(eventArgs)
    local meleeString = ''
    if state.OffenseMode == 'Normal' then
    meleeString = 'Melee: Weapons locked, '
    end

    local defenseString = ''
    if state.Defense.Active then
    local defMode = state.Defense.PhysicalMode
    if state.Defense.Type == 'Magical' then
    defMode = state.Defense.MagicalMode
    end

    defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
    end

    add_to_chat(122,meleeString..'Casting ['..state.CastingMode..'], Idle ['..state.IdleMode..'], '..defenseString..
    'Kiting: '..on_off_names[state.Kiting])

    eventArgs.handled = true
    end

    -------------------------------------------------------------------------------------------------------------------
    -- Utility functions specific to this job.
    -------------------------------------------------------------------------------------------------------------------

    -- Function to get the custom class to use for nukes.
    function get_nuke_class(spell, action, spellMap)
    if lowTierNukes[spell.english] then
    -- low tier nukes use the default set
    return nil
    else
    return 'HighTierNuke'
    end
    end


    There is the mappings lua and also my BLM lua.

Closed Thread
Page 54 of 302 FirstFirst ... 4 44 52 53 54 55 56 64 104 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45