UID52847
帖子
精華
主題
積分14188
現金
積極性
威望
違規
熱心
推廣次數
閱讀權限30
註冊時間2008-1-19
在線時間 小時
最後登錄1970-1-1
TA的每日心情 | 無聊 2012-6-25 09:03 PM |
---|
簽到天數: 11 天 連續簽到: 0 天 [LV.3]偶爾看看II
|
發表於 2008-10-22 12:47:00
|
顯示全部樓層
請問JA我要怎寫出
增加自創技能或新增技能?
我用的ea不過這問題我有研究過 現在還在研究中
貼一篇xray自創新技能的英文文章給你參考
我大概懂一點
但是還在學習
可以一起研究討論
[转贴]XRAY 自创新技能(英文)
Adding Skills (The Bashing-Your-Head-Into-A-Wall Method)
Disclaimer: This is the result of preliminary testing and is intended only to get people started with adding skills and is by no means complete. Throughout the guide will be several "theories" that I will most likely test, and if it works out or not, then I shall edit the guide as necessary.
Changelog
=======
12/01/2006
- Added weapon groups
- Fixed some formatting
- Added information on selecting skill levels
12/05/2006
- Added the tiny bit of information needed by map.h. Thanks to Legionaire for reminding me
12/20/2006
- Changed a couple of details regarding map.h
- Clarified some things regarding skills
Welcome! Welcome to City 17--er, I mean, welcome to the basic Skills guide. What I'm gonna do is go thru some basic steps that you need to carry out in order to add a new skill to the game using XRay 10.5.2+, so if there's no questions so far, let's get going.
The Beginning - Getting What You Need
'k, there's a few little things you're gonna need before you can go ahead with all of this:
1) The RO client. You just plain NEED this in order to do anything.
2) XRay itself (Download from the fantastic sticky at the top of these forums )
3) The eAthena source code (Go here to find multiple pages of information on how to get files from the SVN. Windows users should do a search for "TortoiseSVN" to get started )
4) A compiler. There's tons of free ones. I recommend either Dev-C++ (which comes with MinGW, a Windows port of the GNU Compiler Collection (gcc)), or Visual C++ Express, a free version of Visual C++ 2005 from Microsoft (but it requires you to "register it" via a Windows Live! account after 30 days; it uses a hardware hash, so each code is unique to each computer you plan to install it on).
5) An idea. This is probably the most important step. If you've got nothin', you're wasting your time. Seriously, don't even bother if you can't come up with anything.
The Middle - What Needs To Be Done
'k, now that you have everything you need at your disposal (you DO have everything, right?), it's time to get to work. We'll start off with the easy stuff--screwing around with the XRay client.
As far as XRay goes, the only file we're interested in for this tutorial is ability_tab.txt, so open it up and you should be presented with something like this:
Quote:Zero Skill
NV_BASIC
SM_SWORD
<lots of skills>
<lots more skills>
SA_ELEMENTGROUND
SA_ELEMENTFIRE
SA_ELEMENTWIND
Now then, to add a new skill, we simply add it to the bottom of this list, right after SA_ELEMENTWIND.
Theory: The list is by no means completely filled, and in fact there are several gaps from what I've noticed where a person could insert their skills. However, one must be cautious, as each skill is appropriately numbered inside the source. These spots may also be reserved by the client for some unknown reason. I'll have to test it out.
Next, go to your data folder (or extract the files from your GRFs) and open up skilldesctable.txt. Copy any skill description (preferably a short one) and paste it at the end of the file, renaming the skill name to your skill. Do the same with the skillnametable.
If you want to allow your players to select a specific level of the skill, you need to add the information to the file "leveluseskillspamount.txt". The format is as follows:
Quote:SKILL_NAME#
SPAMOUNT#
SPAMOUNT#
(etc. etc.)
SPAMOUNT#
@
where you replace SPAMOUNT with the amount of SP you use for that level. So if all you want to do is allow users to change the level, set them all to the same number.
Important Step: In order to prevent resource errors (which will crash the client after a while), you MUST add placeholders for both sprites and texture icons for your new skills.
For Icons-> Go to your data folder and browse to this directory (create new directories as necessary): texture\À‾ÀúÀÎÅÍÆäÀ̽º\item. Add a .bmp to this directory, 24x24, and name it the same as your skill (in my example, it would be "asc_bladeflurry.bmp").
For Shortcut Keys-> Go to your data folder and browse to this directory (create new directories as necessary): sprite\¾ÆÀÌÅÛ. Add a .spr and an associating .act file to this directory with the same name as your skill. I'd recommend taking the icon you make for the above step and whipping up a quick little sprite with it (Sprite Editors can be found on the eAthena forums).
The Creamy Centre - Editing the Source Code
Now that the client is prepped, we can add our skill to the server source code. Fire up your IDE or a text editor (Editplus is good), and open up these files:
Quote:skill.h
skill.c
From here, the additional files you need to open will vary depending on what you wish to do.
- If your intention is to add a castable attack skill (such as Bash, or Storm Gust), you'll need to open battle.c and insert additional code into there. You'll also need to consult this file if you're adding certain passive skills, such as masteries.
- If you're adding a status-affecting skill (Two-Hand Quicken, Critical Explosion, etc), you'll need to open status.c, status.h, and map.h for editing. If your castable skill inflicts a status effect (Storm Gust's Freeze effect), then you'll also have to add it in here as well. Certain passive buffs also require the editing of these files.
Note: There may be other files that need to be taken into account, but they should all be located inside the map-server project. If any additional files need to be edited, let me know which ones, as well as the type of skill you were creating.
I'm not going to go thru all the nitty-gritty details here, since explaining how to edit the source is beyond the scope of this guide. What I will say though is this:
1) Add your skill name to skill.h, at the approximate location your skill is listed in ability_tab.txt. If you don't know what number your skill is, go to ability_tab.txt and count by hand. Use the source code as a reference if necessary; many IDEs (such as Visual C++ Express) will tell you what value each skill in the enumerator is at, so it should be easy to get a good reference.
2) Add your skill name to the array skill_names[] in skill.c, which is located near the top. All the skills are listed in alphabetical order here, but you should be able to add it anywhere in the array.
3) If you're adding a status-affecting skill, you need to add your status effect to the enumerator at the top of status.h (if it's like Critical Explosion), and you also have to add it to status.c, in the section with all the add_sc() and set_sc() function calls. The format used for the status-change enumerator is SC_NAMEOFSKILL.
4) If adding any new statuses, you need to open up map.h and increase the size of the MAXSTATUSCHANGE constant; otherwise, the map-server will yell at you for going out of the status array's bounds.
Once you've edited the source, compile and if there aren't any errors, consider yourself golden.
The Omega - Setting Up The Rest Of The Server
This is really simple, actually. You need to edit the following files:
Quote:skill_cast_db.txt
skill_castnodex_db.txt
skill_db.txt
skill_nocast_db.txt
skill_require_db.txt
skill_tree.txt
skill_unit_db.txt
The format of these files is something I'm not 100% familiar with. However, the structure is explained inside each file.
Some skills require specific types of weapons, and these requirements are part of the skill's listing in skill_require_db. The weapon groups are:
* 0) Bare Fists (aka anything)
* 1) Daggers
* 2) One-Handed Swords
* 3) Two-Handed Swords
* 4) One-Handed Spears
* 5) Two-Handed Spears
* 6) One-Handed Axes
* 7) Two-Handed Axes
* 8) Maces
* 9) Unknown (It seems to be unused)
* 10) Staves
* 11) Bows
* 12) Fist Weapons
* 13) Instruments
* 14) Whips
* 15) Books
* 16) Katars
* 17) Revolvers
* 18) Rifles
* 19) Shotguns
* 20) Gatling Guns
* 21) Grenades
* 22) Huuma (Don't know what these are)
Note that these currently only apply to active skills; there's no entries for passive skills in any file except for skill_tree and skill_db; I assume that passive skills' requirements are defined in the source.
Basically, you need to add your skill to these files. Not all of them, just some of them. For example, my Blade Flurry skill only needed to be added to skill_db, skill_tree, skill_require_db (to add conditions; I only wanted Blade Flurry to be usable with Katar-type weapons, which is weapon group 16), and skill_cast_db. You use the skill's ID to add it, not the name.
Leftovers - How It All Looks
Well, if you've been tinkering with it and had some kind of success, you should have something like this:
At this point, the skill is fully usable in the game, and players should be able to learn it once they meet the required conditions set out in your skill tree.
So you should have at least a general idea of how to add a skill. If there's any questions, feel free to leave a reply and I'll try to answer it. If you want to contribute something too, please do so and I'll try and incorporate it into this guide.
Thank you.
最後...有些地方變成表情符號...我也不願意
只好自己想辦法看了=口=
抱歉
[ 本帖最後由 camille11307 於 2008-10-22 12:48 PM 編輯 ] |
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒有帳號?註冊
x
|