Jump to content
  • 0

Question

Posted

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 :(

17 answers to this question

Recommended Posts

  • 2
Posted

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 2
  • 0
Posted

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 
Posted

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.

Posted

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.

Posted

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.

Posted (edited)

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
Posted

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;
		}
	}
}


Posted

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
Posted

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

Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...