Jump to content

Angelix

Community
  • Content Count

    518
  • Joined

  • Last visited

  • Days Won

    68

Everything posted by Angelix

  1. It can be achieved with "string.format" and "os.time()". This is how to read the starting date: local oYear, oMonth, oDay, oHour, oMin = Table.Time:match('(%d+)/(%d+)/(%d+)/(%d+)/(%d+)') Then onto reading opening interval, portal duration and map duration: local iDay, iHour, iMin, pDay, pHour, pMin, mDay, mHour, mMin = Table.Time:match('"(%d+)/(%d+)/(%d+)", "(%d+)/(%d+)/(%d+)", "(%d+)/(%d+)/(%d+)"') "Table" refers to this: MapTimerNPC.Table['abandonedcity'] = {ID = 88, Map = 0, PosX = 0, PosY = 0, Time = '"2005/8/30/0/0", "0/3/0", "0/1/0", "0/2/0"'} I have achieved this: You have to turn the dates into seconds, get the current date and the seconds passed since start date (referring to "2005/8/30/0/0"). From there you also need start comparing times which is not that hard having the 2 functions I mentioned at the start.
  2. Those are hex number for colors, here's an example, if that's what you're asking.
  3. I think you'd need an extra application to run the discord chat integration feature, which is not released.
  4. Bug Title: GetRoleByID Function Bug Description: The lua function "GetRoleByID" is not properly returning the role. How to replicate: Insert a character ID into "GetRoleByID" function and it won't return the role. Status: Closed Author: Angelix GameServer Source / CharScript.cpp inline int lua_GetRoleByID(lua_State* L) { BOOL bValid = lua_gettop(L) == 1 && lua_isnumber(L, 1); if (!bValid) { E_LUAPARAM; return 0; } DWORD dwChaDBID = (DWORD)lua_tonumber(L, 1); CPlayer* pPlayer = g_pGameApp->GetPlayerByDBID(dwChaDBID); if (pPlayer) { CCharacter* pCha = (CCharacter*)pPlayer->GetMainCha(); lua_pushlightuserdata(L, (CCharacter*)pCha); return 1; } //lua_pushlightuserdata(L, NULL); return 0; }
  5. Sorry. I could not provide what was fully done since it was given to me by a friend that hexed it. It fixes the issue of "Level Requirement" not showing up on NPC's "BuyPage".
  6. I think that might be on client side, couldn't find something related to that like set view or something from server sources. I could probably be something related like this thread. Update: Fixed by applying this patch to client.
  7. Bug Title: Guild Attribute Refresh Bug Description: Player attributes are not refreshing instantly when applying an attribute from guild. How to replicate: Open character and guild stats, buy an attribute from guild and the character attribute will not refresh instantly. Only upon teleporting will they refresh. Status: Closed Author: Angelix Source Code - GameApp.h Description: I think DealAllInGuild function was not calling the function RefreshCha correctly, it was trying to send an extra parameter. Checking whether the extra parameter exists or not does the trick and then sending the called function after. inline bool CGameApp::DealAllInGuild(int guildID, const char* luaFunc, const char* luaParam){ BEGINGETGATE(); CPlayer *pCPlayer; CCharacter *pCha = 0; GateServer *pGateServer; while (pGateServer = GETNEXTGATE()){ if (!BEGINGETPLAYER(pGateServer)) continue; int nCount = 0; while (pCPlayer = (CPlayer *)GETNEXTPLAYER(pGateServer)) { if (++nCount > GETPLAYERCOUNT(pGateServer)){ LG("player chain list error", "player number:%u, %s\n", GETPLAYERCOUNT(pGateServer), "DealAllInGuild"); break; } pCha = pCPlayer->GetCtrlCha(); if (!pCha) continue; if (pCha->GetPlayer()->GetMainCha()->GetValidGuildID() == guildID){ if (luaParam != ""){ g_CParser.DoString(luaFunc, enumSCRIPT_RETURN_NONE, 0, enumSCRIPT_PARAM_LIGHTUSERDATA, 1, pCha, enumSCRIPT_PARAM_STRING, 1, luaParam, DOSTRING_PARAM_END); } else{ g_CParser.DoString(luaFunc, enumSCRIPT_RETURN_NONE, 0, enumSCRIPT_PARAM_LIGHTUSERDATA, 1, pCha, DOSTRING_PARAM_END); } } } } return true; } Lua Functions: This function was just missing the guildID call at the beginning. function UpdateGuildAttrs(role) local guildID = GetChaGuildID(role) if not guildAttributes[guildID] then InitGuildAttr(guildID,0,0,0,0,0,0,0,0,0,0,0,0) end local pkt = GetPacket() WriteCmd(pkt,508) WriteDword(pkt,GetRoleID(role)) WriteDword(pkt,0) WriteByte(pkt,32) WriteDword(pkt,guildAttributes[guildID][ATTR_PDEF] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MSPD] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_ASPD] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MXATK] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_DEF] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_HIT] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_FLEE] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_HREC] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_SREC] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MXHP] or 0) WriteDword(pkt,guildAttributes[guildID][ATTR_MXSP] or 0) SendPacket(role,pkt) end
  8. Clean list of the game improvements so you can directly go to the comment that you're interested in. Game Improvements: In-Game Shop Limited Duration/Quantity / Open. NPC Hover Text Color / Closed.
  9. Clean list of the architecture improvements so you can directly go to the comment that you're interested in. Architecture Improvements:
  10. Clean list of the bug reports so you can directly go to the comment that you're interested in. Bug Reports and Status Guild Attribute Refresh / Closed. Amplifier Unlimited Stats / Closed. Random Disconnects / Open. Buy Page Missing Level / Closed. Invisible Swings / Closed. Inventory Item Price / Open. In-Game Shop Not Updating / Closed. Nightmare Helmet Issue / Closed. Admiral Cloak / Closed. GetRoleByID Not Working / Closed. Cannot Upgrade Ship / Open. GroupServer Crash / Open.
  11. Hello community of pkoDev, some time ago we got our hands on the source code for the game we love and have been creating unique stuff for years. Many (including myself) are completely useless when trying to build and make a functional application out of the Chinese sources so not many people were using them. Now, thanks to the Sheep Squad (KONG, Billy, Wrexor, Mii, Foxseiz & Snre3n), they have released the source code for the server-side applications and a client to go along with it. We have to thank them for it, since this improves the community as a whole and now you start seeing a few servers popping up. While they're functional, there have been comments about them having some minor issues, which we as a community can come together to fix as a public source code. This thread is created thanks to KONG for giving the idea and is not to bring any other issue/dramas that showed up in the other thread. This thread's only purpose is to identify issues/improvements and share the code that can fix and/or improve the code, therefore: Anyone is allowed to post anything they might have found, even if they don't have an immediate fix for it. Anyone is allowed to contribute fixes to other people's issues and their own. Anyone is allowed to contribute improvements to existing code. If any issue fix and/or improvement is shared and you can make the code better, feel free to contribute! Note1: This thread is not about fixing the directories, missing files or compiling source code itself, that's explained on the original release thread. Note2: This is my first time doing a thread like this, so if I'm missing anything to add, let me know! So for as posting something, lets follow the example stated by KONG. For Bug Reports, follow this: Bug Title: Bug Description: How to replicate: Status (pending / close / open): Author (whoever that fixes it): For Architecture Improvements, follow: Title: Refactor to MVC design pattern Reason: scalability and maintainability Approach: For Game Improvements, follow this: Title: Reason: Improve existing guild functions Approach: SQL table, Open-closed, etc Concerns: concurrency, race, etc Please try posting the actual fixes, if you can, try explaining what was done so the rest of people reading the thread can learn if they're interested. Avoid just posting the whole file like "here's the fixes inside my functions.lua" and posting your 20K line file, try posting just the fixes/changes.
  12. I’ll start a new thread on it later tonight and post my fixes on the guild issues. Those are the only things I have found myself and fixed since I haven’t really gotten to fully explore the files.
  13. Send me a message on discord. Angelix#2836
  14. Have you tried gaining levels with guild to gain points to increase attributes? If not, do so. Then open up your character stats and check if it gets updated instantly when increasing guild attributes. Send me a message on discord if you can’t find the issue.
  15. The issues are within sources themselves, compiled by you or someone else, those issues are there until you fix them. As for the Chinese sources, those are found by searching pkoDev, especially announcements.
  16. The missing files while building 'Common' folder are taken from Chinese source and the missing files while building Account/Gate/Group/Game are within 'Common' folder, you just need to fix the path of directories. Additionally, someone already shared built exes and client. I don't know if the shared exes have fixed the guild issues within source and lua files.
  17. Little contribution. This should allow you to choose were a player revives when they press the prompt "revive in town". For those interested in making new map scripts and also stuff like respawning near a portal if a map is still active like "Chaos Argent" and such. Lua function and its corresponding source adjustment. MapRespawnOnDeath = function(Player) return "" end void CCharacter::BackToCity(bool bDie, cChar *szCityName, Long lMapCpyNO, Char chSwitchType) { SubMap *pCMap = GetSubMap(); pCMap->GoOut(this); SetToMainCha(bDie); CCharacter *pCMainCha = GetPlyMainCha(); pCMainCha->SetExistState(enumEXISTS_NATALITY); //pCMainCha->m_timerScripts.Reset(); /* if(bDie && (!strcmp(pCMap->GetName(), "guildwar"))) { if(GetGuildType() == emGldTypePirate) { szCityName = "guildwarpirateside"; } else { szCityName = "guildwarnavyside"; } } else if(bDie && (!strcmp(pCMap->GetName(), "guildwar2"))) { if(GetGuildType() == emGldTypePirate) { szCityName = "guildwarpirateside2"; } else { szCityName = "guildwarnavyside2"; } } */ if (g_CParser.DoString("MapRespawnOnDeath", enumSCRIPT_RETURN_STRING, 1, enumSCRIPT_PARAM_LIGHTUSERDATA, 1, pCMainCha, DOSTRING_PARAM_END)) szCityName = g_CParser.GetReturnString(0); if (!szCityName || !strcmp(szCityName, "")) pCMainCha->ResetBirthInfo(); else { SBirthPoint *pSBirthP; pSBirthP = GetRandBirthPoint(GetLogName(), szCityName); SetBirthMap(pSBirthP->szMapName); SetPos(pSBirthP->x * 100, pSBirthP->y * 100); } pCMainCha->SwitchMap(pCMap, pCMainCha->GetBirthMap(), pCMainCha->GetPos().x, pCMainCha->GetPos().y, false, chSwitchType, lMapCpyNO); }
  18. Como dijo Wolfen, si recién creaste un personaje, debes abrir un GameServer con el mapa que escogiste. Si escogiste “Argent City”, debe ser un GameServer con “garner” abierto así tal cual dijo el. Si es “Shaitan City” entonces “magicsea” y “Icicle Castle” es “darkblue”.
  19. Just do this: function can_open_entry_garner2( map ) local hour = os.date ("%H") local hournum = tonumber(hour) if hournum == 10 or hournum == 14 or hournum == 18 or hournum == 21 then return 1 else return 0 end end @flamyman1412, remove the comments all together if you're having trouble.
  20. For that I used some libs from one of the sources that’s not labeled “2.4”, built exes again and it worked. After that, I’m stuck on the other two issues about item ID and no characters.
  21. Send me a message on discord and I’ll help you get pass that.
  22. From what I remember CaLua was missing items, also the libs might be generated inside bin, not where they should be.
  23. The CaLua libs gets generated I think, but inside. You have to get them and put them inside a new folder called “lib”.
  24. Kong mentioned that any missing file can be taken out of the Chinese source.
  25. Kong mentioned that any missing file can be taken out of the Chinese source.
×
×
  • Create New...