Jump to content
  • 0

Bragi/Dancer Status Effect Timers


Dragonis1701

Question


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   7
  • Joined:  05/25/12
  • Last Seen:  

Hi. So, I added status effect icons for the dancer and bard songs. I noticed that when a player enters the song, the status icon timer is the time the song would last. So, Poem of Bragi has a status icon that says it will last for 3 minutes, regardless of when the player entered the song. I'm trying to change it so that the timer will now say 20 seconds, and refresh every second, as it does for when a player is in the song effect. Since I can't find a timer in general on status.c, I'm not exactly sure where to start. Can someone help me? )X

 

Some additional information: It seems that when the player relogs while under the effects of Poem of Bragi, the timer is correct when they log back in. Showing a timer less than 20 seconds.

Edited by Dragonis1701
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   8
  • Joined:  03/05/12
  • Last Seen:  

I solved this problem as follows: 

		case UNT_WHISTLE:
		case UNT_ASSASSINCROSS:
		case UNT_POEMBRAGI:
		case UNT_APPLEIDUN:
		case UNT_HUMMING:
		case UNT_DONTFORGETME:
		case UNT_FORTUNEKISS:
		case UNT_SERVICEFORYOU:
			if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER))
				return 0;

			if (!sc) return 0;
			if (!sce)
				sc_start4(ss, bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,sg->limit); // edit this line
			else if (sce->val4 == 1) { //Readjust timers since the effect will not last long.
				sce->val4 = 0; //remove the mark that we stepped out
				delete_timer(sce->timer, status_change_timer);
				sce->timer = add_timer(tick+sg->limit, status_change_timer, bl->id, type); //put duration back to 3min
			}
			break;

to:

		case UNT_WHISTLE:
		case UNT_ASSASSINCROSS:
		case UNT_POEMBRAGI:
		case UNT_APPLEIDUN:
		case UNT_HUMMING:
		case UNT_DONTFORGETME:
		case UNT_FORTUNEKISS:
		case UNT_SERVICEFORYOU:
			if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER))
				return 0;

			if (!sc) return 0;
			if (!sce)
				sc_start4(ss, bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,skill_get_time2(sg->skill_id,sg->skill_lv)); // edit this line
			else if (sce->val4 == 1) { //Readjust timers since the effect will not last long.
				sce->val4 = 0; //remove the mark that we stepped out
				delete_timer(sce->timer, status_change_timer);
				sce->timer = add_timer(tick+sg->limit, status_change_timer, bl->id, type); //put duration back to 3min
			}
			break;

This topic is old, but should help someone.

Edited by Fry
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   7
  • Joined:  05/25/12
  • Last Seen:  

Alright, so what I have so far is:

case UNT_WHISTLE:
        case UNT_ASSASSINCROSS:
        case UNT_POEMBRAGI:
        case UNT_APPLEIDUN:
        case UNT_HUMMING:
        case UNT_DONTFORGETME:
        case UNT_FORTUNEKISS:
        case UNT_SERVICEFORYOU:
            if (sg->src_id==bl->id && !(sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER))
                return 0;

            if (!sc) return 0;
            if (!sce)
                sc_start4(ss, bl,type,100,sg->skill_lv,sg->val1,sg->val2,0,-1);
            else if (sce->val4 == 1) { //Readjust timers since the effect will not last long.
                sce->val4 = 0; //remove the mark that we stepped out
                delete_timer(sce->timer, status_change_timer);
                sce->timer = add_timer(tick+sg->limit, status_change_timer, bl->id, -1);
            }
            break;

I have a fair grasp on what this means. sce = status change end. Val4 means it's started but if the player re-enters song effect, they get the buff replenished. That's all fine but what I'm having issues with is here:

case BA_POEMBRAGI:
        case BA_WHISTLE:
        case BA_ASSASSINCROSS:
        case BA_APPLEIDUN:
        case DC_HUMMING:
        case DC_DONTFORGETME:
        case DC_FORTUNEKISS:
        case DC_SERVICEFORYOU:
            if (sce)
            {
                //NOTE: It'd be nice if we could get the skill_lv for a more accurate extra time, but alas...
                //not possible on our current implementation.
                sce->val4 = 1; //Store the fact that this is a "reduced" duration effect.
                sce->timer = add_timer(tick+20000, status_change_timer, bl->id, type);
            }
            break;

Now, I have it so that players lose the effect after 20 seconds, which is standard. I deleted the delete_timer because it would shell out errors with a -1 effect timer. The effect still ends properly but what I want to do is, I want to get a sc here to replace the timer with 20 seconds when the player leaves the song effect so people know when it will end. I already have it that when they re-enter they will get the timer replenished but I don't know how to get a sc_start in this function without it erroring. Help. =X

Edited by Dragonis1701
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  140
  • Reputation:   11
  • Joined:  09/28/14
  • Last Seen:  

Whats the progress on this one?

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