Jump to content

mkhzaleh

Developer
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by mkhzaleh

  1. not developer and want write top from scratch that's mean you should be rich enough to hire people to do that, but if not dev, and not rich then you are searching in wrong place better improve your python maybe o.o or learn c# if want to move that to unity . or c++ for unreal
  2. yea i would suggest to run it once inside "initial.lua"
  3. just to make this topic more helpful for newbie's , : add this function to your function.lua or anywhere function IsPlayerLocked(character) ------- small check for all kind of locks ingame if KitbagLock(character, 1) == LUA_TRUE or GetChaStateLv(character, STATE_BAT) >= 1 or GetChaStateLv(character, STATE_JY) >= 1 then return true else return false end ------ end then you write the function itself function ChestX(Player, Item) local ItemID = GetItemID(Item) local SlotsNeeds = 3 local LevelCheck = true local LevelNeeds = 50 local OpenInXmap = true local quality = 4 --disable for boats if ChaIsBoat(Player) == 1 then SystemNotice(Player, GetItemName(ItemID).." is only usable for players not in a boat.") UseItemFailed(Player) return end --check if inventory loked if IsPlayerLocked(Player) then PopupNotice(Player, "Your bag is locked!") UseItemFailed(Player) return end --if has free slots if GetChaFreeBagGridNum(Player) < SlotsNeeds then SystemNotice(Player, "You need at least "..SlotsNeeds.." free inventory slot to open ["..GetItemName(GetItemID(Item)).."].") UseItemFailed(Player) return end --if we check levels if LevelCheck then if GetChaAttr(Player, ATTR_LV) < LevelNeeds then BickerNotice(Player, GetItemName(ItemID).." is only usable for players below level "..LevelNeeds..".") UseItemFailed(Player) return end end --if we open this chest inside x maps only if OpenInXmap then local mapName = GetChaMapName(Player) local maps = {} maps["garner2"] = true if maps[mapName] == nil then SystemNotice(Player ,"Cannot be used in "..mapName..) UseItemFailed ( Player ) return end end --give the item --to give it to temp bag use --GiveItemX(Player, 0, item_id, qty, quality ) --or use giveitem to inventory --GiveItem(Player, 0, item_id, qty, quality ) --if want give gem with level use like --GiveItem(Player,0,gemid,1,GemLv+100) --give new gem GiveItem(Player, 0, 102, 1, quality ) GiveItemX(Player, 0, 500, 1, quality ) GiveItem(Player, 0, 860, 1, 102 ) --gem --give random items from x table math.randomseed(os.time()) local RandomItems = {6910,6911,6912,6913,6914} GiveItem(Player, 0, RandomItems[math.random(1,#RandomItems)], 1, quality ) end and that's it
  4. your side, well you still can improve on your code, for example, add auto copy after create the function, or add copy button more options to generate ref gems inside that chest , if we are talking about "newbies "
  5. that's normal you should edit your Creat_Item_Tattr(item_type,item_lv , item_event) local quality = SetItemQua ( item_event ) -----------gemes lv3+ if item_event == 101 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 10 ) --��ʯ return end if item_event == 102 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 20 ) --��ʯ return end if item_event == 101 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 10 ) --��ʯ return end if item_event == 102 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 20 ) --��ʯ return end if item_event == 103 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 30 ) --��ʯ return end if item_event == 104 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 40 ) --��ʯ return end if item_event == 105 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 50 ) --��ʯ return end if item_event == 106 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 60 ) --��ʯ return end if item_event == 107 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 70 ) --��ʯ return end if item_event == 108 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 80 ) --��ʯ return end if item_event == 109 then Add_Item_Attr ( ITEMATTR_VAL_BaoshiLV , 90 ) --��ʯ return end ---------------
  6. SPECIALSKILL = {} SPECIALSKILL[10]=0 SPECIALSKILL[11]=0 SPECIALSKILL[12]=0 SPECIALSKILL[13]=0 SPECIALSKILL[14]=0 SPECIALSKILL[15]=0 SPECIALSKILL[16]=0 SPECIALSKILL[17]=0 SPECIALSKILL[18]=0 SPECIALSKILL[19]=0 this suppose to be inside ctrl.lua hell3 in your case seems not exist as it already nil
  7. well i know that, and trying to understand why people would bother develop such a thing ,as it not healthy
  8. people vs bots and you make it legal /? what the point of that? making all top spots full of fake empty bots so real new comer can't farm anymore lol?
  9. i will write this in english so some people can use it first in such a code you will face 2 problems in general as it above server will take your cash and do not extract anything if one of slots had empy socket so to solve such a problem you should do like this --inside can_getstone_item_main( Table ) --below if Item_Stone[0]==0 and Item_Stone[1]==0 and Item_Stone[2]==0 then SystemNotice( role ,"Equipment is not forged with gem") return 0 end --add : if (ItemID_otheritem ~= 1020 and ItemID_otheritem ~= 15109 and ItemID_otheritem ~= 15110) then SystemNotice( role ,"Please use Blacksmith's Pliers") return 0 end if (ItemID_otheritem == 15109 and Item_Stone[1]==0 ) then SystemNotice( role ,"Equipment second socket not forged with gem ") return 0 elseif (ItemID_otheritem == 15110 and Item_Stone[2]==0 ) then SystemNotice( role ,"Equipment Third socket not forged with gem ") return 0 end --note change ids to your ids *second issue you may face if you want to make normal blacksmith to extract all slots not only slot one *Third issue you will have small dupe if you have stack gems slots same as co files etc how ever this small fix for these issues >find in attachment extract gems per slot code.lua
  10. that's mean you didn't built util project or audio or you don't have included in correct path for commons
  11. rebuild your common files as release
  12. hello! as the title says is there is any c++ assist to check if wpe already attached to game process ? i know there is few from windows for anti debugging the game included in windows header but how about wpe?
  13. hello there! this small optimizing for _evtGameOptionFormMouseDown normal code will run every functions in the list even if its same previous value example: so what we do small optimize to call changed values in system options only " this helpful if you are using hide effects/apps etc" the modification: open UISystemForm.cpp and search for : void CSystemMgr::_evtGameOptionFormMouseDown(CCompent* pSender, int nMsgType, int x, int y, DWORD dwKey) for example we change it to now repeat same steps for the rest options pGroup = g_stUISystem.cbxHelpMode; if (pGroup) { bool bHelpMode = pGroup->GetActiveIndex() == 1 ? true : false; if (g_stUISystem.m_sysProp.m_gameOption.bHelpMode != bHelpMode) { g_stUISystem.m_sysProp.m_gameOption.bHelpMode = bHelpMode; if (!bHelpMode) g_stUIStart.ShowLevelUpHelpButton(bHelpMode); g_stUIStart.ShowInfoCenterButton(bHelpMode); ::WritePrivateProfileString("gameOption", "helpMode", bHelpMode ? "1" : "0", "./user/system.ini"); } }
  14. Hello there! as all you know all top client has this bug exist you edit music volume >close client> reopen music still playing as max volume until open/apply music edits again so this small fix for that! open: PacketCMD_CS.CPP on header add : #include "UIsystemform.h" :search for: void CS_BeginPlay(const char *cha) add inside it : g_stUISystem.m_sysProp.ApplyAudio(); done: rebuild . :if you have some cool ideas to make for top type them here! some of codes been done lately :
  15. not sure who care for your list? when ever i bought something from you? lol? if not "and its not" just can stfu? when i ever sold you anything? " which is also never done" so stfu?
  16. mentioning my name while i never sold u anyshit or bought from you means you are totally dumb person? but talking about scams everyone who contact with you and bought your"mount fix" was totally my code with 1 line of edits? so its means you are a dumb person and scammer for other people works? and you still standing there to comment about this guy work with no sense and doing shits in this community? so can you just stfu and quit as u did before?
  17. its happen if you use ship.. and i see people still keep such stupid bugs like this for their own
  18. you have to check player stall/trade action as well if IsChaStall(role) == LUA_TRUE and IsChaLocked(role) == LUA_TRUE then return LUA_FALSE end to fix in src just replace to this BOOL CCharacter::SafeBuy( WORD wItemID, BYTE byCount, BYTE byIndex, DWORD& dwMoney ) {T_B if(GetPlyMainCha()->m_CKitbag.IsPwdLocked()) { //SystemNotice("Item bar is locked!"); SystemNotice(RES_STRING(GM_CHARACTER_CPP_00002)); return FALSE; } ///stall/trade dupe fix [ mothannakh 15/8/2019]/ //check if trade mode if (GetPlyMainCha()->GetTradeData()) { SystemNotice(RES_STRING(GM_CHARSTALL_CPP_00029)); return FALSE; } //check if player stalling if (GetPlyMainCha()->GetStallData()) { //character.SystemNotice( "Stalling, not trading" ); SystemNotice(RES_STRING(GM_CHARTRADE_CPP_00003)); return FALSE; } //add by ALLEN 2007-10-16 if(GetPlyMainCha()->IsReadBook()) { //SystemNotice("Reading, not trading!"); SystemNotice(RES_STRING(GM_CHARACTER_CPP_00003)); return FALSE; } CItemRecord* pItem = GetItemRecordInfo( wItemID ); if( pItem == NULL ) { //SystemNotice( "The item ID is wrong, the item information cannot be found!ID = %d", wItemID ); SystemNotice( RES_STRING(GM_CHARACTER_CPP_00005), wItemID ); return FALSE; } if(byCount <= 0) { //SystemNotice("Data error, purchase failed!"); SystemNotice(RES_STRING(GM_CHARACTER_CPP_00015)); return FALSE; } //mothannakh fix the npc exploit in src , if (byCount > pItem->nPileMax) { BickerNotice("%s comes in Stacks of %d Only", pItem->szName, pItem->nPileMax); return FALSE; } dwMoney = pItem->lPrice * byCount; USHORT sSize = m_CKitbag.GetCapacity(); if( byIndex >= sSize ) { //SystemNotice( "Item field index (% d) is invalid!", By Index ); SystemNotice( RES_STRING(GM_CHARACTER_CPP_00016), byIndex ); return FALSE; } if( m_CKitbag.GetID( byIndex ) == wItemID ) { if( !pItem->GetIsPile() ) { //SystemNotice( "This item"% s "cannot be stacked!", pItem->szName ); SystemNotice( RES_STRING(GM_CHARACTER_CPP_00017), pItem->szName ); return FALSE; } } DWORD dwCharMoney = (long)getAttr( ATTR_GD ); if( dwCharMoney < dwMoney ) { //SystemNotice( "Your money (% d) is not enough to purchase% d items "% s"! Unit price (% d)", dwCharMoney,byCount, pItem->szName, pItem->lPrice ); SystemNotice( RES_STRING(GM_CHARACTER_CPP_00018), dwCharMoney,byCount, pItem->szName, pItem->lPrice ); return FALSE; } //fix money npc exploit >mothannakh< if (dwMoney >= 2000000000 && dwCharMoney != 0) { if (dwMoney > 2000000000) { BickerNotice("Total cost cannot exceed 2b..."); return FALSE; } } USHORT sNum = byCount; SItemGrid SGridCont; SGridCont.sID = wItemID; SGridCont.sNum = byCount; ItemInstance( enumITEM_INST_BUY, &SGridCont ); m_CKitbag.SetChangeFlag(false); m_CChaAttr.ResetChangeFlag(); SetBoatAttrChangeFlag(false); // Deposit instantiated items Short sPushPos = defKITBAG_DEFPUSH_POS; Short sPushRet = KbPushItem( true, false, &SGridCont, sPushPos ); SynKitbagNew( enumSYN_KITBAG_FROM_NPC ); if( sPushRet == enumKBACT_ERROR_LOCK ) // Item bar is locked { ItemOprateFailed( enumITEMOPT_ERROR_KBLOCK ); return FALSE; } else if( sPushRet == enumKBACT_ERROR_PUSHITEMID ) // Item does not exist { ItemOprateFailed( enumITEMOPT_ERROR_NONE ); return FALSE; } else if( sPushRet == enumKBACT_ERROR_FULL ) // Item bar is full, reducing purchases { // Get item trigger event sNum = sNum - SGridCont.sNum; if( sNum == 0 ) { //SystemNotice( "Your inventory is full and you cannot buy items!" ); SystemNotice( RES_STRING(GM_CHARACTER_CPP_00019) ); return TRUE; } // Get item trigger event AfterPeekItem( wItemID, sNum ); } else if( sPushRet == enumKBACT_SUCCESS ) { // Get item trigger event AfterPeekItem( wItemID, sNum ); } dwMoney = sNum * pItem->lPrice; dwCharMoney -= dwMoney; setAttr( ATTR_GD, dwCharMoney ); SynAttr( enumATTRSYN_TRADE ); SyncBoatAttr(enumATTRSYN_TRADE); //SystemNotice( "You have purchased% d "% s" and spent (% d) money! Balance (%d)", sNum, pItem->szName, dwMoney, dwCharMoney ); SystemNotice( RES_STRING(GM_CHARACTER_CPP_00020), sNum, pItem->szName, dwMoney, dwCharMoney ); char szLog[128] = ""; sprintf( szLog, "%d��%s", sNum, pItem->szName ); TL( CHA_BUY, GetName(), "", szLog ); // Database save SaveAssets(); LogAssets(enumLASSETS_TRADE); return TRUE; T_E}
  19. there is few bugs if someone willing to spend some of his time and fix them Title: GM Login function what is does ? after you use gm login you won't be able to create any character until restart groupserver how to avoid that ? just stop using that function and stop using auto login in gm accounts ---------------------------- fast panel switch lag the client : using >tab< will make client heavey until press tab once again how to fix? so far i just went to the easier solution disabled tab function & +/- buttons -----------------
  20. yea its always back how people use the code in my case its used in item so i had to use that way
  21. BOOL CTableCha::ChangePlayerChatColor(CPlayer* pPlayer, DWORD color) { T_B if (!pPlayer || !pPlayer->IsValid()) { return false; } CCharacter* pCha = pPlayer->GetMainCha(); DWORD cha_id = pPlayer->GetDBChaId(); if (cha_id == 0) { return false; } sprintf(g_sql, "Update %s set chatColour = '%d' where cha_id = %d;", _get_table(), color, cha_id); short l_sqlret = exec_sql_direct(g_sql); if (!DBOK(l_sqlret) || get_affected_rows() == 0) { pCha->PopupNotice(" Change Chat Color Failed! Something Wrong happened, try again "); return false; } LG("Player Change Chat Color", "Player '%s' Changed his Chat color to '%d'\n", pCha->GetName(), color); pCha->SetPChatColor(color); //send to groupserver WPACKET wpk = GETWPACKET(); WRITE_CMD(wpk, CMD_MP_PlayerChatColor); WRITE_LONG(wpk, color); pCha->ReflectINFof(pCha, wpk); return true; T_E } here small example how i used to do it , you have to create new cmd packet inside groupserver to update color after changes inline int lua_ChangePlayerChatColor(lua_State* L) { T_B BOOL bValid = (lua_gettop(L) == 2 && lua_islightuserdata(L, 1) && lua_isnumber(L, 2)); if (!bValid) { PARAM_ERROR return 0; } CCharacter* pCha = (CCharacter*)lua_touserdata(L, 1); const DWORD color = lua_tonumber(L, 2); if (pCha) { game_db.ChangePlayerChatColor(pCha->GetPlayer(), color); return 1; } return 0; T_E } no changes needed on db side lua side ChangePlayercColor(role,0xFFff3399)
  22. just replace Receiver.cpp from both client and gate to clean "Receiver.cpp" will fix the issue there is another fix but not a big deal
  23. this small code for people who have problem with "angle " when add npcs simply open "GameAppMsg.cpp" go to "void CGameApp::HandleKeyDown(DWORD dwKey)" add the following code : "you can add it above if(IsEnableSuperKey())" else if (IsKeyDown(DIK_K) && IsCtrlPress() && CGameScene::GetMainCha()->getGMLv()) { CCharacter* pMain = CGameScene::GetMainCha(); if (pMain) { char buf[128] = { 0 }; sprintf(buf, "Cord :(%d,%d) Angle :%d Pitch : %d Roll %d", pMain->GetCurX(), pMain->GetCurY(), pMain->getYaw(), pMain->getPitch(),pMain->getRoll()); g_pGameApp->SysInfo(buf); } } rebuild client and done ingame click ctrl+k and the result will be like this

Board Life Status


Board startup date: May 27, 2020 20:35:04

Chat

Chat

    You don't have permission to chat.
    ×
    ×
    • Create New...