Jump to content
  • 0
eboni001

How to disable this delay

Question

helo guys does somebody know how to disable the @warp and @go delay when facing mobs? i only want it enable for pvp but this is desperating when i get hitted by a mob and i cant warp out, please somebody help me with this :(

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

now is working, thanks for your help, you are really Awesome ^_^, Power to you, there's any way to apply this delay when you inflict damage to another player too? because this delay is working only when you receive damage from another players ^_^.

 

 

I imagine there are better ways of doing this but whatever works right.

void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
	unsigned int tick = gettick(); 
	int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want 
	struct map_session_data *md = (struct map_session_data *)src;

	if (sp) clif_updatestatus(sd,SP_SP);
	if (hp) clif_updatestatus(sd,SP_HP);
	else return;

	if( !src || src == &sd->bl )
		return;

	if(src->type == BL_PC) {
		sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 
		md->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 
	}

	if( pc_issit(sd) )
	{
		pc_setstand(sd);
		skill_sit(sd,0);
	}

	if( sd->progressbar.npc_id )
		clif_progressbar_abort(sd);

	if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
		pet_target_check(sd,src,1);

	if( sd->status.ele_id > 0 )
		elemental_set_target(sd,src);

	sd->canlog_tick = gettick();
}
  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Hello, this doesn't work anymore with the latest git 😞

Share this post


Link to post
Share on other sites
  • -2

how about to use flywing or butterflywing does it delay of teleporting somewhere else if been hit by any mobs or characters?

 

Share this post


Link to post
Share on other sites

this guide is to enable the delay, but i need to know how to disable delay when facing mobs, i only want it works for pvp.

Share this post


Link to post
Share on other sites

then show your custom source mod...we dont know how you implement ur own custom src mod for this ==''

Share this post


Link to post
Share on other sites

then show your custom source mod...we dont know how you implement ur own custom src mod for this ==''

sry sir emistry im newbie in this im not sure about what mods are you talking about. :( to enable @warp and @go delay i just follow steps in this guide @go_delay_when_hit. but now people complaining they can't warp when a mob hit them.

Share this post


Link to post
Share on other sites

Have you tried changing-

int warpgodelaycd = 5000;

In src/map/pc.c

 

to something like-

int warpgodelaycd = 0;

Share this post


Link to post
Share on other sites

Have you tried changing-

 

int warpgodelaycd = 5000;

In src/map/pc.c

 

to something like-

 

int warpgodelaycd = 0;

ok i tried but now the delay has been removed in pvp too, i want the delay when you hit or hited for another player, but i want you can warp if you are facing only mobs.

Share this post


Link to post
Share on other sites

ok i tried but now the delay has been removed in pvp too, i want the delay when you hit or hited for another player, but i want you can warp if you are facing only mobs.

 

Oh I didn't know that's what you wanted.

 

In pc.c

 

After:

int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want

Make sure you change that back to 5000...

 

Replace:

sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer

 

With:

	if(src->type == BL_PC)
		sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 

Share this post


Link to post
Share on other sites

ok i tried but now the delay has been removed in pvp too, i want the delay when you hit or hited for another player, but i want you can warp if you are facing only mobs.

 

Oh I didn't know that's what you wanted.

 

In pc.c

 

After:

 

int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want

Make sure you change that back to 5000...

 

Replace:

 

sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer

 

With:

	if(src->type == BL_PC)
		sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 

i did it, but now when i try to use any skill or try to pvp server get disconected and when i try to log in, server rejected me, to can log in i have to restart my server.

Share this post


Link to post
Share on other sites

i did it, but now when i try to use any skill or try to pvp server get disconected and when i try to log in, server rejected me, to can log in i have to restart my server.

 

Post the code from pc.c not the whole file though just the parts you edited, and tell me if the compliler has an errors.

 

Edit:

 

Move:

	if(src->type == BL_PC)
		sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 

 

Below:

	if( !src || src == &sd->bl )
		return;

 

Or else command that do damage like @heal -1 or @die will crash the map server.

Edited by Skorm

Share this post


Link to post
Share on other sites

i did it, but now when i try to use any skill or try to pvp server get disconected and when i try to log in, server rejected me, to can log in i have to restart my server.

 

Post the code from pc.c not the whole file though just the parts you edited, and tell me if the compliler has an errors.

 

Edit:

 

Move:

	if(src->type == BL_PC)
		sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 

 

Below:

	if( !src || src == &sd->bl )
		return;

 

Or else command that do damage like @heal -1 or @die will crash the map server.

 

this is my code, when i add this, recompile in putty said my compile may be incomplete:

 

/*==========================================
 * Invoked when a player has received damage
 *------------------------------------------*/
void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
	unsigned int tick = gettick();
	int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want
    if(src->type == BL_PC)
        sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 	 

	if (sp) clif_updatestatus(sd,SP_SP);
	if (hp) clif_updatestatus(sd,SP_HP);
	else return;

	if( !src || src == &sd->bl )
		return;

	if( pc_issit(sd) ) {
		pc_setstand(sd);
		skill_sit(sd,0);
	}

	if( sd->progressbar.npc_id )
		clif_progressbar_abort(sd);

	if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
		pet_target_check(sd,src,1);

	if( sd->status.ele_id > 0 )
		elemental_set_target(sd,src);

	sd->canlog_tick = gettick();
}

int pc_close_npc_timer(int tid, unsigned int tick, int id, intptr_t data)
{
	TBL_PC *sd = map_id2sd(id);
	if(sd) pc_close_npc(sd,data);
	return 0;
}
/*
 *  Method to properly close npc for player and clear anything related
 * @flag == 1 : produce close button
 * @flag == 2 : directly close it
 */
void pc_close_npc(struct map_session_data *sd,int flag)
{
	nullpo_retv(sd);

	if (sd->npc_id || sd->npc_shopid) {
		if (sd->state.using_fake_npc) {
			clif_clearunit_single(sd->npc_id, CLR_OUTSIGHT, sd->fd);
			sd->state.using_fake_npc = 0;
		}

		if (sd->st) {
			if(sd->st->state == RUN){ //wait ending code execution
				add_timer(gettick()+500,pc_close_npc_timer,sd->bl.id,flag);
				return;
			}
			sd->st->state = ((flag==1 && sd->st->mes_active)?CLOSE:END);
			sd->st->mes_active = 0;
		}
		sd->state.menu_or_input = 0;
		sd->npc_menu = 0;
		sd->npc_shopid = 0;
#ifdef SECURE_NPCTIMEOUT
		sd->npc_idle_timer = INVALID_TIMER;
#endif
		clif_scriptclose(sd,sd->npc_id);
		if(sd->st && sd->st->state == END ) {// free attached scripts that are waiting
			script_free_state(sd->st);
			sd->st = NULL;
			sd->npc_id = 0;
		}
	}
}


Share this post


Link to post
Share on other sites

this is my code, when i add this, recompile in putty said my compile may be incomplete:

 

 

void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
    unsigned int tick = gettick();
    int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want

    if (sp) clif_updatestatus(sd,SP_SP);
    if (hp) clif_updatestatus(sd,SP_HP);
    else return;

    if( !src || src == &sd->bl )
        return;

    if(src->type == BL_PC)
        sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer

    if( pc_issit(sd) )
    {
        pc_setstand(sd);
        skill_sit(sd,0);
    }

    if( sd->progressbar.npc_id )
        clif_progressbar_abort(sd);

    if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
        pet_target_check(sd,src,1);

    if( sd->status.ele_id > 0 )
        elemental_set_target(sd,src);

    sd->canlog_tick = gettick();
}

 

If that doesn't work perhaps the problem is somewhere else. :)

 

Make sure your servers are all closed before recompiling etc etc.

  • Upvote 1

Share this post


Link to post
Share on other sites

this is my code, when i add this, recompile in putty said my compile may be incomplete:

 

 

 

void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
    unsigned int tick = gettick();
    int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want

    if (sp) clif_updatestatus(sd,SP_SP);
    if (hp) clif_updatestatus(sd,SP_HP);
    else return;

    if( !src || src == &sd->bl )
        return;

    if(src->type == BL_PC)
        sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer

    if( pc_issit(sd) )
    {
        pc_setstand(sd);
        skill_sit(sd,0);
    }

    if( sd->progressbar.npc_id )
        clif_progressbar_abort(sd);

    if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
        pet_target_check(sd,src,1);

    if( sd->status.ele_id > 0 )
        elemental_set_target(sd,src);

    sd->canlog_tick = gettick();
}

 

If that doesn't work perhaps the problem is somewhere else. :)

 

Make sure your servers are all closed before recompiling etc etc.

now is working, thanks for your help, you are really Awesome ^_^, Power to you, there's any way to apply this delay when you inflict damage to another player too? because this delay is working only when you receive damage from another players ^_^.

Share this post


Link to post
Share on other sites

now is working, thanks for your help, you are really Awesome ^_^, Power to you, there's any way to apply this delay when you inflict damage to another player too? because this delay is working only when you receive damage from another players ^_^.

 

 

I imagine there are better ways of doing this but whatever works right.

void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp)
{
	unsigned int tick = gettick(); 
	int warpgodelaycd = 5000; //This is the delay in milliseconds you can set what ever delay you want 
	struct map_session_data *md = (struct map_session_data *)src;

	if (sp) clif_updatestatus(sd,SP_SP);
	if (hp) clif_updatestatus(sd,SP_HP);
	else return;

	if( !src || src == &sd->bl )
		return;

	if(src->type == BL_PC) {
		sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 
		md->warpgodelay_tick = tick+warpgodelaycd; //This is the timer 
	}

	if( pc_issit(sd) )
	{
		pc_setstand(sd);
		skill_sit(sd,0);
	}

	if( sd->progressbar.npc_id )
		clif_progressbar_abort(sd);

	if( sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support )
		pet_target_check(sd,src,1);

	if( sd->status.ele_id > 0 )
		elemental_set_target(sd,src);

	sd->canlog_tick = gettick();
}

You Are Awesome, Really Thanks!!

Share this post


Link to post
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.