Crushing Blow Tables
#9
Not sure what part you find confusing :)

Anyway. Hit events has always existed in the game. They are things such as CB, OW, mana after kill, damage to attacker and so on. They have always existed. Basically, they were all handled by one special function called at various places in the code. WHen calling it, one parameter would be an index value, telling what of the events to check for at that particular call. Basically, the calls would be once in the resitsance code, once in the doing damage code and once when a kill had occured. It was slightly more complicated since there was one index for a kill and one for being killed for example, so the call on a kill would be twice with different indexes.

Back before 1.10, in addition, there were various calls and code spread out to handle event like things, such as IM, Thorns, various cold armor, Bone Armor and so on. From the look of it, most of those have now been converted into events too. That would account for some movement such as for Bone/Cyclone Armor, since the event call in the resistance code only exist before any calcs are done, whole BA/CA was done in-between resistance and absorbtion before if I recall correctly. The same might abboly to things such as CB, IM and those, they al seem to be called before damage is dealt now, whiel being spread a bit before.

I have still not tracked some of the "events" down. I have no idea how Thorns is done now, since it has no event function or index attached to is, such as IM seems to have. But most other effects now seem to be event driven (from the look of data tables, have not checked code much).

Another difference that makes it slightly more troublesome to check is that there is a change in the technical aspect the game goes about checking for events to do. Before, there was one internal table which for each event had an index, and then some paramaters for how to handle it, including a pointer to the function to run for it. Now, there is no such table!!! AT least not in an easy to find way (and I have not run the game to trace it). Instead, through out the various txt data files (itemsstatscost, skills, missiles and so on), there are "eventfunc" colums and "eventtype" (or something like that, the type is a text entry that through events.txt is converted into the index number I mentioned above), which tells at what call the event function should be handled.

Also note that some of these events actually have to do with euiping or handling items, that was the case before and is so now too. I think the added skill upon hit for example is also an event now though.

Anyway, the main event function that gets an index, will no longer look into a table with all events to see which match the index and call them. Instead each player and monster will have a list upon itself with all events it should trigger, and the main event function looks thorugh this player/monster list and call the event functions that match the index. The pointer to the proper event function is stored inside the player/monster list, and only looked up when the list is created, not when you actually check for which events to trigger. This is no big problem, just made it take aslightly more time to find it, since you had to look at the point a player or monster GOT the effect on it that would trigger an event. For example, it is at the moment a player would be subject to a Thorns aura, or equiping an item with CB, that the game would set the list entry on the player which would include the pointer to the proper function and also the index type and so on. However, it was not that hard to find the function pointer table and the txt files pretty much has all the easy to see information about what stat or skill trigger which event (except I have not found Thorns for examaple). Phew. Not sure that help ease the confusion.

In any case, the different events are:

Idx event *desc
0 hitbymissile hit by a missile
1 damagedinmelee damaged in melee
2 damagedbymissile damaged by missile
3 attackedinmelee melee attack atttempt
4 doactive do active state skill
5 domeleedamage do damage in melee
6 domissiledamage do missile damage
7 domeleeattack do melee attack
8 domissileattack do missile attack
9 kill killed something
10 killed killed by something
11 absorbdamage dealt damage
12 levelup gain a level

I have not seen any call for absorbdamage. There seem to be none. The others are easy to find where they are called, although I have to check notes at home. Will post later today. If anyone is interested in which effects are tied to which event index, I can post that too.

As for absorbtion, I have not seen anthing that could sugest why it would be added twice for example (if that would be the case). On the other hand, I have not played the game in a while (well, I have done some tests, but have looked at the server code setting up games and such instead, seems a server now theoretically can handle 1024 games instead of the old max 128 for example) so I have not been able to check if the absorbed damage is applied twice, should be relatively easy to check for with a breakpoint on the absorbed damage location for example.
There are three types of people in the world. Those who can count and those who can't.
Reply


Messages In This Thread
Crushing Blow Tables - by bigeyedbug - 02-14-2004, 09:41 PM
Crushing Blow Tables - by JustAGuy - 02-14-2004, 10:05 PM
Crushing Blow Tables - by Jarulf - 02-15-2004, 07:49 AM
Crushing Blow Tables - by Tommi - 02-15-2004, 12:29 PM
Crushing Blow Tables - by Jarulf - 02-15-2004, 04:09 PM
Crushing Blow Tables - by Jarulf - 02-15-2004, 04:29 PM
Crushing Blow Tables - by Tommi - 02-15-2004, 07:30 PM
Crushing Blow Tables - by Crystalion - 02-15-2004, 11:44 PM
Crushing Blow Tables - by Jarulf - 02-16-2004, 11:12 AM
Crushing Blow Tables - by Raziel - 02-16-2004, 07:20 PM
Crushing Blow Tables - by Jarulf - 02-18-2004, 10:31 PM
Crushing Blow Tables - by Bob - 02-18-2004, 10:50 PM
Crushing Blow Tables - by Jarulf - 02-18-2004, 11:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)