Jump to content

wouter2004

Advanced members
  • Content Count

    33
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by wouter2004

  1. Hi V3ctor many thanks for your support! that is indeed very helpful, I will check if I can make a derived function based on monster kills and check special monster kills, like Boses and event mobs. Player enter map will also help. I will use an ODBC script to keep track of login timestamps. Already use some new tables for game and website integration. Regarding the client pictures: I see that most server package functions are in the character.cpp, I will copy one and try to make a new package on both client and server, then on client side create a nice daily gift window with checkmarks, which will open on request. will share it when I am done, but you already helped me a lot thanks!
  2. Dear All, I have a question, I am working on an automated event which occurs every week and for this I need a clear "onkill" function for monsters? This means that when you kill a particular monster this function is automatically triggered and can give you items. Additionally I was wondering if there is a clean "onlogin" function, which only starts when you logon to the GameServer. I would like to use this for the function to deliver daily gifts to players. Last but not least, is there a package function which allows you to show pictures on client side? The example below is the "GmMail" package, but I would like to make a nice login GUI with more details about daily gifts.
  3. EXPLAINATION: I was playing around with some lua scripts and functions and wanted to share this script with you. It is a slot machine NPC, which allows you to play a game for fairy coins and money. Everytime you play, there are three wheels with four rows that show randomized slots. If you get three of the same slots in one row, you win a prize. Prizes can be easily customized and also the costs to play this game. Enjoy! SCREENSHOT: THE FUNCTION: \resource\script\calculate\functions.lua slotmachine = {} slotmachine.wheel = {} slotmachine.wheel[1] = {} slotmachine.wheel[1][1] = '$$$' slotmachine.wheel[1][2] = '^-^' slotmachine.wheel[1][3] = 'LOL' slotmachine.wheel[1][4] = '*-*' slotmachine.wheel[1][5] = '*-*' slotmachine.wheel[1][6] = '^-^' slotmachine.wheel[1][7] = '777' slotmachine.wheel[1][8] = '777' slotmachine.wheel[2] = {} slotmachine.wheel[2][1] = '$$$' slotmachine.wheel[2][2] = '^-^' slotmachine.wheel[2][3] = 'LOL' slotmachine.wheel[2][4] = '*-*' slotmachine.wheel[2][5] = '*-*' slotmachine.wheel[2][6] = '^-^' slotmachine.wheel[2][7] = '777' slotmachine.wheel[2][8] = '777' slotmachine.wheel[3] = {} slotmachine.wheel[3][1] = '$$$' slotmachine.wheel[3][2] = '^-^' slotmachine.wheel[3][3] = 'LOL' slotmachine.wheel[3][4] = '*-*' slotmachine.wheel[3][5] = '*-*' slotmachine.wheel[3][6] = '^-^' slotmachine.wheel[3][7] = '777' slotmachine.wheel[3][8] = '777' slotmachine.wheel[4] = {} slotmachine.wheel[4][1] = '$$$' slotmachine.wheel[4][2] = '^-^' slotmachine.wheel[4][3] = 'LOL' slotmachine.wheel[4][4] = '*-*' slotmachine.wheel[4][5] = '*-*' slotmachine.wheel[4][6] = '^-^' slotmachine.wheel[4][7] = '777' slotmachine.wheel[4][8] = '777' function SlotMachine(role) local randomNumber1 = math.random(1, 8) --Returns a number between 1 and 10. local randomNumber2 = math.random(1, 8) --Also returns a number between 1 and 10. local randomNumber3 = math.random(1, 8) --Returns a number between 1 and 10. local randomNumber4 = math.random(1, 8) --Also returns a number between 1 and 10. local slot = {} local prize = 0 local bonus = 'no bonus' for x=1,4 do slot[x] = {} slot[x][1] = slotmachine.wheel[x][math.random(1, 8)] slot[x][2] = slotmachine.wheel[x][math.random(1, 8)] slot[x][3] = slotmachine.wheel[x][math.random(1, 8)] end for row=1,4 do if ( slot[row][1] == slot[row][2] and slot[row][2] == slot[row][3]) then -- ROW STREAK if(slot[row][1] =='$$$') then prize = prize + 1000000 end if(slot[row][1] =='^-^') then prize = prize + 500000 end if(slot[row][1] =='777') then prize = prize + 777777 end if(slot[row][1] =='LOL') then prize = prize + 200000 bonus = 'Heaven Berry' end if(slot[row][1] =='*-*') then prize = prize + 100000 end end end if(prize ~= 0) then AddMoney ( role , 0 , prize ) end if(bonus == 'Heaven Berry') then GiveItem( role , 0 , 3844 , 1 , 1 ) end HelpInfoX(role, 0, "** SLOTMACHINE **__".."row 1: ["..slot[1][1].."] - ".."["..slot[1][2].."] - ".."["..slot[1][3].."]_".."row 2: ["..slot[2][1].."] - ".."["..slot[2][2].."] - ".."["..slot[2][3].."]_".."row 3: ["..slot[3][1].."] - ".."["..slot[3][2].."] - ".."["..slot[3][3].."]_".."row 4: ["..slot[4][1].."] - ".."["..slot[4][2].."] - ".."["..slot[4][3].."]__".."PRIZE: "..tostring(prize).." gold, ".."BONUS: "..bonus) return LUA_TRUE end THE NPC: \resource\script\MisScript\NpcScript06.lua Jackpot = {} Jackpot.Coins = {} Jackpot.Coins.amount = 30 -- 3 stacks of fairy coins 297 Jackpot.Coins.item = 0855 -- 3 stacks of fairy coins Jackpot.Coins.money = 10000 -- Money needed for second class advancement. function JackpotNPC() InitTrigger() TriggerCondition(1, HasItem, Jackpot.Coins.item, Jackpot.Coins.amount) TriggerCondition( 1, HasMoney, Jackpot.Coins.money ) TriggerCondition( 1, HasLeaveBagGrid, 1 ) TriggerCondition( 1, KitbagLock, 0 ) TriggerAction( 1, TakeMoney, Jackpot.Coins.money ) TriggerAction( 1, TakeItem, Jackpot.Coins.item, Jackpot.Coins.amount ) TriggerAction( 1, SlotMachine ) TriggerFailure( 1, JumpPage, 2 ) Talk( 1, "Jackpot Machine: For "..Jackpot.Coins.money.." gold and "..Jackpot.Coins.amount.." of fairy coins, you can try your luck and win a prize." ) Text( 1, "Try your luck, play a round!", MultiTrigger, GetMultiTrigger(), 1) Text( 1, "Explain the game.", JumpPage, 3) Text( 1, "Prizes", JumpPage, 4) Talk( 3, "Everytime you play a round there are three_wheels with four rows._The wheels will spin and you will see_the result in the next window._If you have three of the same slots in one_row, you win a prize.") Text( 3, "Back", JumpPage, 1) Talk( 4, "PRIZES:_3 x $$$ = 1 milion gold_3 x ^-^ = 500000 gold_3 x 777 = 777777 gold_3 x LOL = 200000 + a heavens berry_3 x *-* = 100000 gold.") Text( 4, "Back", JumpPage, 1) Talk( 2, "Failed to play a round. Insufficient gold or fairy coins" ) end NEW NPC ACTION PROCEDURE: \resource\script\MisSdk\MissionSdk.lua elseif actions[i].func == SlotMachine then PRINT( "ActionProc: SlotMachine") local ret = SlotMachine( character ) if ret ~= LUA_TRUE then PRINT( "ActionProc:SlotMachine = false" ) return LUA_FALSE end
  4. No you can remove the ++ it just indicates which lines should be added
  5. SynLook is already there in almost all faiy.lua functions, but nothing was changed on server side. When I compile the clean CO client from this forum, the fairy level is incorrect (becomes 0). When I use the precompiled CO executables, the fairy level is correctly shown. The only thing which I changed was the client executable in the system folder. Update I found the fix, the sourcecode was wrong after all: //nLevel= pGrid.GetAttr(ITEMATTR_VAL_STR) + pGrid.GetAttr(ITEMATTR_VAL_AGI) + pGrid.GetAttr(ITEMATTR_VAL_DEX) + pGrid.GetAttr(ITEMATTR_VAL_CON) + pGrid.GetAttr(ITEMATTR_VAL_STA); int nLevel= pGrid.GetInstAttr(ITEMATTR_VAL_STR) + pGrid.GetInstAttr(ITEMATTR_VAL_AGI) + pGrid.GetInstAttr(ITEMATTR_VAL_DEX) + pGrid.GetInstAttr(ITEMATTR_VAL_CON) + pGrid.GetInstAttr(ITEMATTR_VAL_STA);
  6. The strange thing is, when I downloaded the precompiled co client files, the glitch was fixed and I didn’t change the lua files on the server. I think it’s iteminfo related perhaps the pInfo is NULL. but I will look at the files you mentioned, perhaps I have an old version.
  7. When compiling the Corsair client code, I noticed that the fairy level in the form top left corner is incorrect. (see screenshot below) I noticed that the UIStartForm.ccp file, in void CStartMgr::RefreshPet the "int nLevel" is incorrectly calculated. When I change the value into "int nLevel = 100" it changes the value, but the following code does not work. CItemRecord* pInfo = GetItemRecordInfo( ID ); if(pInfo){ int nLevel = pGrid.GetAttr(ITEMATTR_VAL_STR) + pGrid.GetAttr(ITEMATTR_VAL_AGI) + pGrid.GetAttr(ITEMATTR_VAL_DEX) + pGrid.GetAttr(ITEMATTR_VAL_CON) + pGrid.GetAttr(ITEMATTR_VAL_STA); Does anyone know how to fix this? Thanks in advance!
  8. Here is fix for the mount animation which you can put in the client. I dont ask money for code, here to help
  9. Fixed the mount animation in the client, swings still dont work To get animated mounts update the following the the Character.ccp void CCharacter::FrameMove(DWORD dwTimeParam) { CSceneNode::FrameMove(dwTimeParam); if( !_isArrive ) { if( _IsMoveTimeType ) { static float dis; static D3DXVECTOR2 vTmp; dis = (float)( CGameApp::GetCurTick() - _dwStartTime ) * _fMoveSpeed; if( dis>_fMoveLen ) { setPos( (int)_vMoveEnd.x, (int)_vMoveEnd.y ); ++ if(pMount) ++ pMount->CCharacterModel::PlayPose(POSE_WAITING, PLAY_LOOP_SMOOTH, -1, 30, 1); // wouter _isArrive = true; } else { ++ if(pMount) ++ pMount->CCharacterModel::PlayPose(POSE_RUN, PLAY_LOOP_SMOOTH, -1, 30, 1); // wouter vTmp = _vMoveStart + _vMoveDir * dis; setPos( (int)vTmp.x, (int)vTmp.y ); } } else if( GetChaState()->IsTrue(enumChaStateMove) ) { // ????????ProgressRate(??????j???????)------------------------------------------------------------------------------ if( _nTurnCnt>1 ) _fStepProgressRate = _fStepProgressRate + _fStep * CWaitMoveState::GetMoveRate() / (float)_nTurnCnt; else _fStepProgressRate = _fStepProgressRate + _fStep * CWaitMoveState::GetMoveRate(); _CalPos(_fStepProgressRate); if(_fStepProgressRate >= 1.0f) { ++ if(pMount) ++ pMount->CCharacterModel::PlayPose(POSE_WAITING, PLAY_LOOP_SMOOTH, -1, 30, 1); // wouter _isArrive = true; } else if( _isStopMove ) { ++ if(pMount) ++ pMount->CCharacterModel::PlayPose(POSE_WAITING, PLAY_LOOP_SMOOTH, -1, 30, 1); // wouter _isArrive = true; } else { ++ if(pMount) ++ pMount->CCharacterModel::PlayPose(POSE_RUN, PLAY_LOOP_SMOOTH, -1, 30, 1); // wouter } } }
  10. I am wondering if someone has a fix for the fairy level in the HUD top left corner. I noticed that the nLevel in the UIStartForm.ccp in "void CStartMgr::RefreshPet" the nLevel is not properly calculated. When I put in a fixed value like 100, then I see this in game, but the calculation in the HUD does not work, while it works in the inventory. Please help. Thanks in advance!
  11. Sorry I didn't know there was a more advanced version of the mounts in game. I made some client tweaks, but on only in the Character.ccp, which means others will not see the different mount poses (walking and waiting). For this you need to code the CharacterModel.ccp
  12. It is already for free on these forums, right? I simply copied the code for the character.ccp and made the changes in the iteminfodb. Is this what you mean?
  13. Hi everyone, My friends and I are running a CO client and server and I was wondering where in the client source code I can extend the camera range. We have already increased the resolution to 1400x900 and the FPS to 60, with the desired effect. However the camera remains an ugly issue. PS> I know that the CameraConf.lua can be used to extend the range and change the camera angle, but I want to get rid of the ugly blue borders and extend the view range. Help would be much appreciated
  14. many thanks this will help a lot. using the counter and multiplying with the GetItemStackSize, will indeed with the right results
  15. Hi everyone I have successfully compiled the code and it works fine for me, but for some reason mounting to a swing gives me a dump. Is there a reason for this? 10-02 23:43:04SC_CharacterActionAccess Violation The thread attempted to read from or write to a virtual address for which it does not have the appropriate access xxxx\src\intel\strncpy.asm(157) : Game.exe at strncpy() xxxx\client\src\character.cpp(1104) : Game.exe at CCharacter::setName() xxxx\client\src\character.cpp(1733) : Game.exe at CCharacter::UpdataItem() xxxx\client\src\character.cpp(1553) : Game.exe at CCharacter::UpdataFace() xxxx\client\src\netprotocol.cpp(1535) : Game.exe at NetChangeChaPart() xxxx\client\src\packetcmd_sc.cpp(1118) : Game.exe at SC_CharacterAction()
  16. Sorry for bumping up this old topic, but I need some help with this script. The script only return 1 count, while I have 8 gems with level 1 stacked in one inventory slot. Most likely the script below expect that each gem has their own inventory slot. Is there a function to check the level of stacked items? Also when I have more than 8 gems in one slot, for example 12 times a level 1 gem, the script removes 8 and converts all remaining gems into level 4. function HasStone(character, stoneID, stoneLv, stoneCount) local amount = CheckBagItem(character,stoneID) if amount < stoneCount then return LUA_FALSE end local bagSize = GetKbCap(character) local count = 0 for i=1, bagSize do local gem =GetChaItem(character, 2, i) if gem ~= nil then local id =GetItemID(gem) if id == stoneID then local lv = Get_StoneLv(gem) if lv == stoneLv then count = count + 1 end end if count >= stoneCount then return LUA_TRUE end end end return LUA_FALSE end I have now reversed the script and changed it into a check for the exact amount and exact level. Quick and dirty, but this new version works. function HasStone(character, stoneID, stoneLv, stoneCount) local amount = CheckBagItem(character,stoneID) if amount ~= stoneCount then SystemNotice(character,"You need exactly "..stoneCount.." gems in your inventory. Amount = "..amount) return LUA_FALSE end local bagSize = GetKbCap(character) for i=0, bagSize do local gem =GetChaItem(character, 2, i) if gem ~= nil then local id =GetItemID(gem) if id == stoneID then local lv = Get_StoneLv(gem) if lv ~= stoneLv then SystemNotice(character,"Found gem level = "..lv) SystemNotice(character,"Remove the high level gems from your inventory") return LUA_FALSE end end end end SystemNotice(character,"Succesful! "..amount.." gems of level "..stoneLv.." detected.") return LUA_TRUE end If anyone has a better solution for the stacked items, level check I am open for suggestions.
  17. Hi everyone, My friends and I play on a private CO server and we want to extend the item list with new items of Winter Island. I created a new iteminfo.txt with all the items (starting from 5901 till 6808), which I extracted from the iteminfo.txt of PKO. On server side it works fine, on client side I get these strange glitches, like statbonus attributes in common drops etc. When I just extract the iteminfo.bin from CO with the Deguix Decompiler, I also get these strange unicode characters in the text file. Before I can change the iteminfo.txt back into a iteminfo.bin, I have to manually correct all these unicode characters. See example below. Question 1: is there a clean way to extract the iteminfo.bin file with the Deguix Decompiler, without the unicode characters? --> I tried version 1 and 2 already, which seems to be the only compatible version with CO "decompile_bin(iteminfo, 2, ......" --> no matter what version I try, the unicode characters keeps reoccuring in the resulting iteminfo.txt file. Question 2: is there someone who has a clean version of the iteminfo.bin, compatible with the CO client, which contains the items 5901 till 6808 for winter island? Help is much appreciated! Thanks in advance.
  18. Thanks great initiative! I was wondering can you make an overview of bug fixes and tweaks? I have already made some changes in the source code myself and want to know if this is covered. However the random disconnnect issues, remains super annoying. I really hope someone can find the reason for this. anyway thanks
  19. Can you please elaborate? Are you talking about recompiling the "Server\source\Common\Server\sdk\Lib\LIBDBC.lib" like: "Server\source\Common>call devenv Server/sdk/Proj/LIBDBC.sln /build release"
  20. Many thanks, I have recompiled the code and this solved the problem. I am very happy that you pointed me in the right directions.
  21. This solves the problem, try to add your NPC Builder to lua/plugin/npcexploit.lua in SailNpc
  22. Dear all, I am running a top CA server, for myself and friends. We face the strange issue that when teleporting inside the same map, the NANA buff (party exp banana's) are removed. This happens when using teleport tickets or the GM command "&move 2200,2750,garner". reproduce the issue When I warp from Argent to Abandoned Mines, which are both in "garner" map, the nana buffs are deactivated after teleporting. However when I use the same teleport ticket from Argent to Shaitan, I dont lose the buffs after teleporting. investigation I checked the LUA functions and it all ends with the function MoveCity( role, "" ). where "" is the name of the city. Unfortunately neither the GameServer source codes, nor the LUA files on the server, shows any deactivation of buffs after warping. Still the nana buffs are removed. Can someone please help me to find out why this happens? NpcScript.cpp --> lua_MoveCity Character.cpp --> CCharacter::MoveCity pictures nana deactivated after warp: Nana active before warp: please help. thanks in advance
  23. awesome that was the trick. thank you very much for pointing this out
  24. Hi everyone, I am running a top CA server for friends and myself, but we cannot upgrade our ship. Ok here is the problem. When I move to the ship builder in Argent called Sinbad, I am able to see the ship that can be upgraded, but when I select it nothing happens. So I did a trace and this is what happens so far: NpcScript03.lua file, has a function called r_talk155, which calls the BoatLevelBerthList function. function r_talk155 () Talk( 1, "George: Hey you! Want to go sailing? How can you do so without a good ship! Come have a look at what I have!" ) InitTrigger() TriggerCondition( 1, IsBoatFull ) TriggerAction( 1, SystemNotice, "Ships limit reached. Unable to build more ship" ) TriggerFailure( 1, JumpPage, 2 ) Text( 1, "Build Ship", MultiTrigger, GetMultiTrigger(), 1 ) InitTrigger() TriggerCondition( 1, HasBoatInBerth, 4 ) TriggerAction( 1, BoatLevelBerthList, 4 ) <-------------- TriggerFailure( 1, JumpPage, 3 ) Text( 1, "Upgrade ship", MultiTrigger, GetMultiTrigger(), 1 ) then this BoatLevelBerthList, open the function in the MissionSDK.lua elseif actions[i].func == BoatLevelBerthList then PRINT( "ActionsProc:BoatLevelBerthList, p1 = ", actions[i].p1 ) local ret = BoatLevelBerthList( character, npc, actions[i].p1 ) <----------------- if ret ~= LUA_TRUE then PRINT( "ActionsProc:BoatLevelBerthList failed!" ) SystemNotice( character, "ActionsProc:BoatLevelBerthList failed!" ) return LUA_FALSE end Now the NPCSDK.lua has the following function BoatLevelBerthList, which returns the values. --船只升级列表 function BoatLevelBerthList( character, npc, berth ) PRINT( "BoatLevelList: Show upgrade list of ships docked in this harbor!" ) SystemNotice( character, "BoatLevelList: Show upgrade list of ships docked in this harbor!" ) <---------- this is what I see local npcid = GetCharID( npc ) return BoatBerthList( character, npcid, BERTH_BOATLEVEL_LIST, berth, 0, 0, 0 ) <-------- BERTH_BOATLEVEL_LIST = 6 end After this nothing happens and I lost track of what to check next. exp_and_level.lua file, has a function called "BoatLevelUpProc", which is not triggered at all. So I am kinda stuck with this issue, as no one can upgrade their ship and no error messages are triggered. Please help. thanks in advance!
  25. Yes 10m worked. However all the NPC scripts were changed to 1m (1,000,000 G). All the NPC multitrigger conditions were met, otherwise I would not have seen the createguild window. Eventually I searched through the lua scripts and found the nasty parameter in the guildvars.lua This means that the multitrigger did not fail, but the "createguild" function was aborted, as the parameter Guild1_Gold was still 10m print('Loading guildvars.lua') Guild_ReqId = 1780 Guild1_Gold = 1000000 <---- Guild2_Gold = Guild1_Gold [/CODE] Anyways thanks for your suggestion. it put me on the right track.
×
×
  • Create New...