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 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
--[[ Character Creation Data]] --
-- The important stuff, data describing all the valid options you can choose from
return createData
end
end
local missingDataPosition = 0
if position > 0 then
return position
end
missingDataPosition = missingDataPosition + 1
return missingDataPosition
end
missingDataPosition = 0
end
self . alliances = { }
local alliances = self . alliances
local alliance , name , normalIcon , pressedIcon , mouseoverIcon , backdropTop , backdropBottom , position , lore , gamepadNormalIcon , gamepadPressedIcon = GetAllianceInfo ( i )
alliances [ i ] =
{
alliance = alliance ,
normalIcon = normalIcon ,
pressedIcon = pressedIcon ,
mouseoverIcon = mouseoverIcon ,
backdropTop = backdropTop ,
backdropBottom = backdropBottom ,
lore = lore ,
isSelectable = false ,
gamepadNormalIcon = gamepadNormalIcon ,
gamepadPressedIcon = gamepadPressedIcon ,
}
end
self . classes = { }
local classes = self . classes
local class , lore , normalIcon , pressedIcon , mouseoverIcon , isSelectable , _ , _ , gamepadNormalIcon , gamepadPressedIcon = GetClassInfo ( i )
classes [ i ] =
{
class = class ,
lore = lore ,
normalIcon = normalIcon ,
pressedIcon = pressedIcon ,
mouseoverIcon = mouseoverIcon ,
isSelectable = isSelectable ,
gamepadNormalIcon = gamepadNormalIcon ,
gamepadPressedIcon = gamepadPressedIcon ,
}
end
self . races = { }
local races = self . races
local raceDef , lore , alliance , normalIcon , pressedIcon , mouseoverIcon , position , isSelectable , gamepadNormalIcon , gamepadPressedIcon = GetRaceInfo ( i )
races [ i ] =
{
race = raceDef ,
alliance = alliance ,
lore = lore ,
normalIcon = normalIcon ,
pressedIcon = pressedIcon ,
mouseoverIcon = mouseoverIcon ,
isSelectable = isSelectable ,
isRadioEnabled = isSelectable ,
gamepadNormalIcon = gamepadNormalIcon ,
gamepadPressedIcon = gamepadPressedIcon ,
}
end
self . templates = { }
if templatesAllowed then
local templates = self . templates
if not templatesRequired then
-- add the no template option
end
-- Keep these in the order that they are returned in so the template list matches the def order
-- If lookup time ever becomes a problem, make a table that maps templateDefId -> tableIndex
local templateDef , name , race , class , gender , alliance , overrideAppearance , isSelectable = GetTemplateInfo ( i )
{
template = templateDef ,
race = race ,
class = class ,
gender = gender ,
alliance = alliance ,
overrideAppearance = overrideAppearance ,
isSelectable = isSelectable
} )
end
end
end
do
local NONE_TEMPLATE =
{
template = 0 ,
race = 0 ,
class = 0 ,
gender = 0 ,
alliance = 0 ,
overrideAppearance = false ,
isSelectable = true
}
return NONE_TEMPLATE
end
end
-- Updates whether or not an alliance is selectable based on whether or not the races in the alliance can be selected
-- This could actually be overridden by the "play any race as any alliance" entitlement, it's just a safe starting point
local currentAlliance = allianceData . alliance
allianceData . isSelectable = false
if raceData . alliance == currentAlliance and raceData . isSelectable and raceData . isRadioEnabled then
allianceData . isSelectable = true
break
end
end
end
end
return self . alliances
end
return self . races
end
return self . classes
end
return self . templates
end
local races = self . races
if raceInfo . race == defId then
return raceInfo
end
end
end
local alliances = self . alliances
if allianceInfo . alliance == defId then
return allianceInfo
end
end
end
local classes = self . classes
if classInfo . class == defId then
return classInfo
end
end
end
if templateInfo . template == templateDef then
return templateInfo
end
end
end
do
if option . isSelectable then
optionsTable [ # optionsTable + 1 ] = option
end
end
local optionsTable = { }
if validIndices then
end
else
end
end
if # optionsTable > 0 then
return optionsTable [ randomIndex ] [ defIdFieldName ]
end
return 1
end
end
end
-- Needs special behavior because this will usually follow the selected race...however
-- some races have no alliance, so we should actually make a random choice for the alliance.
-- So, if there are no preselected alliances do the fancy business.
if not validIndicesTable then
if not currentRace or currentRace . alliance == 0 then
else
return currentRace . alliance
end
end
end
if gender == 1 then
return GENDER_MALE
end
return GENDER_FEMALE
end
end |