Jump to content

Recommended Posts

Posted

index.php?app=downloads&module=display&section=screenshot&id=2356

File Name: @Warp / @Go Damage Delay

File Submitter: Ind

File Submitted: 16 Apr 2012

File Category: Source Modifications

Made this modification based on a user request http://rathena.org/board/topic/61753-warp-delay/

This modification allows you to setup a delay in milliseconds between last received / issued player damage and a use of @warp/@go.

By default it ships with a 5 second (5000 milliseconds) delay, and it won't work on GMs


Customizing:

- Changing @go delay

You'll find this in atcommand.c

if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
	clif_displaymessage(fd,"@go cannot be issued since you were into battle recently");
	return -1;
}

Change the 5000ms (5s) to your desired value.

- Changing @warp delay

You'll find this in atcommand.c

if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
	clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently");
	return -1;
}

Change the 5000ms (5s) to your desired value.

- Make it not count if player was damaged by monster

You'll find this in pc.c

sd->canlog_tick = gettick();
if( src->type == BL_PC )
	((TBL_PC*)src)->canlog_tick = gettick();

Change to

if( src->type == BL_PC ) {
	((TBL_PC*)src)->canlog_tick = gettick();
	sd->canlog_tick = gettick();
}

so that the delay will only count when damaged vs a player / when a player damages each other.

Click here to download this file

  • Upvote 3
  • 2 months later...
Posted (edited)

im getting this error:

src\map\atcommand.c(458) : warning C4013: 'pc_get_group_level' undefined; assuming extern returning int

im using eathena

Edited by Hyoru
Posted

Group levels are rAthena only, you'll want to do a GM level check instead:

battle_config.any_warp_GM_min_level > pc_isGM(sd)

  • Upvote 1
  • 2 weeks later...
Posted (edited)

index.php?app=downloads&module=display&section=screenshot&id=2356

File Name: @Warp / @Go Damage Delay

File Submitter: Ind

File Submitted: 16 Apr 2012

File Category: Source Modifications

Made this modification based on a user request http://rathena.org/b...753-warp-delay/

This modification allows you to setup a delay in milliseconds between last received / issued player damage and a use of @warp/@go.

By default it ships with a 5 second (5000 milliseconds) delay, and it won't work on GMs


Customizing:

- Changing @go delay

You'll find this in atcommand.c

if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
	clif_displaymessage(fd,"@go cannot be issued since you were into battle recently");
	return -1;
}

Change the 5000ms (5s) to your desired value.

- Changing @warp delay

You'll find this in atcommand.c

if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
	clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently");
	return -1;
}

Change the 5000ms (5s) to your desired value.

- Make it not count if player was damaged by monster

You'll find this in pc.c

sd->canlog_tick = gettick();
if( src->type == BL_PC )
	((TBL_PC*)src)->canlog_tick = gettick();

Change to

if( src->type == BL_PC ) {
	((TBL_PC*)src)->canlog_tick = gettick();
	sd->canlog_tick = gettick();
}

so that the delay will only count when damaged vs a player / when a player damages each other.

Click here to download this file

how can i add this.

then i find the code cannot be found

Edited by CybeR
Posted (edited)

How to apply the .patch files? Do I have to open it in notepad and then paste to my server files? Like in my atcommand.c? Sorry for the very noob question.

Edited by dudongwtf
  • 11 months later...
  • 3 weeks later...
  • 2 months later...
  • 1 month later...
Posted

index.php?app=downloads&module=display&s

File Name: @Warp / @Go Damage Delay

File Submitter: Ind

File Submitted: 16 Apr 2012

File Category: Source Modifications

Made this modification based on a user request http://rathena.org/board/topic/61753-warp-delay/

This modification allows you to setup a delay in milliseconds between last received / issued player damage and a use of @warp/@go.

By default it ships with a 5 second (5000 milliseconds) delay, and it won't work on GMs


Customizing:

- Changing @go delay

You'll find this in atcommand.c

	if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
		clif_displaymessage(fd,"@go cannot be issued since you were into battle recently");
		return -1;
	}
Change the 5000ms (5s) to your desired value.

- Changing @warp delay

You'll find this in atcommand.c

	if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
		clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently");
		return -1;
	}
Change the 5000ms (5s) to your desired value.

- Make it not count if player was damaged by monster

You'll find this in pc.c

	sd->canlog_tick = gettick();
	if( src->type == BL_PC )
		((TBL_PC*)src)->canlog_tick = gettick();
Change to

	if( src->type == BL_PC ) {
		((TBL_PC*)src)->canlog_tick = gettick();
		sd->canlog_tick = gettick();
	}
so that the delay will only count when damaged vs a player / when a player damages each other.

Click here to download this file

 

How to include @jump in this?

Posted

	sd->canlog_tick = gettick();
	if( src->type == BL_PC )
		((TBL_PC*)src)->canlog_tick = gettick();

Change to

	if( src->type == BL_PC ) {
		((TBL_PC*)src)->canlog_tick = gettick();
		sd->canlog_tick = gettick();
	}

I'm having a trouble/error in this part while compiling it, currently using SVN 17200 need a little help Indi.

post-18342-0-82136100-1382972471_thumb.jpg

  • 3 months later...
  • 1 month later...
  • 2 months later...
Posted

Is there a new version? It seems that the atcommand.c is already changed. Since i cannot find the
 

	if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
		clif_displaymessage(fd,"@go cannot be issued since you were into battle recently");
		return -1;
	}

and the

if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
		clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently");
		return -1;
	}
  • 3 years later...
Posted

This Codes Works On Mine. But The Problem Is When I log in the @go/@warp delay wont refresh. it needs to take an action like doing skill and attack before the delay second's refresh
is there any way to fix that problem? Any One Can Help? Heres My Code

Spoiler

/*==========================================
 * @rura, @warp, @mapmove
 *------------------------------------------*/

    }
    if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
        clif_displaymessage(fd,"@warp cannot be issued since you were into battle recently");
        return -1;
    }

 

/*==========================================
 * @go [city_number or city_name] - Updated by Harbin

 *------------------------------------------*/

        }
        if( !pc_get_group_level(sd) && DIFF_TICK(gettick(),sd->canlog_tick) < 5000 ) {
            clif_displaymessage(fd,"@go cannot be issued since you were into battle recently");
            return -1;
        }

 

/*==========================================
 * 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)
{
    if (sp) clif_updatestatus(sd,SP_SP);
    if (hp) clif_updatestatus(sd,SP_HP);
    else return;

    if (!src)
        return;

    if( pc_issit(sd) ) {
        pc_setstand(sd, true);
        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->pd,src,1);

    if( src->type == BL_PC ) {
        ((TBL_PC*)src)->canlog_tick = gettick();
        sd->canlog_tick = gettick();
    }
    if( sd->status.ele_id > 0 )
        elemental_set_target(sd,src);

    if(battle_config.prevent_logout_trigger&PLT_DAMAGE) {
        sd->canlog_tick = gettick();
    }

 

 

Hope you Guys Have Solution. Thanks in Advance

 

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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