Назад

Cкиллы....

Автор: Kill Spirit: Дата: 04.25.2010

Вот у меня есть скилл Cross Impact я бы хотел добавить его кроссу...

Читал тему на eathena.ws, но при компиляции было много ошибок...

Может кто выложить рабочий гайд? и именно чтоб Cross Impact работал как соник и бил 1400% от атк...

Я в сорсах не очень сильно понимаю...

И прошу воздержатся от ответов типа...

РУЧКАМИ ВСЕ.

НЕКТО ТЕБЕ НЕ БУДЕТ НЕЧЕГО ДАВАТЬ,САМ ДЕЛАЙ

Если не понимаешь не лезь тогда.

И тому подобное...

Автор: Kill Spirit: Дата: 04.25.2010

А ты думаешь я в сорсах очень сильно понимаю? и знаю что куда вставлять?

И прошу воздержатся от ответов типа...

РУЧКАМИ ВСЕ.

НЕКТО ТЕБЕ НЕ БУДЕТ НЕЧЕГО ДАВАТЬ,САМ ДЕЛАЙ

И тому подобное...

Автор: Sanasol: Дата: 04.25.2010

Если не понимаешь чего лезешь тогда. Зачем ставить недо-скиллы с недо-формулами.

Автор: Kill Spirit: Дата: 04.25.2010

Тебе помочь лень?

Может мне надо =\\

Автор: Kill Spirit: Дата: 04.25.2010

Вот гайд, но при компиле выдает ошибки, спрайты у меня есть...

Introduction 

A large area where players have difficulty is adding new skills to the source and client. To implement new skills, it's required that you use an XRay client (if you don't want to use XRay, you will have to replace existing, un-used skills and edit their previous descriptions).

Below will be documentation on how to implement these new skills
The skill

The skill I will be working on is a simple one.
Earth Bolt
Max Level: 10
Type: Active
SP Cost: 20 + 5*SkillLV
Target: 1 Enemy
Cast Time: 2 sec
Cool Down: 1 sec
Duration: Instant
Deals SkillLV bolts of Earth magic damage to one enemy, at 150% MATK per hit.

Basically, this skill should target 1 enemy, and deal 10 hits of 150% MATK, Earth elemental property and should be magic damage based.
Open /src/map/skill.h

Scroll down until you find
MER_DECAGI,
MER_SCAPEGOAT,
MER_LEXDIVINA,
MER_ESTIMATION,

After here is where we add any additional skills. It's better to give the skills a custom ID to begin with. So, let's add our "Earth Bolt" skill.

After those, add
MG_EARTHBOLT = 545,

MG_ definitively means "Mage", you'll work out the acronyms as you scroll through the skills. We have defined the basis of the skill. As you can see, the skill id is set to '545' since Ninja's Final Strike is set to 544 (and is the last player accessible skill).
Open /src/map/skill.c

This file is where we define the actual skill implementations. For single-target skills, all processing of that skill will go in skill_castend_damage_id (for damaging skills) or skill_castend_nodamage_id (for non-damage skills).
Magic based skills

Because Earth Bolt is damage based, find the skill_castend_damage_id function and find:
case WZ_SIGHTBLASTER:
case WZ_SIGHTRASHER:
case NJ_KOUENKA:
case NJ_HYOUSENSOU:
case NJ_HUUJIN:

The reason we will be placing the case for Earth Bolt here is because:
skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);

The BF_MAGIC quality means that the skill is magic based, and should be calculated under the magic battle calculations. So, after case NJ_HUUJIN add:
case MG_EARTHBOLT:
Weapon based skills

In the event of wanting to add a skill that's based on Weapon, rather than Magic, find:
case HFLI_MOON: //[orn]
case HFLI_SBR44: //[orn]
case NPC_BLEEDING:
case NPC_CRITICALWOUND:
case NPC_HELLPOWER:

And add the case after those. If we wanted Earth Bolt to be weapon based, it would look like this:
case HFLI_MOON: //[orn]
case HFLI_SBR44: //[orn]
case NPC_BLEEDING:
case NPC_CRITICALWOUND:
case NPC_HELLPOWER:
case MG_EARTHBOLT:

However, we will stick to the Magic function instead.
Open /src/map/battle.c

In this function, all main damage calculations are performed. And in seperate functions, the % modifiers for the skills are stored. Therefore, for our 150% damage, we add the extra 50% (since 100% is the default) in the appropriate function.
Weapon based attacks

For Weapon based attacks, the modifiers are found in battle_calc_weapon_attack. Simply find:
case NPC_VAMPIRE_GIFT:
skillratio += ((skill_lv-1)%5+1)*100;
break;

And add your damage modifier there. For example, if Earth Bolt was Weapon based, we would add:
case MG_EARTHBOLT:
skillratio += 50;
break;

The += 50 simply means "Add 50% onto the 100%" for 150% ATK damage.
Magic based attacks

For Magic based attacks, the modifiers are found in battle_calc_magic_attack. Simply find:
case NPC_EARTHQUAKE:
skillratio += 100 +100*skill_lv +100*(skill_lv/2);
break;

And add the damage modifier below. Since Earth Bolt is magic based, we add it here.
case MG_EARTHBOLT:
skillratio += 50;
break;

This now means that Earth Bolt will deal Magic damage at 150% MATK.
Skill database support

Technically speaking, the basis of the skill is now in place. Of course, if you want to implement more complex skills, there's a lot more to it. A seperate section will be created in the future for this. But for now, we need to implement the skill database entries.
skill_db.txt

For our Earth Bolt, we can now enter this:
545,5,8,1,2,0,0,10,1:2:3:4:5:6:7:8:9:10,yes,0,0,0,magic,0,MG_EARTHBOLT,Earth Bolt

This defines that:

Earth Bolt has a range of 5 cells, hits multiple times, is Earth element and targets 1 enemy. It can be interrupted, and is of magic type damage. The amount of hits increases by 1 every level, with a maximum level of 10.
skill_cast_db.txt

For our Earth Bolt, we can now enter this:
545,2000,1000,0,0,0

This defines that:

Earth Bolt has a 2 second cast time, and a 1 second delay time. There is no after-cast walk-delay
skill_require_db.txt

For our Earth Bolt, we can now enter this:
545,0,0,25:30:35:40:45:50:55:60:65:70,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

This defines that:

Earth Bolt requires 25 SP at level 1, 30 SP at level 2 .. 70 SP at level 10. Can be cast with any weapon, doesn't require a state and doesn't require any items to be consumed.
skill_tree.txt

This part of the database isn't necessary if it can't be learned by a class. However, if you want a class to learn a skill, you have to make an entry in skill_tree.txt. An example below:
2,545,10,19,5,20,5,0,0,0,0,0,0

This defines that:

Earth Bolt can be learned by Mage, has a maximum level of 10 (for this class), and requires skill 19 (Firebolt) at level 5, and skill 20 (Lightning Bolt) at level 5.

Technically, this is usually all the areas that you'd usually cover with skill database files. There are more, but that's for you to explore.
XRay support

To support the skill in the actual client, assuming you're using XRay (required to add new IDs for skills), you can do the following:
ability_tab.txt

To add in the custom skill, find:
NJ_ISSEN

And below it, add:
MG_EARTHBOLT
leveluseskillspamount.txt

To make the skill level-selectable, simply add an entry in leveluseskillspamount.txt in the data folder.
545#
25#
30#
35#
40#
45#
50#
55#
60#
65#
70#
@

This will allow the skill to be level selectable.
Finishing up

You can add the rest of the information in skillnametable.txt, skilldesctable2.txt and you'll need to add the appropriate Sprite and BMP file for the skill. Use the name MG_EARTHBOLT as the name of the file, and for the entries in the two text files.

Автор: Kill Spirit: Дата: 04.25.2010

Ну ><

Тема все еще актуальна ><