Function : SetStat
Add this to embperl.cpp
Code:
"sub setstat{push(@cmd_queue,{func=>'setstat',args=>join(',',@_)});}" Code:
quest::setstat(6,1); I made first this perl command because i need to way to edit stats ... sad thing, i didnt realise setstats was only increase/decrease command. Note you cant decrease your base stats (dont know why). Im looking for a way to change stats via a PERL command, or a way to reload baseracestats, if someone has an idea ... |
to change stats via perl command:
add this to client.cpp: Code:
void Client::SetStat(int8 type,sint16 number){ Code:
void SetStat(int8 type,sint16 number); //cofruben:-For setting stats. mob->CastToClient()->SetStat(0,70); //sets 70 to STR or mob->CastToClient()->SetStat(1,65); //sets 65 to STA. |
Im getting mad *sight*
I added your suggestion Cofruben but look like there is a little problem (From me, for sure).
I added this to code. CLIENT.CPP, 2084 Code:
void Client::SetStat(int8 type,sint16 number){ Code:
void BaseStat(int8 type,sint16 number); //cofruben:-For setting stats. Code:
else if (!strcmp(strlwr(command),"permarace")) {//Cofruben:-Makes the client the race specified Code:
quest::permarace(1) Its true im not a C++ guru, but i have some logic and i just dont understand why it dont work. I would like to thanks you for all your answer in my post :) Thanks / KhaN |
Code:
else if (!strcmp(strlwr(command),"BaseStat")) {//Cofruben:-Makes the client the gender specified |
Made changes you submited, im not kicked to char screen, maybe a problem with command being reconized. Also, the idea is to add this command to your $permarace command, this way, you will fully change the race, not only the model graph :)
|
this is the code I used in my server I hope it helps you.
Code:
else if (!strcmp(strlwr(command),"permaclass")) {//Cofruben:-Makes the client the class specified |
Instead of a new function, maybe just modify SetStats (and those using it) to take an additional argument. Something more along the lines of:
void Client::SetStats (int8 type, sint16 val, int flags) where flags may be of some define'd/enum'd value, ie: STAT_INCREASE, STAT_SET, ... (As an alternative, maybe zero out all stats -- is there a function like this? -- and call SetStats as-is to increase them.) Also, would recommend using STAT_STR, STAT_STA, etc. in place of hard-coded values in your command. |
The question is, isnt settats used for something else then #setstat ?
Code:
void Client::SetStats (int8 type, sint16 val, int flags) |
Right now there are some things defined as such:
Code:
#define STAT_STR 0 Code:
mob->CastToClient()->SetStat(0,70); Code:
mob->CastToClient()->SetStat(STAT_STR,70); Code:
enum { Code:
#define FLAG1 0x01 Code:
if (flags & FLAG1) |
All times are GMT -4. The time now is 11:21 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.