Jump to content
  • 0

Automatic Speed Change on the map


arokken

Question


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

Hello guys,
can u help me give a script OnPCLoadMapEvent for speed change as fast as "@speed 1", only when player stay on the Map, when player leave the Map they speed back to normal.
Thanks

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

Try 

-	script	autospeed	-1,{
OnInit:
	setarray .map_list$[0],"prontera","payon"; // Map lists
	.map_size = getarraysize(.map_list$);
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		.@map$ = .map_list$[.@i];
		setmapflag .@map$,mf_loadevent;
	}
	end;

OnPCLoadMapEvent:
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) == .map_list$[.@i] ) {
			atcommand "@speed 1";
			@speed = 1;
		}
	}
	end;

OnPCStatCalcEvent:
	if( !@speed )end;
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) == .map_list$[.@i] )
			end; // don't remove speed
	}
	atcommand "@speed 150"; // Put normal speed here
	@speed = 0;
	end;
}

 

Edited by Technoken
  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  249
  • Reputation:   72
  • Joined:  10/20/12
  • Last Seen:  

OnPCStatCalcEvent:
	if( !@speed )end;
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) == .map_list$[.@i] ) {
			end; // don't remove speed
		}
	}
	atcommand "@speed 150"; // Put normal speed here
	@speed = 0;
	end;

@Technoken

 

Sadly the player has to re-log to get back his "normal" speed with modifiers like agi-up, Moonlight Flower, etc. after it has been changed by `@speed`

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

@Jey I am confused. Your script looks the same with mine, the condition was just changed. and yeah. I just test it now and moonlight flower card can't override the @speed command. XD /gawi

 

Link to comment
Share on other sites

  • 0

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

2 hours ago, Technoken said:

Try 


-	script	autospeed	-1,{
OnInit:
	.map_list$[0],"prontera","payon"; // Map lists
	.map_size = getarraysize(.map_list$);
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		.@map$ = .map_list$[.@i];
		setmapflag .@map$,mf_loadevent;
	}
	end;

OnPCLoadMapEvent:
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) == .map_list$[.@i] ) {
			atcommand "@speed 1";
			@speed = 1;
		}
	}
	end;

OnPCStatCalcEvent:
	if( !@speed )end;
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) != .map_list$[.@i] ) {
			atcommand "@speed 150"; // Put normal speed here
			@speed = 0;
		}
	}
	end;
}

 

Thanks Technoken for the script, 
i have some problem here, what's wrong?
 

autospeed error.JPG

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

Sorry. It was an array and I forgot to set it as an array.

replace 

.map_list$[0],"prontera","payon"; // Map lists

with

setarray .map_list$[0],"prontera","payon"; // Map lists

 

Link to comment
Share on other sites

  • 0

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

19 minutes ago, Technoken said:

Sorry. It was an array and I forgot to set it as an array.

replace 


.map_list$[0],"prontera","payon"; // Map lists

with


setarray .map_list$[0],"prontera","payon"; // Map lists

 

thanks a lot Technoken, it works.
it's not my problem, but this script doesn't work if i insert town_map like prontera or payon, but another map like dungeon, field, or custom_map great!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

1 hour ago, arokken said:

thanks a lot Technoken, it works.
it's not my problem, but this script doesn't work if i insert town_map like prontera or payon, but another map like dungeon, field, or custom_map great!

It doesn't work on towns? try to check if the loadevent mapflag is being set. Use @mapinfo and see if Other Flags2 has a loadevent mapflag. If it's not there maybe you have a script that sets mapflag loadevent off after the script I provided was executed.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  249
  • Reputation:   72
  • Joined:  10/20/12
  • Last Seen:  

7 hours ago, Technoken said:

@Jey I am confused. Your script looks the same with mine, the condition was just changed. and yeah. I just test it now and moonlight flower card can't override the @speed command. XD /gawi

 

@Technoken It's just a small difference. Take a closer look. Your script removes the speed bonus if the player isn't standing on every map of .map_list$. That  is impossible if there is more than one map in .map_list$ ;>

  • Upvote 2
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

@Jey I get it now. Thanks for clearing that up! I'll edit my first post.

  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  296
  • Reputation:   4
  • Joined:  02/19/17
  • Last Seen:  

how about for GM only? if you login your gm account it will auto the speed to zero

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

On 4/11/2018 at 10:30 AM, skymia said:

how about for GM only? if you login your gm account it will auto the speed to zero

-	script	GMLogin	-1,{
OnPCLoginEvent:
if(getgmlevel() > 60)
{
atcommand "@speed 0"; //auto speed
atcommand "@hide"; //auto hide
}
end;
}

...another question... it's possibile to have different speeds in different maps (towns)?
How can I modified the script in post #1?

Edited by CyberDevil
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.02
  • Content Count:  242
  • Reputation:   37
  • Joined:  02/25/18
  • Last Seen:  

I made a recent update of rAthena and from this point onwards this script to increase the speed in the city is creating me many problems... first of all the skills (like Cart Boost) and the buffs and potions that increase the speed of movement, they go into conflict when entering the city (also the debuffs movement speed from monsters castedt o players)... players lose speed despite the buff icon remains active and even if you leave the city the speed remains inoperative. To make it work you have to get out of the city, log out of the game and re-enter, but every time you enter a city where this script is active, it messes up all over again.
Do you know how to solve it?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  71
  • Topics Per Day:  0.03
  • Content Count:  167
  • Reputation:   8
  • Joined:  12/30/16
  • Last Seen:  

On 4/17/2017 at 10:33 AM, Technoken said:

Try 


-	script	autospeed	-1,{
OnInit:
	setarray .map_list$[0],"prontera","payon"; // Map lists
	.map_size = getarraysize(.map_list$);
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		.@map$ = .map_list$[.@i];
		setmapflag .@map$,mf_loadevent;
	}
	end;

OnPCLoadMapEvent:
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) == .map_list$[.@i] ) {
			atcommand "@speed 1";
			@speed = 1;
		}
	}
	end;

OnPCStatCalcEvent:
	if( !@speed )end;
	for( .@i = 0; .@i < .map_size; .@i++ ) {
		if( strcharinfo(3) == .map_list$[.@i] )
			end; // don't remove speed
	}
	atcommand "@speed 150"; // Put normal speed here
	@speed = 0;
	end;
}

 

Hello I just tried your script but . when I leave the town the speed didn't change. Thanks 

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