Jump to content
  • 0

Character Stats as a quest requirement [Possible?]


hadji22

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   1
  • Joined:  12/28/14
  • Last Seen:  

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?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.02
  • Content Count:  354
  • Reputation:   22
  • Joined:  11/17/11
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   1
  • Joined:  12/28/14
  • Last Seen:  

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.

Link to comment
Share on other sites

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.

×
×
  • Create New...