Classes¶
-
CanUseClassAbilities
(cre, class)¶ Determine if creature can use class abilites.
Parameters: - cre (
Creature
) – Creature instance. - class (int) – CLASS_TYPE_*
- cre (
-
GetClassName
(class)¶ Get class name.
Arguments
Parameters: - class (int) – CLASS_TYPE_*
Return type: string
-
GetHitPointsGainedOnLevelUp
(class, pc)¶ Get number of hitpoints class gains on level up.
Parameters: - class (int) – CLASS_TYPE_*
- pc (
Creature
) – Creature instance.
-
GetLevelBonusFeats
(cre, class, level)¶ Get bonus feats for level.
Parameters: - cre (
Creature
) – Creature instance. - class (int) – CLASS_TYPE_*
- level (int) – Class level.
- cre (
-
GetSkillPointsGainedOnLevelUp
(class, pc)¶ Get number of skillpoints class gains on level up.
Parameters: - class (int) – CLASS_TYPE_*
- pc (
Creature
) – Creature instance.
-
SetCanUseClassAbilitiesOverride
(class, func)¶ Registers a class ability handler.
Parameters: - class (int) – CLASS_TYPE_*
- func (function) – A function that takes a creature and optionally a CLASS_TYPE_* argument and returns a boolean indicating whether the creature can use the abilities for the class and the creatures class level. You must return both or an assertion will fail.
Example
local function monk(cre, class) local level = cre:GetLevelByClass(class) if level == 0 then return false, 0 end if not cre:GetIsPolymorphed() then local chest = cre:GetItemInSlot(INVENTORY_SLOT_CHEST) if chest:GetIsValid() and chest:ComputeArmorClass() > 0 then return false, level end local shield = cre:GetItemInSlot(INVENTORY_SLOT_LEFTHAND) if shield:GetIsValid() and (shield:GetBaseType() == BASE_ITEM_SMALLSHIELD or shield:GetBaseType() == BASE_ITEM_LARGESHIELD or shield:GetBaseType() == BASE_ITEM_TOWERSHIELD) then return false, level end end return true, level end Rules.SetCanUseClassAbilitiesOverride(CLASS_TYPE_MONK, monk)