Jump to content

Karbust

Management
  • Posts

    1161
  • Joined

  • Days Won

    10
  • Feedback

    100%

Everything posted by Karbust

  1. Just disable thr function and it's declarations and change the default variables (set to ymir by default and filled up when the locale is loaded) I just needed to do that, nothing more...
  2. The problem is, how do I check if the player is online or not? The functions I know only detect if player is in the same map or not... I'm using this one at the moment: LPCHARACTER pkbanned = CHARACTER_MANAGER::instance().FindPC(username); LPCHARACTER CHARACTER_MANAGER::FindPC(const char * name) { char szName[CHARACTER_NAME_MAX_LEN + 1]; str_lower(name, szName, sizeof(szName)); NAME_MAP::iterator it = m_map_pkPCChr.find(szName); if (it == m_map_pkPCChr.end()) return NULL; // <Factor> Added sanity check LPCHARACTER found = it->second; if (found != NULL && strncasecmp(szName, found->GetName(), CHARACTER_NAME_MAX_LEN) != 0) { sys_err("[CHARACTER_MANAGER::FindPC] <Factor> %s != %s", name, found->GetName()); return NULL; } return found; } If I'm not in Channel 99 (for example, in OX Map) and I send the band to a player on Channel 1 it doesn't find, how can I do that?
  3. Hello, How can I find a player on server having only the character name? I know the CHARACTER_MANAGER::instance().FindPC(), but it only works if the player is online and on the same map that the user that searched it. Is there a way to find in the whole server? And check if is online or offline? The objective is when the player is if the player is online it sends a chat message saying that the account has been banned and disconnects, if is not online, it only bans. Thanks
  4. Only the client disconnects, I can connect right after, the game doesn't crash...
  5. I don't have error on client syserr, only on server syserr... And it's always difference depending on what action I do after I open the shop (the shop is never created)
  6. Hi there So, I needed a script that was able to transfer my backups through SSH to another UNIX based server (in this case, Ubuntu). Since I already had the server authenticating with key I had to set it up on the script. Prerequisites: mysqldump gzip ssh scp How does it work: -Dumps and compresses the desired mysql databases -Transfers compressed files to remote host -Removes local compressed files Here's the script with as using private key (it needs to be in OpenSSH format, not PuTTY): #!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin # Bins MYSQLDUMP=`which mysqldump` GZIP=`which gzip` SSH=`which ssh` SCP=`which scp` # Date for folders and filenames DAY=$(date +"%Y-%m-%d.%T") FILETIME=$(date +"%Y-%m-%d.%T") # Local backup folder (no trailing slash) LOCAL_FOLDER="/tmp/backups" # FTP Configuration REMOTE_HOST="IP" REMOTE_PORT="PORT" REMOTE_USER="USER" REMOTE_PEM="/PATH/TO/KEY" #With no trailing slash REMOTE_FOLDER="/PATH/TO/DESTINATION/FOLDER/" # With trailing slash # MySQL Configuration MYSQL_USER="USER" # Which databases shall we backup? # Databases should be separated with a space DATABASES="account common log player" # Check if DATABASES var is set... if [ "$DATABASES" == "" ]; then echo -e "\033[31mThere is no databases specified...\033[0m" exit 1 fi # Dump and compress for db in $DATABASES do FILE=$db.$FILETIME.gz echo -e "\033[32mDumping $db!\033[0m" $MYSQLDUMP --set-gtid-purged=OFF -u $MYSQL_USER $db | $GZIP -9 > $LOCAL_FOLDER/$FILE done # Transfer all backup files to remote host echo -e "\033[32m\nTransfering files!\033[0m" # Create the remote folder $SSH -p "${REMOTE_PORT}" -i "${REMOTE_PEM}" "${REMOTE_USER}@${REMOTE_HOST}" "mkdir ${REMOTE_FOLDER}${DAY}" # Transfer the files to the remote folder $SCP -P "${REMOTE_PORT}" -r -i "${REMOTE_PEM}" "${LOCAL_FOLDER}" "${REMOTE_USER}@${REMOTE_HOST}:/${REMOTE_FOLDER}/${DAY}" # Delete local dump files rm -f $LOCAL_FOLDER/* If you don't want to use key just remove: -i "${REMOTE_PEM}" You can add more databases to the backup, just edit the array: DATABASES="account common log player" Don't forget to set the script to UNIX formatted text file. I based my script on MadTiago's one, but his only works for FTP. Hope it's useful for someone
  7. Hello, Whenever I try to create a private shop (using the 50300, like normal), after I press Okay to create it stops stops everything on client side, if I move the client disconnects, if I write something the client disconnects, if I try to use item the client disconnects, etc Whatever I do after I try to create a shop makes the client disconnect. On syserr (serverside) I get an unknown packet header that's is different depending with whatever I do right after I try to create a private shop. Sometimes it gives me sequence error. This was the last error: SYSERR: Jul 26 20:17:02.588757 :: Process: UNKNOWN HEADER: 248, LAST HEADER: 0(0), REMAIN BYTES: 64, fd: 21 I don't have such header, neither on client nor server Does anybody know how to solve this? Thanks
  8. Then what you need is a maintenance system... VegaS has one for sell, I don't think you can find it for free (unbugged on the internet)
  9. But if I put everything inside that code I'll get an error that not every code returns a value, right? The function is like this, at the moment: CMountActor* CMountSystem::Mount(DWORD mobVnum) { CMountActor* MountActor = this->GetByVnum(mobVnum); DWORD MountVID = MountActor->Mount(); return MountActor; } CMountActor* CMountSystem::Unmount(DWORD mobVnum) { CMountActor* MountActor = this->GetByVnum(mobVnum); DWORD MountVID = MountActor->Unmount(); return MountActor; } If I put it like this will it do the same? CMountActor* CMountSystem::Mount(DWORD mobVnum) { CMountActor* MountActor = this->GetByVnum(mobVnum); if(MountActor) DWORD MountVID = MountActor->Mount(); return MountActor; } CMountActor* CMountSystem::Unmount(DWORD mobVnum) { CMountActor* MountActor = this->GetByVnum(mobVnum); if(MountActor) DWORD MountVID = MountActor->Unmount(); return MountActor; }
  10. Yes, but how can I return a nullpointer when the function has CMountActor* type? I have to return a CMountActor*, but how do I return null?
  11. It was getting to a nullpointer because it wasn't detecting other mounts besides the ones being summoned by the Mount System (like horse, to follow you), the function was always returning something else different from 0, so it was always getting inside the if statement, but there was no actor defined by the quest function, so it would crash on null actor...
  12. I did that, but the functions you mentioned aren't void, so only using the return wouldn't help... That's why I supposed I had to changed them to void, but didn't help...
  13. I didn't understand it was to change to void, I thought he had those functions, and I didn't saw them... But, anyway, I believe I solved it... The command do_ride: ACMD(do_ride) { dev_log(LOG_DEB0, "[DO_RIDE] start"); if (ch->IsDead() || ch->IsStun()) return; #ifdef DEATHMATCH_MODE if (ch->GetMapIndex() == DEATMATCH_MAP_INDEX) return; #endif if(ch->GetMountingVnumM() != 0) { CMountSystem* MountSystem = ch->GetMountSystem(); if(MountSystem != NULL) { bool MState = MountSystem->IsMounting(ch->GetMountingVnumM()); if(MState == true) { MountSystem->Unmount(ch->GetMountingVnumM()); return; } else { do_unmount(ch, NULL, 0, 0); if (ch->IsHorseRiding()) ch->StopRiding(); MountSystem->Mount(ch->GetMountingVnumM()); return; } } } // ³»¸®±â { if (ch->IsHorseRiding()) { dev_log(LOG_DEB0, "[DO_RIDE] stop riding"); ch->StopRiding(); return; } if (ch->GetMountVnum()) { dev_log(LOG_DEB0, "[DO_RIDE] unmount"); do_unmount(ch, NULL, 0, 0); return; } } // Ÿ±â { if (ch->GetHorse() != NULL) { dev_log(LOG_DEB0, "[DO_RIDE] start riding"); ch->StartRiding(); return; } #ifdef ENABLE_INVENTORY_12_PAGES for (UINT i=0; i<INVENTORY_MAX_NUM; ++i) #else for (BYTE i=0; i<INVENTORY_MAX_NUM; ++i) #endif { 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_MOUNT)) { dev_log(LOG_DEB0, "[DO_RIDE] USE UNIQUE ITEM"); //ch->EquipItem(item); ch->UseItem(TItemPos (INVENTORY, i)); return; } } // ÀÏ¹Ý Å»°Í ¾ÆÀÌÅÛ // TODO : Å»°Í¿ë SubType Ãß°¡ switch (item->GetVnum()) { case 71114: // Àú½ÅÀÌ¿ë±Ç case 71116: // »ê°ß½ÅÀÌ¿ë±Ç case 71118: // ÅõÁö¹üÀÌ¿ë±Ç case 71120: // »çÀÚ¿ÕÀÌ¿ë±Ç dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM"); ch->UseItem(TItemPos (INVENTORY, i)); return; } // GF mantis #113524, 52001~52090 ¹ø Å»°Í if( (item->GetVnum() > 52000) && (item->GetVnum() < 52091) ) { dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM"); ch->UseItem(TItemPos (INVENTORY, i)); return; } } } // Ÿ°Å³ª ³»¸± ¼ö ¾øÀ»¶§ ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¸»À» ¸ÕÀú ¼ÒȯÇØÁÖ¼¼¿ä.")); } The function if(ch->GetMountingVnumM() != 0) Was always getting passed by, it was never 0, I don't know why, maybe some garbage in memory, I don't know... There's this code in char.h #ifdef ENABLE_MOUNT_SYSTEM //////////////////////////////// // Mount system public: void SetMountingM(bool bValue) { bMounting = bValue; } bool GetMountVnumM() { return bMounting; } DWORD GetMountingVnumM() const { return bMountVnumM; } void SetMountVnumM(DWORD bVnum) { bMountVnumM = bVnum; } private: bool bMounting; DWORD bMountVnumM; #endif I just set the return value to 0 by default DWORD bMountVnumM = 0; With this, I can use the CTRL+G shortcut to unmount in every mount, since the variable is 0, it won't enter the if statement... In the other hand, the mount system with the quest function Mount.summon the variable will be programmatically filled with the mount vnum, and be set to 0 with unsummon. With this the server didn't crash, but I'll ask my team to test it better, but so far there's no problem...
  14. I don't have such functions... Here my MountSystem.h: #ifndef __HEADER_MOUNT_SYSTEM__ #define __HEADER_MOUNT_SYSTEM__ #include <boost/unordered_map.hpp> #include <algorithm> class CHARACTER; class CMountActor { protected: friend class CMountSystem; CMountActor(LPCHARACTER owner, DWORD vnum); virtual ~CMountActor(); virtual bool Update(DWORD deltaTime); protected: virtual bool _UpdateFollowAI(); virtual bool _UpdatAloneActionAI(float fMinDist, float fMaxDist); private: bool Follow(float fMinDistance = 50.f); public: LPCHARACTER GetCharacter() const { return m_pkCharacter; } LPCHARACTER GetOwner() const { return m_pkOwner; } DWORD GetVnum() const { return m_dwVnum; } DWORD GetVID() const { return m_dwVID; } void SetName(const char* MountName); DWORD Mount(); DWORD Unmount(); DWORD Summon(const char* MounName, DWORD mobVnum); void Unsummon(); bool IsSummoned() const { return 0 != m_pkCharacter; } bool IsMounting() const { return m_dwMounted; } void UpdateTime(); private: DWORD m_dwVnum; DWORD m_dwVID; DWORD m_dwLastActionTime; DWORD m_dwUpdatePeriod; DWORD m_dwLastUpdateTime; short m_OMoveSpeed; bool m_dwMounted; std::string m_Name; LPCHARACTER m_pkCharacter; 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); CMountActor* Summon(DWORD mobVnum, const char* MountName); CMountActor* Mount(DWORD mobVnum); CMountActor* Unmount(DWORD mobVnum); void Unsummon(DWORD mobVnum, bool bDeleteFromList = false); void Unsummon(CMountActor* MountActor, bool bDeleteFromList = false); CMountActor* Mount(DWORD mobVnum, const char* MountName); void DeleteMount(DWORD mobVnum); void DeleteMount(CMountActor* MountActor); bool IsActiveMount(); bool IsMounting(DWORD mobVnum); void UpdateTime(); private: TMountActorMap m_MountActorMap; LPCHARACTER m_pkOwner; DWORD m_dwUpdatePeriod; DWORD m_dwLastUpdateTime; LPEVENT m_pkMountSystemUpdateEvent; }; #endif On the debug is mentioned this function: 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; } This is only breaking on non-MountSystem mounts, on the mounts configured on the mounting system quest for this system it works fine. Thanks for your answer
  15. Ok, but what does that mean? How can I solve it? Thanks for your answer.
  16. Hello, I've found a bug on the mount system, since I use it as "horse", when you unmount, it follows you. It happens when unmounting, with the command /ride (CTRL+G). It crashes here (do_ride): if(ch->GetMountingVnumM() != 0) { CMountSystem* MountSystem = ch->GetMountSystem(); if(MountSystem != NULL) { bool MState = MountSystem->IsMounting(ch->GetMountingVnumM()); if(MState == true) { MountSystem->Unmount(ch->GetMountingVnumM()); return; } else { do_unmount(ch, NULL, 0, 0); if (ch->IsHorseRiding()) ch->StopRiding(); MountSystem->Mount(ch->GetMountingVnumM()); return; } } } gdb: (gdb) bt full #0 0x082adc1e in boost::unordered_detail::hash_table<boost::unordered_detail::map<unsigned int, boost::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, CMountActor*> > > >::find ( k=<synthetic pointer>: 1291250540, this=0x4c6a45d4) at ../../../Extern/include/boost/unordered/detail/table.hpp:580 No locals. #1 boost::unordered_map<unsigned int, CMountActor*, boost::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, CMountActor*> > >::find (k=<synthetic pointer>: 1291250540, this=0x4c6a45d4) at ../../../Extern/include/boost/unordered/unordered_map.hpp:428 No locals. #2 CMountSystem::GetByVnum (vnum=1291250540, this=0x4c6a45d0) at MountSystem.cpp:515 MountActor = 0x0 iter = <optimized out> #3 CMountSystem::IsMounting (this=this@entry=0x4c6a45d0, mobVnum=1291250540) at MountSystem.cpp:447 MountActor = 0x0 #4 0x080f3295 in do_ride (ch=0x4cf6abc0, argument=0xffff8e5f "", cmd=228, subcmd=0) at cmd_general.cpp:4626 MState = <optimized out> __FUNCTION__ = "do_ride" #5 0x080e99b2 in interpret_command (ch=ch@entry=0x4cf6abc0, argument=argument@entry=0xffff980f "ride", len=len@entry=4) at cmd.cpp:930 __FUNCTION__ = "interpret_command" cmd = "ride\000\000\001\000\000\000\001\000\000\000(\216\377\377N:9\bD!]L\250\r\234L\000\000\000\000\370\r\234L\000\000\000\000\021\000\000\000\344\027J\b\b\000\000\000\000\000\000\000\a\000\000\000\b\000\000\000\b\000\000\000\340\226\373L\030!]L\270\216\377\377\n\n&\b\000!]L\004\000\000\000\370\r\234L\000\000\000\000\001\000\000\000\021\000\000\000H!]Lx\216\377\377t\216\377\377H!]Lt\216\377" new_line = "ride\000\374\r\234Lp\216\377\377\004\000\000\000\000\000\000\000\227\310PKT)V\356KP\310\227\370\r\234L\b\000\000\000\260\r\234L\310\216\377\377i\325\063\b@!]L\250\r\234L\000\000\000\000\370\r\234L\364\226\373L\000\000\000\000\000\000\000\000\b\000\000\000\001\000\000\000\370\377\377\377\000\000\000\000\350\000\000\000\001\000\000\000\001\000\000\000\b\217\377\377N:9\bD!]L\250\r\234L\000\000\000\000\370\r\234L\000\000\000\000\021\000\000\000\344\027J\b\b\000\000\000\000\000\000\000\a\000\000\000\b\000\000\000\b\000\000\000\370\226\373L\030!]L\230\217\377\377\n\n&\b\000!]L\004\000\000\000\343\251\223(\000\000\000\000\001\000\000\000"... icmd = 228 cmdlen = 4 #6 0x081799cb in CInputMain::Chat (this=0x4c998e9c, ch=ch@entry=0x4cf6abc0, data=data@entry=0x4cfd9680 "\003\n", uiBytes=11) at input_main.cpp:830 pinfo = 0x4cfd9680 buf = "/ride\000\260\231\377\377\334h\225(\002\000\000\000x\231\377\377\322\033\224(\002\000\000\000\334h\225(x\232\377\377\343\311\215(\220\232\377\377|\231\377\377\334h\225(\377\377\377\377\002\000\000\000v\231\377\377\000\000\000\000\377\377\377\377\000\000\000\000\002\000\000\000\001\000\000\000\000\000\000\000\022\000\000\000\001\000\000\000\001\000\000\000\002\000\000\000\200\000\000\000\001\000\000\000\002\000\000\000\001\000\000\000\000\000\000\000\001\000\000\000\001\000\000\000\002\000\000\000\001\000\000\000\260\310\224(\001\000\000\000\002\000\000\000\001\000\000\000\001\000\000\000\000\000\000\000\200*j\b\350\233\377\377\000\000\000\000\001\000\000\000\002\000\000\000\001\000\000\000\372\326\377N\000\000\000\000\200*"... chatbuf = "\000\000\001\000\000\000\001\000\000\000\030\000\000\000\001\000\000\000\260\310\224(\001\000\000\000\004\000\000\000\001", '\000' <repeats 11 times>, "\200*j\b(\235\377\377\000\000\000\000\000\000\000\000\200*j\bH\235\377\377\000\000\000\000\000\000\000\000\200*j\bH\235\377\377\000\000\000\000\000\000\000\000\200*j\000D\235\377\377\000\000\000\000\367\000\277\374\024\216\376\000L\235\377\377<\302\257\304\310\000]L@\000\000\000\346\307W\202\205\311-\352q\000\334\027&\315\263\000\064\236\377\377\200*j\b\220\232\377\377\334h\225(\250\233\377\377\030i\222(\220\232\377\377\274\211\225(\316\033\224(\350\233\377\377\372\233\377\377\000\000\000\000\375\377\377\177\b\002\377\377\370\233"... iExtraLen = 6 __FUNCTION__ = "Chat" pAffect = <optimized out> nNome = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x38 <error: Cannot access memory at address 0x38>}} buflen = 5 len = <optimized out> pack_chat = {header = 0 '\000', size = 0, type = 0 '\000', id = 256, bEmpire = 0 '\000'} #7 0x0817ae85 in CInputMain::Analyze (this=0x4c998e9c, d=0x4c998e00, bHeader=3 '\003', c_pData=0x4cfd9680 "\003\n") at input_main.cpp:3840 __FUNCTION__ = "Analyze" iExtraLen = 0 #8 0x0815f09a in CInputProcessor::Process (this=0x4c998e9c, lpDesc=0x4c998e00, c_pvOrig=<optimized out>, r_iBytesProceed=@0xffffa3f8: 0, iBytes=<optimized out>) at input.cpp:114 iExtraPacketSize = <optimized out> bHeader = 3 '\003' c_pszName = 0x4cfaa10c "Chat" bLastHeader = <optimized out> iLastPacketLen = <optimized out> iPacketLen = 5 c_pData = 0x4cfd9680 "\003\n" #9 0x081247e9 in DESC::ProcessInput (this=this@entry=0x4c998e00) at desc.cpp:313 iBytesProceed = 0 bytes_read = 11 __FUNCTION__ = "ProcessInput" #10 0x082c52d4 in io_loop (fdw=0x28cf62e0) at main.cpp:1185 iRet = <optimized out> d = 0x4c998e00 num_events = 4 event_idx = 3 __FUNCTION__ = "io_loop" #11 0x082c5557 in idle () at main.cpp:1062 pta = {tv_sec = 1532296067, tv_usec = 21324} ---Type <return> to continue, or q <return> to quit--- This is the system (in case anyone need it): [Hidden Content] Thank you all
  17. Working now locale_game.txt CHANGE_LOOK_COST Custo da transmutação: %s uichangelook.py def NumberToMoneyString(self, n) : if n <= 0 : return "0 %s" % (localeInfo.MONETARY_UNIT0) return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), localeInfo.MONETARY_UNIT0) It was a problem with this function. The original function: def NumberToMoneyString(self, number): number = str(number) strNumber = "%s" % (','.join([number[::-1][k : k + 3][::-1] for k in xrange(len(number)+1, -1, -3)])) strNumber = strNumber[1:] return "%s" % (strNumber)
  18. Thanks, it worked (I used @ManiacRobert's option) But I have another bugs that isn't solved... Even though I have CL_TRANSMUTATION_PRICE = 1000000000 (1kkk) ingame it only shows 10000000 (10kk) but it removes the 1kkk correctly... I already changed the packets and everything price related to long long but it keeps not showing the correct amount... locale_game.txt CHANGE_LOOK_COST Custo da transmutação: %s Yang uichangelook.py self.cost.SetText(localeInfo.CHANGE_LOOK_COST % (self.NumberToMoneyString(changelook.GetCost()))) PythonChangeLook.cpp PyObject * GetClCost(PyObject * poSelf, PyObject * poArgs) { return Py_BuildValue("L", CPythonChangeLook::Instance().GetCost()); } { "GetCost", GetClCost, METH_VARARGS }, PythonChangeLook.h class CPythonChangeLook : public CSingleton<CPythonChangeLook> { public: long long dwCost; public: long long GetCost() { return dwCost; } void SetCost(long long dwCostR) { dwCost = dwCostR; } PythonNetworkStreamPhaseGame.cpp TPacketChangeLook sPacket; CPythonChangeLook::Instance().SetCost(sPacket.dwCost); packet.h typedef struct SPacketChangeLook { BYTE header; BYTE subheader; long long dwCost; BYTE bPos; TItemPos tPos; } TPacketChangeLook; char.cpp TPacketChangeLook sPacket; sPacket.dwCost = bOpen == true ? CL_TRANSMUTATION_PRICE : 0; Does anyone know what is wrong? Thank you
  19. DWORD's size is 4294967295 (around 4,29kkk) my price is just 1kkk, I believe it's correct, right? But I will try it anyway... Thanks for your answer
  20. Hello, Today I realized I had a bug on the transmutation system (change look). Instead the game discount 1kkk on the gold (price I set) it gives exactly 3.294.967.296 yang every time... The function that discounts the money: void CHARACTER::RefineClMaterials() { LPITEM * pkItemMaterial; pkItemMaterial = GetClWindowMaterials(); if (!pkItemMaterial[0]) return; else if (!pkItemMaterial[1]) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[Transmutation] Please submit the item you want to transmute.")); return; } DWORD dwPrice = CL_TRANSMUTATION_PRICE; if (GetGold() < dwPrice) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("[Transmutation] You don't have enough Yang.")); return; } DWORD dwVnum = pkItemMaterial[1]->GetVnum(); PointChange(POINT_GOLD, -dwPrice); DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, pkItemMaterial[0]->GetVnum(), -dwPrice); ITEM_MANAGER::instance().RemoveItem(pkItemMaterial[1], "TRANSMUTED (SUCCESSFULLY)"); pkItemMaterial[0]->SetTransmutation(dwVnum, true); ClearClWindowMaterials(); TItemPos tPos; tPos.window_type = INVENTORY; tPos.cell = 0; TPacketChangeLook sPacket; sPacket.header = HEADER_GC_CL; sPacket.subheader = CL_SUBHEADER_REFINE; sPacket.dwCost = 0; sPacket.bPos = 0; sPacket.tPos = tPos; GetDesc()->Packet(&sPacket, sizeof(TPacketChangeLook)); } The POINT_GOLD: case POINT_GOLD: { long long nTotalMoney = GetGold() + amount; if (nTotalMoney > yang_max) { sys_err("[OVERFLOW_GOLD] maximum %lld OriGold %lld AddedGold %lld id %u Name %s ", yang_max, GetGold(), amount, GetPlayerID(), GetName()); LogManager::instance().CharLog(this, GetGold() + amount, "OVERFLOW_GOLD", ""); nTotalMoney = GetGold(); amount = 0; SetGold(yang_max); return; } // û�ҳ⺸ȣ if (LC_IsNewCIBN() && amount > 0) { if (IsOverTime(OT_NONE)) { dev_log(LOG_DEB0, "<GOLD_LOG> %s = NONE", GetName()); } else if (IsOverTime(OT_3HOUR)) { amount = (amount / 2); dev_log(LOG_DEB0, "<GOLD_LOG> %s = 3HOUR", GetName()); } else if (IsOverTime(OT_5HOUR)) { amount = 0; dev_log(LOG_DEB0, "<GOLD_LOG> %s = 5HOUR", GetName()); } } SetGold(GetGold() + amount); val = GetGold(); } break; Can anyone help me out?
  21. Hello, I need to do a NPC to duplicate items, when the npc take the item it gives back a new item with the same bonus and both stay on inventory. I just need this for the test server so I don't need to create a new item everytime for my team... Thank you all
  22. Thank you for sharing! Can you also share the button code please?
  23. M2 Download Center Download Here ( Internal ) Hi, So, I needed the element slot on inventory for what I'm doing, but I also need the ring, since there's no image with talisman and ring, I made my own... Download: [Hidden Content] Hope it's useful for someone
  24. I don't have the FoxFS source code, but I would like to, without it I doubt you can do an unpacker...
×
×
  • 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.