Jump to content


Photo

mabils.xml


    6 replies to this topic

    #1 Saydn

    Saydn

      Member

    • Members
    • PipPip
    • 11 posts

      Posted 13 May 2014 - 09:24 PM

      I was trying to write a bit of script for use on my SCH and found a couple of references to mabils.xml, but it definitely isn't in my windower files. I have abils.xml and spells.xml, but not mabils.xml.

      Does mabils.xml still exist? If so, where can I find it? Or is it no longer relevant and been replaced? Any help would be greatly appreciated.

      Thanks.

      #2 Arcon

      Arcon

        Advanced Member

      • Windower Staff
      • 1189 posts
      • LocationMunich, Germany

      Posted 14 May 2014 - 04:15 AM

      Windower/res/monster_ablities.lua



      #3 Saydn

      Saydn

        Member

      • Members
      • PipPip
      • 11 posts

        Posted 14 May 2014 - 11:17 AM

        Hi Arcon,

         

        Thanks a lot! Is there any documentation on how to use this or just figure it out yourself?

         

        Thanks.



        #4 Arcon

        Arcon

          Advanced Member

        • Windower Staff
        • 1189 posts
        • LocationMunich, Germany

        Posted 14 May 2014 - 11:32 AM

        res = require('resources')
         
        print(res.monster_abilities[27].english)

         

        What exactly did you wanna use it for? Hard to say how to use it otherwise.



        #5 Saydn

        Saydn

          Member

        • Members
        • PipPip
        • 11 posts

          Posted 14 May 2014 - 12:00 PM

          I'm trying to set up some custom chat messages for curtain moves to help me remember what to do and react quicker, so for example if Tojil uses Incinerating Lahar then I want it to add to chat "STUN!". Similarly if he uses Blistering Roar then some text to dispel etc.

           

          I'm completely new to Lua, but have developed in php and some other languages.

           

          I think for what I'm trying to do now, mainly what I need to do is.

          Get the move that the mob is doing: act.targets[1].actions[1].param

           

          Get an array of moves(by name) with messages for each, which I will make in another Lua file.

          Get the ids for the move based on the name from monsters_abilities

           

          Check it against act.targets[1].actions[1].param move and add_to_chat the message

           

           

          Just not really sure how to do it all, thanks!



          #6 Arcon

          Arcon

            Advanced Member

          • Windower Staff
          • 1189 posts
          • LocationMunich, Germany

          Posted 14 May 2014 - 05:49 PM

          You'll want something like this:

           

          windower.register_event('action', function(act)
              local move = res.monster_abilities[act.targets[1].actions[1].param]
              if not move then
                  return
              end
           
              local response = response_table[move.english]
              if response then
                  windower.add_to_chat(101, response)
              end
          end)


          #7 Saydn

          Saydn

            Member

          • Members
          • PipPip
          • 11 posts

            Posted 10 June 2014 - 11:55 AM

            Thanks for you all your help, really helped me figure it out! Thought you might want to see 

             

            _addon.name = 'stun'
            
            act = require('actions')
            res = require('resources')
            require('mobs')
            
            windower.register_event('action', function(move)
                
                local player = windower.ffxi.get_player()
            
                -- Get mob info
                local mob_info = windower.ffxi.get_mob_by_id(move.actor_id)
                if not mob_info then print("No mob info") return end
                if mob_info.is_npc ~= true then return end
                
            
                -- Check if move is a tp move or spell
                if move.category ~= 7 and move.category ~= 8 then return end
                
                -- Check if it is starting the move or spell
                if move.param ~= 24931 then return end
            
                -- Get extra move info, name etc
                if move.category == 7 then move_info = res.monster_abilities[move.targets[1].actions[1].param] end
                if move.category == 8 then move_info = res.spells[move.targets[1].actions[1].param] end
            
                -- Cycle through stub enemies and stun moves.
                for groups, group in pairs( mob_groups ) do
                    for mobs, mob in pairs( group.mobs ) do
                        if mob == mob_info.name then
                            for moves_to_stun, move_to_stun in pairs( group.moves ) do
                                if move_to_stun == move_info.name then
                                    windower.add_to_chat(10, " ------------------ " )
                                    windower.add_to_chat(10, move_info.name .. " --> STUN" )
                                    windower.add_to_chat(10, " ------------------ " )
                                end
                            end
                        end
                    end
                end
            
            end)
            
            mob_groups = {
            
            -- Delve
            
                -- Tojil
                
                raptor_delv = {
                    mobs = { "Perdurable Raptor", },
                    moves = { "Whirling Inferno", },
                },
                
                peiste_delv = {
                    mobs = { "Tutewehiwehi", },
                    moves = { "Calcifying Mist", "Oppressive Gaze", },
                },
                
                turtle_delv = {
                    mobs = { "Kurma", },
                    moves = { "Testudo Tremor", },
                },
            
            }
            

             

            Only thing left to add is to check whether the mob is claimed by someone in my party or ally. Anything you think I could have done better? As I said, I'm completely new to Lua.






            1 user(s) are reading this topic

            0 members, 1 guests, 0 anonymous users