mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 22:53:26 +02:00
Version 2.5.4 - http://otclient.net/showthread.php?tid=329
This commit is contained in:
@@ -1384,7 +1384,14 @@ void Game::mount(bool mount)
|
||||
{
|
||||
if(!canPerformGameAction())
|
||||
return;
|
||||
m_protocolGame->sendMountStatus(mount);
|
||||
m_protocolGame->sendOutfitExtensionStatus(mount ? 1 : 0);
|
||||
}
|
||||
|
||||
void Game::setOutfitExtensions(int mount, int wings, int aura, int shader)
|
||||
{
|
||||
if (!canPerformGameAction())
|
||||
return;
|
||||
m_protocolGame->sendOutfitExtensionStatus(mount, wings, aura, shader);
|
||||
}
|
||||
|
||||
void Game::requestItemInfo(const ItemPtr& item, int index)
|
||||
|
@@ -282,6 +282,7 @@ public:
|
||||
// 870 only
|
||||
void equipItem(const ItemPtr& item);
|
||||
void mount(bool mount);
|
||||
void setOutfitExtensions(int mount, int wings, int aura, int shader);
|
||||
|
||||
// 910 only
|
||||
void requestItemInfo(const ItemPtr& item, int index);
|
||||
|
@@ -279,6 +279,7 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_game", "requestQuestLine", &Game::requestQuestLine, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "equipItem", &Game::equipItem, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "mount", &Game::mount, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "setOutfitExtensions", &Game::setOutfitExtensions, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "requestItemInfo", &Game::requestItemInfo, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "ping", &Game::ping, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "setPingDelay", &Game::setPingDelay, &g_game);
|
||||
@@ -488,8 +489,10 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindClassStaticFunction<Creature>("create", []{ return CreaturePtr(new Creature); });
|
||||
g_lua.bindClassMemberFunction<Creature>("getId", &Creature::getId);
|
||||
g_lua.bindClassMemberFunction<Creature>("getName", &Creature::getName);
|
||||
g_lua.bindClassMemberFunction<Creature>("setName", &Creature::setName);
|
||||
g_lua.bindClassMemberFunction<Creature>("setManaPercent", &LocalPlayer::setManaPercent);
|
||||
g_lua.bindClassMemberFunction<Creature>("getManaPercent", &LocalPlayer::getManaPercent);
|
||||
g_lua.bindClassMemberFunction<Creature>("setHealthPercent", &Creature::setHealthPercent);
|
||||
g_lua.bindClassMemberFunction<Creature>("getHealthPercent", &Creature::getHealthPercent);
|
||||
g_lua.bindClassMemberFunction<Creature>("getSpeed", &Creature::getSpeed);
|
||||
g_lua.bindClassMemberFunction<Creature>("setSpeed", &Creature::setSpeed);
|
||||
|
@@ -84,9 +84,9 @@ bool luavalue_cast(int index, Outfit& outfit)
|
||||
}
|
||||
if (g_game.getFeature(Otc::GameWingsAndAura)) {
|
||||
g_lua.getField("wings", index);
|
||||
outfit.setMount(g_lua.popInteger());
|
||||
outfit.setWings(g_lua.popInteger());
|
||||
g_lua.getField("aura", index);
|
||||
outfit.setMount(g_lua.popInteger());
|
||||
outfit.setAura(g_lua.popInteger());
|
||||
}
|
||||
//if (g_game.getFeature(Otc::GameOutfitShaders)) {
|
||||
g_lua.getField("shader", index);
|
||||
|
@@ -828,15 +828,24 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit)
|
||||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::sendMountStatus(bool mount)
|
||||
void ProtocolGame::sendOutfitExtensionStatus(int mount, int wings, int aura, int shader)
|
||||
{
|
||||
if(g_game.getFeature(Otc::GamePlayerMounts)) {
|
||||
if(g_game.getFeature(Otc::GamePlayerMounts) || g_game.getFeature(Otc::GameWingsAndAura) || g_game.getFeature(Otc::GameWingsAndAura)) {
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
msg->addU8(Proto::ClientMount);
|
||||
msg->addU8(mount);
|
||||
if (g_game.getFeature(Otc::GamePlayerMounts)) {
|
||||
msg->addU8(mount);
|
||||
}
|
||||
if (g_game.getFeature(Otc::GameWingsAndAura)) {
|
||||
msg->addU8(wings);
|
||||
msg->addU8(aura);
|
||||
}
|
||||
if (g_game.getFeature(Otc::GameOutfitShaders)) {
|
||||
msg->addU8(shader);
|
||||
}
|
||||
send(msg);
|
||||
} else {
|
||||
g_logger.error("ProtocolGame::sendMountStatus does not support the current protocol.");
|
||||
g_logger.error("ProtocolGame::sendOutfitExtensionStatus does not support the current protocol.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user