party improvements, still need to fix shared exp

This commit is contained in:
Henrique Santiago
2012-01-10 21:38:32 -02:00
parent 8ad88c4070
commit e714f9e149
7 changed files with 141 additions and 22 deletions

View File

@@ -174,16 +174,16 @@ namespace Otc
enum PlayerShields {
ShieldNone = 0,
ShieldWhiteYellow,
ShieldWhiteBlue,
ShieldBlue,
ShieldYellow,
ShieldBlueSharedExp,
ShieldYellowSharedExp,
ShieldBlueNoSharedExpBlink,
ShieldYellowNoSharedExpBlink,
ShieldBlueNoSharedExp,
ShieldYellowNoSharedExp
ShieldWhiteYellow, // 1 party leader
ShieldWhiteBlue, // 2 party member
ShieldBlue, // 3 party member sexp off
ShieldYellow, // 4 party leader sexp off
ShieldBlueSharedExp, // 5 party member sexp on
ShieldYellowSharedExp, // 6 // party leader sexp on
ShieldBlueNoSharedExpBlink, // 7 party member sexp inactive guilty
ShieldYellowNoSharedExpBlink, // 8 // party leader sexp inactive guilty
ShieldBlueNoSharedExp, // 9 party member sexp inactive innocent
ShieldYellowNoSharedExp // 10 party leader sexp inactive innocent
};
enum PlayerEmblems {

View File

@@ -333,7 +333,7 @@ void Game::talkPrivate(int channelType, const std::string& receiver, const std::
m_protocolGame->sendTalk(channelType, 0, receiver, message);
}
void Game::inviteToParty(int creatureId)
void Game::partyInvite(int creatureId)
{
if(!m_online || !checkBotProtection())
return;
@@ -341,6 +341,47 @@ void Game::inviteToParty(int creatureId)
m_protocolGame->sendInviteToParty(creatureId);
}
void Game::partyJoin(int creatureId)
{
if(!m_online || !checkBotProtection())
return;
m_protocolGame->sendJoinParty(creatureId);
}
void Game::partyRevokeInvitation(int creatureId)
{
if(!m_online || !checkBotProtection())
return;
m_protocolGame->sendRevokeInvitation(creatureId);
}
void Game::partyPassLeadership(int creatureId)
{
if(!m_online || !checkBotProtection())
return;
m_protocolGame->sendPassLeadership(creatureId);
}
void Game::partyLeave()
{
if(!m_online || !checkBotProtection())
return;
m_protocolGame->sendLeaveParty();
}
void Game::partyShareExperience(bool active)
{
if(!m_online || !checkBotProtection())
return;
m_protocolGame->sendShareExperience(active, 0);
}
void Game::openOutfitWindow()
{
if(!m_online || !checkBotProtection())

View File

@@ -65,7 +65,12 @@ public:
void talk(const std::string& message);
void talkChannel(int channelType, int channelId, const std::string& message);
void talkPrivate(int channelType, const std::string& receiver, const std::string& message);
void inviteToParty(int creatureId);
void partyInvite(int creatureId);
void partyJoin(int creatureId);
void partyRevokeInvitation(int creatureId);
void partyPassLeadership(int creatureId);
void partyLeave();
void partyShareExperience(bool active);
void openOutfitWindow();
void setOutfit(const Outfit& outfit);
void addVip(const std::string& name);

View File

@@ -122,6 +122,7 @@ void OTClient::registerLuaFunctions()
g_lua.registerClass<Creature, Thing>();
g_lua.bindClassMemberFunction<Creature>("getName", &Creature::getName);
g_lua.bindClassMemberFunction<Creature>("getShield", &Creature::getShield);
g_lua.bindClassMemberFunction<Creature>("setOutfit", &Creature::setOutfit);
g_lua.bindClassMemberFunction<Creature>("getOutfit", &Creature::getOutfit);
g_lua.bindClassMemberFunction<Creature>("setSkullTexture", &Creature::setSkullTexture);
@@ -183,7 +184,14 @@ void OTClient::registerLuaFunctions()
g_lua.bindClassStaticFunction<Game>("follow", std::bind(&Game::follow, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("cancelFollow", std::bind(&Game::cancelFollow, &g_game));
g_lua.bindClassStaticFunction<Game>("rotate", std::bind(&Game::rotate, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("inviteToParty", std::bind(&Game::inviteToParty, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("partyInvite", std::bind(&Game::partyInvite, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("partyJoin", std::bind(&Game::partyJoin, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("partyRevokeInvitation", std::bind(&Game::partyRevokeInvitation, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("partyPassLeadership", std::bind(&Game::partyPassLeadership, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("partyLeave", std::bind(&Game::partyLeave, &g_game));
g_lua.bindClassStaticFunction<Game>("partyShareExperience", std::bind(&Game::partyShareExperience, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("addVip", std::bind(&Game::addVip, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("removeVip", std::bind(&Game::removeVip, &g_game, _1));
g_lua.bindClassStaticFunction<Game>("talk", std::bind(&Game::talk, &g_game, _1));