Page 1 of 2

Anyone Please Help

PostPosted: Sat Apr 20, 2013 2:37 am
by rave
Hi Someone Please Help Me

Just Want To Know If It Is Possible To Increase The Stat Requirement Value

Example

I Have Str 15 And I Need To Have 3 Stat Points To Make It 16 And The Higher The Stat The Higher Stat Requirement It Needs

Sample Again I Have 300 Str To Make It 301 I Need 1000 Stat Points

Is This Possible ?

Thanks In Advance

Re: Anyone Please Help

PostPosted: Mon Apr 22, 2013 2:43 pm
by PurpleYouko
yes it's possible

You would have to modify pakAddStats which you will find in worldpackets.cpp

  1.  
  2. // This function is for increasing your stats
  3. bool CWorldServer::pakAddStats( CPlayer* thisclient, CPacket* P )
  4. {
  5.     BYTE statid = GETBYTE((*P), 0);
  6.     int statval = -1;
  7.     int nstatval = 0;
  8.     switch(statid)
  9.     {
  10.         case 0: nstatval=(int)floor((float)thisclient->Attr->Str/5); break;
  11.         case 1: nstatval=(int)floor((float)thisclient->Attr->Dex/5); break;
  12.         case 2: nstatval=(int)floor((float)thisclient->Attr->Int/5); break;
  13.         case 3: nstatval=(int)floor((float)thisclient->Attr->Con/5); break;
  14.         case 4: nstatval=(int)floor((float)thisclient->Attr->Cha/5); break;
  15.         case 5: nstatval=(int)floor((float)thisclient->Attr->Sen/5); break;
  16.     }
  17.     if (thisclient->CharInfo->StatPoints>=nstatval && nstatval < ((Config.MaxStat/5)+1))
  18.     {
  19.         switch(statid)
  20.         {
  21.             case 0: statval=++thisclient->Attr->Str; break;
  22.             case 1: statval=++thisclient->Attr->Dex; break;
  23.             case 2: statval=++thisclient->Attr->Int; break;
  24.             case 3: statval=++thisclient->Attr->Con; break;
  25.             case 4: statval=++thisclient->Attr->Cha; break;
  26.             case 5: statval=++thisclient->Attr->Sen; break;
  27.         }
  28.     }
  29.     if (statval>0)
  30.     {
  31.         thisclient->CharInfo->StatPoints-=nstatval;
  32.         BEGINPACKET( pak, 0x7a9 );
  33.         ADDBYTE( pak, statid );
  34.         ADDWORD( pak, (unsigned short)statval );
  35.         thisclient->client->SendPacket( &pak );
  36.     }
  37.     thisclient->SetStats( );
  38.     return true;
  39. }

the actual amount of stat points that we take away from your total to increase STR (for example) is calculated in the first switch statement and stored in the variable nstatval then later this amount is subtracted from your statpoints.

just adjust the formula and you can make it cost whatever you like.

Re: Anyone Please Help

PostPosted: Tue Apr 23, 2013 8:49 am
by rave
ive change all 5 to 20 but nothing happened

still STR 15 requires 3 Stat points

case 0: nstatval=(int)floor((float)thisclient->Attr->Str/5); break;
case 1: nstatval=(int)floor((float)thisclient->Attr->Dex/5); break;
case 2: nstatval=(int)floor((float)thisclient->Attr->Int/5); break;
case 3: nstatval=(int)floor((float)thisclient->Attr->Con/5); break;
case 4: nstatval=(int)floor((float)thisclient->Attr->Cha/5); break;
case 5: nstatval=(int)floor((float)thisclient->Attr->Sen/5); break;
}
if (thisclient->CharInfo->StatPoints>=nstatval && nstatval < ((Config.MaxStat/5)+1))

To This

case 0: nstatval=(int)floor((float)thisclient->Attr->Str/20); break;
case 1: nstatval=(int)floor((float)thisclient->Attr->Dex/20); break;
case 2: nstatval=(int)floor((float)thisclient->Attr->Int/20); break;
case 3: nstatval=(int)floor((float)thisclient->Attr->Con/20); break;
case 4: nstatval=(int)floor((float)thisclient->Attr->Cha/20); break;
case 5: nstatval=(int)floor((float)thisclient->Attr->Sen/20); break;
}
if (thisclient->CharInfo->StatPoints>=nstatval && nstatval < ((Config.MaxStat/20)+1))

Re: Anyone Please Help

PostPosted: Tue Apr 23, 2013 8:56 am
by rave
Ive Change Things Like The 5 To 20 Or The -1 To 20 But Still Doesnt Change The Requirement Value

Heres A Picture

screen007.jpg
screen007.jpg (18.37 KiB) Viewed 7711 times

As The Image Show

STR 29 Requires 5 Stat Points

screen008.jpg
screen008.jpg (19.16 KiB) Viewed 7711 times

As The Image Show

STR 30 Requires 6 Stat Points

screen009.jpg
screen009.jpg (19.2 KiB) Viewed 7711 times

As The Image Show

STR 31 Requires 7 Stat Points

=========================

How can i make STR from 29 , 30, 31 makes 100 200 300 stat requirements

just an example of requirements

Thanks : )

Re: Anyone Please Help

PostPosted: Tue Apr 23, 2013 1:58 pm
by PurpleYouko
It's not going to change what the client displays.
That is hard coded in the client. only ASM will fix that.
It will only change what it actually costs in the server.

Re: Anyone Please Help

PostPosted: Tue Apr 23, 2013 11:45 pm
by rave
PurpleYouko wrote:It's not going to change what the client displays.
That is hard coded in the client. only ASM will fix that.
It will only change what it actually costs in the server.


hmm so it means

if i put 20

it actually takes 20 from the stat points ?

Re: Anyone Please Help

PostPosted: Wed Apr 24, 2013 2:00 pm
by PurpleYouko
yup.
actual stat point totals are controlled by the server but the display of costs is controlled by the client.

Re: Anyone Please Help

PostPosted: Thu Apr 25, 2013 9:44 am
by rave
PurpleYouko wrote:yup.
actual stat point totals are controlled by the server but the display of costs is controlled by the client.


ok so from client its just the display while the server controls everything?

but ive changed the 5 to 20 but still it took the right value like the image above

Re: Anyone Please Help

PostPosted: Thu Apr 25, 2013 4:42 pm
by Circa
I may be wrong but changing the 5 to a 20 makes stats cost 0 lol

For example, a character starts with 15 str. And the way the server calculates the cost it does integer division I suppose. Because 15/5 = 3 until it hits str 20 it changes required 4 stat points.

So if you change that 5 to a 20 then you have

15 str/ 20 = 0 stat points required unless I missed something in the code which will force it to be 1. But until str = 20 then required stat points is 1 until you have str 40 will it require 2 stat points.

Re: Anyone Please Help

PostPosted: Thu Apr 25, 2013 11:45 pm
by rave
Circa wrote:I may be wrong but changing the 5 to a 20 makes stats cost 0 lol

For example, a character starts with 15 str. And the way the server calculates the cost it does integer division I suppose. Because 15/5 = 3 until it hits str 20 it changes required 4 stat points.

So if you change that 5 to a 20 then you have

15 str/ 20 = 0 stat points required unless I missed something in the code which will force it to be 1. But until str = 20 then required stat points is 1 until you have str 40 will it require 2 stat points.


ok ive tested it

i changed the 5 to 1 but it doesnt did what you said with dividing str / ( value )

like you said 15 str / 5 = 3 ( from the basic thats why it is 3 )

ive change it to str / 1 so the answer is 5 also if the str is 100 / 1 it should be 100 as well but

after reaching str 60 i got 12 requirement stat but my max stat is 300 and i am level 250 i cant no longer put stats but i got 10,000 stat points

just to recap

what i wanted to happen was to make the require stat value per STAT higher than the normal

if the 15 str requires 3 stat points to make 15 STR what i want is to make the 3 do something like 100 or higher

thank you for the answers and efforts
thank you very much masters