Jump to content
  • 0

Instacast - would this be easy to do?


michaelsoftman

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  410
  • Reputation:   29
  • Joined:  04/04/12
  • Last Seen:  

Would it be easy to code in different instacast values for 1st and high class, 2nd and trans, and 3rd class?

In other words, something like

insta for 1st class - 99 dex

Insta for trans - 150 dex

Insta for 3rd - 190 dex

If so, can someone point me in the right direction?

  • Upvote 1
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


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

Maybe try searching in skill.c skill.h or battle.c battle.h

You will definitely need to add arguments that will specify the classes, I have never done an edit like this, good luck!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

here I'll give you a clue..


/*==========================================
* Does cast-time reductions based on dex, item bonuses and config setting
*------------------------------------------*/
int skill_castfix (struct block_list *bl, int skill_id, int skill_lv) {
int time = skill_get_cast(skill_id, skill_lv);

nullpo_ret(bl);
#ifndef RENEWAL_CAST
{
	struct map_session_data *sd;

	sd = BL_CAST(BL_PC, bl);

	// calculate base cast time (reduced by dex)
	if( !(skill_get_castnodex(skill_id, skill_lv)&1) ) {
		int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
		if( scale > 0 )	// not instant cast
			time = time * scale / battle_config.castrate_dex_scale;
		else
			return 0;	// instant cast
	}

	// calculate cast time reduced by item/card bonuses
	if( !(skill_get_castnodex(skill_id, skill_lv)&4) && sd )
	{
		int i;
		if( sd->castrate != 100 )
			time = time * sd->castrate / 100;
		for( i = 0; i < ARRAYLENGTH(sd->skillcast) && sd->skillcast[i].id; i++ )
		{
			if( sd->skillcast[i].id == skill_id )
			{
				time+= time * sd->skillcast[i].val / 100;
				break;
			}
		}
	}

}
#endif
// config cast time multiplier
if (battle_config.cast_rate != 100)
	time = time * battle_config.cast_rate / 100;
// return final cast time
return (time > 0) ? time : 0;
}

and sorry I can't do it for you right now.. :)

:meow:

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

your request is good idea. :D

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...