case TK_DOWNKICK:
case TK_STORMKICK:
skillratio += 60 + 20 * skill_lv;
break;
case TK_TURNKICK:
case TK_COUNTER:
skillratio += 90 + 30 * skill_lv;
break;
case TK_JUMPKICK:
//Different damage formulas depending on damage trigger
if (sc && sc->getSCE(SC_COMBO) && sc->getSCE(SC_COMBO)->val1 == skill_id)
skillratio += -100 + 4 * status_get_lv(src); //Tumble formula [4%*baselevel]
else if (wd->miscflag) {
skillratio += -100 + 4 * status_get_lv(src); //Running formula [4%*baselevel]
if (sc && sc->getSCE(SC_SPURT)) //Spurt formula [8%*baselevel]
skillratio *= 2;
}
else
skillratio += -70 + 10 * skill_lv;
break;
Assistant
This code snippet appears to be part of a game script for the MMORPG "Ragnarok Online," specifically concerning the Taekwon class and its skills. The code handles damage calculations for different Taekwon skills.
Here’s a breakdown of what each part of the code does:
Skill Case TK_DOWNKICK and TK_STORMKICK:
User
if ((sce = sc->getSCE(SC_COMBO)) != nullptr) {
switch (skill_id) {
case TK_TURNKICK:
case TK_STORMKICK:
case TK_DOWNKICK:
case TK_COUNTER:
if (sd && pc_famerank(sd->status.char_id,MAPID_TAEKWON)) {//Extend combo time.
sce->val1 = skill_id; //Update combo-skill
sce->val3 = skill_id;
if( sce->timer != INVALID_TIMER )
delete_timer(sce->timer, status_change_timer);
sce->timer = add_timer(tick+sce->val4, status_change_timer, src->id, SC_COMBO);
break;
}
unit_cancel_combo(src); // Cancel combo wait
break;
default:
if( src == dsrc ) // Ground skills are exceptions. [Inkfish]
status_change_end(src, SC_COMBO);
}
}
Assistant
This code snippet handles logic related to combo skills for the Taekwon class in "Ragnarok Online." It deals with extending or ending combo states based on various conditions.
User
case TK_READYCOUNTER:
case TK_READYDOWN:
case TK_READYSTORM:
case TK_READYTURN:
case TK_JUMPKICK:
if( (sd.class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER ) { // Soul Linkers cannot use this skill
clif_skill_fail( sd, skill_id );
return false;
}
break;
case TK_TURNKICK:
case TK_STORMKICK:
case TK_DOWNKICK:
case TK_COUNTER:
if ((sd.class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER)
return false; //Anti-Soul Linker check in case you job-changed with Stances active.
if(!(sc && sc->getSCE(SC_COMBO)) || sc->getSCE(SC_COMBO)->val1 == TK_JUMPKICK)
return false; //Combo needs to be ready
code
if (sc->getSCE(SC_COMBO)->val3) { //Kick chain
//Do not repeat a kick.
if (sc->getSCE(SC_COMBO)->val3 != skill_id)
break;
status_change_end(&sd.bl, SC_COMBO);
return false;
}
if(sc->getSCE(SC_COMBO)->val1 != skill_id && !pc_is_taekwon_ranker(&sd)) { //Cancel combo wait.
unit_cancel_combo(&sd.bl);
return false;
}
break; //Combo ready.
Assistant
This code is part of the skill-checking mechanism for the Taekwon class and its evolved classes in "Ragnarok Online," focusing on skill availability and combo conditions. It ensures that the player's class and combo status meet specific conditions before allowing the use of particular skills.
User
Taekwon Mission is only usable by Taekwons and cannot be used if the player changes into a Soul Linker or Star Gladiator. When used, the name of a monster is randomly chosen. This will be displayed and memorized. If the player kills the selected monster 100 times (does not have to be consecutive), they will be award with 1 fame point, and will be assigned a new randomly selected monster. The selected monster will never be an MVP.
Notes
If this skill is used while the player's Target Percent is at 0% (no monster killed yet), they have a 1% chance to receive a new random target.
The ten players on each server with the most amount of Fame points become Taekwon Rankers (no effect if the player is already a Star Gladiator or Soul Linker). Taekwon Rankers can perform an infinite combo of all kicks - Whirlwind Kick, Axe Kick, Round Kick, Counter Kick - but they must prepare the stance of at least one of said kicks and spam the hotkeys when it triggers. Also, the kicks must be alternated; performing the same kick twice in a row ends the spam. The exception to this is Flying Side Kick, which cannot be used to continue a kick combo (but can be used infinitely without stance activation, as usual).
Level 90+ Taekwon Ranker players receive tripled Maximum HP and SP, and are able to use all of the Taekwon skills. View the Taekwon Ranker Fame List by typing "/taekwon" in-game.
If your target is Goblin, any monster called "Goblin" will count toward the mission (All 5 "Goblin"s will count, but not Steam Goblin).
You can get a mini boss for target (in-game skill description says you can't).
Assistant
The skill damage is modified by adding a value calculated as 60 + 20 * skill_lv to skillratio.
This means the base damage bonus is 60, and for each skill level (skill_lv), an additional 20 is added.
Skill Case TK_TURNKICK and TK_COUNTER:
The skill damage is modified by adding 90 + 30 * skill_lv to skillratio.
The base damage bonus is 90, and each skill level adds an additional 30.
Skill Case TK_JUMPKICK:
This section is more complex as it utilizes different conditions for calculating the damage ratio.
Combo Trigger:
If a status condition (sc) exists and the specific status effect (SC_COMBO) is active, where its value (val1) equals the skill ID, a specific formula for the damage ratio is used: -100 + 4 * status_get_lv(src).
This formula implies a base reduction of 100 plus 4 times the character's base level.
Miscellaneous Trigger:
If the miscflag is set in wd (likely a structure dealing with weapon or skill details), the same damage calculation as the combo trigger applies: -100 + 4 * status_get_lv(src).
If another specific status effect (SC_SPURT) is active, the damage ratio is doubled (skillratio *= 2).
Default Case:
If none of those conditions are met, a default formula applies: -70 + 10 * skill_lv.
This suggests a base reduction of 70 with a bonus of 10 per skill level.
Overall, this snippet is concerned with calculating the damage output for various Taekwon skills based on skill level, the player's base level, and certain status effects that may be active in the game. Different damage formulas are applied depending on the context of how the skill is triggered (e.g., via a combo or running start).
Here's what the code does step-by-step:
Check for Combo Status Effect:
The variable sce is assigned the status change effect related to a combo (SC_COMBO) for the character. If sce is not nullptr, it indicates that the character is currently in a combo state.
Skill ID Switch Case:
This block contains a switch statement based on skill_id to determine how to handle the combo state for specific skills: TK_TURNKICK, TK_STORMKICK, TK_DOWNKICK, and TK_COUNTER.
Extend Combo Time for Certain Skills:
If the player (sd) is in the Taekwon rank (checked with pc_famerank(sd->status.char_id, MAPID_TAEKWON)), it extends the combo time.
sce->val1 and sce->val3 are updated to the current skill_id, possibly for tracking or applying additional logic tied to these specific skills.
If there's an existing timer (sce->timer is not INVALID_TIMER), it is deleted to reset or adjust the timing of the combo window.
A new timer is added with add_timer(tick+sce->val4, status_change_timer, src->id, SC_COMBO) to prolong the combo window, effectively allowing the player more time to perform subsequent combo moves.
Cancel Combo:
If the player isn't in the Taekwon rank or other related checks aren't met, the combo mode is canceled by invoking unit_cancel_combo(src). This ends any waiting period for executing a combo.
Handling Ground Skills:
The default case handles scenarios not covered by the previous skills. It seems to deal with ground skills (based on the comment [Inkfish]).
If the source (src) is the damage source (dsrc), the combo status effect (SC_COMBO) is ended with status_change_end(src, SC_COMBO). This suggests an exception for ground-based skill mechanics, which do not sustain the combo status.
In summary, this code extends or ends combo sequences as players execute specific Taekwon skills, allowing flexibility in combat and encouraging mastery of timing between combos. The code ensures players who achieve Taekwon rank can maintain longer combo sequences, providing them with additional strategic advantages in battle.
Here's a detailed explanation of the code:
Skill Case TK_READYCOUNTER, TK_READYDOWN, TK_READYSTORM, TK_READYTURN, TK_JUMPKICK:
Soul Linker Restriction:
The code checks if the player's class (sd.class_) ANDed with MAPID_UPPERMASK equals MAPID_SOUL_LINKER. This bitwise operation effectively checks if the player is a Soul Linker or an evolved version of a Taekwon.
If the player is a Soul Linker, the skill is not allowed. The function clif_skill_fail(sd, skill_id) is invoked to inform the player that the skill cannot be used, and return false prevents the skill from being executed.
Skill Case TK_TURNKICK, TK_STORMKICK, TK_DOWNKICK, TK_COUNTER:
Soul Linker Restriction:
Similar to the previous skills, Soul Linkers cannot use these skills. The code return false ensures that the skill is not executed if the player is a Soul Linker.
Combo State Check:
If there is no combo status effect (!(sc && sc->getSCE(SC_COMBO))) or the current combo skill is TK_JUMPKICK (sc->getSCE(SC_COMBO)->val1 == TK_JUMPKICK), the skill cannot proceed, returning false.
Kick Chain Validation:
If there is a kick chain in progress (sc->getSCE(SC_COMBO)->val3) and the current skill skill_id doesn't match the skill being used in the combo (sc->getSCE(SC_COMBO)->val3 == skill_id), the combo ends, and false is returned.
status_change_end(&sd.bl, SC_COMBO) ensure that the combo status effect ends when a repeated kick occurs.
Cancel Combo on Incompatible Skill:
If the current combo skill (sc->getSCE(SC_COMBO)->val1) does not match the skill_id, and the player is not a Taekwon Ranker (!pc_is_taekwon_ranker(&sd)), the combo sequence is canceled. This is done through unit_cancel_combo(&sd.bl), and the skill returns false.
In summary, this code enforces class restrictions for Soul Linkers, constrains skill usage based on combo status, and ensures that a logical combo sequence is followed. If these conditions aren't met, the skill execution is halted, maintaining the integrity of the game's combat system and ensuring that players adhere to the intended mechanics of Taekwon combos.
here is problem, When I play the game, My character is Taekwon job and already top 10 Taekwon Ranker. The problem is when I try use Taekwon stance, to do combo whirlwind kick, axe kick and round kick. the combo is not working only can do whirlwind kick. Can you see what problem on that code?
Based on the description of the issue you're experiencing, there are a few potential reasons why the Taekwon kick combo might not be functioning as expected, especially given that you've achieved the status of a top 10 Taekwon Ranker:
Stance Preparation:
Ensure that you have correctly activated and prepared the stances for each of the kicks. The combo system requires at least one stance to be prepared before initiating a sequence of kicks.
Kick Alternation:
As noted in the game mechanics, to continue a kick combo, you must alternate between different kicks. Using the same kick consecutively will end the combo. Double-check that the keybindings for different kicks are correctly set and that you're alternating as required.
Skill Restrictions and Conditions:
If there are any restrictions or conditions coded to prevent certain combos (like using Flying Side Kick in the sequence), ensure that you're not accidentally trying to include disallowed moves in the combo sequence.
Verify that all conditions for maintaining the combo, such as no repeat of the same kick consecutively, are met.
Status Effects and Buffs:
Ensure that your character isn't under any status effects or buffs/debuffs that might interfere with skill execution or timing.
Check that the combo status effect (SC_COMBO in the code) is being properly applied, maintained, and not prematurely canceled. This might require reviewing whether any functions are unintentionally ending the combo status.
Code Logic for Combo Execution:
Review the implementation logic that handles combo sequences for potential bugs. Inspect how the code checks for repeated kicks and handles skill chaining to ensure there are no errors stopping the combo prematurely. This involves the sc->getSCE(SC_COMBO) checks.
Client-side Issues:
Make sure there is no client-related issue such as lag or incorrect hotkey assignments that might prevent the combo from executing properly.
Given the context that you are already a Taekwon Ranker, most game mechanics should work in your favor, like infinite combos. However, any of the above factors could contribute to interruptions in executing your kick combos. You may want to start by checking these areas and assuring that your in-game setup aligns with what is expected for successful combo execution in the game's environment. If necessary, it could also be helpful to review game patch notes or community forums for known issues related to recent updates or configuration changes.