FallenOne Posted December 24, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Share Posted December 24, 2011 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~ Quote Link to comment Share on other sites More sharing options...
Angry Mjoo Posted December 24, 2011 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 33 Reputation: 0 Joined: 12/17/11 Last Seen: June 30, 2012 Share Posted December 24, 2011 I like this stuff. this is really good for PK Mode Servers, and an additional Mod like this is great.. Quote Link to comment Share on other sites More sharing options...
FallenOne Posted December 24, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted December 24, 2011 (edited) Update on what I need: I want the players to be able to @warp/@go when they are NOT getting attacked or using a skill. But it will work when they are being attacked or used a skill. Thank You~ Edited December 24, 2011 by FallenOne Quote Link to comment Share on other sites More sharing options...
JayPee Posted December 24, 2011 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted December 24, 2011 (edited) in src/map/pc.h find unsigned int canuseitem_tick; // [skotlex] then add below unsigned int warpgodelay_tick; then go to the src/map/pc.c find sd->canuseitem_tick = tick; then add below sd->warpgodelay_tick = tick; then this is still in src/map/pc.c find:(In the description it says this function is invoked when the player is receiving) void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int hp, unsigned int sp) inside the function add this: unsigned int tick = gettick(); int warpgodelaycd = 5000; //This is the delay in milliseconds sd->warpgodelay_tick = tick+warpgodelaycd; //This is the timer then go now in map/atcommand.c find ACMD_FUNC(go) then add this inside the function unsigned int tick = gettick(); this is still in the (go) function find below nullpo_retr(-1, sd); This is just below the list of maps in @go then add below if(DIFF_TICK(sd->warpgodelay_tick,tick)>0) { clif_displaymessage(fd,"There is a 5 seconds delay in using @go command"); return 0; } now for the @warp find: ACMD_FUNC(mapmove) then add this inside the function unsigned int tick = gettick(); now below memset(map_name, '0', sizeof(map_name)); add this below if(DIFF_TICK(sd->warpgodelay_tick,tick)>0) { clif_displaymessage(fd,"There is a 5 seconds delay in using @warp command"); return -1; } for the skill edit src/map/unit.c find: int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel) then add this inside the function int warpgodelaycd = 5000; //This is a delay in miliseconds then scroll down to the end of the function you will see this if( casttime > 0 ) { ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 ); if( sd && pc_checkskill(sd,SA_FREECAST) > 0 ) status_calc_bl(&sd->bl, SCB_SPEED); } else skill_castend_id(ud->skilltimer,tick,src->id,0); add this code above sd->warpgodelay_tick= tick+warpgodelaycd ;//The delay when they use skill Hope it helps. Merry XMAS Edited December 26, 2011 by JayPeeMateo Quote Link to comment Share on other sites More sharing options...
FallenOne Posted December 25, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted December 25, 2011 (edited) Merry Xmas to you too~ Based on your src edits, I don't have to implement Vengeance's @warp and @go delay since you made the "warpgodelaycd" thing, right? Oh yeah, Im using eA's SVN 14843... It will still work? Edited December 25, 2011 by FallenOne Quote Link to comment Share on other sites More sharing options...
JayPee Posted December 25, 2011 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted December 25, 2011 Yes. But Venegeances @warp and @go does need compiling again when changing the delay. And warpgodelaycd is the variable name i use to store the delay Quote Link to comment Share on other sites More sharing options...
Sneaky Posted December 25, 2011 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 392 Reputation: 47 Joined: 11/18/11 Last Seen: July 8, 2024 Share Posted December 25, 2011 Yes. But Venegeances @warp and @go does need compiling again when changing the delay. And warpgodelaycd is the variable name i use to store the delay 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 However, Jaypee's one works better, since it resets the timer after being attacked (Not sure if Vengeance's one does, since I didn't read the whole thing, but I already tested Jaypee's one and it works). You can simply change the timer of jaypee's int warpgodelaycd = 5000; //This is a delay in miliseconds 5000 = 5 seconds, just change it to whatever you want, then compile, and it's ready. Quote Link to comment Share on other sites More sharing options...
FallenOne Posted December 26, 2011 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted December 26, 2011 Nice! I will go ahead and take out Vengeance's version on my SVN and try out Jaypee's... Thanks guys! Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 1, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 1, 2012 (edited) Hi! What was changed from the last time I replied to this thread? I see that you updated your post in 12/26/11. Update: I added and tried to test your src edit. I turned off my test server, recompiled, turned on my test server. No errors showed up via putty. But the problem is my map server does not turn on for some reason. Login and Character servers are only on. I am not a coder and I might have messed up every time you say, "add this inside the function." When I read that instruction, I just try to add it to the first line after " { " like for example: 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; And it becomes like: 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; I don't know if I did it right. If I did, nice! But I might have messed up in the other parts. I am more accurate in adding src edits manually if it was in diff version since I can see the exact tabs and location of where it should be. Edited January 1, 2012 by FallenOne Quote Link to comment Share on other sites More sharing options...
JayPee Posted January 1, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted January 1, 2012 Did you add the warpgodelay_tick in the pc.c? Also please post the things you editted Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 2, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 2, 2012 (edited) Did you add the warpgodelay_tick in the pc.c? Also please post the things you editted I added everything. But I might have added some of them in a wrong way. So, I reversed all the edit with my back-up. I will try to implement it again and if I experience the same problem, I will post all of my edits. Edited January 2, 2012 by FallenOne Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 2, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 2, 2012 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 ) Quote Link to comment Share on other sites More sharing options...
JayPee Posted January 2, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted January 2, 2012 It seems nothing is wrong. Did you try it compiling in your local computer and test it in your local computer? Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 2, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 2, 2012 It seems nothing is wrong. Did you try it compiling in your local computer and test it in your local computer? Yes, I have. I typed these: ./athena-start stop make clean && ./configure --with-pcre && make sql ./athena-start start Quote Link to comment Share on other sites More sharing options...
JayPee Posted January 2, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted January 2, 2012 I mean in your Windows OS. I cant see anything wrong with the code it works fine on my test server(rAthena). Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 2, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 2, 2012 (edited) I mean in your Windows OS. I cant see anything wrong with the code it works fine on my test server(rAthena). My Test Server is on a VPS using Linux OS. And it's eAthena 14843 with other src edits so, that could be the problem then? Edited January 3, 2012 by FallenOne Quote Link to comment Share on other sites More sharing options...
JayPee Posted January 3, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted January 3, 2012 I guess it can be a problem since I coded them in rAthena Quote Link to comment Share on other sites More sharing options...
Ren Posted January 3, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 3 Reputation: 0 Joined: 12/31/11 Last Seen: June 6, 2012 Share Posted January 3, 2012 weird thing is , i also tested this and it works localy, but when i upload this to my host and recompile using 'make sql' , then run server, map crashes Quote Link to comment Share on other sites More sharing options...
FatalEror Posted January 3, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 67 Reputation: 23 Joined: 11/14/11 Last Seen: October 3, 2014 Share Posted January 3, 2012 Update: Here are my edits that made my Map Server not to turn on so, I cannot really test the edit: 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 ) Try change 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 ) to: if (!src->prev) return 0; //Warped away! } if (sd) 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 ) Quote Link to comment Share on other sites More sharing options...
Ren Posted January 3, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 3 Reputation: 0 Joined: 12/31/11 Last Seen: June 6, 2012 Share Posted January 3, 2012 man, you are my savior ! thank you! Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 5, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 5, 2012 (edited) man, you are my savior ! thank you! It worked! JayPee, Slim and FatalError, you are our savior... hehe! Edited January 5, 2012 by FallenOne Quote Link to comment Share on other sites More sharing options...
maynard Posted January 12, 2012 Group: Members Topic Count: 44 Topics Per Day: 0.01 Content Count: 159 Reputation: 1 Joined: 12/21/11 Last Seen: April 20, 2014 Share Posted January 12, 2012 help please, my mapserv crash... [error] delete_timer_error: funtion mismatch 0053AC20<connect_check_clear> !=0051FFF8<pc_endautobonus> [error] delete_timer_error: funtion mismatch 0053AC20<connect_check_clear> !=0051FFF8<pc_endautobonus> Quote Link to comment Share on other sites More sharing options...
JayPee Posted January 14, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted January 14, 2012 are you using rAthena? Quote Link to comment Share on other sites More sharing options...
maynard Posted January 14, 2012 Group: Members Topic Count: 44 Topics Per Day: 0.01 Content Count: 159 Reputation: 1 Joined: 12/21/11 Last Seen: April 20, 2014 Share Posted January 14, 2012 (edited) No sir, Im using eathena SVN 14993.This is always the error in my mapserv then it will crash. All I want is they cant use @warp/@go for atleast 5 seconds when hit by player. I also tried this http://rathena.org/w..._delay_when_hit but same error that I get.I hope you can help me.Thanks sir. [error] delete_timer_error: funtion mismatch 0053AC20<connect_check_clear> !=0051FFF8<pc_endautobonus> [error] delete_timer_error: funtion mismatch 0053AC20<connect_check_clear> !=0051FFF8<pc_endautobonus> Edited January 14, 2012 by maynard Quote Link to comment Share on other sites More sharing options...
JayPee Posted January 14, 2012 Group: Members Topic Count: 47 Topics Per Day: 0.01 Content Count: 633 Reputation: 78 Joined: 11/14/11 Last Seen: September 20, 2017 Share Posted January 14, 2012 I coded it using rAthena SVN i dunno why it doesnt work in eAthena Quote Link to comment Share on other sites More sharing options...
FallenOne Posted January 14, 2012 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 11/23/11 Last Seen: February 29, 2012 Author Share Posted January 14, 2012 No sir, Im using eathena SVN 14993.This is always the error in my mapserv then it will crash. All I want is they cant use @warp/@go for atleast 5 seconds when hit by player. I also tried this http://rathena.org/w..._delay_when_hit but same error that I get.I hope you can help me.Thanks sir. [error] delete_timer_error: funtion mismatch 0053AC20<connect_check_clear> !=0051FFF8<pc_endautobonus> [error] delete_timer_error: funtion mismatch 0053AC20<connect_check_clear> !=0051FFF8<pc_endautobonus> Did you try changing this file: http://rathena.org/board/topic/56318-solved-modify-warp-go-delay/page__view__findpost__p__67799 Quote Link to comment Share on other sites More sharing options...
Question
FallenOne
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
35 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.