|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.player.Skills
Special handling for various skills players can train in.
Field Summary | |
static int |
MAX_LORE_LEVEL
Don't allow player to train higher than this. |
Method Summary | |
static int[] |
drainXPForDeath(Player defender,
GameObject attacker)
Handles adjusting a player's XP when they die. |
static int |
ensureCorrectSkillPoints(Player p)
Ensures the player has the correct number of skill points. |
static long |
getAdjustedBuyPrice(long price,
int skill)
Returns the price a player would pay for an item in a shop, taking into account the player's merchant skill. |
static int |
getAdjustedSellPrice(int gold_value,
int skill)
Returns the amount a shop will pay for an item, adjusted for the player's merchant skill. |
static int |
getCritChance(Commandable agent)
Returns the chance of scoring a critical hit, based on the agent's find-weakness skill. |
static int |
getDodgeBonus(int dodge)
Returns the dodge bonus, as a percentage, given the player's dodge skill level. |
static int |
getExpectedLorePoints(int lore)
Returns the total number of lore points a player of the specified level should have, including spent and unspent points. |
static int |
getExpectedSkillPoints(Player p)
Returns the number of skill points a player should have, based on their race and level. |
static int |
getHurledBonus(int hurled)
Returns the to-hit bonus, as a percentage, given the player's hurled-weapons skill level (sk-hurled). |
static int |
getMeleeSpeedBonus(int skill)
Returns the attack-speed bonus for a given skill level in Melee. |
static int |
getRangeBonus(int range)
Returns the to-hit bonus, as a percentage, given the player's range-weapons skill level (sk-range). |
static java.lang.String |
getSkillName(java.lang.String name)
Translates a skill property name to a player-visible skill name. |
static int |
getSkillPointsForLevel(Commandable agent,
int level)
Returns the number of skill points to give to the player for advancing to the specified level. |
static int |
getSneak(Commandable agent)
Returns the sneak percent chance for the agent. |
static int |
getSneak(int skill)
Returns the sneak percent chance for a given skill level. |
static int |
getSpentSkillPoints(Player p)
Returns the total number of skill-points the player has spent on training in their skills. |
static int |
getStrength(Commandable agent)
Returns the number of pounds the passed player can carry. |
static int |
getStrengthDamageBonus(Commandable agent)
Returns the extra damage done by the agent from their strength. |
static int |
getToHitBonus(int skill)
Returns the to-hit bonus, as a percentage, given the player's weapon skill level for the weapon they're using. |
static java.lang.String |
getTrainerTitle(java.lang.String skill,
int max)
Returns the title to use for a trainer who can train to a given train-max value. |
static int |
getXPLevelForLoreLevel(int lore)
Returns the experience level you have to have in order to train to a given lore level. |
static void |
main(java.lang.String[] args)
Tests out the various functions. |
static boolean |
trainInForestry(Commandable agent)
Improves the player's move-speed over forest terrain. |
static boolean |
trainInLore(Commandable agent)
When a player trains in the "lore" skill, they get a certain number of lore points. |
static boolean |
trainInSkill(java.lang.String skill,
Commandable agent)
Called when a player trains in a specific skill. |
static boolean |
untrainInLore(Commandable agent)
Removes a skill point in Lore, and also removes any lore points they got for that skill point. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_LORE_LEVEL
Method Detail |
public static int getDodgeBonus(int dodge)
dodge
- the dodge skill level
public static int getRangeBonus(int range)
range
- the sk-range skill level
public static int getHurledBonus(int hurled)
hurled
- the sk-hurled skill level
public static int getToHitBonus(int skill)
skill
- the weapon skill level
public static int[] drainXPForDeath(Player defender, GameObject attacker)
defender
- the player who diedattacker
- the thing that killed the player
public static int getMeleeSpeedBonus(int skill)
public static long getAdjustedBuyPrice(long price, int skill)
price
- the price the buyer would pay with no merchant skill.
You can pass a price in silver, gold or any currency, but it's
most accurate if you use silver.skill
- the buyer's skill level in sk-merchant
public static int getAdjustedSellPrice(int gold_value, int skill)
gold_value
- the full value of the item. Must be passed
in GOLD for the calculation to work correctly, because
of the cap.skill
- the agent's effective merchant skill level
public static boolean trainInSkill(java.lang.String skill, Commandable agent)
This method handles deducting a skill point (or more, if the skill requires more than one skill points to train in it). If the player has maxed out in the skill, it will issue the appropriate message to the player and not change any properties or deduct any skill points.
skill
- the skill to train in, e.g. "sk-lore". Skill names
should always begin with "sk-".agent
- the player who's training in the skill
public static boolean trainInLore(Commandable agent)
agent
- the player to train in lore
public static boolean untrainInLore(Commandable agent)
public static int getXPLevelForLoreLevel(int lore)
lore
- the lore level you're trying to attain
public static int getExpectedLorePoints(int lore)
lore
- the player's persistent sk-lore skill
public static boolean trainInForestry(Commandable agent)
agent
- the player to train
public static int getStrength(Commandable agent)
agent
- the player
public static int getSneak(int skill)
skill
- the agent's total skill in sk-sneak
public static int getSneak(Commandable agent)
agent
- the agent
public static int getSkillPointsForLevel(Commandable agent, int level)
agent
- the player to advancelevel
- the level they're advancing to
public static int getStrengthDamageBonus(Commandable agent)
agent
- the agent doing the attacking
public static java.lang.String getSkillName(java.lang.String name)
name
- sk-whatever
public static int getCritChance(Commandable agent)
agent
- the agent doing the attackpublic static java.lang.String getTrainerTitle(java.lang.String skill, int max)
skill
- the skill (e.g. "sk-blacksmith")max
- the maximum level the trainer can train you topublic static int ensureCorrectSkillPoints(Player p)
p
- the player - updates their skill-points, which can
go negative if they were over.
public static int getExpectedSkillPoints(Player p)
p
- the player
public static int getSpentSkillPoints(Player p)
p
- the player
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |