Jump to content
  • 0

Skill Src Questions


Yonko

Question


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

I have a custom skill how will i make it usable if a certain other skill is being used?

example scenario
I used increase agility as my skill on my self then the custom skill can now be used once.

Thanks

Edited by Yonko
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  802
  • Reputation:   229
  • Joined:  01/30/13
  • Last Seen:  

Well, you have to work with status changes.

Basically you do:

if(sc && sc->data[SC_MYSTATUSCHANGE]) skillcode;
Check skill.c, you can look at Monk combos to see examples:

		case MO_CHAINCOMBO:
			if(!sc)
				return false;
			if(sc->data[SC_BLADESTOP])
				break;
			if(sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == MO_TRIPLEATTACK)
				break;
			return false;
		case MO_COMBOFINISH:
			if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == MO_CHAINCOMBO))
				return false;
			break;
		case CH_TIGERFIST:
			if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == MO_COMBOFINISH))
				return false;
			break;
		case CH_CHAINCRUSH:
			if(!(sc && sc->data[SC_COMBO]))
				return false;
			if(sc->data[SC_COMBO]->val1 != MO_COMBOFINISH && sc->data[SC_COMBO]->val1 != CH_TIGERFIST)
				return false;
			break;
		case MO_EXTREMITYFIST:
	//		if(sc && sc->data[SC_EXTREMITYFIST]) //To disable Asura during the 5 min skill block uncomment this...
	//			return false;
			if( sc && (sc->data[SC_BLADESTOP] || sc->data[SC_CURSEDCIRCLE_ATKER]) )
				break;
			if( sc && sc->data[SC_COMBO] ) {
				switch(sc->data[SC_COMBO]->val1) {
					case MO_COMBOFINISH:
					case CH_TIGERFIST:
					case CH_CHAINCRUSH:
						break;
					default:
						return false;
				}
			}
in function "skill_check_condition_castbegin".

If you just want the increase agi status change to be a requirement to use another skill you can just check for that status change, very easy.

But if you only want to allow the other skill if you used increase agi yourself, then you need to make increase agi give the SC_COMBO status change to yourself and set "val1" to AL_INCAGI.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

so sc->data[SC_COMBO]->MYCUSTOM_SKILL)?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  802
  • Reputation:   229
  • Joined:  01/30/13
  • Last Seen:  

Well you need to do two things:

1. Make the required skill start SC_COMBO.

This can be doen by adding the skill to skill_combo:

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
This one is pretty self-explanatory. In section "Start new combo", add the required skill and give it a duration.

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
		case AL_INCAGI:
			if (pc_checkskill(sd, MYCUSTOM_SKILL) > 0)
				duration=1;
			break;
That means during AL_INCAGI effect you can do a combo. You can also set a fixed duration like 2000, that means you can do the combo until 2 seconds after the cast of AL_INCAGI.

2. Now when using your new skill, add the code as explained above (see part I quoted).

It would look like this:

case MYCUSTOM_SKILL:
  if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI))
    return false;
  break;
That way you check if the combo was triggered by AL_INCAGI. If it's not the case you return false = "skill not possible".

If you don't like the negation you can also do it the other way around:

case MYCUSTOM_SKILL:
  if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI)
    break;
  return false;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

Well you need to do two things:

1. Make the required skill start SC_COMBO.

This can be doen by adding the skill to skill_combo:

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
This one is pretty self-explanatory. In section "Start new combo", add the required skill and give it a duration.

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
		case AL_INCAGI:
			if (pc_checkskill(sd, MYCUSTOM_SKILL) > 0)
				duration=1;
			break;
That means during AL_INCAGI effect you can do a combo. You can also set a fixed duration like 2000, that means you can do the combo until 2 seconds after the cast of AL_INCAGI.

2. Now when using your new skill, add the code as explained above (see part I quoted).

It would look like this:

case MYCUSTOM_SKILL:
  if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI))
    return false;
  break;
That way you check if the combo was triggered by AL_INCAGI. If it's not the case you return false = "skill not possible".

If you don't like the negation you can also do it the other way around:

case MYCUSTOM_SKILL:
  if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI)
    break;
  return false;

Thank you i'll test it when i get home :)/no1

 

Well you need to do two things:

1. Make the required skill start SC_COMBO.

This can be doen by adding the skill to skill_combo:

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
This one is pretty self-explanatory. In section "Start new combo", add the required skill and give it a duration.

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
		case AL_INCAGI:
			if (pc_checkskill(sd, MYCUSTOM_SKILL) > 0)
				duration=1;
			break;
That means during AL_INCAGI effect you can do a combo. You can also set a fixed duration like 2000, that means you can do the combo until 2 seconds after the cast of AL_INCAGI.

2. Now when using your new skill, add the code as explained above (see part I quoted).

It would look like this:

case MYCUSTOM_SKILL:
  if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI))
    return false;
  break;
That way you check if the combo was triggered by AL_INCAGI. If it's not the case you return false = "skill not possible".

If you don't like the negation you can also do it the other way around:

case MYCUSTOM_SKILL:
  if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI)
    break;
  return false;

Thank you i'll test it when i get home :)/no1

 

 

 

Well you need to do two things:

1. Make the required skill start SC_COMBO.

This can be doen by adding the skill to skill_combo:

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
This one is pretty self-explanatory. In section "Start new combo", add the required skill and give it a duration.

void skill_combo(struct block_list* src,struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int tick){
		case AL_INCAGI:
			if (pc_checkskill(sd, MYCUSTOM_SKILL) > 0)
				duration=1;
			break;
That means during AL_INCAGI effect you can do a combo. You can also set a fixed duration like 2000, that means you can do the combo until 2 seconds after the cast of AL_INCAGI.

2. Now when using your new skill, add the code as explained above (see part I quoted).

It would look like this:

case MYCUSTOM_SKILL:
  if(!(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI))
    return false;
  break;
That way you check if the combo was triggered by AL_INCAGI. If it's not the case you return false = "skill not possible".

If you don't like the negation you can also do it the other way around:

case MYCUSTOM_SKILL:
  if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == AL_INCAGI)
    break;
  return false;

Thanks it works =)

just another out of topic question

I know that this source will change  animation effect of a certain skill. 

clif_specialeffect(bl, 405, AREA);

clif_specialeffect(src, 405, AREA);

My question is how will i do a certain skill effect using source which display a certain shape example the sanctuary which is literally a rectangular pattern, how will i modify the sanctuary into a magnus exorcismus effect which the skill's effect display many sanctuary effect. Hope you get it lol sorry for the bad english =) /no1

 

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