Jump to content
  • 0

Character Stats as a quest requirement [Possible?]


Question

Posted

Hey there, rAthena pips. 
Is it feasible to create quest requirements that are based on character stats?

For instance, in order to finish this mission/quest, you must achieve at least 300str.

Is it possible?

2 answers to this question

Recommended Posts

  • 1
Posted

Definitely. You can use the one below:

*readparam(<parameter number>{,"<character name>"})
*readparam(<parameter number>{,<char_id>})

This function will return the specified stat of the invoking character, or, if a
character name or character id is specified, of that player. The stat can either
be a number or parameter name, defined in 'src/map/script_constants.hpp'.

Some example parameters:

StatusPoint, BaseLevel, SkillPoint, Class, Upper, Zeny, Sex, Weight, MaxWeight,
JobLevel, BaseExp, JobExp, NextBaseExp, NextJobExp, Hp, MaxHp, Sp, MaxSp,
BaseJob, Karma, Manner, bVit, bDex, bAgi, bStr, bInt, bLuk, Ap, MaxAp

All of these also behave as variables, but don't expect to be able to just 'set'
them - some will not work for various internal reasons.

Example 1:

    // Returns how many status points you haven't spent yet.
    mes "Unused status points: " + readparam(9);

Using this particular information as a function call is not required. Typing this
will return the same result:

    mes "Unused status points: " + StatusPoint;

Example 2:

You can also use this command to get stat values.

    if (readparam(bVit) > 77)
        mes "Only people with over 77 Vit are reading this!";

https://github.com/rathena/rathena/blob/b56f11207c3cb5337dca07bb910ba85316c84939/doc/script_commands.txt#L2445

  • 0
Posted
5 minutes ago, Virtue said:

Definitely. You can use the one below:

*readparam(<parameter number>{,"<character name>"})
*readparam(<parameter number>{,<char_id>})

This function will return the specified stat of the invoking character, or, if a
character name or character id is specified, of that player. The stat can either
be a number or parameter name, defined in 'src/map/script_constants.hpp'.

Some example parameters:

StatusPoint, BaseLevel, SkillPoint, Class, Upper, Zeny, Sex, Weight, MaxWeight,
JobLevel, BaseExp, JobExp, NextBaseExp, NextJobExp, Hp, MaxHp, Sp, MaxSp,
BaseJob, Karma, Manner, bVit, bDex, bAgi, bStr, bInt, bLuk, Ap, MaxAp

All of these also behave as variables, but don't expect to be able to just 'set'
them - some will not work for various internal reasons.

Example 1:

    // Returns how many status points you haven't spent yet.
    mes "Unused status points: " + readparam(9);

Using this particular information as a function call is not required. Typing this
will return the same result:

    mes "Unused status points: " + StatusPoint;

Example 2:

You can also use this command to get stat values.

    if (readparam(bVit) > 77)
        mes "Only people with over 77 Vit are reading this!";

https://github.com/rathena/rathena/blob/b56f11207c3cb5337dca07bb910ba85316c84939/doc/script_commands.txt#L2445

Thank you @Virtue, big help man.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...