Jump to content
  • 0

changing ASPD formula (not #define renewalaspd) or implementing my own (possible?)


patsi91

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  05/02/13
  • Last Seen:  

well hello there.
I am relatively new in the rA scene  but I've wondered about the aspd  a lot.
I have seen that the RE aspd is taken from kRO but I come from the french/european server , where the aspd formula seems to differ (a lot, actually).
I first noticed this on a server I was playing a while ago and I've just recently setup my own server for me and friends too ... So I may ask a  stupid question now but  ..
how is the aspd calculated  on rA ?(like where are the - I am only guessing - formula calculations located at ?)
And where could I change it ? I don't want the #define RenewalASPD bit (if possible), I want like , make my own formula (that will hopefully be oriented on iRO/fRO xD) instead.
I've got not much clue  about the C language and these things , but I am willing to learn , and I hope that someone can help me with this.
thank you very much for any help , I'll go to bed now and be back later, have a nice night !

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

have you tried to read the main topic for this issue?

http://rathena.org/board/topic/63256-renewal-aspdkro-based-need-help/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  05/02/13
  • Last Seen:  

yes I've looked into that topic , I just didnt find what I was looking for ( I am looking at battle.c and battle.h right now again,trying to find the bit where the formula is , but i can't find anything so far x_x)
I was asking where the source would be located that I needed to change the aspd formula  :( and the topic doesnt really have anything to do with that,since i want to make my own formula and not use the korean one wich is goddamned low compared to the official server I play on ,hence i want to change it).

or what were you trying to get at with pointing me at that thread , please  sir?^^; 
Sorry if I dont get what you may have tried to imply on , but I'm just such a noob when it comes to coding  /sry

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  178
  • Reputation:   16
  • Joined:  06/25/12
  • Last Seen:  

kinda late for a reply, but i think you might find it in status.c since it holds the player status , like str vit and other attribute bonus , also the flee and movespeed calculations, happy hunting :)

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  05/02/13
  • Last Seen:  

Thanks Chowking ! It looks  kind of right to look there but its just so confusing and I don't know what I'm looking for exactly ._.

would anyone then happen to know how to change it or what bits define the aspd  ?im trying to find it in status.c and it looks  just so  confusing and i don't know what to look for  really X_X
I'd appreciate help regarding this very much, thank you !

 

 

guessing its somewhere around or in this  section ?x_X

 

#ifdef RENEWAL_ASPD
// flag&1 - fixed value [malufett]
// flag&2 - percentage value
static short status_calc_aspd(struct block_list *bl, struct status_change *sc, short flag)
{
    int i, pots = 0, skills1 = 0, skills2 = 0;


    if(!sc || !sc->count)
        return 0;
 

 

Edited by patsi91
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

As a suggestion that takes the concept of ASPD away from the source, depending on what you want to do with it, you can do it using functions like onpcloginevent and sc_itemscript.

 

For instance, If your server wants to promote higher ASPD when players level up, you can set an itemscript that gets applied to players depending on their levels, using the doppelganger card item script, you can adjust a passive aspd bonus using sc_itemscript depending on the variables you want to set out.

 

This moves changing entire formula of ASPD in Rathena and allows you to focus on individual variables that can affect it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  05/02/13
  • Last Seen:  

Nah I dont want to do it  via such level up boosts  , that would be  the last resort , and I highly doubt I want to do it that way.
I'd like to change the aspd formula  . I don't want to use the kRO one  , so I am trying to modify it to  the fRO (european server)  formula ... IF I can find the corresponding parts that I need to change in the source ._. 
being clueless when it comes to  programming languages  like C  doesn't help though and I might be aiming too high...but I want to succeed ...:/

 

thanks for the suggestion jasc I'll try to keep it in mind before I grow old and still haven't figured out something .;)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  178
  • Reputation:   16
  • Joined:  06/25/12
  • Last Seen:  

i think i've found what you're looking for:

Index: trunk/src/map/status.c

// Basic ASPD value
int status_base_amotion_pc(struct map_session_data* sd, struct status_data* status)
{
	int amotion;
	int classidx = pc_class2idx(sd->status.class_);
#ifdef RENEWAL_ASPD
	short mod = -1;

	switch( sd->weapontype2 ){ // adjustment for dual weilding
		case W_DAGGER:	mod = 0;	break; // 0, 1, 1
		case W_1HSWORD:
		case W_1HAXE:	mod = 1;
			if( (sd->class_&MAPID_THIRDMASK) == MAPID_GUILLOTINE_CROSS ) // 0, 2, 3
				mod = sd->weapontype2 / W_1HSWORD + W_1HSWORD / sd->weapontype2 ;
	}

	amotion = ( sd->status.weapon < MAX_WEAPON_TYPE && mod < 0 )
			? (job_info[classidx].aspd_base[sd->status.weapon]) // single weapon
			: ((job_info[classidx].aspd_base[sd->weapontype2] // dual-wield
			+ job_info[classidx].aspd_base[sd->weapontype2]) * 6 / 10 + 10 * mod
			- job_info[classidx].aspd_base[sd->weapontype2]
			+ job_info[classidx].aspd_base[sd->weapontype1]);

	if ( sd->status.shield )
			amotion += ( 2000 - job_info[classidx].aspd_base[W_FIST] ) +
					( job_info[classidx].aspd_base[MAX_WEAPON_TYPE] - 2000 );

#else
	// base weapon delay
	amotion = (sd->status.weapon < MAX_WEAPON_TYPE)
	 ? (job_info[classidx].aspd_base[sd->status.weapon]) // single weapon
	 : (job_info[classidx].aspd_base[sd->weapontype1] + job_info[classidx].aspd_base[sd->weapontype2])*7/10; // dual-wield

	// percentual delay reduction from stats
	amotion -= amotion * (4*status->agi + status->dex)/1000;
#endif
Edited by chowking
  • Love 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...