Jump to content
  • 0

Modify @warp @go delay


FallenOne

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  11/23/11
  • Last Seen:  

Hi! This is from eA and I am hoping rA can help as well.

@warp/@go delay: http://www.eathena.ws/board/index.php?showtopic=263936&st=0

How do we make this snippet to work when attacked or used a skill? So, atm, there is just a cool down for using @warp or @go. How about it resets when attacked or used a skill?

Thank You~

Link to comment
Share on other sites

Recommended Posts


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  159
  • Reputation:   1
  • Joined:  12/21/11
  • Last Seen:  

I re input many times and now I finally make it work, sorry my bad. Dont know what happen i just rebuild it in in compiling instead of build only.now it works in @go commands the delay. how can i make it also work in @warp? /no1

Its ok now, all have been working great now. @warp @go is working perfectly now. Thanks to all who help. The mod is good, the problem is in my side.it works in eathena also.

Edited by maynard
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  01/28/12
  • Last Seen:  

it doesn't work in 15097 3ceAM? all errors came from atcommand.c and unit.c

Edited by sasuke
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  77
  • Reputation:   3
  • Joined:  03/25/12
  • Last Seen:  

its work to me Im using 3ceam revision 678.

just follow JayPee and FatalEror.

thanks for this script is very useful for a PK Server.

add:

how about if only the last damage recieve will have a delay.

not the skill used.

its possible?

Edited by jharick
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

Actually I think Vengeance's one doesn't need compiling for changing the delay, because the variable is stored in conf/battle/misc.conf. So you could simply do a @reloadbattleconf

// Delay using @commands in seconds [Vengeance]
warp_delay: 5
go_delay: 5

what svn did use that conf? eA or rA or 3ceAM..? XD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

what svn did use that conf? eA or rA or 3ceAM..? XD

I believe you have to add it yourself.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

I believe you have to add it yourself.

well I'll try to add it..

And I just added this below to gives no delay when use @go or @warp when player is dead

inside pc_dead function in map\pc.c

int pc_dead(struct map_session_data *sd,struct block_list *src)
{
.....
.....
//Reset "can log out" tick.
if( battle_config.prevent_logout )
 sd->canlog_tick = gettick() - battle_config.prevent_logout;
return 1;
}

becomes

int pc_dead(struct map_session_data *sd,struct block_list *src)
{
.....
.....
//Reset "can log out" tick.
if( battle_config.prevent_logout )
 sd->canlog_tick = gettick() - battle_config.prevent_logout;

sd->warpgodelay_tick = tick; //This is the timer. warp go delay
return 1;
}

===============

and btw, I used all source above, and the result,

When player use skill like Raising Dragon (Sura) and Summon Spirit Ball (Earth/Water/Fire/Lighting), has delay when use @warp or @go. delay never ends

how to disable it above?

Edited by cydh
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

I believe you have to add it yourself.

well I'll try to add it..

Update: Here are my edits that made my Map Server not to turn on so, I cannot really test the edit:

src/map/pc.h

 unsigned int canuseitem_tick; // [skotlex]
 unsigned int canusecashfood_tick;

Becomes like this:

 unsigned int canuseitem_tick; // [skotlex]
 unsigned int warpgodelay_tick;
 unsigned int canusecashfood_tick;

src/map/pc.c

  sd->canuseitem_tick = tick;
  sd->canusecashfood_tick = tick;

Becomes like this:

  sd->canuseitem_tick = tick;
  sd->warpgodelay_tick = tick;
  sd->canusecashfood_tick = tick;

src/map/pc.c

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;

Becomes like this:

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

src/map/atcommand.c

ACMD_FUNC(go)
{
 int i;
 int town;
 char map_name[MAP_NAME_LENGTH];
 int m;

Becomes like this:

ACMD_FUNC(go)
{
 unsigned int tick = gettick();
 int i;
 int town;
 char map_name[MAP_NAME_LENGTH];
 int m;

src/map/atcommand.c

 };

 nullpo_retr(-1, sd);

 if( map[sd->bl.m].flag.nogo && battle_config.any_warp_GM_min_level > pc_isGM(sd) ) {
 clif_displaymessage(sd->fd,"You can not use @go on this map.");
 return 0;
 }

Becomes like this:

 };

 nullpo_retr(-1, sd);
 if(DIFF_TICK(sd->warpgodelay_tick,tick)>0)
 {
 clif_displaymessage(fd,"There is a 5 seconds delay in using @go command");
 return 0;
 }
 if( map[sd->bl.m].flag.nogo && battle_config.any_warp_GM_min_level > pc_isGM(sd) ) {
 clif_displaymessage(sd->fd,"You can not use @go on this map.");
 return 0;
 }

src/map/atcommand.c

ACMD_FUNC(mapmove)
{
 unsigned int tick = gettick();
 char map_name[MAP_NAME_LENGTH_EXT];
 unsigned short mapindex;
 int x = 0, y = 0;
 int m = -1;

Becomes like this:

ACMD_FUNC(mapmove)
{
 unsigned int tick = gettick();
 char map_name[MAP_NAME_LENGTH_EXT];
 unsigned short mapindex;
 int x = 0, y = 0;
 int m = -1;

src/map/atcommand.c

 nullpo_retr(-1, sd);

 memset(map_name, '0', sizeof(map_name));


 if (!message || !*message ||

Becomes like this:

 memset(map_name, '0', sizeof(map_name));
 if(DIFF_TICK(sd->warpgodelay_tick,tick)>0)
 {
 clif_displaymessage(fd,"There is a 5 seconds delay in using @warp command");
 return -1;
 }
 if (!message || !*message ||

src/map/unit.c

int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel)
{
 struct unit_data *ud;
 struct status_data *tstatus;

Becomes like this:

int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel)
{
 int warpgodelaycd = 5000; //This is a delay in miliseconds
 struct unit_data *ud;
 struct status_data *tstatus;

src/map/unit.c

	  if (!src->prev) return 0; //Warped away!
 }
 if( casttime > 0 )
 {
 ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
 if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )

Becomes like this:

	  if (!src->prev) return 0; //Warped away!
 }
 sd->warpgodelay_tick= tick+warpgodelaycd ;//The delay when they use skill
 if( casttime > 0 )
 {
 ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
 if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )

And I just added this below to gives no delay when use @go or @warp when player is dead

inside pc_dead function in map\pc.c

int pc_dead(struct map_session_data *sd,struct block_list *src)
{
.....
.....
//Reset "can log out" tick.
if( battle_config.prevent_logout )
 sd->canlog_tick = gettick() - battle_config.prevent_logout;
return 1;
}

becomes

int pc_dead(struct map_session_data *sd,struct block_list *src)
{
.....
.....
//Reset "can log out" tick.
if( battle_config.prevent_logout )
 sd->canlog_tick = gettick() - battle_config.prevent_logout;

sd->warpgodelay_tick = tick; //This is the timer. warp go delay
return 1;
}

===============

and btw, I used all source above, and the result,

When player use skill like Raising Dragon (Sura) and Summon Spirit Ball (Earth/Water/Fire/Lighting), has delay when use @warp or @go. delay never ends

how to disable it above?

The map server crash's, is there any solution for that?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   33
  • Joined:  11/15/12
  • Last Seen:  

no errors but when i try to warp it already said i need to wait 5 seconds lol and i cannot warp everytime i try to warp it restricts me

Edited by sQueeze
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

no errors but when i try to warp it already said i need to wait 5 seconds lol and i cannot warp everytime i try to warp it restricts me

and btw, I used all source above, and the result,

When player use skill like Raising Dragon (Sura) and Summon Spirit Ball (Earth/Water/Fire/Lighting), has delay when use @warp or @go.delay never ends

how to disable it above?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

http://rathena.org/b...lay/#entry67799

I tried this but I also got map crash on server I'm using rathena svn

Problem solve :)

Edited by zhen
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...