Skip to content

trainer

Teaches skills for gold, as a trainer does.

Source: src/Moongate.Server.Ultima/Modules/TrainerModule.cs

trainer.pay(npc, giver, item) -> boolean

Takes the gold item the player dropped on the NPC against the quote the player was given: the skill rises by the gold in tenths of a point, at most what was quoted, and the gold above the price stays with the player. True when gold was taken, which is what an on_drag_drop answers; false for anything else, a player with no quote from this NPC, or a skill that can no longer rise.

ParameterTypeDefault
npcinteger
giverinteger
iteminteger

Returns boolean.

trainer.quote(npc, player, skill) -> boolean

Has the NPC quote the price of teaching the skill (a SkillType) to the player, 1 gold for each tenth of a point, and keeps the quote until the player pays it. The NPC says why when it cannot teach. False when nothing was quoted.

ParameterTypeDefault
npcinteger
playerinteger
skillinteger

Returns boolean.

trainer.skills(npc, player) -> table

The skills the NPC teaches that the player knows less of than it would teach: those the NPC has at 60.0 or more, up to a third of its value (42.0 at most), as skill ids in the order of the skills. Empty for an NPC that is not one, a player who is dead or one not in the world.

ParameterTypeDefault
npcinteger
playerinteger

Returns table.

Made with ❤️ by Tom

Buy me a coffee