Jump to content

new horse function Horse.Kill


Braunwald

Recommended Posts

Precisei de fazer alguns testes com o Cavalo morto, e verifiquei que não havia forma (rápida) de o matar.  Aqui fica a função! Acabei de a criar e já estive a testar, não me parece haver qualquer erro!

 

#### Server/game/src/horse_rider.cpp

Spoiler
// Search:
void CHorseRider::FeedHorse()
{
	[...]
}

// Add after:
void CHorseRider::KillHorse()
{
	if (GetHorseLevel() > 0 && GetHorseHealth() >= 0)
	{
		UpdateHorseHealth( -GetHorseHealth());
		ResetHorseHealthDropTime();
	}
}

 

 

#### Server/game/src/horse_rider.h

Spoiler
// Search:
		void FeedHorse();

// Add after:
		void KillHorse();

 

 

#### Server/game/src/questlua_horse.cpp

Spoiler
// Search:
	int horse_feed(lua_State* L)
	{
		[...]
	}

// Add after:
	int kill_horse(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		ch->KillHorse();
		return 0;
	}



// Search:
			{ "feed",			horse_feed				},

// Add after:
			{ "kill",			kill_horse				},

 

 

quest_functions

Spoiler
horse.kill

 

 

quest:

Spoiler
when 40003.use with pc.is_gm() begin
		local s = select("Kill Horse", "Revive Horse", "Exit")
		if s == 1 then
			if horse.is_dead() then syschat("Horse is dead") return end
			horse.kill()
			horse.summon()
		elseif s == 2 then
			if horse.is_dead() == false then return end
			horse.revive()
		end
	end

 

 

Edited by Braunwald
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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
×
×
  • Create New...