Monday, 2024-05-06, 7:49 PM
Main Sign Up RSS
Welcome, Guest
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum moderator: Ðimentio  
Forum » Diablo II modding » Programs and Mods » Basic Skill Edition Info
Basic Skill Edition Info
SeaAngelDate: Tuesday, 2011-12-06, 9:49 AM | Message # 1
3D Modeling
Group: Administrators
Messages: 972
Awards: 1
Reputation: 42
Status: Offline
Diablo II is a client/server based game. Two threads are running at the same time on your computer when the game is running. A Server thread that will handle all the calculations in the game and a Client thread that will display graphics or play sounds depending on what the server thread decides. When you play on Battle.Net, the server thread is located on the B.Net server and the client thread runs on your machine. In a solo game, both threads run on your computer.

Why is this important? Well, to get a coherent way to control skills, the skill effects are split into server effect and client effect - each of which handles a totally different kind of task and produces a different kind of result.

Moreover, each effect type is split into two parts: the Start function and the Do function. If you open up skills.txt and look at the very first row, you'll see the four columns that handle these functions:

* srvstfunc: This is an index into a function table server-side which controls what the skill does when you first attempt to use it, assuming the check that you have enough mana and the right item equipped etc. passes. This function will generally check that certain requirements are met and for some skills it will pre-setup some values (for example srvstfunc 9, which is used by fend, will count the number of enemies in range and save that with the unit using the skill).

*cltstfunc: Analogous to srvstfunc but client-side. Since this is a different table than the one used by srvstfunc, the numbers are different.

* srvdofunc: Like srvstfunc, but controls what the skill does when you hit the contact frame of the cast animation (in the case of event-triggered skills, this occurs immediately after srvstfunc since there is no animation). The srvdofunc uses the fields prgcalcX, srvmissileX, aurafilter, aurastate, auratargetstate, auralencalc, aurarangecalc, aurastat#, aurastatcalc#, auraevent#, auraeventfunc#, auratgtevent, auratgteventfunc, passivestate, passivestat#, passivecalc#, summon, pettype, petmax, summode, sumskill#, sumsk#calc, sumumod, sumoverlay, do sound a, do sound b, calc#. In general, filling out any of the above fields unless you've assigned a srvdofunc which uses them will not have any effect. Each srvdofunc can use any of the above fields for its own purposes, but generally there is a sort of logic to which fields get used for what. There are a couple of cases where srvdofunc is 0. In such a case, if there is a srvmissile that missile is fired at the target (either x,y or unit). Skills with the passive field set to 1 will also usually have srvdofunc 0. Note that this is an index into a different function table from srvstfunc.

* cltdofunc: Analogous to srvstfunc but client-side. Since this is a different table than the one used by srvstfunc, the numbers are different. It makes use of the same fields as srvdofunc, except it uses cltmissileX in place of srvmissileX, etc.

This layout allows us to easily mix and match skills, clone skills or swap skills. The core mechanisms of skills are handled by this quadruplet of function index and function arguments. Keep this in mind for future references.

The same organization applies to missiles:

* pCltDoFunc: gets called every frame of a missile's existence on the client.
* pCltHitFunc: gets called on the client when the missile hits something.
* pSrvDoFunc: gets called every frame of a missile's existence on the server.
* pSrvHitFunc: gets called on the server when the missile hits something.
* pSrvDmgFunc : gets called between when the missile calculates the damage it does and when it actually applies that damage - this function is used to modify the damage done.

What to Keep in Mind?

What to Keep in Mind ?
* Diablo II uses a server/client model to handle almost anything.
* Skill and Missile effects are split into client and server effects.
* There are some internal tables that keep track of effect functions by an ordinal index..
 
Forum » Diablo II modding » Programs and Mods » Basic Skill Edition Info
  • Page 1 of 1
  • 1
Search: