Jump to content
metin2dev

M2BobFixed

Members
  • Content count

    300
  • Joined

  • Last visited

M2BobFixed last won the day on May 6 2016

M2BobFixed had the most liked content!

Community Reputation

1,383 Godlike

4 Followers

About M2BobFixed

  • Rank
    Noble

Contact Methods

  • Website URL
    http://www.gamesecurity.eu
  • Skype
    realotus

Profile Information

  • Gender
    Male
  • Location
    Roma

Recent Profile Visitors

2,948 profile views
  1. I will pay for fix

    The fix is very easy just fix packet imo
  2. With this tool you can convert the Eternexus Keys to Eterpack.cpp Keys: //Your Eterpack.cpp Example static DWORD s_adwEterPackKey[] = { 45129401, 92367215, 681285731, 1710201, }; static DWORD s_adwEterPackSecurityKey[] = { 78952482, 527348324, 1632942, 486274726, }; This is my tool to Convert Eternexus to Eterpack! <html> <head> <title> LZO - Eternexus To EterPack by M2BobFixed </title> </head> <body> <center> <?php if (isset($_POST["key1"])) { $key1=$_POST["key1"]; $key2=$_POST["key2"]; $key3=$_POST["key3"]; $key4=$_POST["key4"]; $key5=$_POST["key5"]; $key6=$_POST["key6"]; $key7=$_POST["key7"]; $key8=$_POST["key8"]; if (ctype_xdigit($key1) && ctype_xdigit($key2) && ctype_xdigit($key3) && ctype_xdigit($key4)) { if (strlen($key1) == 8 && strlen($key2) == 8 && strlen($key3) == 8 && strlen($key4) == 8) { $index_key=explode(" - ", $key1." - ".$key2." - ".$key3." - ".$key4); $final_key=""; foreach ($index_key as $k=>$v) $final_key.=strtolower("".implode("", array_reverse(str_split($index_key[$k], 2)))); $eterpack=unpack("L*", hex2bin($final_key)); echo "You inserted these Index Keys: <b>[".$key1." - ".$key2." - ".$key3." - ".$key4."]</b><br><br>"; echo "Here, your Index Keys for Eterpack.cpp:<br>"; echo "<b>static DWORD s_adwEterPackKey[] = {".$eterpack[1].", ".$eterpack[2].", ".$eterpack[3].", ".$eterpack[4].",};</b><br><br>"; }else{ echo "[IndexKey] Insert valid index keys!<br>"; } }else{ echo "[IndexKey] Insert valid index keys!<br>"; } if (ctype_xdigit($key5) && ctype_xdigit($key6) && ctype_xdigit($key7) && ctype_xdigit($key8)) { if (strlen($key5) == 8 && strlen($key6) == 8 && strlen($key7) == 8 && strlen($key8) == 8) { $pack_key=explode(" - ", $key5." - ".$key6." - ".$key7." - ".$key8); $final_key2=""; foreach ($pack_key as $k2=>$v2) $final_key2.=strtolower("".implode("", array_reverse(str_split($pack_key[$k2], 2)))); $eterpack2=unpack("L*", hex2bin($final_key2)); echo "You inserted these Pack Keys: <b>[".$key5." - ".$key6." - ".$key7." - ".$key8."]</b><br><br>"; echo "Here, your Pack Keys for Eterpack.cpp:<br>"; echo "<b>static DWORD s_adwEterPackSecurityKey[] = {".$eterpack2[1].", ".$eterpack2[2].", ".$eterpack2[3].", ".$eterpack2[4].",};</b><br><br>"; }else{ echo "[PackKey] Insert valid pack keys!<br>"; } }else{ echo "[PackKey] Insert valid pack keys!<br>"; } } ?> <form method="post"> Insert your Eternexus Index Key: <input maxlength="8" placeholder="02B09EB9" value="02B09EB9" name="key1"> - <input maxlength="8" placeholder="0581696F" value="0581696F" name="key2"> - <input maxlength="8" placeholder="289B9863" value="289B9863" name="key3"> - <input maxlength="8" placeholder="001A1879" value="001A1879" name="key4"> <br> <br> Insert your Eternexus Pack Key: <input maxlength="8" placeholder="04B4B822" value="04B4B822" name="key5"> - <input maxlength="8" placeholder="1F6EB264" value="1F6EB264" name="key6"> - <input maxlength="8" placeholder="0018EAAE" value="0018EAAE" name="key7"> - <input maxlength="8" placeholder="1CFBF6A6" value="1CFBF6A6" name="key8"> <br> <br> <input type="submit" value="Convert!"> </form> </body> </center> </html>
  3. SERVER PART: input_main.cpp void CInputMain::PartyUseSkill(LPCHARACTER ch, const char* c_pData) { TPacketCGPartyUseSkill* p = (TPacketCGPartyUseSkill*) c_pData; if (!ch->GetParty()) return; if (ch->GetPlayerID() != ch->GetParty()->GetLeaderPID()) { ch->ChatPacket(CHAT_TYPE_INFO, "<Group> Only the leader can use this function."); return; } switch (p->bySkillIndex) { case PARTY_SKILL_HEAL: ch->GetParty()->HealParty(); break; case PARTY_SKILL_WARP: { if (ch->GetSkillLevel(SKILL_LEADERSHIP) >= 10) { //10 IS THE MIN LEVEL OF LEADERSHIP SKILL TO USE TELEPORT LPCHARACTER pch = CHARACTER_MANAGER::instance().Find(p->vid); if (pch) { ch->GetParty()->SummonToLeader(pch->GetPlayerID()); }else{ ch->ChatPacket(CHAT_TYPE_INFO, "<Teleport> The character is not online."); } }else{ ch->ChatPacket(CHAT_TYPE_INFO, "<Teleport> You need upgrade your leadership skill to use this function."); } } break; } } party.cpp void CParty::SummonToLeader(DWORD pid) { LPCHARACTER l = GetLeaderCharacter(); if (m_memberMap.find(pid) == m_memberMap.end()) { l->ChatPacket(CHAT_TYPE_INFO, "<Teleport> The character is too far."); return; } LPCHARACTER ch = m_memberMap[pid].pCharacter; if (!ch) { l->ChatPacket(CHAT_TYPE_INFO, "<Teleport> The character was not found in your map."); return; } if (ch->IsDead()) { l->ChatPacket(CHAT_TYPE_INFO, "<Teleport> I can't teleport the character if he is dead."); return; } ch->Show(l->GetMapIndex(), l->GetX(), l->GetY()); ch->Stop(); } CLIENT PART: root -> uiparty.py FIND THE __ShowStateButton and: ## Warp if self.stateButtonDict.has_key(self.MEMBER_BUTTON_WARP): button = self.stateButtonDict[self.MEMBER_BUTTON_WARP] button.SetPosition(xPos, y) button.Show() xPos += 23 Thanks to marty sama that sell this for 50€. NOW IT'S COMPLETELY FREE!
  4. Good evening! Do I want to order the protection of this process?
    
    Thank you for your reply, sorry if I'm curious about my english de google translator (i am hungarian)
  5. Yes is true... Now is free!
  6. item_manager.cpp: go to the bottom of the "LPITEM ITEM_MANAGER::CreateItem" Function Find this: else if (item->GetType() == ITEM_UNIQUE) { 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); } } } if (item->IsDragonSoul() && 0 == id) { DSManager::instance().DragonSoulItemInitialize(item); } return item; } REPLACE WITH THIS: else if (item->GetType() == ITEM_UNIQUE) { 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); } } } //FIX!!! if (item->IsAccessoryForSocket()) { item->SetSocket(0, 0); item->SetSocket(1, 0); item->SetSocket(2, 0); } //END OF FIX!!! if (item->IsDragonSoul() && 0 == id) { DSManager::instance().DragonSoulItemInitialize(item); } return item; } THIS FIX NOW IS FREE, MARTY SAMA SELL THIS FOR 20€... THAT NOOB!
  7. threeway_war.cpp #include "stdafx.h" #include "threeway_war.h" #include "../../common/length.h" #include "../../common/tables.h" #include "p2p.h" #include "locale_service.h" #include "packet.h" #include "char.h" #include "questmanager.h" #include "questlua.h" #include "start_position.h" #include "char_manager.h" #include "sectree_manager.h" #include "regen.h" #include "log.h" extern int test_server; extern int passes_per_sec; CThreeWayWar::CThreeWayWar() { Initialize(); } CThreeWayWar::~CThreeWayWar() { RegisterUserMap_.clear(); ReviveTokenMap_.clear(); } void CThreeWayWar::Initialize() { RegenFlag_ = 0; memset( KillScore_, 0, sizeof(KillScore_) ); RegisterUserMap_.clear(); ReviveTokenMap_.clear(); } int CThreeWayWar::GetKillScore( BYTE empire ) const { if( empire <= 0 || empire >= EMPIRE_MAX_NUM ) { sys_err("ThreeWayWar::GetKillScore Wrong Empire variable"); return 0; } return KillScore_[empire-1]; } void CThreeWayWar::SetKillScore( BYTE empire, int count ) { if( empire <= 0 || empire >= EMPIRE_MAX_NUM ) { sys_err("ThreeWayWar::SetKillScore Wrong Empire variable"); return; } KillScore_[empire-1] = count; } void CThreeWayWar::SetReviveTokenForPlayer(DWORD PlayerID, int count) { if (0 == PlayerID) return; ReviveTokenMap_[PlayerID] = count; } int CThreeWayWar::GetReviveTokenForPlayer(DWORD PlayerID) { if (0 == PlayerID) return 0; return ReviveTokenMap_[PlayerID]; } void CThreeWayWar::DecreaseReviveTokenForPlayer(DWORD PlayerID) { if (0 == PlayerID) return; ReviveTokenMap_[PlayerID] = ReviveTokenMap_[PlayerID] - 1; } bool CThreeWayWar::LoadSetting(const char* szFileName) { char szPath[1024]; snprintf( szPath, sizeof(szPath), "%s/%s", LocaleService_GetBasePath().c_str(), szFileName); FILE* pf = fopen( szPath, "r" ); if (NULL == pf) { sys_err("[ThreeWayWar] Cannot open file: <%s>", szPath ); return false; } char szLine[256]; char szSungziName[128]; char szPassName[3][128]; while( NULL != fgets(szLine, 256, pf) ) { if (0 == strncmp(szLine, "sungzi:", 7)) { struct ForkedSungziMapInfo sungziinfo; sscanf( szLine+7, "%d %d %d %d %d %d %d %s", &sungziinfo.m_iForkedSung, &sungziinfo.m_iForkedSungziStartPosition[0][0], &sungziinfo.m_iForkedSungziStartPosition[0][1], &sungziinfo.m_iForkedSungziStartPosition[1][0], &sungziinfo.m_iForkedSungziStartPosition[1][1], &sungziinfo.m_iForkedSungziStartPosition[2][0], &sungziinfo.m_iForkedSungziStartPosition[2][1], szSungziName); sungziinfo.m_stMapName = static_cast<std::string>(szSungziName); SungZiInfoMap_.push_back( sungziinfo ); MapIndexSet_.insert( sungziinfo.m_iForkedSung ); } else if (0 == strncmp(szLine, "pass:", 5)) { struct ForkedPassMapInfo passinfo; sscanf( szLine+5, "%d %d %d %s %d %d %d %s %d %d %d %s", &passinfo.m_iForkedPass[0], &passinfo.m_iForkedPassStartPosition[0][0], &passinfo.m_iForkedPassStartPosition[0][1], szPassName[0], &passinfo.m_iForkedPass[1], &passinfo.m_iForkedPassStartPosition[1][0], &passinfo.m_iForkedPassStartPosition[1][1], szPassName[1], &passinfo.m_iForkedPass[2], &passinfo.m_iForkedPassStartPosition[2][0], &passinfo.m_iForkedPassStartPosition[2][1], szPassName[2] ); passinfo.m_stMapName[0] = static_cast<std::string>(szPassName[0]); passinfo.m_stMapName[1] = static_cast<std::string>(szPassName[1]); passinfo.m_stMapName[2] = static_cast<std::string>(szPassName[2]); PassInfoMap_.push_back( passinfo ); MapIndexSet_.insert( passinfo.m_iForkedPass[0] ); MapIndexSet_.insert( passinfo.m_iForkedPass[1] ); MapIndexSet_.insert( passinfo.m_iForkedPass[2] ); } } fclose(pf); return true; } const ForkedPassMapInfo& CThreeWayWar::GetEventPassMapInfo() const { const size_t idx = quest::CQuestManager::instance().GetEventFlag( "threeway_war_pass_idx" ); return PassInfoMap_[idx]; } const ForkedSungziMapInfo& CThreeWayWar::GetEventSungZiMapInfo() const { const size_t idx = quest::CQuestManager::instance().GetEventFlag( "threeway_war_sungzi_idx" ); return SungZiInfoMap_[idx]; } bool CThreeWayWar::IsThreeWayWarMapIndex(int iMapIndex) const { return MapIndexSet_.find(iMapIndex) != MapIndexSet_.end(); } bool CThreeWayWar::IsSungZiMapIndex(int iMapIndex) const { std::vector<ForkedSungziMapInfo>::const_iterator it = SungZiInfoMap_.begin(); for( ; it != SungZiInfoMap_.end() ; ++it ) { if (iMapIndex == it->m_iForkedSung) { return true; } } return false; } void CThreeWayWar::RandomEventMapSet() { const size_t pass_idx = number( 0, PassInfoMap_.size()-1 ); const size_t sung_idx = number( 0, SungZiInfoMap_.size()-1 ); quest::CQuestManager::instance().RequestSetEventFlag( "threeway_war_sungzi_idx", sung_idx ); quest::CQuestManager::instance().RequestSetEventFlag( "threeway_war_pass_idx", pass_idx ); } bool CThreeWayWar::IsRegisteredUser(DWORD PlayerID) const { boost::unordered_map<DWORD, DWORD>::const_iterator iter = RegisterUserMap_.find(PlayerID); if (iter == RegisterUserMap_.end()) { return false; } return true; } void CThreeWayWar::RegisterUser(DWORD PlayerID) { if (0 == PlayerID) return; RegisterUserMap_.insert( std::make_pair(PlayerID, PlayerID) ); } void CThreeWayWar::onDead(LPCHARACTER pChar, LPCHARACTER pkKiller) { if (!pChar->IsPC()) return; if (GetRegenFlag() == -1) return; DecreaseReviveTokenForPlayer( pChar->GetPlayerID() ); if (!IsSungZiMapIndex(pChar->GetMapIndex())) return; if (NULL == pkKiller || !pkKiller->IsPC()) return; if (pChar->GetEmpire() == pkKiller->GetEmpire()) return; int nKillScore = GetKillScore(pkKiller->GetEmpire()); if (nKillScore >= 0) { nKillScore += 1; SetKillScore(pkKiller->GetEmpire(), nKillScore); } const int nVictoryScore = quest::CQuestManager::instance().GetEventFlag("threeway_war_kill_count"); if (GetRegenFlag() == 0) { if (nKillScore != 0 && (nKillScore % 5) == 0) { char szBuf[80 + 1]; snprintf(szBuf, sizeof(szBuf), "Shinsoo: [%d/%d] - Chunjo: [%d/%d] - Jinno: [%d/%d]", GetKillScore(1), nVictoryScore, GetKillScore(2), nVictoryScore, GetKillScore(3), nVictoryScore); SendNoticeMap(szBuf, GetSungziMapIndex(), false); } int nEliminatedEmpireCount = 0; BYTE bLoseEmpire = 0; for (int n = 1; n < 4; ++n) { if (GetKillScore(n) < nVictoryScore) { ++nEliminatedEmpireCount; bLoseEmpire = n; } } if (nEliminatedEmpireCount == 1) { SetKillScore(1, 0); SetKillScore(2, 0); SetKillScore(3, 0); SetKillScore(bLoseEmpire, -1); quest::warp_all_to_map_my_empire_event_info *info; info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>(); info->m_lMapIndexFrom = GetSungziMapIndex(); info->m_lMapIndexTo = EMPIRE_START_MAP(bLoseEmpire); info->m_x = EMPIRE_START_X(bLoseEmpire); info->m_y = EMPIRE_START_Y(bLoseEmpire); info->m_bEmpire = bLoseEmpire; event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(5)); const std::string Nation(EMPIRE_NAME(bLoseEmpire)); char szNotice[512+1]; snprintf(szNotice, sizeof(szNotice), "<EmpireWar> The empire %s has lost the war.", Nation.c_str()); BroadcastNotice(szNotice); char szBuf[80 + 1]; snprintf(szBuf, sizeof(szBuf), "[%s] You'll be teleported to your own village...", Nation.c_str()); SendNoticeMap(szBuf, GetSungziMapIndex(), false); SetRegenFlag(1); } } else if (GetRegenFlag() == 1) { if (nKillScore != 0 && (nKillScore % 2) == 0) { char szBuf[80 + 1]; if (GetKillScore(1) != -1 && GetKillScore(2) != -1 && GetKillScore(3) == -1) { snprintf(szBuf, sizeof(szBuf), "Shinsoo: [%d/%d] - Chunjo: [%d/%d]", GetKillScore(1), nVictoryScore, GetKillScore(2), nVictoryScore); }else if (GetKillScore(1) != -1 && GetKillScore(2) == -1 && GetKillScore(3) != -1) { snprintf(szBuf, sizeof(szBuf), "Shinsoo: [%d/%d] - Jinno: [%d/%d]", GetKillScore(1), nVictoryScore, GetKillScore(3), nVictoryScore); }else if (GetKillScore(1) == -1 && GetKillScore(2) != -1 && GetKillScore(3) != -1) { snprintf(szBuf, sizeof(szBuf), "Chunjo: [%d/%d] - Jinno: [%d/%d]", GetKillScore(2), nVictoryScore, GetKillScore(3), nVictoryScore); } SendNoticeMap(szBuf, GetSungziMapIndex(), false); } int nVictoryEmpireIndex = 0; for (int n = 1; n < 4; ++n) { nKillScore = GetKillScore(n); if (nKillScore == -1) continue; if (nKillScore >= nVictoryScore) { nVictoryEmpireIndex = n; break; } } if (nVictoryEmpireIndex == 0) return; for (int n = 1; n < 4; ++n) { if (n != nVictoryEmpireIndex && GetKillScore(n) != -1) { BYTE bLoseEmpire = n; quest::warp_all_to_map_my_empire_event_info * info; info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>(); info->m_lMapIndexFrom = GetSungziMapIndex(); info->m_lMapIndexTo = EMPIRE_START_MAP(bLoseEmpire); info->m_x = EMPIRE_START_X(bLoseEmpire); info->m_y = EMPIRE_START_Y(bLoseEmpire); info->m_bEmpire = bLoseEmpire; event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(5)); const std::string LoseNation(EMPIRE_NAME(bLoseEmpire)); char szBuf[80 + 1]; snprintf(szBuf, sizeof(szBuf), "[%s] You'll be teleported to your own village...", LoseNation.c_str()); SendNoticeMap(szBuf, GetSungziMapIndex(), false); } } const std::string EmpireName(EMPIRE_NAME(nVictoryEmpireIndex)); char szNotice3[512+1]; snprintf(szNotice3, sizeof(szNotice3), "<EmpireWar> The war was won by %s!", EmpireName.c_str()); BroadcastNotice(szNotice3); char szBuf[160 + 1]; snprintf(szBuf, sizeof(szBuf), "[%s] Congrats guys, you win the war. You'll be teleported to your own village!", EmpireName.c_str()); SendNoticeMap(szBuf, GetSungziMapIndex(), false); SetRegenFlag(-1); quest::CQuestManager::instance().EraseEventFlag("threeway_war"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_dead_count"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_kill_count"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_open_gate1"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_open_gate2"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_open_gate3"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_pass_idx"); quest::CQuestManager::instance().EraseEventFlag("threeway_war_sungzi_idx"); quest::warp_all_to_map_my_empire_event_info * info; info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>(); info->m_lMapIndexFrom = GetSungziMapIndex(); info->m_lMapIndexTo = EMPIRE_START_MAP(nVictoryEmpireIndex); info->m_x = EMPIRE_START_X(nVictoryEmpireIndex); info->m_y = EMPIRE_START_Y(nVictoryEmpireIndex); info->m_bEmpire = nVictoryEmpireIndex; event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(30)); } } struct FDestroyAllEntity { void operator() (LPENTITY ent) { if (true == ent->IsType(ENTITY_CHARACTER)) { LPCHARACTER ch = static_cast<LPCHARACTER>(ent); if (false == ch->IsPC()) { ch->Dead(); } } } }; void CThreeWayWar::RemoveAllMonstersInThreeWay() const { std::set<int>::const_iterator iter = MapIndexSet_.begin(); while( iter != MapIndexSet_.end() ) { LPSECTREE_MAP pSecMap = SECTREE_MANAGER::instance().GetMap( *iter ); if (NULL != pSecMap) { FDestroyAllEntity f; pSecMap->for_each( f ); } ++iter; } } const char* GetSungziMapPath() { static char s_szMapPath[128]; snprintf(s_szMapPath, sizeof(s_szMapPath), "%s/map/%s/", LocaleService_GetBasePath().c_str(), CThreeWayWar::instance().GetEventSungZiMapInfo().m_stMapName.c_str()); return s_szMapPath; } const char* GetPassMapPath( BYTE bEmpire ) { if (bEmpire > 0 && bEmpire < EMPIRE_MAX_NUM) { static char s_szMapPath[128]; snprintf(s_szMapPath, sizeof(s_szMapPath), "%s/map/%s/", LocaleService_GetBasePath().c_str(), CThreeWayWar::instance().GetEventPassMapInfo().m_stMapName[bEmpire-1].c_str()); return s_szMapPath; } return NULL; } int GetPassMapIndex( BYTE bEmpire ) { if (bEmpire > 0 && bEmpire < EMPIRE_MAX_NUM) { return CThreeWayWar::instance().GetEventPassMapInfo().m_iForkedPass[bEmpire-1]; } return 0; } int GetPassStartX( BYTE bEmpire ) { if (bEmpire > 0 && bEmpire < EMPIRE_MAX_NUM) { return CThreeWayWar::instance().GetEventPassMapInfo().m_iForkedPassStartPosition[bEmpire-1][0]; } return 0; } int GetPassStartY( BYTE bEmpire ) { if (bEmpire > 0 && bEmpire < EMPIRE_MAX_NUM) { return CThreeWayWar::instance().GetEventPassMapInfo().m_iForkedPassStartPosition[bEmpire-1][1]; } return 0; } int GetSungziMapIndex() { return CThreeWayWar::instance().GetEventSungZiMapInfo().m_iForkedSung; } int GetSungziStartX( BYTE bEmpire ) { if (bEmpire > 0 && bEmpire < EMPIRE_MAX_NUM) { return CThreeWayWar::instance().GetEventSungZiMapInfo().m_iForkedSungziStartPosition[bEmpire-1][0]; } return 0; } int GetSungziStartY( BYTE bEmpire ) { if (bEmpire > 0 && bEmpire < EMPIRE_MAX_NUM) { return CThreeWayWar::instance().GetEventSungZiMapInfo().m_iForkedSungziStartPosition[bEmpire-1][1]; } return 0; } threeway_war.h #ifndef THREE_WAY_WAR_EVENT_ #define THREE_WAY_WAR_EVENT_ #include <boost/unordered_map.hpp> #include "../../common/stl.h" struct ForkedSungziMapInfo { int m_iForkedSung; int m_iForkedSungziStartPosition[3][2]; std::string m_stMapName; }; struct ForkedPassMapInfo { int m_iForkedPass[3]; int m_iForkedPassStartPosition[3][2]; std::string m_stMapName[3]; }; class CThreeWayWar : public singleton<CThreeWayWar> { public: CThreeWayWar (); virtual ~CThreeWayWar (); void Initialize (); bool LoadSetting (const char* szFileName); int GetKillScore (BYTE empire) const; void SetKillScore (BYTE empire, int count); void SetReviveTokenForPlayer (DWORD PlayerID, int count); int GetReviveTokenForPlayer (DWORD PlayerID); void DecreaseReviveTokenForPlayer (DWORD PlayerID); const ForkedPassMapInfo& GetEventPassMapInfo () const; const ForkedSungziMapInfo& GetEventSungZiMapInfo () const; bool IsThreeWayWarMapIndex (int iMapIndex) const; bool IsSungZiMapIndex (int iMapIndex) const; void RandomEventMapSet (); void RegisterUser (DWORD PlayerID); bool IsRegisteredUser (DWORD PlayerID) const; void onDead (LPCHARACTER pChar, LPCHARACTER pKiller); void SetRegenFlag (int flag) { RegenFlag_ = flag; } int GetRegenFlag () const { return RegenFlag_; } void RemoveAllMonstersInThreeWay () const; private: int KillScore_[3]; int RegenFlag_; std::set<int> MapIndexSet_; std::vector<ForkedPassMapInfo> PassInfoMap_; std::vector<ForkedSungziMapInfo> SungZiInfoMap_; boost::unordered_map<DWORD, DWORD> RegisterUserMap_; boost::unordered_map<DWORD, int> ReviveTokenMap_; }; const char* GetSungziMapPath(); const char* GetPassMapPath( BYTE bEmpire ); int GetPassMapIndex( BYTE bEmpire ); int GetSungziMapIndex(); int GetSungziStartX( BYTE bEmpire ); int GetSungziStartY( BYTE bEmpire ); int GetPassStartX( BYTE bEmpire ); int GetPassStartY( BYTE bEmpire ); #endif /* THREE_WAY_WAR_EVENT_ */ Implement the ERASEEVENTFLAG FUNCTION! FORKEDMAPINDEX.txt #sungzi: mapindex startposX startposY startposX startposY startposX startposY #pass: mapindex1 startposX startposY mapindex2 startposX startposY mapindex3 startposX startposY sungzi: 114 948100 36500 937100 22000 953200 18500 metin2_map_sungzi pass: 118 1150400 182400 metin2_map_sungzi_flame_hill_01 119 1150400 284800 metin2_map_sungzi_flame_hill_02 120 1150400 387200 metin2_map_sungzi_flame_hill_03 TO LET THE SYSTEM WORKING WITHOUT PROBLEM, YOUR NPC THAT START THE WAR MUST BE IN CH99!
  8. c++ [C++] Erase EventFlag Function!

    this code can be executed only by Staff... Why a gm have to sql inject the server? Just use this for take care: char text[160+1]; DBManager::instance().EscapeString(text, sizeof(text), "KORAY NOOB", strlen("KORAY NOOB"));
  9. cmd.cpp ACMD(do_erase_event_flag); { "eraseeventflag", do_erase_event_flag, 0, POS_DEAD, GM_HIGH_WIZARD }, cmd_gm.cpp ACMD(do_erase_event_flag) { char arg1[256]; one_argument(argument, arg1, sizeof(arg1)); if (!(*arg1)) return; quest::CQuestManager::instance().EraseEventFlag(arg1); ch->ChatPacket(CHAT_TYPE_INFO, "EraseEventFlag %s", arg1); sys_log(0, "EraseEventFlag %s", arg1); } questmanager.h void EraseEventFlag(const string& name); questmanager.cpp #include "db.h" void CQuestManager::EraseEventFlag(const string& name) { itertype(m_mapEventFlag) it; for (it = m_mapEventFlag.begin(); it != m_mapEventFlag.end(); ++it) { const string& flagname = it->first; if (flagname.compare(name) == 0) { m_mapEventFlag.erase(it); char szName[160+1]; //CAUSE KORAY DOESN'T UNDERSTAND NOTHING DBManager::instance().EscapeString(szName, sizeof(szName), name.c_str(), strlen(name.c_str())); char szQuery[1024+1]; snprintf(szQuery, sizeof(szQuery), "DELETE FROM player.quest%s WHERE szName='%s';", get_table_postfix(), szName); DBManager::instance().DirectQuery(szQuery); break; } } } questlua_game.cpp int game_erase_event_flag(lua_State* L) { CQuestManager& q = CQuestManager::instance(); if (lua_isstring(L,1)) q.EraseEventFlag(lua_tostring(L,1)); return 0; } { "erase_event_flag", game_erase_event_flag }, KEEP A LOT OF EVENTS FLAG IS A BIG PROBLEM, A LOT OF SERVER CRASH DAILY FOR THIS PROBLEM! THIS FUNCTION IS FREE FOR ALL!!! NOT AS MARTYSAMA THAT SELL THIS FOR 10€...
  10. Find the function: void CHARACTER::PointChange(BYTE type, int amount, bool bAmount, bool bBroadcast) Find the case: POINT_GOLD And put this: case POINT_GOLD: { unsigned int nTotalMoney = GetGold() + amount; if (nTotalMoney > GOLD_MAX) { return; }else if (nTotalMoney < 0) { return; }else{ SetGold(GetGold() + amount); val = GetGold(); } } break; Your YANGS never been negatives!
  11. c++ Sbugga PG (Unstucker) Without Delay - InGame!

    Thanks but these guys are only angry with me cause i post this idea that a lot of people like MartySama sell for a lot of money...
  12. c++ Sbugga PG (Unstucker) Without Delay - InGame!

    WHY ALL PEOPLE CREATE SBUG PG IN PHP? This is fucking better than that!
  13. c++ Sbugga PG (Unstucker) Without Delay - InGame!

    If your player go in a invalid map or is bugged, can warp to the own empire city!
  14. Input_DB.cpp -> PlayerLoad function: void CInputDB::PlayerLoad(LPDESC d, const char * data) { TPlayerTable * pTab = (TPlayerTable *) data; if (!d) return; long lMapIndex = pTab->lMapIndex; long lPosX = pTab->x; long lPosY = pTab->y; int lEmpire = d->GetAccountTable().bEmpire; //MAP INDEX NULL (MAYBE WHEN YOU CREATE THE CHARACTER) if (lMapIndex == 0) { if (SECTREE_MANAGER::instance().GetMapIndex(lPosX, lPosY) == 0) //IF YOU CREATE THE CHARACTER RETURN TRUE NOT FALSE { lMapIndex = EMPIRE_START_MAP(lEmpire); lPosX = EMPIRE_START_X(lEmpire); lPosY = EMPIRE_START_Y(lEmpire); }else{ //YOU CREATE THE CHARACTER AND CHARACTER START IN THE RIGHT POSITION! lMapIndex = EMPIRE_START_MAP(lEmpire); lPosX = CREATE_START_X(lEmpire) + number(-300, 300); lPosY = CREATE_START_Y(lEmpire) + number(-300, 300); } } //CHECK IF IS A VALID LOCATION else if (!SECTREE_MANAGER::instance().IsValidLocation(lMapIndex, lPosX, lPosY, lEmpire)) { lMapIndex = EMPIRE_START_MAP(lEmpire); lPosX = EMPIRE_START_X(lEmpire); lPosY = EMPIRE_START_Y(lEmpire); } //CHECK IF NEED SBUG PG std::string PgName=std::string("/server/game/pg_bugged/")+std::string(pTab->name)+std::string(".txt"); struct stat sbug; if (stat(PgName.c_str(), &sbug) == 0) { remove(PgName.c_str()); lMapIndex = EMPIRE_START_MAP(lEmpire); lPosX = EMPIRE_START_X(lEmpire); lPosY = EMPIRE_START_Y(lEmpire); sys_err("<SbugPGSystem> %s was moved to the own empire. (Index: %d - X:%d, Y:%d)", pTab->name, EMPIRE_START_MAP(lEmpire), EMPIRE_START_X(lEmpire), EMPIRE_START_Y(lEmpire)); } //SET NEW MAP INDEX AND COORDS pTab->lMapIndex = lMapIndex; pTab->x = lPosX; pTab->y = lPosY; if (d->GetCharacter() || d->IsPhase(PHASE_GAME)) { LPCHARACTER p = d->GetCharacter(); sys_err("login state already has main state (character %s %p)", p->GetName(), get_pointer(p)); return; } if (NULL != CHARACTER_MANAGER::Instance().FindPC(pTab->name)) { sys_err("InputDB: PlayerLoad : %s already exist in game", pTab->name); return; } LPCHARACTER ch = CHARACTER_MANAGER::instance().CreateCharacter(pTab->name, pTab->id); ch->BindDesc(d); ch->SetPlayerProto(pTab); ch->SetEmpire(d->GetEmpire()); d->BindCharacter(ch); { TPacketGGLogin p; p.bHeader = HEADER_GG_LOGIN; strlcpy(p.szName, ch->GetName(), sizeof(p.szName)); p.dwPID = ch->GetPlayerID(); p.bEmpire = ch->GetEmpire(); p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY()); p.bChannel = g_bChannel; P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin)); char buf[51]; snprintf(buf, sizeof(buf), "%s %d %d %ld %d", inet_ntoa(ch->GetDesc()->GetAddr().sin_addr), ch->GetGold(), g_bChannel, ch->GetMapIndex(), ch->GetAlignment()); LogManager::instance().CharLog(ch, 0, "LOGIN", buf); } d->SetPhase(PHASE_LOADING); ch->MainCharacterPacket(); long lPublicMapIndex = lMapIndex >= 10000 ? lMapIndex / 10000 : lMapIndex; const TMapRegion * rMapRgn = SECTREE_MANAGER::instance().GetMapRegion(lPublicMapIndex); if( rMapRgn ) { DESC_MANAGER::instance().SendClientPackageSDBToLoadMap( d, rMapRgn->strMapName.c_str() ); } if (!map_allow_find(lPublicMapIndex)) { sys_err("InputDB::PlayerLoad : entering %d map is not allowed here (name: %s, empire %u)", lMapIndex, pTab->name, d->GetEmpire()); ch->SetWarpLocation(EMPIRE_START_MAP(d->GetEmpire()), EMPIRE_START_X(d->GetEmpire()) / 100, EMPIRE_START_Y(d->GetEmpire()) / 100); d->SetPhase(PHASE_CLOSE); return; } quest::CQuestManager::instance().BroadcastEventFlagOnLogin(ch); for (int i = 0; i < QUICKSLOT_MAX_NUM; ++i) ch->SetQuickslot(i, pTab->quickslot[i]); ch->PointsPacket(); ch->SkillLevelPacket(); sys_log(0, "InputDB: player_load %s %dx%dx%d LEVEL %d MOV_SPEED %d JOB %d ATG %d DFG %d GMLv %d", pTab->name, ch->GetX(), ch->GetY(), ch->GetZ(), ch->GetLevel(), ch->GetPoint(POINT_MOV_SPEED), ch->GetJob(), ch->GetPoint(POINT_ATT_GRADE), ch->GetPoint(POINT_DEF_GRADE), ch->GetGMLevel()); ch->QuerySafeboxSize(); CXTrapManager::instance().CreateClientSession( ch ); } Sectree_manager.h Sectree_manager.cpp bool SECTREE_MANAGER::IsValidLocation(long lMapIndex, long x, long y, BYTE empire) { LPSECTREE_MAP pkSectreeMap = GetMap(lMapIndex); if (!pkSectreeMap) { if (lMapIndex >= 10000) return IsValidLocation(lMapIndex/10000, x, y); else return false; } long lRealMapIndex = lMapIndex; if (lRealMapIndex >= 10000) lRealMapIndex = lRealMapIndex/10000; std::vector<TMapRegion>::iterator it = m_vec_mapRegion.begin(); while (it != m_vec_mapRegion.end()) { TMapRegion & rRegion = *(it++); if (rRegion.index == lRealMapIndex) { LPSECTREE tree = pkSectreeMap->Find(x, y); if (!tree) return false; return true; } } return false; } questlua_global.cpp int _sbugga_pg(lua_State* L) { if (!lua_isstring(L, 1)) return 0; if (!lua_isstring(L, 2)) return 0; if (!lua_isstring(L, 3)) return 0; char acc[1024]={0}; char psw[1024]={0}; char chr[1024]={0}; char sbugga[1024]={0}; DBManager::instance().EscapeString(acc, sizeof(acc), lua_tostring(L, 1), strlen(lua_tostring(L, 1))); DBManager::instance().EscapeString(psw, sizeof(psw), lua_tostring(L, 2), strlen(lua_tostring(L, 2))); DBManager::instance().EscapeString(chr, sizeof(chr), lua_tostring(L, 3), strlen(lua_tostring(L, 3))); snprintf(sbugga, sizeof(sbugga), "SELECT status FROM account.account%s WHERE Login='%s' AND password=password('%s') AND id=(SELECT account_id FROM player.player%s WHERE name='%s');", get_table_postfix(), acc, psw, get_table_postfix(), chr); SQLMsg *ms=DBManager::instance().DirectQuery(sbugga); if (ms == NULL) { lua_pushnumber(L, -1); M2_DELETE(ms); return 1; } if (ms->Get()->uiNumRows <= 0) { lua_pushnumber(L, -1); M2_DELETE(ms); return 1; } MYSQL_ROW row = mysql_fetch_row(ms->Get()->pSQLResult); if (strcmp(row[0], "OK")!=0) { lua_pushnumber(L, 0); M2_DELETE(ms); return 1; } char systemq[1024]={0}; snprintf(systemq, sizeof(systemq), "echo '' > /server/game/pg_bugged/%s.txt", chr); system(systemq); lua_pushnumber(L, 1); M2_DELETE(ms); return 1; } And at the end of the file remember the: { "sbugga_pg", _sbugga_pg }, The folder /server/game/pg_bugged/ need to be create in your FTP of server. QUEST EXAMPLE: quest sbug_pg begin state start begin when 11000.chat."My character is bugged..." or 11002.chat."My character is bugged..." or 11004.chat."My character is bugged..." begin say_title("Sbug-Pg Tool: ") say("") if get_time() <= pc.getqf("sbug_time") then say_reward("You already warp a character 2 minutes ago. Wait pls.") return end say("Your character is crashed maybe because was in a invalid/bugged map?") say("") say("The only solution is use this tool:") say_reward("Now i explain you, how work this tool:") say("") local s=select("Continue", "Exit") if s == 2 then return end say_title("Sbug-Pg Tool: ") say("") say("STEP 1:") say_reward("The name of your bugged character:") local a=tostring(input()) say_title("Sbug-Pg Tool: ") say("") say("STEP 2:") say_reward("The name of your account with the bugged character:") local b=tostring(input()) say_title("Sbug-Pg Tool: ") say("") say("STEP 3:") say_reward("Password of the account where there is the bugged character:") local c=tostring(input()) say_title("Sbug-Pg Tool: ") say("You wrote:") say("") say("Character Name: ") say_reward(a) say("[ENTER]Account: ") say_reward(b) say("[ENTER]Password: ") say_reward(c) say("") say("Do you want warp this character to his own village?") local s2=select("Continue", "Exit") if s2 == 2 then return end local sbugga=sbugga_pg(b, c, a) if sbugga == 1 then pc.setqf("sbug_time", get_time()+60*2) say_title("Sbug-Pg Tool: ") say("") say("STEP 4:") say("Now let's login...") say("You will be in your own village!") elseif sbugga == 0 then say("This account is banned.") elseif sbugga == -1 then say("Incorrect id or password.") end end end end
×