Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2009, 01:12 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default Adding "Spent" aa.. here is some code

Anyways.. I tried to write some code to "add" to the "spent" aa pool using the quest manager..and...I tried this, but it doesn't seem to work..

perl_client.cpp

add this in somewhere:

i put it at line 3621

Code:
XS(XS_Client_AddSpentAAPoints);
XS(XS_Client_AddSpentAAPoints) {
	dXSARGS;
	if(items != 2)
		Perl_croak(aTHX_ "Usage: Client::AddSpentAAPoints(THIS, points)");
	{
		Client * THIS;
		uint32 points = SvUV(ST(1));
		uint32 spent_points = THIS->GetPP().aapoints_spent;
		
		if (sv_derived_from(ST(0), "Client")) {
			IV tmp = SvIV((SV*)SvRV(ST(0)));
			THIS = INT2PTR(Client *,tmp);
		}
		else
			Perl_croak(aTHX_ "THIS is not of type Client");
		if(THIS == NULL)
			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");

		THIS->GetPP().aapoints_spent = spent_points + points;
		THIS->SendAAStats();
	}
	XSRETURN_EMPTY;
}
then i tried calling it using

$client->AddSpentAAPoints(2);

in a quest script, and it doesn't seem to work., the quest manager seems to fail at that point.

any ideas?
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #2  
Old 06-22-2009, 01:14 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

nevermind

i didn't prototype it
testing now
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #3  
Old 06-22-2009, 01:22 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

IIRC the spent AA points are recalculated from the AAs the player actually has, each time the player profile is saved to the database, so updating them like this will only have a temporary effect.
Reply With Quote
  #4  
Old 06-22-2009, 01:24 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

ok, now it "Works" but it doesn't add anything to the spent AA; The quest manager however seems to like the function, it doesn't balk at me anymore.

any ideas?
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #5  
Old 06-22-2009, 01:25 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

this is exactly what i did:


use with a command like :
$client->AddSpentAAPoints(2);

perl_client.cpp

insert at line 4148
Code:
newXSproto(strcpy(buf, "AddSpentAAPoints"), XS_Client_AddSpentAAPoints, file, "$$");
i put it at line 3621 (arbitrary?)

Code:
XS(XS_Client_AddSpentAAPoints);
XS(XS_Client_AddSpentAAPoints) {
	dXSARGS;
	if(items != 2)
		Perl_croak(aTHX_ "Usage: Client::AddSpentAAPoints(THIS, points)");
	{
		Client * THIS;
		uint32 points = SvUV(ST(1));
		
		if (sv_derived_from(ST(0), "Client")) {
			IV tmp = SvIV((SV*)SvRV(ST(0)));
			THIS = INT2PTR(Client *,tmp);
		}
		else
			Perl_croak(aTHX_ "THIS is not of type Client");
		if(THIS == NULL)
			Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");

		THIS->GetPP().aapoints_spent = THIS->GetPP().aapoints_spent + points;
		THIS->SendAAStats();
	}
	XSRETURN_EMPTY;
}
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #6  
Old 06-22-2009, 01:47 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

ahh just saw derisions post.. which somehow appeared before my 2nd and 3rd posts.. ok i see..

well that "should" be changed eventually if we are going to implement expendable AA, as on live when expendable AA are used, it increased the "Spent" aa ad infinitum as long as you keep buying the same expendable AAs over and over.
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
  #7  
Old 06-22-2009, 02:06 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

could you explain what does "expendable" AAs actualy and do, where they come from and how the differ from regular AA?

I have read your another post on the subject but it still a total mistery to me.
Reply With Quote
  #8  
Old 06-22-2009, 02:11 AM
Davood
Discordant
 
Join Date: Jan 2005
Posts: 488
Default

Expendable AA were AA that added a short duration Effect that would boost damage in some fashion, or increase hit points, or add a rune effect for a short duration. (I don't have a list handy)

they added them in DoD so that people who were maxed out could still adventure and make use of AA; and over the course of a year I noticed that they AA I was spending on expendables was being "counted" as spent aa, which was cool, a monk friend of mine had over 4k AA spent, and a certain hacker i know of had like 7k AA spent from farming stuff with his monk and abusing the damage AAs
__________________
----------
Demon Overlord of Alakamin
skype @ davoodinator
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:03 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3