API:BuyCareerPackage
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Asks the server to buy a career advance (ability, mastery point, renown or tome reward) from the trainer the player is talking to.
BuyCareerPackage(tier, category, packageId)
Arguments
- tier
number– Tier of the advance (thetierfield of the advance data).- category
number– Category of the advance, aGameData.CareerCategoryvalue (thecategoryfield of the advance data).- packageId
number– ID of the advance (thepackageIdfield of the advance data).
Returns
Nothing.
Details
- Sends a purchase request with the three values and a value identifying the player's current NPC interaction.
tierandcategoryare cut to 8 bits,packageIdto 16 bits. - The client does not check that the player can afford the advance or meets its requirements. The server decides; the stock training windows assume the purchase worked.
- Nothing is sent if the connection is not ready.
- The function needs at least three arguments and only reads the last three.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
From default/ea_interactionwindow/source/interactioncoretraining.lua:
local packageID = EA_Window_InteractionCoreTraining.advanceData[dataIndex].packageId local tier = EA_Window_InteractionCoreTraining.advanceData[dataIndex].tier local category = EA_Window_InteractionCoreTraining.advanceData[dataIndex].category BuyCareerPackage( tier, category, packageID )
Buying specialization levels, from default/ea_interactionwindow/source/interactionspecialtytraining.lua:
-- TODO: make tier not hardcoded BuyCareerPackage( 1, GameData.CareerCategory.SPECIALIZATION, tab )
