Jump to content

OkamiRo

Member
  • Posts

    81
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by OkamiRo

  1. bump, same problem here quest quest charge_cash_by_voucher begin state start begin function charge(amount, charge_type) if charge_type == nil then charge_type = "coins" end if 0 < amount then -- syntax : pc.charge_cash(amount, charge_type) -- warning: 1. 'charge_type' : "cash"(default) | "mileage" -- 2. 'amount' must be positive number. local result = pc.charge_cash(amount, charge_type) if true == result then local item_id = item.get_id() char_log(item_id, "CHARGE_CASH_BY_VOUCHER", amount) syschat(string.format(gameforge.charge_cash_by_voucher._010_syschat, amount)) local flag_name = "total_" .. charge_type pc.setqf(flag_name, pc.getqf(flag_name) + amount) item.remove() end end return false end when 80014.use or 80015.use or 80016.use or 80017.use begin local amount = item.get_value(0) charge_cash_by_voucher.charge(amount, "coins") end end end Edit, nevermind. in db/src/ClientManager.cpp search for this function void CClientManager::ChargeCash(const TRequestChargeCash* packet) and change in this function sprintf(szQuery, "update account set `cash` = `cash` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID); with sprintf(szQuery, "update account set `coins` = `coins` + %d where id = %d limit 1", packet->dwAmount, packet->dwAID);
  2. I really appreciate Mitachi's work because he also explain little things here and there, when i don't understand something. Also his code is clean and straight to the point. Communication 10/10, very patient and he understands customer's needs. Highly recommended!
  3. No syserr unfortunately. Also I didn't do any changes in source to affect players to not get experience. It's happening sometimes to random people. No matter if they level in a party or solo.
  4. bump. i know this is a old theard, but i have the same problem sometimes. some random players get their exp locked and they have to close the client and enter the game again, the exp gain blocks out of nowhere
  5. How can you fix it for r40k with .txt protos? Thanks in advance, Okami.
  6. I know this theard is old af, but maybe someone else will look for answer. If you reversed xSag's changes for Yang on taskbar and still have issues with yang refresh, then: root/interfacemodule.py search for function def RefreshStatus(self): under self.wndCharacter.RefreshStatus() add self.wndInventory.RefreshStatus() In your case with metin2pandora client it should look like (the whole function) def RefreshStatus(self): self.wndTaskBar.RefreshStatus() self.wndCharacter.RefreshStatus() self.wndInventory.RefreshStatus() if self.wndEnergyBar: self.wndEnergyBar.RefreshStatus() if app.ENABLE_DRAGON_SOUL_SYSTEM: self.wndDragonSoul.RefreshStatus() xSag made that change for MDs in inventory (which is bullshit imo) and removed self.wndInventory.RefreshStatus() completly because the MDs uses another refresh function. Good luck.
  7. reupload please? edit: nevermind, i did not notice internal download
  8. Dear all, First of all, thank you for your interest into reading this theard. Old Metin2 is now looking for a metin2 experienced developer in oder to fix a bug/error regarding the bonus apply on our server. If you have knowledge of C++ and metin2 development please contact me on Discord at Okami#1001 or by email at [email protected] We will discuss more in private, please without no name developers as i'm looking for a trustworthy person. Thank you. Regards, Okami.
  9. It's not my business with this topic, but, as a past customer of Braxy's services i'm really happy with the work he done for me, i don't get why you guys are fighting? LUA is a free-of-learn language program, same as C++/Python/Java and so on, if he learned from you it's normal that he will use the same structure, as you were his master, then he is free to change whatever he wants to expand his knowledge, also don't forget we're all involved in a ILLEGAL ACTIVITY and the work you're argue with, that's ''your own'' is actually not, you're earning this money from a illegal activity in a metin2 private community so better to stop fighting for a sh*t that can end in every second due to copyright in my vision, once you're working for ymir/webzen and develop something for official servers that has been leaked, then you can come on this private community to say that is your work, if this source of this game wasn't leaked probably you don't even exist on this community, same as me and other 10k people. Best of luck
  10. Just posted here in case someone need in one day like me... Open from you db source Main.cpp Search #ifdef __FreeBSD__ _malloc_options = "A"; #endif Replace with #if defined (__FreeBSD__) && !defined (__GNUC__) _malloc_options = "A"; #endif
  11. bump same problem here @MUZI know it's funny cause this topic was from 2016, i found the solution Perhaps my server accept connections from outside of the server with auth exploit, however i have fixed it.
  12. Thank you so much, i've been struggling with this bug since 3 months ago, now it's working perfectly!
  13. Could you please let me know exactly what do you need? I don't really understeand where i can find this function: mountSystem->Mount MountSystem.cpp #include "stdafx.h" #include "config.h" #include "utils.h" #include "vector.h" #include "char.h" #include "sectree_manager.h" #include "char_manager.h" #include "mob_manager.h" #include "MountSystem.h" #include "../../common/VnumHelper.h" #include "packet.h" #include "item_manager.h" #include "item.h" EVENTINFO(mountsystem_event_info) { CMountSystem* pMountSystem; }; EVENTFUNC(mountsystem_update_event) { mountsystem_event_info* info = dynamic_cast<mountsystem_event_info*>( event->info ); if ( info == NULL ) { sys_err( "<mountsystem_update_event> <Factor> Null pointer" ); return 0; } CMountSystem* pMountSystem = info->pMountSystem; if (NULL == pMountSystem) return 0; pMountSystem->Update(0); return PASSES_PER_SEC(1) / 4; } /////////////////////////////////////////////////////////////////////////////////////// // CMountActor /////////////////////////////////////////////////////////////////////////////////////// CMountActor::CMountActor(LPCHARACTER owner, DWORD vnum) { m_dwVnum = vnum; m_dwVID = 0; m_dwLastActionTime = 0; m_pkChar = 0; m_pkOwner = owner; m_originalMoveSpeed = 0; m_dwSummonItemVID = 0; m_dwSummonItemVnum = 0; } CMountActor::~CMountActor() { this->Unsummon(); m_pkOwner = 0; } void CMountActor::SetName() { std::string petName = m_pkOwner->GetName(); if (true == IsSummoned()) { petName += " Mount"; m_pkChar->SetName(petName); } m_name = petName; } bool CMountActor::Mount(LPITEM mountItem) { if (0 == m_pkOwner) return false; if(!mountItem) return false; if (m_pkOwner->IsHorseRiding()) m_pkOwner->StopRiding(); if (m_pkOwner->GetHorse()) m_pkOwner->HorseSummon(false); Unmount(); m_pkOwner->AddAffect(AFFECT_MOUNT, POINT_MOUNT, m_dwVnum, AFF_NONE, (DWORD)mountItem->GetSocket(0) - time(0), 0, true); for (int i = 0; i < ITEM_APPLY_MAX_NUM; ++i) { if (mountItem->GetProto()->aApplies[i].bType == APPLY_NONE) continue; m_pkOwner->AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[mountItem->GetProto()->aApplies[i].bType].bPointType, mountItem->GetProto()->aApplies[i].lValue, AFF_NONE, (DWORD)mountItem->GetSocket(0) - time(0), 0, false); } return m_pkOwner->GetMountVnum() == m_dwVnum; } void CMountActor::Unmount() { if (0 == m_pkOwner) return; if (!m_pkOwner->GetMountVnum()) return; m_pkOwner->RemoveAffect(AFFECT_MOUNT); m_pkOwner->RemoveAffect(AFFECT_MOUNT_BONUS); m_pkOwner->MountVnum(0); if (m_pkOwner->IsHorseRiding()) m_pkOwner->StopRiding(); if (m_pkOwner->GetHorse()) m_pkOwner->HorseSummon(false); m_pkOwner->MountVnum(0); } void CMountActor::Unsummon() { if (true == this->IsSummoned()) { this->SetSummonItem(NULL); if (NULL != m_pkChar) M2_DESTROY_CHARACTER(m_pkChar); m_pkChar = 0; m_dwVID = 0; } } DWORD CMountActor::Summon(LPITEM pSummonItem, bool bSpawnFar) { long x = m_pkOwner->GetX(); long y = m_pkOwner->GetY(); long z = m_pkOwner->GetZ(); if (true == bSpawnFar) { x += (number(0, 1) * 2 - 1) * number(2000, 2500); y += (number(0, 1) * 2 - 1) * number(2000, 2500); } else { x += number(-100, 100); y += number(-100, 100); } if (0 != m_pkChar) { m_pkChar->Show(m_pkOwner->GetMapIndex(), x, y); m_dwVID = m_pkChar->GetVID(); return m_dwVID; } m_pkChar = CHARACTER_MANAGER::instance().SpawnMob(m_dwVnum, m_pkOwner->GetMapIndex(), x, y, z, false, (int)(m_pkOwner->GetRotation()+180), false); if (0 == m_pkChar) { sys_err("[CMountActor::Summon] Failed to summon the mount. (vnum: %d)", m_dwVnum); return 0; } m_pkChar->SetMount(); m_pkChar->SetEmpire(m_pkOwner->GetEmpire()); m_dwVID = m_pkChar->GetVID(); this->SetName(); this->SetSummonItem(pSummonItem); //m_pkOwner->ComputePoints(); m_pkChar->Show(m_pkOwner->GetMapIndex(), x, y, z); return m_dwVID; } bool CMountActor::_UpdateFollowAI() { if (0 == m_pkChar->m_pkMobData) { return false; } if (0 == m_originalMoveSpeed) { const CMob* mobData = CMobManager::Instance().Get(m_dwVnum); if (0 != mobData) m_originalMoveSpeed = mobData->m_table.sMovingSpeed; } float START_FOLLOW_DISTANCE = 300.0f; float START_RUN_DISTANCE = 900.0f; float RESPAWN_DISTANCE = 4500.f; int APPROACH = 200; bool bRun = false; DWORD currentTime = get_dword_time(); long ownerX = m_pkOwner->GetX(); long ownerY = m_pkOwner->GetY(); long charX = m_pkChar->GetX(); long charY = m_pkChar->GetY(); float fDist = DISTANCE_APPROX(charX - ownerX, charY - ownerY); if (fDist >= RESPAWN_DISTANCE) { float fOwnerRot = m_pkOwner->GetRotation() * 3.141592f / 180.f; float fx = -APPROACH * cos(fOwnerRot); float fy = -APPROACH * sin(fOwnerRot); if (m_pkChar->Show(m_pkOwner->GetMapIndex(), ownerX + fx, ownerY + fy)) { return true; } } if (fDist >= START_FOLLOW_DISTANCE) { m_pkChar->SetNowWalking(false); Follow(APPROACH); m_pkChar->SetLastAttacked(currentTime); m_dwLastActionTime = currentTime; } else m_pkChar->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0); return true; } bool CMountActor::Update(DWORD deltaTime) { bool bResult = true; if (m_pkOwner->IsDead() || (IsSummoned() && m_pkChar->IsDead()) || NULL == ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID()) || ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetOwner() != this->GetOwner() ) { this->Unsummon(); return true; } if (this->IsSummoned()) bResult = bResult && this->_UpdateFollowAI(); return bResult; } bool CMountActor::Follow(float fMinDistance) { if( !m_pkOwner || !m_pkChar) return false; float fOwnerX = m_pkOwner->GetX(); float fOwnerY = m_pkOwner->GetY(); float fPetX = m_pkChar->GetX(); float fPetY = m_pkChar->GetY(); float fDist = DISTANCE_SQRT(fOwnerX - fPetX, fOwnerY - fPetY); if (fDist <= fMinDistance) return false; m_pkChar->SetRotationToXY(fOwnerX, fOwnerY); float fx, fy; float fDistToGo = fDist - fMinDistance; GetDeltaByDegree(m_pkChar->GetRotation(), fDistToGo, &fx, &fy); if (!m_pkChar->Goto((int)(fPetX+fx+0.5f), (int)(fPetY+fy+0.5f)) ) return false; m_pkChar->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0, 0); return true; } void CMountActor::SetSummonItem(LPITEM pItem) { if (NULL == pItem) { m_dwSummonItemVID = 0; m_dwSummonItemVnum = 0; return; } m_dwSummonItemVID = pItem->GetVID(); m_dwSummonItemVnum = pItem->GetVnum(); } /////////////////////////////////////////////////////////////////////////////////////// // CMountSystem /////////////////////////////////////////////////////////////////////////////////////// CMountSystem::CMountSystem(LPCHARACTER owner) { m_pkOwner = owner; m_dwUpdatePeriod = 400; m_dwLastUpdateTime = 0; } CMountSystem::~CMountSystem() { Destroy(); } void CMountSystem::Destroy() { for (TMountActorMap::iterator iter = m_mountActorMap.begin(); iter != m_mountActorMap.end(); ++iter) { CMountActor* mountActor = iter->second; if (0 != mountActor) { delete mountActor; } } event_cancel(&m_pkMountSystemUpdateEvent); m_mountActorMap.clear(); } bool CMountSystem::Update(DWORD deltaTime) { bool bResult = true; DWORD currentTime = get_dword_time(); if (m_dwUpdatePeriod > currentTime - m_dwLastUpdateTime) return true; std::vector <CMountActor*> v_garbageActor; for (TMountActorMap::iterator iter = m_mountActorMap.begin(); iter != m_mountActorMap.end(); ++iter) { CMountActor* mountActor = iter->second; if (0 != mountActor && mountActor->IsSummoned()) { LPCHARACTER pMount = mountActor->GetCharacter(); if (NULL == CHARACTER_MANAGER::instance().Find(pMount->GetVID())) { v_garbageActor.push_back(mountActor); } else { bResult = bResult && mountActor->Update(deltaTime); } } } for (std::vector<CMountActor*>::iterator it = v_garbageActor.begin(); it != v_garbageActor.end(); it++) DeleteMount(*it); m_dwLastUpdateTime = currentTime; return bResult; } void CMountSystem::DeleteMount(DWORD mobVnum) { TMountActorMap::iterator iter = m_mountActorMap.find(mobVnum); if (m_mountActorMap.end() == iter) { sys_err("[CMountSystem::DeleteMount] Can't find mount on my list (VNUM: %d)", mobVnum); return; } CMountActor* mountActor = iter->second; if (0 == mountActor) sys_err("[CMountSystem::DeleteMount] Null Pointer (mountActor)"); else delete mountActor; m_mountActorMap.erase(iter); } void CMountSystem::DeleteMount(CMountActor* mountActor) { for (TMountActorMap::iterator iter = m_mountActorMap.begin(); iter != m_mountActorMap.end(); ++iter) { if (iter->second == mountActor) { delete mountActor; m_mountActorMap.erase(iter); return; } } sys_err("[CMountSystem::DeleteMount] Can't find mountActor(0x%x) on my list(size: %d) ", mountActor, m_mountActorMap.size()); } void CMountSystem::Unsummon(DWORD vnum, bool bDeleteFromList) { //if (m_pkOwner->IncreaseMountCounter() >= 5) //{ // m_pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("_TRANSLATE_CHAT_TYPE_PACKETS_FROM_SOURCE_TO_GLOBAL__TRANSLATE_LIST_110")); // return; //} CMountActor* actor = this->GetByVnum(vnum); if (0 == actor) { sys_err("[CMountSystem::Unsummon(%d)] Null Pointer (actor)", vnum); return; } actor->Unsummon(); if (true == bDeleteFromList) this->DeleteMount(actor); bool bActive = false; for (TMountActorMap::iterator it = m_mountActorMap.begin(); it != m_mountActorMap.end(); it++) { bActive |= it->second->IsSummoned(); } if (false == bActive) { event_cancel(&m_pkMountSystemUpdateEvent); m_pkMountSystemUpdateEvent = NULL; } } void CMountSystem::Summon(DWORD mobVnum, LPITEM pSummonItem, bool bSpawnFar) { //if (m_pkOwner->IncreaseMountCounter() >= 5) //{ // m_pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("_TRANSLATE_CHAT_TYPE_PACKETS_FROM_SOURCE_TO_GLOBAL__TRANSLATE_LIST_110")); // return; //} CMountActor* mountActor = this->GetByVnum(mobVnum); if (0 == mountActor) { mountActor = M2_NEW CMountActor(m_pkOwner, mobVnum); m_mountActorMap.insert(std::make_pair(mobVnum, mountActor)); } DWORD mountVID = mountActor->Summon(pSummonItem, bSpawnFar); if (!mountVID) sys_err("[CMountSystem::Summon(%d)] Null Pointer (mountVID)", pSummonItem->GetID()); if (NULL == m_pkMountSystemUpdateEvent) { mountsystem_event_info* info = AllocEventInfo<mountsystem_event_info>(); info->pMountSystem = this; m_pkMountSystemUpdateEvent = event_create(mountsystem_update_event, info, PASSES_PER_SEC(1) / 4); } //return mountActor; } void CMountSystem::Mount(DWORD mobVnum, LPITEM mountItem) { CMountActor* mountActor = this->GetByVnum(mobVnum); if (!mountActor) { sys_err("[CMountSystem::Mount] Null Pointer (mountActor)"); return; } if(!mountItem) return; //check timer // if (m_pkOwner->IncreaseMountCounter() >= 5) // { // m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "<Mount> Asteapta 5 secunde pentru a face aceasta actiune"); // return; // } this->Unsummon(mobVnum, false); mountActor->Mount(mountItem); } void CMountSystem::Unmount(DWORD mobVnum) { CMountActor* mountActor = this->GetByVnum(mobVnum); if (!mountActor) { sys_err("[CMountSystem::Mount] Null Pointer (mountActor)"); return; } //check timer // if (m_pkOwner->IncreaseMountCounter() >= 5) // { // m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "<Mount> Asteapta 5 secunde pentru a face aceasta actiune"); // return; // } if(LPITEM pSummonItem = m_pkOwner->GetWear(WEAR_COSTUME_MOUNT)) { this->Summon(mobVnum, pSummonItem, false); } mountActor->Unmount(); } CMountActor* CMountSystem::GetByVID(DWORD vid) const { CMountActor* mountActor = 0; bool bFound = false; for (TMountActorMap::const_iterator iter = m_mountActorMap.begin(); iter != m_mountActorMap.end(); ++iter) { mountActor = iter->second; if (0 == mountActor) { sys_err("[CMountSystem::GetByVID(%d)] Null Pointer (mountActor)", vid); continue; } bFound = mountActor->GetVID() == vid; if (true == bFound) break; } return bFound ? mountActor : 0; } CMountActor* CMountSystem::GetByVnum(DWORD vnum) const { CMountActor* mountActor = 0; TMountActorMap::const_iterator iter = m_mountActorMap.find(vnum); if (m_mountActorMap.end() != iter) mountActor = iter->second; return mountActor; } size_t CMountSystem::CountSummoned() const { size_t count = 0; for (TMountActorMap::const_iterator iter = m_mountActorMap.begin(); iter != m_mountActorMap.end(); ++iter) { CMountActor* mountActor = iter->second; if (0 != mountActor) { if (mountActor->IsSummoned()) ++count; } } return count; } MountSystem.h #ifndef __HEADER_MOUNT_SYSTEM__ #define __HEADER_MOUNT_SYSTEM__ class CHARACTER; class CMountActor { protected: friend class CMountSystem; CMountActor(LPCHARACTER owner, DWORD vnum); virtual ~CMountActor(); virtual bool Update(DWORD deltaTime); virtual bool _UpdateFollowAI(); private: bool Follow(float fMinDistance = 50.f); public: LPCHARACTER GetCharacter() const { return m_pkChar; } LPCHARACTER GetOwner() const { return m_pkOwner; } DWORD GetVID() const { return m_dwVID; } DWORD GetVnum() const { return m_dwVnum; } void SetName(); bool Mount(LPITEM mountItem); void Unmount(); DWORD Summon(LPITEM pSummonItem, bool bSpawnFar = false); void Unsummon(); bool IsSummoned() const { return 0 != m_pkChar; } void SetSummonItem (LPITEM pItem); DWORD GetSummonItemVID () { return m_dwSummonItemVID; } private: DWORD m_dwVnum; DWORD m_dwVID; DWORD m_dwLastActionTime; DWORD m_dwSummonItemVID; DWORD m_dwSummonItemVnum; short m_originalMoveSpeed; std::string m_name; LPCHARACTER m_pkChar; LPCHARACTER m_pkOwner; }; class CMountSystem { public: typedef boost::unordered_map<DWORD, CMountActor*> TMountActorMap; public: CMountSystem(LPCHARACTER owner); virtual ~CMountSystem(); CMountActor* GetByVID(DWORD vid) const; CMountActor* GetByVnum(DWORD vnum) const; bool Update(DWORD deltaTime); void Destroy(); size_t CountSummoned() const; public: void SetUpdatePeriod(DWORD ms); void Summon(DWORD mobVnum, LPITEM pSummonItem, bool bSpawnFar); void Unsummon(DWORD mobVnum, bool bDeleteFromList = false); void Unsummon(CMountActor* mountActor, bool bDeleteFromList = false); void Mount(DWORD mobVnum, LPITEM mountItem); void Unmount(DWORD mobVnum); void DeleteMount(DWORD mobVnum); void DeleteMount(CMountActor* mountActor); private: TMountActorMap m_mountActorMap; LPCHARACTER m_pkOwner; DWORD m_dwUpdatePeriod; DWORD m_dwLastUpdateTime; LPEVENT m_pkMountSystemUpdateEvent; }; #endif
  14. Here: ACMD(do_ride) { // dev_log(LOG_DEB0, "[DO_RIDE] start"); if (ch->IsDead() || ch->IsStun()) return; if (ch->GetMapIndex() == 113) return; #ifdef ENABLE_MOUNT_COSTUME_SYSTEM if (ch->IsPolymorphed() == true){ ch->ChatPacket(CHAT_TYPE_INFO, "Cannot use a mount when you're transformed."); return; } if(ch->GetWear(WEAR_COSTUME_MOUNT)) { CMountSystem* mountSystem = ch->GetMountSystem(); LPITEM mount = ch->GetWear(WEAR_COSTUME_MOUNT); DWORD mobVnum = 0; if (!mountSystem && !mount) return; #ifdef __CHANGELOOK_SYSTEM__ if(mount->GetTransmutation()) { const TItemTable* itemTable = ITEM_MANAGER::instance().GetTable(mount->GetTransmutation()); if (itemTable) mobVnum = itemTable->alValues[1]; else mobVnum = mount->GetValue(1); } else mobVnum = mount->GetValue(1); #else if(mount->GetValue(1) != 0) mobVnum = mount->GetValue(1); #endif if (ch->GetMountVnum()) { if(mountSystem->CountSummoned() == 0) { mountSystem->Unmount(mobVnum); } } else { if(mountSystem->CountSummoned() == 1) { mountSystem->Mount(mobVnum, mount); } } return; } #endif if (ch->IsHorseRiding()) { ch->StopRiding(); return; } if (ch->GetHorse() != NULL) { ch->StartRiding(); return; } for (BYTE i=0; i<INVENTORY_MAX_NUM; ++i) { LPITEM item = ch->GetInventoryItem(i); if (NULL == item) continue; if (item->GetType() == ITEM_COSTUME && item->GetSubType() == COSTUME_MOUNT) { ch->UseItem(TItemPos (INVENTORY, i)); return; } } ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("cmd_general.cpp line 2452: Summon the horse first.")); }
  15. I was 100% sure about it, I think also there are exploits for vote, some server are getting crazy after few hours and that's impossible if you compare the number of players online on that server and numbers counted for vote ??
  16. Just change like this // if internal ip exists, p2p socket uses internal ip, if not use public ip if ((p2p_socket = socket_tcp_bind(*g_szInternalIP ? g_szInternalIP : g_szPublicIP, p2p_port)) == INVALID_SOCKET) //if ((p2p_socket = socket_tcp_bind(g_szPublicIP, p2p_port)) == INVALID_SOCKET) i know it's older answer but perhaps some users will need this even is written above.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.