Jump to content

[C++]Summon and Ride Mounts like Horses


xkillmt2
 Share

Recommended Posts

image.thumb.png.9d1362e76d7d42e65aae42799d6647d4.png

 

Testado e aprovado no entanto haverá diversos erros, inclusive em conflito com o sistema tradicional do pet.

Necessitam de recodificar o código de forma a que possa dar (não me peçam por ajuda de momento, encontro-me muito ocupado) senão terão vários erros e bugs estranhos.

 

Obrigado pela partilha, poupaste-me o trabalho de começar do 0.

 

Dica: Quem utilizar isto, que esqueça por completo o uso de montadas por quest. Para quem não entendeu, refiro-me a quests deste género:

[71114] = { 20110,	5*60,					apply.DEF_GRADE_BONUS,	75,		75,	false	},

 

Edited by Mário.
Link to comment
Share on other sites

Em 01/03/2018 em 18:45, xkillmt2 disse:

O sistema custa dinheiro, deixo-o aqui de graça. (NÃO OFERECE SUPORTE!)
senha do arquivo: [email protected]

 

 

Mount_system by Rudhon.zip  19   14 kB

para quem tiver problema ao compilar no MountSystem.h 60:18

vá ao topo do arquivo MountSystem.h e adicione

#include <boost/unordered_map.hpp>

abaixo do 

#define    __HEADER_MOUNT_SYSTEM__

Link to comment
Share on other sites

Para o sistema em si funcionar melhor, sigam o tutorial abaixo:

 

1) Ignorar por completo o questlua_mount.cpp (não adicionar no makefile)

 

2) Em um questlua à vossa escolha (irei meter no _pc), procurem por:

#include "item.h"

 

Adicionem por baixo:

#ifdef ENABLE_MOUNT_SYSTEM
#include "MountSystem.h"
#endif

 

Procurem por:

void RegisterPCFunctionTable()

 

Adicionem antes:

#ifdef ENABLE_MOUNT_SYSTEM
	int pc_summon(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		CMountSystem* MountSystem = ch->GetMountSystem();
		if (!ch || !MountSystem)
		{
			lua_pushnumber(L, 0);
			return 1;
		}
		if (0 == MountSystem)
		{
			lua_pushnumber(L, 0);
			return 1;
		}

		DWORD mobVnum = lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;
		
		CMountActor* MState = MountSystem->Summon(mobVnum, ch->GetName());
		
		if (MState != NULL)
			lua_pushnumber(L, 1);
		else
			lua_pushnumber(L, 0);

		return 1;
	}

	int pc_unsummon(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		CMountSystem* MountSystem = ch->GetMountSystem();

		if (0 == MountSystem)
			return 0;

		DWORD mobVnum = lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;

		MountSystem->Unsummon(mobVnum);
		return 1;
	}
	
	int pc_count_summoned(lua_State* L)
	{
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		CMountSystem* MountSystem = ch->GetMountSystem();

		lua_Number count = 0;

		if (0 != MountSystem)
			count = (lua_Number)MountSystem->CountSummoned();

		lua_pushnumber(L, count);

		return 1;
	}
#endif

 

Procurem por:

{ NULL,			NULL			}

 

Adicionem antes:

			{ "summon",			pc_summon },
			{ "unsummon",			pc_unsummon },
			{ "count_summoned",	pc_count_summoned },

 

 

Aqui está uma quest já preparada para teste, mas vocês têm que fazer uma que não entre em conflito com os pets pois isto utiliza a forma como os pets são e não como o cavalo

quest MountSystem begin
	state start begin
		when 52045.use begin
			if pc.count_summoned() == 0 then
				pc.summon(20212)
			else
				pc.unsummon(20212)
			end -- if
		end -- when
	end -- state
end -- quest

 

 

OBS: Adicionar essas funções ao quest_function, nem era preciso dizer.

Link to comment
Share on other sites

  • 1 month later...
1 minuto atrás, trample disse:

O sistema custa dinheiro, deixo-o aqui de graça. (NÃO OFERECE SUPORTE!)

kkkkkkkkkkkkkkkk

isso ta na net ah anos ...

alendo mais esse sistema nao tem nem melhorias feito na dev  so passei para avisar se curtiu Blz ..

Mas alem de avisar vou deixar a Dica !

Tem esse sistema na Rubinum Funcional e so copy e cole!!!

A minha "versão" é outra 

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
 Share

×
×
  • Create New...