Request for Automatic Skill System Based on Attribute Points (Legacy)

GoldGames

Vassal
Customer
Hi @Deazer

I am currently working on the L2GoldGames server, and we are using the attribute point distribution system where players can freely assign points to stats like STR, INT, DEX, WIT, CON, MEN.

I need an automatic skill system for the attribute. Here's what I'm looking for:

1. Automatic Skill Activation: When a player reaches 50 points in CON, they should automatically receive a passive skill (e.g., "Status CON Lv. 1") that gives a +1000 HP bonus. As they add more points to CON (51, 52, etc.), they should automatically receive higher levels of the skill (Lv. 2, Lv. 3, etc.).

2. Automatic Skill Removal: If the player removes points from CON, the system should automatically remove the corresponding skill. For example, if the player's CON drops from 51 to 50, they should lose "Status CON Lv. 2" and go back to "Status CON Lv. 1."

### Suggested Code Implementation:

Here’s an example of the logic needed to implement this system:

```java
// Function to update CON-based skills dynamically
public void updateConSkill(Player player) {
int conValue = player.getCon(); // Get the player's current CON value

// Remove all previous levels of the skill, if any exist
player.removeSkill(StatusConSkillLv1);
player.removeSkill(StatusConSkillLv2);
player.removeSkill(StatusConSkillLv3);
player.removeSkill(StatusConSkillLv4);
player.removeSkill(StatusConSkillLv5);
player.removeSkill(StatusConSkillLv6);

// Check the CON value and add the corresponding skill
if (conValue >= 50 && conValue < 51) {
player.addSkill(StatusConSkillLv1); // +1000 HP
} else if (conValue >= 51 && conValue < 52) {
player.removeSkill(StatusConSkillLv1);
player.addSkill(StatusConSkillLv2); // +2000 HP
} else if (conValue >= 52 && conValue < 53) {
player.removeSkill(StatusConSkillLv2);
player.addSkill(StatusConSkillLv3); // +3000 HP
} else if (conValue >= 53 && conValue < 54) {
player.removeSkill(StatusConSkillLv3);
player.addSkill(StatusConSkillLv4); // +4000 HP
} else if (conValue >= 54 && conValue < 55) {
player.removeSkill(StatusConSkillLv4);
player.addSkill(StatusConSkillLv5); // +5000 HP
} else if (conValue >= 55) {
player.removeSkill(StatusConSkillLv5);
player.addSkill(StatusConSkillLv6); // +6000 HP
}
}

// Function to trigger updates when the player adjusts attribute points
public void applyAttributePoints(Player player, AttributeType type, int points) {
// Standard code to apply points to the correct attribute
// ...

// If the player is changing CON, update the corresponding skills
if (type == AttributeType.CON) {
updateConSkill(player); // Call function to update CON-based skills
}
}



Suggested Skill Configuration:​

Here are the skills that would need to be added for this system:
<list>
<!-- Status CON Lv. 1 - Requires CON 50 -->
<skill id="100010" levels="1" name="Status CON Lv. 1">
<set name="icon" val="icon.statbonus_con"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="operateType" val="OP_PASSIVE"/>
<add order="0x40" stat="maxHp" val="1000"/> <!-- +1000 HP for CON 50 -->
</skill>

<!-- Status CON Lv. 2 - Requires CON 51 -->
<skill id="100011" levels="1" name="Status CON Lv. 2">
<set name="icon" val="icon.statbonus_con"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="operateType" val="OP_PASSIVE"/>
<add order="0x40" stat="maxHp" val="2000"/> <!-- +2000 HP for CON 51 -->
</skill>

<!-- Status CON Lv. 3 - Requires CON 52 -->
<skill id="100012" levels="1" name="Status CON Lv. 3">
<set name="icon" val="icon.statbonus_con"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="operateType" val="OP_PASSIVE"/>
<add order="0x40" stat="maxHp" val="3000"/> <!-- +3000 HP for CON 52 -->
</skill>

<!-- Status CON Lv. 4 - Requires CON 53 -->
<skill id="100013" levels="1" name="Status CON Lv. 4">
<set name="icon" val="icon.statbonus_con"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="operateType" val="OP_PASSIVE"/>
<add order="0x40" stat="maxHp" val="4000"/> <!-- +4000 HP for CON 53 -->
</skill>

<!-- Status CON Lv. 5 - Requires CON 54 -->
<skill id="100014" levels="1" name="Status CON Lv. 5">
<set name="icon" val="icon.statbonus_con"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="operateType" val="OP_PASSIVE"/>
<add order="0x40" stat="maxHp" val="5000"/> <!-- +5000 HP for CON 54 -->
</skill>

<!-- Status CON Lv. 6 - Requires CON 55 -->
<skill id="100015" levels="1" name="Status CON Lv. 6">
<set name="icon" val="icon.statbonus_con"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="operateType" val="OP_PASSIVE"/>
<add order="0x40" stat="maxHp" val="6000"/> <!-- +6000 HP for CON 55 -->
</skill>
</list>

This system will automatically adjust the player’s skills based on their CON value in real-time, improving the dynamic nature of the attribute point distribution system.

If this system already exists or if I missed something that could help achieve this, please clarify. Otherwise, let me know if it’s possible to implement or if there is another way to handle this directly in the server core.

Thanks for your time and attention.

Best regards,
L2GoldGames
 
Back
Top