Jump to content
External pictures are being replaced... ×
×
×
  • Create New...

Set Speed for Riding Mounts


Recommended Posts

  • Honorable Member

Open questlua_pc.cpp and search for the pc_mount function.

Overwrite the whole function with this:

	int pc_mount(lua_State* L)
	{
		if (!lua_isnumber(L, 1))
			return 0;

		int length = 60;

		if (lua_isnumber(L, 2))
			length = (int)lua_tonumber(L, 2);

		DWORD mount_vnum = (DWORD)lua_tonumber(L, 1);

		if (length < 0)
			length = 60;

		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

		ch->RemoveAffect(AFFECT_MOUNT);
		ch->RemoveAffect(AFFECT_MOUNT_BONUS);

		// ¸»ŔĚ ĽŇČŻµÇľî µű¶ó´Ů´Ď´Â »óŶó¸é ¸»şÎĹÍ ľřľÚ
		if (ch->GetHorse())
			ch->HorseSummon(false);

		int ertek = 0;
			
		if (lua_isnumber(L, 3))
			ertek = (int)lua_tonumber(L, 3);
		
		if (ertek <= 0)
			ertek = 0;
			
		ch->AddAffect(AFFECT_MOUNT, POINT_MOV_SPEED, ertek, AFF_NONE, length, 0, true, true);
		
		
		return 0;
	}

Then you can use it in quests like

pc.mount(ID, duration, speed)

 

WRnRW3H.gif

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.