Jump to content

Unride stat bug.


Recommended Posts

  • Premium

Show the whole quest, if you can.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Honorable Member

What do you mean with "Status don't clear, only if you click them" and what are you trying todo with this function?


If you're trying to add a bonus to the mount your using you can use this function: pc.mount_bonus(type, value, duration)

local mount_vnum = 22006 -- Mount Vnum
local affect_duration = 3600 -- 1h

pc.mount(mount_vnum, affect_durration)
pc.mount_bonus(apply.MOV_SPEED, 20, affect_durration) -- Apply bonus with +20 move speed

 

Link to comment
Share on other sites

  • Premium

Basically what @Owsap said. pc.unmount() only clears the bonuses you give via the pc.mount_bonus(apply, quantity, duration) function.

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Silver
8 minutes ago, Owsap said:

What do you mean with "Status don't clear, only if you click them" and what are you trying todo with this function?


If you're trying to add a bonus to the mount your using you can use this function: pc.mount_bonus(type, value, duration)


local mount_vnum = 22006 -- Mount Vnum
local affect_duration = 3600 -- 1h

pc.mount(mount_vnum, affect_durration)
pc.mount_bonus(apply.MOV_SPEED, 20, affect_durration) -- Apply bonus with +20 move speed

 

 

 

No no.
Here is problem this:

 

Base Riding code added for your character riding bonus: str vit etc point..
 

If you using this code...

pc.mount()


So.. Now stop riding and check your Character window ingame. (Bonus cp. VIT, INT, STR ..)

Link to comment
Share on other sites

  • Honorable Member

I still don't understand...
When you unmount all bonuses are removed.

-- Quest
when 31071.use begin
	if pc.is_polymorphed() then
		return syschat("You can't ride while transformed.")
	end

	if pc.is_riding() or pc.is_mount() then
		pc.unmount()
	else
		if horse.is_summon() then
			horse.unsummon()
		end

		pc.mount(22006, 3600)
		pc.mount_bonus(apply.MOV_SPEED, 60, 3600)
	end
end
// @ questlua_pc.cpp
	int pc_mount_bonus(lua_State* L)
	{
		BYTE applyOn = static_cast<BYTE>(lua_tonumber(L, 1));
		long value = static_cast<long>(lua_tonumber(L, 2));
		long duration = static_cast<long>(lua_tonumber(L, 3));

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

		if (ch && ch->GetMountVnum())
		{
			ch->RemoveAffect(AFFECT_MOUNT_BONUS);
			ch->AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[applyOn].bPointType, value, AFF_NONE, duration, 0, false);
		}

		return 0;
	}

	int pc_unmount(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

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

		if (ch->IsHorseRiding())
			ch->StopRiding();

		return 0;
	}

 

jtbEn90.gif

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Silver
6 minutes ago, Owsap said:

I still don't understand...
When you unmount all bonuses are removed.


-- Quest
when 31071.use begin
	if pc.is_polymorphed() then
		return syschat("You can't ride while transformed.")
	end

	if pc.is_riding() or pc.is_mount() then
		pc.unmount()
	else
		if horse.is_summon() then
			horse.unsummon()
		end

		pc.mount(22006, 3600)
		pc.mount_bonus(apply.MOV_SPEED, 60, 3600)
	end
end

// @ questlua_pc.cpp
	int pc_mount_bonus(lua_State* L)
	{
		BYTE applyOn = static_cast<BYTE>(lua_tonumber(L, 1));
		long value = static_cast<long>(lua_tonumber(L, 2));
		long duration = static_cast<long>(lua_tonumber(L, 3));

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

		if (ch && ch->GetMountVnum())
		{
			ch->RemoveAffect(AFFECT_MOUNT_BONUS);
			ch->AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[applyOn].bPointType, value, AFF_NONE, duration, 0, false);
		}

		return 0;
	}

	int pc_unmount(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

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

		if (ch->IsHorseRiding())
			ch->StopRiding();

		return 0;
	}

 

jtbEn90.gif

 

 

Yes but! Use ctrl+g or h or j.

And Dizer not use Costume mount system.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium

..It's the same thing, it doesn't change a thing in that field.

 

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • Honorable Member

Well testing only with quest type, in fact there is a problem in refreshing the status points. (never noticed this)

This is what you can do in order to refresh them.

// @ questlua_pc.cpp
	int pc_unmount(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();

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

		ch->PointsPacket(); // 2020.01.25.Owsap - Refresh Status Points

		if (ch->IsHorseRiding())
			ch->StopRiding();

		return 0;
	}

Before:

 

gYpuhkk.gif

 

After:

 

O0oQl1a.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.