create_skill
Create custom skills for RPG Maker MZ/MV games by defining properties like name, description, costs, damage formulas, effects, and animations.
Instructions
Create a new skill with custom properties
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Skill name | |
| description | No | Skill description | |
| iconIndex | No | Icon index (0-1000+) | |
| mpCost | No | MP cost | |
| tpCost | No | TP cost | |
| scope | No | Target scope (1=enemy single, 2=enemy all, 7=ally all, etc.) | |
| damage | No | Damage configuration | |
| effects | No | Skill effects (buffs, debuffs, states, etc.) | |
| animationId | No | Animation ID | |
| message1 | No | Battle message | |
| stypeId | No | Skill type (1=magic, 2=special, etc.) |
Implementation Reference
- src/tools/skillTools.ts:23-96 (handler)The implementation of `createSkill` in `src/tools/skillTools.ts` handles the creation of a new skill, calculates the next available ID, sets default values, and writes the updated skills list to `Skills.json`.
export async function createSkill( projectPath: string, skillData: { name: string; description?: string; iconIndex?: number; mpCost?: number; tpCost?: number; scope?: number; damage?: { type: number; elementId: number; formula: string; variance?: number; critical?: boolean; }; effects?: Array<{ code: number; dataId: number; value1: number; value2: number; }>; animationId?: number; message1?: string; stypeId?: number; } ): Promise<Skill> { const skills = await getSkills(projectPath); // Find the next available ID const maxId = skills.reduce((max, skill) => { return skill && skill.id > max ? skill.id : max; }, 0); const newSkill: Skill = { id: maxId + 1, name: skillData.name, description: skillData.description || '', iconIndex: skillData.iconIndex || 64, mpCost: skillData.mpCost || 0, tpCost: skillData.tpCost || 0, tpGain: 0, scope: skillData.scope || 1, // Default: enemy single occasion: 1, // Battle only speed: 0, successRate: 100, repeats: 1, hitType: skillData.damage?.type === 1 || skillData.damage?.type === 5 ? 1 : 2, animationId: skillData.animationId || 0, damage: { type: skillData.damage?.type || 0, elementId: skillData.damage?.elementId || 0, formula: skillData.damage?.formula || '0', variance: skillData.damage?.variance !== undefined ? skillData.damage.variance : 20, critical: skillData.damage?.critical !== undefined ? skillData.damage.critical : false }, effects: skillData.effects || [], message1: skillData.message1 || '', message2: '', note: '', stypeId: skillData.stypeId || 1, // Default: Magic requiredWtypeId1: 0, requiredWtypeId2: 0, messageType: 1, traits: [] }; skills.push(newSkill); const skillsPath = getDataPath(projectPath, 'Skills.json'); await writeJsonFile(skillsPath, skills); return newSkill; }