Jump to content

wouter2004

Advanced members
  • Content Count

    33
  • Joined

  • Last visited

  • Days Won

    2

wouter2004 last won the day on November 9 2021

wouter2004 had the most liked content!

Community Reputation

11 Neutral

5 Followers

About wouter2004

  • Rank
    Pirate

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  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()
×
×
  • Create New...