summaryrefslogtreecommitdiff
path: root/Data/BuiltIn/Libraries/lua-addons/addons/InfoReplacer/reps.lua
blob: 685a17c61a5430539c7cdc57c9993972395f763d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
-- Copyright © 2014-2015, Cairthenn
-- All rights reserved.

-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:

    -- * Redistributions of source code must retain the above copyright
      -- notice, this list of conditions and the following disclaimer.
    -- * Redistributions in binary form must reproduce the above copyright
      -- notice, this list of conditions and the following disclaimer in the
      -- documentation and/or other materials provided with the distribution.
    -- * Neither the name of InfoReplacer nor the
      -- names of its contributors may be used to endorse or promote products
      -- derived from this software without specific prior written permission.

-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-- DISCLAIMED. IN NO EVENT SHALL Cairthenn BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

require('tables')
local res = require('resources')

return T{

    name            = function() return windower.ffxi.get_player().name end,
    linkshell       = function() return windower.ffxi.get_player().linkshell end,
    linkshell_rank  = function() return windower.ffxi.get_player().linkshell_rank end,
    linkshell_slot  = function() return windower.ffxi.get_player().linkshell_slot end,
    main_job        = function() return res.jobs[windower.ffxi.get_player().main_job].short end,
    main_job_level  = function() return windower.ffxi.get_player().main_job_level end,
    main_job_full   = function() return res.jobs[windower.ffxi.get_player().main_job].english end,
    main_job_id     = function() return windower.ffxi.get_player().main_job_id end,
    status          = function() return res.statuses[windower.ffxi.get_player().status].english end,
    status_id       = function() return windower.ffxi.get_player().status end,
    index           = function() return windower.ffxi.get_player().index end,
    sub_job         = function() return res.jobs[windower.ffxi.get_player().sub_job].short end,
    sub_job_level   = function() return windower.ffxi.get_player().sub_job_level end,
    sub_job_full    = function() return res.jobs[windower.ffxi.get_player().sub_job].english end,
    sub_job_id      = function() return windower.ffxi.get_player().sub_job_id end,
    target_index    = function() return windower.ffxi.get_player().target_index end,
    target_locked   = function() return windower.ffxi.get_player().target_locked and "True" or "False" end,
    autorun         = function() return windower.ffxi.get_player().autorun and "True" or "False" end,
    follow_index    = function() return windower.ffxi.get_player().follow_index end,
    in_combat       = function() return windower.ffxi.get_player().in_combat and "True" or "False" end,
    id              = function() return windower.ffxi.get_mob_by_target('me').id end,


    hp      = function() return windower.ffxi.get_player().vitals.hp end,
    max_hp  = function() return windower.ffxi.get_player().vitals.max_hp end,
    hpp     = function() return windower.ffxi.get_player().vitals.hpp end,
    mp      = function() return windower.ffxi.get_player().vitals.mp end,
    max_mp  = function() return windower.ffxi.get_player().vitals.max_mp end,
    mpp     = function() return windower.ffxi.get_player().vitals.mpp end,
    tp      = function() return windower.ffxi.get_player().vitals.tp end,


    hand_to_hand        = function() return windower.ffxi.get_player().skills.hand_to_hand end,
    dagger              = function() return windower.ffxi.get_player().skills.dagger end,
    sword               = function() return windower.ffxi.get_player().skills.sword end,
    great_sword         = function() return windower.ffxi.get_player().skills.great_sword end,
    axe                 = function() return windower.ffxi.get_player().skills.axe end,
    great_axe           = function() return windower.ffxi.get_player().skills.great_axe end,
    scythe              = function() return windower.ffxi.get_player().skills.scythe end,
    polearm             = function() return windower.ffxi.get_player().skills.polearm  end,
    katana              = function() return windower.ffxi.get_player().skills.katana end,
    great_katana        = function() return windower.ffxi.get_player().skills.great_katana end,
    club                = function() return windower.ffxi.get_player().skills.club end,
    staff               = function() return windower.ffxi.get_player().skills.staff end,
    archery             = function() return windower.ffxi.get_player().skills.archery end,
    marksmanship        = function() return windower.ffxi.get_player().skills.marksmanship end,
    throwing            = function() return windower.ffxi.get_player().skills.throwing end,
    guarding            = function() return windower.ffxi.get_player().skills.guarding end,
    evasion             = function() return windower.ffxi.get_player().skills.evasion end,
    shield              = function() return windower.ffxi.get_player().skills.shield end,
    parrying            = function() return windower.ffxi.get_player().skills.parrying end,
    divine_magic        = function() return windower.ffxi.get_player().skills.divine_magic end,
    healing_magic       = function() return windower.ffxi.get_player().skills.healing_magic end,
    enhancing_magic     = function() return windower.ffxi.get_player().skills.enhancing_magic end,
    enfeebling_magic    = function() return windower.ffxi.get_player().skills.enfeebling_magic end,
    elemental_magic     = function() return windower.ffxi.get_player().skills.elemental_magic end,
    dark_magic          = function() return windower.ffxi.get_player().skills.dark_magic end,
    summoning_magic     = function() return windower.ffxi.get_player().skills.summoning_magic end,
    ninjitsu            = function() return windower.ffxi.get_player().skills.ninjitsu end,
    singing             = function() return windower.ffxi.get_player().skills.singing end,
    stringed_instrument = function() return windower.ffxi.get_player().skills.string end,
    wind_instrument     = function() return windower.ffxi.get_player().skills.wind end,
    blue_magic          = function() return windower.ffxi.get_player().skills.blue_magic end,
    alchemy             = function() return windower.ffxi.get_player().skills.alchemy end,
    bonecraft           = function() return windower.ffxi.get_player().skills.bonecraft end,
    clothcraft          = function() return windower.ffxi.get_player().skills.clothcraft end,
    cooking             = function() return windower.ffxi.get_player().skills.cooking end,
    fishing             = function() return windower.ffxi.get_player().skills.fishing end,
    goldsmithing        = function() return windower.ffxi.get_player().skills.goldsmithing end,
    leathercraft        = function() return windower.ffxi.get_player().skills.leathercraft end,
    smithing            = function() return windower.ffxi.get_player().skills.smithing end,
    woodworking         = function() return windower.ffxi.get_player().skills.woodworking end,
    synergy             = function() return windower.ffxi.get_player().skills.synergy end,


    camera_x        = function() return windower.ffxi.get_camera().camera_x end,
    camera_y        = function() return windower.ffxi.get_camera().camera_y end,
    camera_z        = function() return windower.ffxi.get_camera().camera_z end,


    windower_x          = function() return windower.get_windower_settings().windower_x end,
    windower_y          = function() return windower.get_windower_settings().windower_y end,
    windower_x_pos      = function() return windower.get_windower_settings().windower_x_pos end,
    windower_y_pos      = function() return windower.get_windower_settings().windower_y_pos end,
    ui_x                = function() return windower.get_windower_settings().ui_x end,
    ui_y                = function() return windower.get_windower_settings().ui_y end,
    launcher_version    = function() return windower.get_windower_settings().launcher_version end,
                             

    day             = function() return res.days[windower.ffxi.get_info().day].english end,
    day_element     = function() return res.elements[res.days[windower.ffxi.get_info().day].element].english end,
    moon            = function() return res.moon_phases[windower.ffxi.get_info().moon_phase].english end,
    moon_pct        = function() return windower.ffxi.get_info().moon end,
    time            = function() time = windower.ffxi.get_info().time return (time / 60):floor() .. ':' .. (time % 60) end,
    zone            = function() return res.zones[windower.ffxi.get_info().zone].english end,
    zone_id         = function() return windower.ffxi.get_info().zone end,
    logged_in       = function() return windower.ffxi.get_info().logged_in end,
    weather         = function() return res.weather[windower.ffxi.get_info().weather].english end,
    weather_id      = function() return windower.ffxi.get_info().weather end,
    weather_element = function() return res.elements[res.weathers[windower.ffxi.get_info().weather].element].english end,
    language        = function() return windower.ffxi.get_info().language end,
                            

    target_name             = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').name end,
    target_claim_id         = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').claim_id end,
    target_distance         = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').distance end,
    target_facing           = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').facing end,
    target_hpp              = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').hpp end,
    target_id               = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').id end,
    target_is_npc           = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').is_npc  and "True" or "False" end,
    target_mob_type         = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').mob_type end,
    target_model_size       = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t')._model_size end,
    target_speed            = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').speed end,
    target_speed_base       = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').speed_base end,
    target_status           = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').status end,
    target_index            = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').index end,
    target_x                = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').x end,
    target_y                = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').y end,
    target_z                = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').z end,
    target_pet_index        = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').pet_index end,
    target_mpp              = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').mpp end,
    target_fellow_index     = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').fellow_index end,
    target_race             = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').race end,
    target_tp               = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').tp end,
    target_charmed          = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').charmed and "True" or "False" end,
    target_in_party         = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').in_party and "True" or "False" end,
    target_in_alliance      = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').in_alliance and "True" or "False" end,
    target_is_valid         = function() return windower.ffxi.get_mob_by_target('t') and windower.ffxi.get_mob_by_target('t').is_valid and "True" or "False" end,

    pet_name           = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').name end,
    pet_claim_id       = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').claim_id end,
    pet_distance       = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').distance end,
    pet_facing         = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').facing end,
    pet_hpp            = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').hpp end,
    pet_id             = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').id end,
    pet_is_npc         = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').is_npc end,
    pet_mob_type       = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').mob_type end,
    pet_model_size     = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').model_size end,
    pet_speed          = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').speed end,
    pet_speed_base     = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').speed_base end,
    pet_status         = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').status end,
    pet_index          = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').index end,
    pet_x              = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').x end,
    pet_y              = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').y end,
    pet_z              = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').z end,
    pet_race           = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').race end,
    pet_tp             = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').tp end,
    pet_charmed        = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').charmed and "True" or "False" end,
    pet_in_party       = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').in_party  and "True" or "False" end,
    pet_in_alliance    = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').in_alliance and "True" or "False" end,
    pet_is_valid       = function() return windower.ffxi.get_mob_by_target('pet') and windower.ffxi.get_mob_by_target('pet').is_valid  and "True" or "False" end,
                            

    gil         = function() return windower.ffxi.get_items().gil end,

    ammo        = function() return windower.ffxi.get_items().equipment.ammo > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.ammo].id].english end,
    back        = function() return windower.ffxi.get_items().equipment.back > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.back].id].english end,
    body        = function() return windower.ffxi.get_items().equipment.body > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.body].id].english end,
    feet        = function() return windower.ffxi.get_items().equipment.feet > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.feet].id].english end,
    hands       = function() return windower.ffxi.get_items().equipment.hands > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.hands].id].english end,
    head        = function() return windower.ffxi.get_items().equipment.head > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.head].id].english end,
    left_ear    = function() return windower.ffxi.get_items().equipment.left_ear > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.left_ear].id].english end,
    legs        = function() return windower.ffxi.get_items().equipment.legs > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.legs].id].english end,
    left_ring   = function() return windower.ffxi.get_items().equipment.left_ring > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.left_ring].id].english end,
    main        = function() return windower.ffxi.get_items().equipment.main > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.main].id].english end,
    neck        = function() return windower.ffxi.get_items().equipment.neck > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.neck].id].english end,
    range       = function() return windower.ffxi.get_items().equipment.range > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.range].id].english end,
    right_ear   = function() return windower.ffxi.get_items().equipment.right_ear > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.right_ear].id].english end,
    right_ring  = function() return windower.ffxi.get_items().equipment.right_ring > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.right_ring].id].english end,
    sub         = function() return windower.ffxi.get_items().equipment.sub > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.sub].id].english end,
    waist       = function() return windower.ffxi.get_items().equipment.waist > 0 and res.items[windower.ffxi.get_items().inventory[windower.ffxi.get_items().equipment.waist].id].english end
}