Jump to content
  • 0

Two questions.


Erebos

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

1) How can i remove or replace certain achievement rewards?

 

2) How can i make the Instant Cast requirements depend on the job, what i exactly want to do is keep the 3rd jobs renewal cast as it is, but if you are a 2nd Job your cast would be depending on your dex only. Fixed and Variable cast times like always on 3rd jobs, but only Variable and 150 dex required for instant cast on 2nd jobs.

Thanks in advance.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

1) Edit db/pre-re or db/re achievement_db.yml

 

2) Test this:

skill.cpp

Change:

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

	nullpo_ret(bl);

#ifndef RENEWAL_CAST
	{
		struct map_session_data *sd = BL_CAST(BL_PC, bl);
		struct status_change *sc = status_get_sc(bl);
		int reduce_cast_rate = 0;
		uint8 flag = skill_get_castnodex(skill_id);

		// Calculate base cast time (reduced by dex)
		if (!(flag&1)) {
			int scale = battle_config.castrate_dex_scale - status_get_dex(bl);

			if (scale > 0)	// not instant cast
				time = time * (float)scale / battle_config.castrate_dex_scale;
			else
				return 0; // instant cast
		}

		// Calculate cast time reduced by item/card bonuses
		if (sd) {
			if (!(flag&4) && sd->castrate != 100)
				reduce_cast_rate += 100 - sd->castrate;
			// Skill-specific reductions work regardless of flag
			for (const auto &it : sd->skillcastrate) {
				if (it.id == skill_id) {
					time += time * it.val / 100;
					break;
				}
			}
		}

		// These cast time reductions are processed even if the skill fails
		if (sc && sc->count) {
			// Magic Strings stacks additively with item bonuses
			if (!(flag&2) && sc->data[SC_POEMBRAGI])
				reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
			// Foresight halves the cast time, it does not stack additively
			if (sc->data[SC_MEMORIZE]) {
				if(!(flag&2))
					time -= time * 50 / 100;
				// Foresight counter gets reduced even if the skill is not affected by it
				if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
					status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
			}
		}

		time = time * (1 - (float)reduce_cast_rate / 100);
	}
#endif

	// config cast time multiplier
	if (battle_config.cast_rate != 100)
		time = time * battle_config.cast_rate / 100;
	// return final cast time
	time = max(time, 0);
	//ShowInfo("Castime castfix = %f\n",time);

	return (int)time;
}

to:

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

	nullpo_ret(bl);

	struct map_session_data *sd = BL_CAST(BL_PC, bl);
	struct status_change *sc = status_get_sc(bl);
	int reduce_cast_rate = 0;
	uint8 flag = skill_get_castnodex(skill_id);

	if(sd) {

		if(sd->class_ & ~MAPID_THIRDMASK) {
			// Calculate base cast time (reduced by dex)
			if (!(flag&1)) {

				int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
				if (scale > 0)	// not instant cast
					time = time * (float)scale / battle_config.castrate_dex_scale;
				else
					return 0; // instant cast
			}
			if (!(flag&4) && sd->castrate != 100)
				reduce_cast_rate += 100 - sd->castrate;
			// Skill-specific reductions work regardless of flag
			for (const auto &it : sd->skillcastrate) {
				if (it.id == skill_id) {
					time += time * it.val / 100;
					break;
				}
			}
			// These cast time reductions are processed even if the skill fails
			if (sc && sc->count) {
				// Magic Strings stacks additively with item bonuses
				if (!(flag&2) && sc->data[SC_POEMBRAGI])
					reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
				// Foresight halves the cast time, it does not stack additively
				if (sc->data[SC_MEMORIZE]) {
					if(!(flag&2))
						time -= time * 50 / 100;
					// Foresight counter gets reduced even if the skill is not affected by it
					if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
						status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
				}
			}
            time = time * (1 - (float)reduce_cast_rate / 100);
		}
	}

	// config cast time multiplier
	if (battle_config.cast_rate != 100)
		time = time * battle_config.cast_rate / 100;
	// return final cast time
	time = max(time, 0);
	//ShowInfo("Castime castfix = %f\n",time);

	return (int)time;
}

 

Edited by n0tttt
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

@n0tttt Still i cant get instant cast with 150 dex with 2nd jobs. I cant spot any significant changes.

Edited by Brizyous
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

Brizyous did you recompile your server? 

after source edit?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

Yes, i did recompile the server.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  154
  • Reputation:   6
  • Joined:  10/14/17
  • Last Seen:  

try readding the

#ifndef RENEWAL_CAST

and 

#endif

 


 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

3 hours ago, lllaaazzz said:

try readding the


#ifndef RENEWAL_CAST

and 

#endif

 


 

Nope, didn't work.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  154
  • Reputation:   6
  • Joined:  10/14/17
  • Last Seen:  

12 hours ago, Brizyous said:

Nope, didn't work.

Just to be clear, 

you want third job to have fixed and variable cast time

but you want trans class to be able to hit insta cast with 150 dex? But Third cant?

 

Im assuming this is for a split pvp ? 

 

Edited by lllaaazzz
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

22 minutes ago, lllaaazzz said:

Just to be clear, 

you want third job to have fixed and variable cast time

but you want trans class to be able to hit insta cast with 150 dex? But Third cant?

 

Im assuming this is for a split pvp ? 

 

Yes, i want 3rd job pvp and woe, and 2nd job pvp woe, so i need 2nd jobs to have a separated cast formulla.

  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

1 to 3 need source

1. Is this for server wide?

2. or is it specific for pvp map / gvg map only?

3. not for 3rd job the insta cast?? if dex 150?

 

this one is easier.

4.  Alternatively you could create a custom item with the command to check for Thirdjob

and give that custom item these two item script 

        bonus bVariableCastrate,-100;
        bonus bFixedCastrate,-100;

and only give this custom item to non third job

Edited by utofaery
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

29 minutes ago, utofaery said:

1 to 3 need source

1. Is this for server wide?

2. or is it specific for pvp map / gvg map only?

3. not for 3rd job the insta cast?? if dex 150?

 

this one is easier.

4.  Alternatively you could create a custom item with the command to check for Thirdjob

and give that custom item these two item script 

        bonus bVariableCastrate,-100;
        bonus bFixedCastrate,-100;

and only give this custom item to non third job

Yes, server wide.
Nop, 3rd Jobs have to keep their cast as it is. 2nd jobs have to be able to reach instant cast at 150 dex with all their skills.

I like the item script but its not practical, players would lose an item slot. What i want i saw it in other servers so i know its possible but i think is very difficult.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

1 hour ago, Brizyous said:

Yes, server wide.
Nop, 3rd Jobs have to keep their cast as it is. 2nd jobs have to be able to reach instant cast at 150 dex with all their skills.

I like the item script but its not practical, players would lose an item slot. What i want i saw it in other servers so i know its possible but i think is very difficult.

n0tttt has given a little mistakes i think:

~ << this should be >> !

Try the below one :  (and remember to recompile after you change anything in source)

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

	nullpo_ret(bl);

	struct map_session_data *sd = BL_CAST(BL_PC, bl);
	struct status_change *sc = status_get_sc(bl);
	int reduce_cast_rate = 0;
	uint8 flag = skill_get_castnodex(skill_id);

	if(sd) {

		if(sd->class_ & !MAPID_THIRDMASK) {
			// Calculate base cast time (reduced by dex)
			if (!(flag&1)) {

				int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
				if (scale > 0)	// not instant cast
					time = time * (float)scale / battle_config.castrate_dex_scale;
				else
					return 0; // instant cast
			}
			if (!(flag&4) && sd->castrate != 100)
				reduce_cast_rate += 100 - sd->castrate;
			// Skill-specific reductions work regardless of flag
			for (const auto &it : sd->skillcastrate) {
				if (it.id == skill_id) {
					time += time * it.val / 100;
					break;
				}
			}
			// These cast time reductions are processed even if the skill fails
			if (sc && sc->count) {
				// Magic Strings stacks additively with item bonuses
				if (!(flag&2) && sc->data[SC_POEMBRAGI])
					reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
				// Foresight halves the cast time, it does not stack additively
				if (sc->data[SC_MEMORIZE]) {
					if(!(flag&2))
						time -= time * 50 / 100;
					// Foresight counter gets reduced even if the skill is not affected by it
					if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
						status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
				}
			}
            time = time * (1 - (float)reduce_cast_rate / 100);
		}
	}

	// config cast time multiplier
	if (battle_config.cast_rate != 100)
		time = time * battle_config.cast_rate / 100;
	// return final cast time
	time = max(time, 0);
	//ShowInfo("Castime castfix = %f\n",time);

	return (int)time;
}

 

This was tested working in hercules:

Spoiler

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

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

        sd = BL_CAST(BL_PC, bl);
        if ( (sd)->job & !MAPID_THIRDMASK ) {//xsa
//xsa        if(sd->class_ & ~MAPID_THIRDMASK) {//xsa
            // 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.id; i++ )
                {
                    if( sd->skillcast.id == skill_id )
                    {
                        time+= time * sd->skillcast.val / 100;
                        break;
                    }
                }
            }
        }//xsa
//xsa    }
//xsa#endif

    // config cast time multiplier
    if (battle_config.cast_rate != 100)
        time = time * battle_config.cast_rate / 100;
    // return final cast time
    time = max(time, 0);

    //ShowInfo("Castime castfix = %d\n",time);
    return time;
}

 

Edited by utofaery
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

56 minutes ago, utofaery said:

n0tttt has given a little mistakes i think:

~ << this should be >> !

Try the below one :  (and remember to recompile after you change anything in source)


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

	nullpo_ret(bl);

	struct map_session_data *sd = BL_CAST(BL_PC, bl);
	struct status_change *sc = status_get_sc(bl);
	int reduce_cast_rate = 0;
	uint8 flag = skill_get_castnodex(skill_id);

	if(sd) {

		if(sd->class_ & !MAPID_THIRDMASK) {
			// Calculate base cast time (reduced by dex)
			if (!(flag&1)) {

				int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
				if (scale > 0)	// not instant cast
					time = time * (float)scale / battle_config.castrate_dex_scale;
				else
					return 0; // instant cast
			}
			if (!(flag&4) && sd->castrate != 100)
				reduce_cast_rate += 100 - sd->castrate;
			// Skill-specific reductions work regardless of flag
			for (const auto &it : sd->skillcastrate) {
				if (it.id == skill_id) {
					time += time * it.val / 100;
					break;
				}
			}
			// These cast time reductions are processed even if the skill fails
			if (sc && sc->count) {
				// Magic Strings stacks additively with item bonuses
				if (!(flag&2) && sc->data[SC_POEMBRAGI])
					reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
				// Foresight halves the cast time, it does not stack additively
				if (sc->data[SC_MEMORIZE]) {
					if(!(flag&2))
						time -= time * 50 / 100;
					// Foresight counter gets reduced even if the skill is not affected by it
					if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
						status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
				}
			}
            time = time * (1 - (float)reduce_cast_rate / 100);
		}
	}

	// config cast time multiplier
	if (battle_config.cast_rate != 100)
		time = time * battle_config.cast_rate / 100;
	// return final cast time
	time = max(time, 0);
	//ShowInfo("Castime castfix = %f\n",time);

	return (int)time;
}

 

This was tested working in hercules:

  Hide contents

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

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

        sd = BL_CAST(BL_PC, bl);
        if ( (sd)->job & !MAPID_THIRDMASK ) {//xsa
//xsa        if(sd->class_ & ~MAPID_THIRDMASK) {//xsa
            // 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.id; i++ )
                {
                    if( sd->skillcast.id == skill_id )
                    {
                        time+= time * sd->skillcast.val / 100;
                        break;
                    }
                }
            }
        }//xsa
//xsa    }
//xsa#endif

    // config cast time multiplier
    if (battle_config.cast_rate != 100)
        time = time * battle_config.cast_rate / 100;
    // return final cast time
    time = max(time, 0);

    //ShowInfo("Castime castfix = %d\n",time);
    return time;
}

 1234.PNG.0ef07905a66dc267250df1fc1178bc7f.PNG

Im getting this errors when recompiling.

4321.PNG

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

Not the hercules one but this one..

sorry for posting different code

 

1 hour ago, utofaery said:

 


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

	nullpo_ret(bl);

	struct map_session_data *sd = BL_CAST(BL_PC, bl);
	struct status_change *sc = status_get_sc(bl);
	int reduce_cast_rate = 0;
	uint8 flag = skill_get_castnodex(skill_id);

	if(sd) {

		if(sd->class_ & !MAPID_THIRDMASK) {
			// Calculate base cast time (reduced by dex)
			if (!(flag&1)) {

				int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
				if (scale > 0)	// not instant cast
					time = time * (float)scale / battle_config.castrate_dex_scale;
				else
					return 0; // instant cast
			}
			if (!(flag&4) && sd->castrate != 100)
				reduce_cast_rate += 100 - sd->castrate;
			// Skill-specific reductions work regardless of flag
			for (const auto &it : sd->skillcastrate) {
				if (it.id == skill_id) {
					time += time * it.val / 100;
					break;
				}
			}
			// These cast time reductions are processed even if the skill fails
			if (sc && sc->count) {
				// Magic Strings stacks additively with item bonuses
				if (!(flag&2) && sc->data[SC_POEMBRAGI])
					reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
				// Foresight halves the cast time, it does not stack additively
				if (sc->data[SC_MEMORIZE]) {
					if(!(flag&2))
						time -= time * 50 / 100;
					// Foresight counter gets reduced even if the skill is not affected by it
					if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
						status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
				}
			}
            time = time * (1 - (float)reduce_cast_rate / 100);
		}
	}

	// config cast time multiplier
	if (battle_config.cast_rate != 100)
		time = time * battle_config.cast_rate / 100;
	// return final cast time
	time = max(time, 0);
	//ShowInfo("Castime castfix = %f\n",time);

	return (int)time;
}

 

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   4
  • Joined:  10/25/18
  • Last Seen:  

1 hour ago, utofaery said:

Not the hercules one but this one..

sorry for posting different code

 

 

I'm getting this errors now.

Edit: Fixed the errors but i still doesn't work. Tested with a Champion then a Sura: the Dangerous Soul Collect/Zen skill still has the same fixed cast on both.

6565.PNG

Edited by Brizyous
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...