Method of tracking spell usage and memorisation over logout/login updated for HotU, persistent over server travel/resets/crashes. Runs off the spellhook, OnPlayerRest and OnClientEnter events. Simply unzip the .erf and import the files into your module. Instructions included in the .erf. Feedback is welcome. See the text file below for details.
gah - its these boards that can't handle my post. I posted right the first two times in fact that is likely what happened to your code sir elric st_inc.nss(122): ERROR: NO SEMICOLON AFTER EXPRESSION these boards can't hadnle a properly formated "for" loop and its combining the for and the if statements together.
Posted by Anonymous at 2004-10-2811:53:00
man! I can't sem to post right today one more time :P Sir Elric: the whole line for(nID=0;nID= 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID = 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID = 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID
Posted by Lucky at 2004-10-2811:50:00
sorry the whole line for(nID=0;nID= 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID = 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID
Posted by Lucky at 2004-10-2811:40:00
Sir E you forgot ;nID++ in the line for(nID=0;nID= 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID
Posted by Frang at 2004-09-1007:20:00
anyway you can update the file its not working. says the spelltrackv1_3.erf header is corrupt. and wont let me unzip it
Posted by Sir_Elric at on06/29/05
The fix I created for my earlier post is this for anyone that's interested. Open st_inc and scroll down to... // Check if a spell was memorised legally (with resting) nLegal = st_GetInt(oCaster,"st_SpellCastLegal_"+IntToString(nID)+"_"); if(nLegal) { // Remove any castings of the spell already used nCasts = st_GetInt(oCaster,"st_NumSpellCast_"+IntToString(nID)+"_"); st_LegalLoopDecrement(oCaster, nID, nCasts); } //Check for more of the same spell if so decrement them if (nSpell>nLegal) { int iRemove = nSpell - nLegal; st_LegalLoopDecrement(oCaster, nID, iRemove); } change it to... // Check if a spell was memorised legally (with resting) nLegal = st_GetInt(oCaster,"st_SpellCastLegal_"+IntToString(nID)+"_"); if(nLegal) { // Remove any castings of the spell already used nCasts = st_GetInt(oCaster,"st_NumSpellCast_"+IntToString(nID)+"_"); st_LegalLoopDecrement(oCaster, nID, nCasts); //Check for more of the same spell if so decrement them if (nSpell>nLegal) { int iRemove = nSpell - nLegal; st_LegalLoopDecrement(oCaster, nID, iRemove); } } HTH SECity of Melnibone - PW ausnwn2.dyndns.org:5121 _________________________ City of Melnibone ausnwn.dyndns.org:5121
Posted by Sir_Elric at on06/29/05
One other thing I have found is if you swap used spells for spells that you already had these will not be decremented if you log in and log out. ie: 5th level wizard spells have 3 firebrands and 3 hold monsters cast all 6 spells replace the hold monster with 3 more firebrands log out and back and you have the 3 new firebrands ready to use :S SECity of Melnibone - PW ausnwn2.dyndns.org:5121 _________________________ City of Melnibone ausnwn.dyndns.org:5121
Posted by Sir_Elric at on06/29/05
Easiest way to log spells on first log in rather than decrement them all is to use your st_OnRestCompleted(oPC); function with a delayed SetLocalInt(). #include "st_inc" void main() { object oPC = GetEnteringObject(); if (!GetLocalInt(oPC, "ENTERED"))//First log in? { st_OnRestCompleted(oPC);//Log all current spells } else { st_HideCheck(oPC); DelayCommand(0.8,st_SpellCheck(oPC)); } DelayCommand(10.0, SetLocalInt(oPC, "ENTERED", TRUE)); } Cheers SECity of Melnibone - PW ausnwn2.dyndns.org:5121 _________________________ City of Melnibone ausnwn.dyndns.org:5121
Posted by Sir_Elric at on06/29/05
Excellent stuff just about to add it to my PW. One thing I added was setting a delayed local on the player as they enter in the OnEnter script. #include "st_inc" void main() { object oPC = GetEnteringObject(); DelayCommand(10.0, SetLocalInt(oPC, "ENTERED", TRUE)); st_HideCheck(oPC); DelayCommand(0.8,st_SpellCheck(oPC)); } ...then in the st_SpellCheck() function add... void st_SpellCheck(object oCaster) { if(GetIsPC(oCaster) !GetIsDM(oCaster) !GetIsDMPossessed(oCaster)) { int nID, nSpell, nLegal, nCasts; for(nID=0;nID= 0 nID = 340 nID = 363 nID = 387 nID = 414 nID = 429 nID = 512 nID = 636 nID _________________________ City of Melnibone ausnwn.dyndns.org:5121
Posted by Harkinian at on06/19/04
Excellent system. Well coded and thought out. Very user friendly.