Jump to content

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)

 

  • Metin2 Dev 1
  • Love 1

WRnRW3H.gif

Link to comment
Share on other sites

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

Announcements



×
×
  • Create New...

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.