How to Add TP Moves

From DSP Wiki
Jump to: navigation, search

A quick and dirty "how to" on making TP Moves. Understanding of the basics will be assumed.


Mob Skill Table

mob_skill_id -- The message to be displayed when the TP move is used. See /documentation/monster_tp_movies.txt for a list.

family_id -- The mob family you're adding the TP move to.

mob_anim_id -- The animation ID for the TP move.

mob_skill_aoe -- AoE characteristics. 0 = none, 1 = circular, 2 = circle around the target, 3 = ???, 4 = frontal cone

mob_skill_distance -- How far away can it hit? This is both range for single target, and how large the AoE is for AoE attacks.

mob_anim_time -- How long the animation will take to execute. 2000 = 2 seconds. Due to DSP limitations, values that are not multiples of 500 are kind of pointless. That being said, don't mess with other TP moves if you don't know why they're the way they are.

mob_prepare_time -- How long the mob "prepares" the TP move. 1000 is fairly standard, 0 is instant use.

mob_valid_targets -- What can be targeted? Likely uses the same values as spells, making 1 = self and 4 = enemy.

mob_skill_flag -- Certain TP moves like Fomor attacks are done a little differently, since they're actually weaponskills. Set this to 1 if that's the case.


Script File Structure

OnMobSkillCheck -- Used for logic on TP moves, such as "Spike Flail is only used if the target is behind the dragon." return 0 if all is okay, return 1 to block the TP move. Useful during testing to force your new move to be used by disabling anything else.

OnMobWeaponSkill -- Used to determine damage and effects. Typically you will want to route through one of the functions in /scripts/global/monstertpmoves.lua. Tear apart similar moves if you're not sure which functions to use. This is where you'll be tuning in the damage. For example:

function OnMobWeaponSkill(target, mob, skill)
    local numhits = 1;
    local accmod = 1;
    local dmgmod = 5;
    local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT);
    local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_RANGED,MOBPARAM_SLASH,info.hitslanded);

    dmg = dmg * ((50 - mob:checkDistance(target)) / 50);

    MobStatusEffectMove(mob, target, EFFECT_AMNESIA, 1, 0, 120);

    target:delHP(dmg);
    return dmg;
end;

Here you have a single-hit TP move doing Physical Damage and obeying all the standard damage adjustments and shadow behavior in MobFinalAdjustments. An additional line was added to change the damage based on range from the mob, and an Amnesia effect was added for the sake of the example. Also note info.hitslanded being used to remove 1 shadow per hit landed. dmgmod 5 will make the move quite potent, and values below 3 will be more common.

Always:

require("/scripts/globals/settings");
require("/scripts/globals/status");
require("/scripts/globals/monstertpmoves");

Finding the Animation

You'll need a GM account. Find the mob that should have the TP move, and engage it. Both your character and the mob need to be "in combat" for this to work, but you don't have to be hitting the mob. @godmode or a Judge's Ring might be useful, since you might be here a while. You'll be using a GM command:

@injectaction 11 animation_value

animation_value is the value you'll need for mob_anim_id in the mob_skill table. The animations are in roughly the same order as the ones found in /documentation/monster_tp_movies.txt, but note that the values will not necessarily be the same. You'll also see TP move messages in your text log, but these do not represent the actual move for that animation ID.

You won't always be using "11" for the second value, but if you should be using something else, then you'll understand what it means.

If it's not clear, you're going to have to make a roughly educated guess on animation_value, and then work up and down from there based on what you find. There's a few notes in /documentation/monster_tp_animations.txt as well.


Closing Tips

- The moves will probably be in the same general range as their message/mob_skill_id value, but offset slightly.

- Always check which mobs belong to the family you'll be adding the move to. It's just plain good practice. There's nothing quite like giving Maat his 2hr and having Mammets pop Mighty Strikes. If you don't check, it will probably come back to bite you.

- YouTube is your friend for checking animations and getting some reliable damage numbers, but be prepared for bad video editing and terrible taste in music. While FFXIclopedia has damage estimates, these estimates are often only vaguely accurate.

- Unless it has been fixed, the breath damage formula will be hard to work with, and does not curve nearly the way you'd like it to. Accept it, or figure out a better one.