VaultNetwork.net Vault Network Boards
Author Topic: DEVELOPERS: How to read character skills in .net plugins post-february patch [Locked]
Virindi-Inquisitor  4 stars
Posts: 1,538
Registered: 2001-11-18 22:25:54
A few people have asked me how to do this so I figured I should post it here.

The ACHooks skill functions do a range check, and skill id cannot be >50 (the IDs for new skills now top at 52). Adapter's charstats wrapper won't let you access skills that are not in its enum, and attempting to enumerate the builtin skills list causes an exception. This leaves two options for tracking the status of a skill on a character: manually monitoring the protocol, or using charstats interops. The list of game skill names and their ids can be retrieved from FileService as always.

Getting skill state from charstats interops should work the same on all decal 2960+.

Here is an example of interop code that loops the fileservice skill table (from portal) and displays the current character's points in each skill:

****BEGIN CODE****
Decal.Filters.FileService fs = Decal.Adapter.CoreManager.Current.FileService as Decal.Filters.FileService;
Decal.Interop.Filters.SkillInfo skillinfo = null;
for (int i = 0; i < fs.SkillTable.Length; ++i)
{
try
{
skillinfo = CoreManager.Current.CharacterFilter.Underlying.get_Skill((Decal.Interop.Filters.eSkillID)fs.SkillTable.Id);
System.Windows.Forms.MessageBox.Show(skillinfo.Name + ": " + skillinfo.Increment.ToString());
}
finally
{
if (skillinfo != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(skillinfo);
skillinfo = null;
}
}
}
****END CODE****

 

-----signature-----
Virindi
---
****Virindi Plugins FAQ**** http://www.virindi.net/wiki/index.php/Virindi_Plugins_FAQ
http://www.virindi.net - Virindi Tank, Follower, Integrator, Reporter, VCS5, XPHelper, Item Tool, HUDs, etc...
Decal Core Dev - http://www.decaldev.com
-Eps  3 stars
Title: I Love Boobies. And Butts, too!
Posts: 771
Registered: 2007-5-30 21:33:21
Thanks cutie

 

-----signature-----
#dnn #og-ac http://tinyurl.com/ACDTChat
Fastest 1-275 in AC history.
Plugin Users: 100+
Buy Plugins Relogger, ValSalv, and AutoVendor(route trigger): http://bit.ly/ACaCAl
[Trade] +Envoy Sparker says, "Rep check: Eps Levelin, PST."

VaultNetwork.net is an independently operated community forum and is not affiliated with, endorsed by, or technically based on IGN, GameSpy, FilePlanet, GameStats, or the former IGN/GameSpy Vault Network.
References to VaultNetwork.net mean this site/domain. VNBoards-style presentation is a visual homage only. By using this site, you agree to the forum rules.