Jump to content

Sistema Slot Montada


Dynamic Things
 Share

Recommended Posts

Olá TMoore Tutorial com bases de um comentário que li ontem feito pelo "PACI", tentei fazer esse sistema para responder a pedido de um membro, L2P vou deixar aqui um breve tutorial de como fazer isto:

Primeiro de tudo vamos guardar backup de alguns ficheiros...

Source Game

Common

  • item_length.h
  • length.h

Db

  • ProtoReader.cpp

Game

  • item.cpp
  • char_battle.cpp
  • cmd_general.cpp
  • char_item.cpp
  • item_manager.cpp
  • questlua_pc.cpp

Source do Binario:

GameLib

  • ItemData.h

UserInterface

  • GameType.h
  • PythonItemModule.cpp

Python/Cliente

root

  • uitooltip.py

uiscript

  • costumewindow.py

Feito o backup desses ficheiros vamos começar o tutorial

Vamos começar pelo binário.

Abrir ficheiro GameLib/ItemData.h

Procurar por ECostumeSubTypes

enum ECostumeSubTypes
{
COSTUME_BODY,
COSTUME_HAIR,
COSTUME_NUM_TYPES,
};

E adicionar a baixo do COSTUME_HAIR,

COSTUME_MONTADA,

Ficando assim

enum ECostumeSubTypes
{
COSTUME_BODY,
COSTUME_HAIR,
COSTUME_MONTADA,
COSTUME_NUM_TYPES,
};

Em UserInterface/GameType.h

Procurar por: #ifdef ENABLE_COSTUME_SYSTEM

Substituir por isso:

#ifdef ENABLE_COSTUME_SYSTEM
const DWORD c_Costume_Slot_Start = c_Equipment_Start + 19;
const DWORD	c_Costume_Slot_Body = c_Costume_Slot_Start + 0;
const DWORD	c_Costume_Slot_Hair = c_Costume_Slot_Start + 1;
const DWORD	c_Costume_Slot_Montada = c_Costume_Slot_Start + 2;
const DWORD c_Costume_Slot_Count = 3;
const DWORD c_Costume_Slot_End = c_Costume_Slot_Start + c_Costume_Slot_Count;
#endif

Ainda no mesmo ficheiro procurar por: #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM

Substituir por:

#ifdef ENABLE_NEW_EQUIPMENT_SYSTEM
const DWORD c_New_Equipment_Start = c_Equipment_Start + 22;
const DWORD c_New_Equipment_Count = 3;
const DWORD c_Equipment_Ring1 = c_New_Equipment_Start + 1;
const DWORD c_Equipment_Ring2 = c_New_Equipment_Start + 2;
const DWORD c_Equipment_Belt = c_New_Equipment_Start + 0;
#endif

Agora em PythonItemModule.cpp procurar por:

#ifdef ENABLE_COSTUME_SYSTEM

E adicionam a baixo de

PyModule_AddIntConstant(poModule, "COSTUME_TYPE_HAIR",			CItemData::COSTUME_HAIR);

Adicionam

PyModule_AddIntConstant(poModule, "COSTUME_TYPE_MONTADA",			CItemData::COSTUME_MONTADA);

Ainda no mesmo ficheiro e na mesma "função" adicionar a baixo de

PyModule_AddIntConstant(poModule, "COSTUME_SLOT_HAIR",			c_Costume_Slot_Hair);

Isto

PyModule_AddIntConstant(poModule, "COSTUME_SLOT_MONTADA",			c_Costume_Slot_Montada);

Ficando assim:

#ifdef ENABLE_COSTUME_SYSTEM
PyModule_AddIntConstant(poModule, "ITEM_TYPE_COSTUME",			CItemData::ITEM_TYPE_COSTUME);
PyModule_AddIntConstant(poModule, "COSTUME_TYPE_BODY",			CItemData::COSTUME_BODY);
PyModule_AddIntConstant(poModule, "COSTUME_TYPE_HAIR",			CItemData::COSTUME_HAIR);
PyModule_AddIntConstant(poModule, "COSTUME_TYPE_MONTADA",			CItemData::COSTUME_MONTADA);
PyModule_AddIntConstant(poModule, "COSTUME_SLOT_START",			c_Costume_Slot_Start);
PyModule_AddIntConstant(poModule, "COSTUME_SLOT_COUNT",			c_Costume_Slot_Count);
PyModule_AddIntConstant(poModule, "COSTUME_SLOT_BODY",			c_Costume_Slot_Body);
PyModule_AddIntConstant(poModule, "COSTUME_SLOT_HAIR",			c_Costume_Slot_Hair);
PyModule_AddIntConstant(poModule, "COSTUME_SLOT_MONTADA",			c_Costume_Slot_Montada);
PyModule_AddIntConstant(poModule, "COSTUME_SLOT_END",			c_Costume_Slot_End);
#endif

Agora a parte do binário já está pronto, podem compilar que em principio caso tenham tudo como o tutorial não haverá erros, em caso de erros basta comentar que estaremos aqui para resolver.

Para despachar a parte cliente vamos fazer já a parte python.

Em root/uitooltip.py procuram por:

isCostumeBody = 0

e em baixo adicionam:

isCostumeMontada = 0

ainda no mesmo ficheiro procuram por:

isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType

e adicionam em baixo o seguinte:

isCostumeMontada = item.COSTUME_TYPE_MONTADA == itemSubType

Ficando assim:

notepad_2016-11-12_11-13-37.png

Agora em uiscript/costumewindow.py

Podem substituir o vosso código pelo meu:

import uiScriptLocale
import item

DYNAMIC_THINGS = item.COSTUME_SLOT_START

window = {
"name" : "CostumeWindow",
"x" : SCREEN_WIDTH - 175 - 142,
"y" : SCREEN_HEIGHT - 37 - 565,
"style" : ("movable", "float",),
"width" : 142,
"height" : 180 + 47,
"children" :
(
	{
		"name" : "board",
		"type" : "board",
		"style" : ("attach",),
		"x" : 0,
		"y" : 0,
		"width" : 142,
		"height" : 180 + 47,
		"children" :
		(
			{
				"name" : "TitleBar",
				"type" : "titlebar",
				"style" : ("attach",),
				"x" : 8,
				"y" : 7,
				"width" : 131,
				"color" : "yellow",
				"children" :
				(
					{ "name":"TitleName", "type":"text", "x":60, "y":7, "r" : 0.9020, "g": 0.8157, "b" : 0.6353, "a" : 1.0, "text":uiScriptLocale.COSTUME_WINDOW_TITLE, "text_horizontal_align":"center" },
				),
			},
			{
				"name" : "Costume_Base",
				"type" : "image",
				"x" : 14,
				"y" : 38,
				"image" : "dynamic_things/images/controls/special/inventory/costume_m.tga",
				"children" :
				(
					{
						"name" : "CostumeSlot",
						"type" : "slot",
						"x" : 3,
						"y" : 3,
						"width" : 127,
						"height" : 145,
						"slot" : (
							{"index":DYNAMIC_THINGS+0, "x":61, "y":45, "width":32, "height":64},
							{"index":DYNAMIC_THINGS+1, "x":61, "y": 8, "width":32, "height":32},
							{"index":DYNAMIC_THINGS+2, "x":61, "y":125, "width":32, "height":32},
							{"index":DYNAMIC_THINGS+3, "x":10, "y":125, "width":32, "height":32},
						),
					},
				),
			},
		),
	},
),
}

Feito isso podem compactar o vosso cliente e já terminamos a parte cliente.

Agora vamos a parte Source/game

Em common/item_length.h

procurar por:

enum ECostumeSubTypes

em baixo de

COSTUME_HAIR = ARMOR_HEAD,

Adicionar o seguinte:

COSTUME_MONTADA,

Ficando assim:

enum ECostumeSubTypes
{
COSTUME_BODY = ARMOR_BODY,
COSTUME_HAIR = ARMOR_HEAD,
COSTUME_MONTADA,
COSTUME_NUM_TYPES,
};

Agora em common/length.h

procurar por:

enum EWearPositions

Adicionar a baixo do

WEAR_COSTUME_HAIR,

O seguinte

WEAR_COSTUME_MONTADA,

Ficando assim:

enum EWearPositions
{
WEAR_BODY,	
WEAR_HEAD,	
WEAR_FOOTS,	
WEAR_WRIST,	
WEAR_WEAPON,
WEAR_NECK,	
WEAR_EAR,	
WEAR_UNIQUE1,
WEAR_UNIQUE2,
WEAR_ARROW,	
WEAR_SHIELD,
WEAR_ABILITY1, 
WEAR_ABILITY2, 
WEAR_ABILITY3, 
WEAR_ABILITY4, 
WEAR_ABILITY5, 
WEAR_ABILITY6, 
WEAR_ABILITY7, 
WEAR_ABILITY8, 
WEAR_COSTUME_BODY,
WEAR_COSTUME_HAIR,
WEAR_COSTUME_MONTADA,
WEAR_BELT,	
WEAR_RING1,	
WEAR_RING2,	

WEAR_MAX = 32
};

Agora em db/ProtoReader.cpp

procurar por:

static string arSub28[]

Depois

"COSTUME_HAIR"

Adicionar o seguinte:

, "COSTUME_MONTADA"

Ficando assim:

static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR", "COSTUME_MONTADA" };

Ainda no ficheiro procurar por:

string arWearrFlag[] = {

e nessa função procurar por:

"WEAR_COSTUME_HAIR"

Adicionar o seguinte:

, "WEAR_COSTUME_MONTADA"

Ficando assim:

string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_SHIELD", "WEAR_UNIQUE", "WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY", "WEAR_COSTUME_BODY", "WEAR_COSTUME_HAIR", "WEAR_COSTUME_MONTADA"};

Agora em game/item.cpp

procurar por:

bool CItem::IsRideItem()

e substituir a função toda por:

bool CItem::IsRideItem()
{
if (ITEM_UNIQUE == GetType() && UNIQUE_SPECIAL_RIDE == GetSubType())
	return true;
if (ITEM_UNIQUE == GetType() && UNIQUE_SPECIAL_MOUNT_RIDE == GetSubType())
	return true;
if (ITEM_COSTUME == GetType() && COSTUME_MONTADA == GetSubType())
	return true;
return false;
}

Ainda no mesmo ficheiro procurar por:

else if (GetType() == ITEM_COSTUME)

e substituir o else if todo por:

else if (GetType() == ITEM_COSTUME)
{
	if (GetSubType() == COSTUME_BODY)
		return WEAR_COSTUME_BODY;
	else if (GetSubType() == COSTUME_HAIR)
		return WEAR_COSTUME_HAIR;
	else if (GetSubType() == COSTUME_MONTADA)
		return WEAR_COSTUME_MONTADA;
}

Agora em game/item_manager.cpp

procurar por:

else if (item->GetType() == ITEM_UNIQUE)

e substituir o else if todo por:

else if (item->GetType() == ITEM_UNIQUE || item->GetSubType() == COSTUME_MONTADA)
{
for (itertype(m_map_pkSpecialItemGroup) it = m_map_pkSpecialItemGroup.begin(); it != m_map_pkSpecialItemGroup.end(); it++)
{
	if (it->second->m_bType == CSpecialItemGroup::SPECIAL && it->second->Contains(vnum))
	{
		item->SetSIGVnum(it->first);
	}
}
}

Agora em game/questlua_pc.cpp

procurar por:

int pc_get_special_ride_vnum(lua_State* L)

Substituir a função toda por:

int pc_get_special_ride_vnum(lua_State* L)
{
LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr();

if (NULL != pChar)
{
	LPITEM Unique1 = pChar->GetWear(WEAR_UNIQUE1);
	LPITEM Unique2 = pChar->GetWear(WEAR_UNIQUE2);
	LPITEM Unique3 = pChar->GetWear(WEAR_COSTUME_MONTADA);

	if (NULL != Unique1)
	{
		if (UNIQUE_GROUP_SPECIAL_RIDE == Unique1->GetSpecialGroup())
		{
			lua_pushnumber(L, Unique1->GetVnum());
			lua_pushnumber(L, Unique1->GetSocket(2));
			return 2;
		}
	}

	if (NULL != Unique2)
	{
		if (UNIQUE_GROUP_SPECIAL_RIDE == Unique2->GetSpecialGroup())
		{
			lua_pushnumber(L, Unique2->GetVnum());
			lua_pushnumber(L, Unique2->GetSocket(2));
			return 2;
		}
	}

	if (NULL != Unique3)
	{
		if (UNIQUE_GROUP_SPECIAL_RIDE == Unique3->GetSpecialGroup())
		{
			lua_pushnumber(L, Unique3->GetVnum());
			lua_pushnumber(L, Unique3->GetSocket(2));
			return 2;
		}
	}
}

lua_pushnumber(L, 0);
lua_pushnumber(L, 0);

return 2;
}

Agora em game/char_battle.cpp

procurar por:

if (IsHorseRiding())

alterar para:

{
	if (IsHorseRiding())
	{
		StopRiding();
	}
	else if (GetMountVnum())
	{
		RemoveAffect(AFFECT_MOUNT_BONUS);
		LPITEM item = GetWear(WEAR_UNIQUE1);
		LPITEM item2 = GetWear(WEAR_UNIQUE2);
		LPITEM item3 = GetWear(WEAR_COSTUME_MONTADA);

		if (item && item->IsRideItem())
			UnequipItem(item);

		if (item2 && item2->IsRideItem())
			UnequipItem(item2);

		if (item3 && item3->IsRideItem())
			UnequipItem(item3);

		m_dwMountVnum = 0;
		UnEquipSpecialRideUniqueItem();

		UpdatePacket();
	}
}

Ainda no mesmo ficheiro procurar por:

if (bDropAntiDropUniqueItem)

para não droparem o selo enquanto tiverem a usar a montada...

Alterar para o seguinte:

if (bDropAntiDropUniqueItem)
{
	LPITEM pkItem;

	pkItem = GetWear(WEAR_UNIQUE1);

	if (pkItem && pkItem->GetVnum() == UNIQUE_ITEM_SKIP_ITEM_DROP_PENALTY)
	{
		SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE1, 255);
		vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), EQUIPMENT));
	}

	pkItem = GetWear(WEAR_UNIQUE2);

	if (pkItem && pkItem->GetVnum() == UNIQUE_ITEM_SKIP_ITEM_DROP_PENALTY)
	{
		SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_UNIQUE2, 255);
		vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), EQUIPMENT));
	}

	pkItem = GetWear(WEAR_COSTUME_MONTADA);

	if (pkItem && pkItem->GetVnum() == UNIQUE_ITEM_SKIP_ITEM_DROP_PENALTY)
	{
		SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_COSTUME_MONTADA, 255);
		vec_item.push_back(std::make_pair(pkItem->RemoveFromCharacter(), EQUIPMENT));
	}
}

Em game/cmd_general.cpp

procurar por:

ACMD(do_unmount)

substituir a função toda por:

ACMD(do_unmount)
{
LPITEM item = ch->GetWear(WEAR_UNIQUE1);
LPITEM item2 = ch->GetWear(WEAR_UNIQUE2);
LPITEM item3 = ch->GetWear(WEAR_COSTUME_MONTADA);

if (item && item->IsRideItem())
	ch->UnequipItem(item);
if (item2 && item2->IsRideItem())
	ch->UnequipItem(item2);
if (item3 && item3->IsRideItem())
	ch->UnequipItem(item3);

if (true == ch->UnEquipSpecialRideUniqueItem())
{
	ch->RemoveAffect(AFFECT_MOUNT);
	ch->RemoveAffect(AFFECT_MOUNT_BONUS);

	if (ch->IsHorseRiding())
	{
		ch->StopRiding();
	}
}
else
{
	ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[unmoun]Erro detectado."));
}
}

Procurar por:

ACMD(do_ride)

Substituir a função toda por:

ACMD(do_ride)
{
dev_log(LOG_DEB0, "[DO_RIDE]");
if (ch->IsDead() || ch->IsStun())
return;

{
if (ch->IsHorseRiding())
{
	dev_log(LOG_DEB0, "[DO_RIDE]");
	ch->StopRiding(); 
	return;
}

if (ch->GetMountVnum())
{
	dev_log(LOG_DEB0, "[DO_RIDE]");
	do_unmount(ch, NULL, 0, 0);
	return;
}
   }

{
if (ch->GetHorse() != NULL)
{
	dev_log(LOG_DEB0, "[DO_RIDE]");
	ch->StartRiding();
	return;
}

for (BYTE i=0; i<INVENTORY_MAX_NUM; ++i)
{
	LPITEM item = ch->GetInventoryItem(i);
	if (NULL == item)
	continue;

	if (item->IsRideItem())
	{
		if (NULL==ch->GetWear(WEAR_UNIQUE1) || NULL==ch->GetWear(WEAR_UNIQUE2) || NULL==ch->GetWear(WEAR_COSTUME_MONTADA))
		{
			dev_log(LOG_DEB0, "[DO_RIDE] Usar item da quest");
			ch->UseItem(TItemPos (INVENTORY, i));
			return;
		}
	}

	switch (item->GetVnum())
	{
	case 71114:
	case 71116:
	case 71118:
	case 71120:
		dev_log(LOG_DEB0, "[DO_RIDE] Usar item da quest");
		ch->UseItem(TItemPos (INVENTORY, i));
		return;
	break;
	default:
		return;
	break;
	}

	if( (item->GetVnum() > 52000) && (item->GetVnum() < 52091) )	{
		dev_log(LOG_DEB0, "[DO_RIDE] Usar item da quest");
		ch->UseItem(TItemPos (INVENTORY, i));
		return;
	}
}
}

ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[do_ride] Erro"));
}

Agora em game/char_item.cpp

procurar por:

if (UNIQUE_SPECIAL_RIDE == item->GetSubType() && IS_SET(item->GetFlag(), ITEM_FLAG_QUEST_USE))

abaixo desse if adicionar este:

if (COSTUME_MONTADA == item->GetSubType())
{
quest::CQuestManager::instance().UseItem(GetPlayerID(), item, false);
}

Procurar por:

case POINT_COSTUME_ATTR_BONUS:

Substituir por:

case POINT_COSTUME_ATTR_BONUS:
{
	static BYTE abSlot[] = { WEAR_COSTUME_BODY, WEAR_COSTUME_HAIR, WEAR_COSTUME_MONTADA };
	static std::vector <BYTE> vec_slots(abSlot, abSlot + _countof(abSlot));
	pBuff = M2_NEW CBuffOnAttributes(this, bType, &vec_slots);
}

Procurar por:

bool CHARACTER::IsEquipUniqueItem(DWORD dwItemVnum) const

Substituir a função toda por:

bool CHARACTER::IsEquipUniqueItem(DWORD dwItemVnum) const
{
{
	LPITEM u = GetWear(WEAR_UNIQUE1);

	if (u && u->GetVnum() == dwItemVnum)
		return true;
}
{
	LPITEM u = GetWear(WEAR_UNIQUE2);

	if (u && u->GetVnum() == dwItemVnum)
		return true;
}
{
	LPITEM u = GetWear(WEAR_COSTUME_MONTADA);

	if (u && u->GetVnum() == dwItemVnum)
		return true;
}
if (dwItemVnum == UNIQUE_ITEM_RING_OF_LANGUAGE)
	return IsEquipUniqueItem(UNIQUE_ITEM_RING_OF_LANGUAGE_SAMPLE);
return false;
}

Procurar por:

bool CHARACTER::IsEquipUniqueGroup(DWORD dwGroupVnum) const

Substituir a função toda por:

bool CHARACTER::IsEquipUniqueGroup(DWORD dwGroupVnum) const
{
{
	LPITEM u = GetWear(WEAR_UNIQUE1);

	if (u && u->GetSpecialGroup() == (int)dwGroupVnum)
		return true;
}
{
	LPITEM u = GetWear(WEAR_UNIQUE2);

	if (u && u->GetSpecialGroup() == (int)dwGroupVnum)
		return true;
}
{
	LPITEM u = GetWear(WEAR_COSTUME_MONTADA);

	if (u && u->GetSpecialGroup() == (int)dwGroupVnum)
		return true;
}
return false;
}

Procurar por:

bool CHARACTER::UnEquipSpecialRideUniqueItem()

Substituir a função toda por:

bool CHARACTER::UnEquipSpecialRideUniqueItem()
{
LPITEM Unique1 = GetWear(WEAR_UNIQUE1);
LPITEM Unique2 = GetWear(WEAR_UNIQUE2);
LPITEM Unique3 = GetWear(WEAR_COSTUME_MONTADA);

if (NULL != Unique1)
{
	if (UNIQUE_GROUP_SPECIAL_RIDE == Unique1->GetSpecialGroup())
	{
		return UnequipItem(Unique1);
	}
}
if (NULL != Unique2)
{
	if (UNIQUE_GROUP_SPECIAL_RIDE == Unique2->GetSpecialGroup())
	{
		return UnequipItem(Unique2);
	}
}
if (NULL != Unique3)
{
	if (UNIQUE_GROUP_SPECIAL_RIDE == Unique3->GetSpecialGroup())
	{
		return UnequipItem(Unique3);
	}
}
return true;
}

Procurar por:

if (item->GetWearFlag() & WEARABLE_UNIQUE)

Substituir a função toda por:

if (item->GetWearFlag() & WEARABLE_UNIQUE)
{
if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) ||
	(GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item)) ||
	(GetWear(WEAR_COSTUME_MONTADA) && GetWear(WEAR_COSTUME_MONTADA)->IsSameSpecialGroup(item)))
{
	return false;
}
if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) &&
	!marriage::CManager::instance().IsMarried(GetPlayerID()))
{
	return false;
}
}

Quest

quest ride begin
   state start begin
       function Ride( vnum, remain_time )
           ride_info = {
               [71114] = { 20110,    5*60,                    apply.DEF_GRADE_BONUS,    75,        75,    false    },
               [71115] = { 20110,    5*60,    apply.DEF_GRADE_BONUS,    100,    75,    false    },
               [71116] = { 20111,    5*60,                    apply.DEF_GRADE_BONUS,    100,    80,    false    },
               [71117] = { 20111,    5*60,    apply.DEF_GRADE_BONUS,    150,    80,    false    },
               [71118] = { 20112,    5*60,                    apply.DEF_GRADE_BONUS,    125,    85,    false    },
               [71119] = { 20112,    5*60,    apply.DEF_GRADE_BONUS,    200,    85,    false    },
               [71120] = { 20113,    5*60,                    apply.ATT_GRADE_BONUS,    200,    85,    false    },
               [71121] = { 20113,    5*60,    apply.ATT_GRADE_BONUS,    300,    85,    false    },
               [71161] = { 20219,    5*60,    apply.STR,    100,        1,    false,    false,    false},                
               [71124] = { 20114,    5*60,    apply.MOV_SPEED,    0,    1,    false    },
               [71125] = { 20115,    5*60,    apply.ATTBONUS_MONSTER,    20,        20,    false    },
               [71126] = { 20116,    5*60,    apply.ATTBONUS_MONSTER,    20,        20,    false    },
               [71127] = { 20117,    5*60,    apply.ATTBONUS_MONSTER,    20,        20,    false    },
               [71128] = { 20118,    5*60,    apply.ATTBONUS_MONSTER,    20,        20,    false    },
               [71137] = { 20120,    5*60,    apply.MOV_SPEED, 0,    1,    false,    false,    false},
               [71138] = { 20121,    5*60,    apply.MOV_SPEED, 0,    1,    false,    false,    false},
               [71139] = { 20122,    5*60,    apply.MOV_SPEED, 0,    1,    false,    false,    false},
               [71140] = { 20123,    5*60,    apply.MOV_SPEED, 0,    1,    false,    false,    false},
               [71141] = { 20124,    5*60,    apply.MOV_SPEED, 0,    1,    false,    false,    false},
               [71142] = { 20125,    5*60,    apply.MOV_SPEED, 0,    1,    false,    false,    false},
               [71131] = { 20119,  5*60,    apply.MOV_SPEED, 60,    1,    false    },
               [71132] = { 20119,  5*60,    apply.MOV_SPEED, 60,    1,    false    },
               [71133] = { 20119,  5*60,    apply.MOV_SPEED, 60,    1,    false    },
               [71134] = { 20119,  5*60,    apply.ATTBONUS_MONSTER,    20,    1,    false    },
               [71161] = { 20219,  5*60,    apply.ATTBONUS_MONSTER,    20,    1,    false    },
               }

           if pc.level < ride_info[vnum][5] then
               syschat("Não podes usar está montada, porque o teu nivel é muito baixo.")
           else
               if ride_info[vnum][2] == 0 and remain_time != 0 then
                   pc.mount( ride_info[vnum][1], remain_time*60 )
                   pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], remain_time*60 )
               else
                   pc.mount( ride_info[vnum][1], ride_info[vnum][2] )
                   pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], ride_info[vnum][2] )
               end

               if true == ride_info[vnum][6] then
                   pc.remove_item(vnum, 1)
               end    
           end    
       end

       when login begin
           local vnum, remain_time = pc.get_special_ride_vnum()

           if 0 != vnum then
               ride.Ride(vnum, remain_time)
           end
       end

       when 71114.use or 71115.use or 71116.use or 71117.use or
           71118.use or 71119.use or 71120.use or 71121.use or 71124.use or
           71125.use or 71126.use or 71127.use or 71128.use or
           71131.use or 71132.use or 71133.use or 71134.use or 71161.use or 71137.use or 71138.use or 71139.use begin

           if pc.is_polymorphed() then
               syschat("Não podes usar está montada, porque estás transformado!")
           elseif false == pc.is_riding() then
                if true == horse.is_summon() then
                   horse.unsummon()
               end
               ride.Ride(item.vnum, 0)
           else
               pc.unmount()
           end
       end

       when 52001.use or 52002.use or 52003.use or 52004.use or 52005.use or 52006.use or 52007.use or 52008.use or 52009.use or 52010.use or 52011.use or 52012.use or 52013.use or 52014.use or 52015.use or
           52016.use or 52017.use or 52018.use or 52019.use or 52020.use or 52021.use or 52022.use or 52023.use or 52024.use or 52025.use or 52026.use or 52027.use or 52028.use or 52029.use or 52030.use or
           52031.use or 52032.use or 52033.use or 52034.use or 52035.use or 52036.use or 52037.use or 52038.use or 52039.use or 52040.use or 52041.use or 52042.use or 52043.use or 52044.use or 52045.use or
           52046.use or 52047.use or 52048.use or 52049.use or 52050.use or 52051.use or 52052.use or 52053.use or 52054.use or 52055.use or 52056.use or 52057.use or 52058.use or 52059.use or 52060.use or
           52061.use or 52062.use or 52063.use or 52064.use or 52065.use or 52066.use or 52067.use or 52068.use or 52069.use or 52070.use or 52071.use or 52072.use or 52073.use or 52074.use or 52075.use or
           52076.use or 52077.use or 52078.use or 52079.use or 52080.use or 52081.use or 52082.use or 52083.use or 52084.use or 52085.use or 52086.use or 52087.use or 52088.use or 52089.use or 52090.use or 71164.use or
           52091.use or 52092.use or 52093.use or 52094.use or 52095.use or 52096.use or 52097.use or 52098.use or 52099.use or 52100.use or 52101.use or 52102.use or 52103.use or 52104.use or 52105.use begin
           if pc.is_polymorphed() then
               syschat("Não podes usar está montada, porque estás transformado!")
           elseif false == pc.is_riding() then
               if true == horse.is_summon() then
                   horse.unsummon()
               end

               ride.Ride(item.vnum, 0)
           else
               pc.unmount()
           end
       end
   end
end

Para poderem usar o item nesse slot basta ir ao navicat (ou qualquer software de gestão de base de dados)

Alteram o type da vossa montada para 28 e o subtype para 2 (ira utilizar o slot que atualmente usa-se as faixas, tiverem faixas e quiserem usar o outro slot ao lado para as montadas basta alterar o subtype para 3, não esquecer que a alteração deve ser feita no item_proto do mysql e no item_proto do cliente.

Cumprimentos Dynamic Things

Link to comment
Share on other sites

  • 2 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
 Share

×
×
  • Create New...