XObedient 5 Report post Posted September 26, 2020 Hi, I decided to share the mounts code since everyone who has it is taking advantage of it and sell it. (Corsairs Online based) Character.cpp CCharacter::CCharacter() pMount(0), oldmount(0), mountboneID(0), --------------------------------- void CCharacter::_UpdateValid(BOOL bValid) { if(bValid == FALSE) { ++ if (pMount) { ++ pMount->SetValid(false); ++ pMount->removeLink(); ++ pMount = NULL; ++ this->oldmount = 0; } setSideID( 0 ); if( GetDrunkState() ) CCharacterModel::SetDrunkState( FALSE ); _pChaState->ChaDestroy(); DieTime(); if( _pEvent ) { _pEvent->SetIsValid( false ); _pEvent = NULL; } _DetachAllItem(); for( int i=0; i<enumEQUIP_NUM; i++ ) { if( _pHandItem[i] ) { _pHandItem[i]->SetValid( FALSE ); _pHandItem[i] = NULL; } } for( int i=0; i<ITEM_FACE_MAX; i++ ) { if( _pItemFaceEff[i] ) { _pItemFaceEff[i]->SetValid( FALSE ); _pItemFaceEff[i] = NULL; } } memset( _ItemFace,0,sizeof(_ItemFace) ); GetScene()->HandleSceneMsg(SCENEMSG_CHA_DESTROY, getID()); } else { SetPoseKeyFrameProc( __keyframe_proc, (void*)this ); } } ---------------------------------------- bool CCharacter::PlayPose( DWORD pose, DWORD type, int time, int fps, bool isBlend ) if (GetIsOnMount()) { if (pMount) { pMount->setYaw(3); pMount->PlayPose(pose, type, time, fps, isBlend); int chatype = (this->GetDefaultChaInfo()->lID); pose = ((chatype == 1 || chatype == 2 || chatype == 3 || chatype == 4) ? POSE_SEAT2 : POSE_SEAT); } } ------------------------------------------ bool CCharacter::UpdataItem( int nItem, DWORD nLink ) switch(nLink){ case enumEQUIP_MOUNT:{ if (dynamic_cast<CWorldScene*>(_pScene)) { int ID = GetPart().SLink[nLink].sID; CItemRecord* pInfo = GetItemRecordInfo( ID); if(pMount && ID!=oldmount ){ setHeightOff(GetDefaultChaInfo()->fHeight); pMount->SetValid(FALSE); pMount->removeLink(); pMount = NULL; PlayPose(POSE_SHOW); this->oldmount = 0; } if (nItem > 0 && !GetIsPK() && pCha->IsPlayer() ) { if (!pMount && pInfo ) { int mountid = pInfo->sItemEffect[0]; int mHeight = pInfo->sItemEffect[1]; pMount = _pScene->AddCharacter(mountid); pMount->setName(pInfo->szName); setHeightOff(mHeight); int chatype = (this->GetDefaultChaInfo()->lID); std::string model = pInfo->chModule[chatype]; std::istringstream mountbone(model); mountbone >> std::hex >> mountboneID; pMount->linkTo(this, mountboneID); pMount->setChaCtrlType(8); pMount->setMobID(mountid); pMount->_Attr.set(ATTR_LV, 10); } } else { if (pMount) { setHeightOff(GetDefaultChaInfo()->fHeight); pMount->SetValid(FALSE); pMount->removeLink(); pMount = NULL; PlayPose(POSE_WAITING); this->oldmount = 0; } } } } ---------------------------- bool CCharacter::GetIsOnMount(){ if(!g_stUIBoat.GetHuman()){ return false; } if(GetIsForUI()){ return false; } return static_cast<bool>(pMount); } Character.h Line 548 protected: CCharacter* pMount; int mountboneID; int oldmount; How to add a mount? Iteminfo: 9624 Cuddly Lamb Mount n1774 10130005 0 0 0 0 0 0 90 0 0 0 0 0 1 1 1 1 1 1 0 -1 0 -1 0 0 18 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 60,60 0,0 0,0 0 1000,1000 1000,1000 3 0 0 0 0 0 0 0 0 0 0 0 0 125,85 0 0 Your personal pet. Double Click To Ride 1 125 = monster model(you can find it in characterinfo.txt) 85 = height(you can modify it depending on the mount height) Note: It's not complete yet, character is not attached properly to the mount bone. You will notice the animation is pretty static, however if anyone finds a solution for it, you can share it here. 3 Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted September 26, 2020 @XObedient Hi, thanks for sharing such code, but its incomplete as it throws few errors while building 1 Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 26, 2020 Just now, Rinor said: @XObedient Hi, thanks for sharing such code, but its incomplete as it throws few errors while building Hi, Those errors are easy to fix, shouldn't ask for help but there we go: Change from pCha->IsPlayer to this->IsPlayer() at the line || if (nItem > 0 && !GetIsPK() && pCha->IsPlayer() ) || Before switch(nLink) Add CCharacter* pCha = this; Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted September 26, 2020 (edited) @XObedient Actually thats not what im having problem with, but these 3 errors:https://imgur.com/a/Lu4knbV Edited September 26, 2020 by Rinor Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 26, 2020 1 minute ago, Rinor said: @XObedient Actually thats not what im having problem with, but these 3 errors:https://imgur.com/a/Lu4knbV #include <string> #include <sstream> Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted September 26, 2020 32 minutes ago, XObedient said: #include <string> #include <sstream> thanks, i also got this last one:https://imgur.com/a/NsrI3Er Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 26, 2020 1 minute ago, Rinor said: thanks, i also got this last one:https://imgur.com/a/NsrI3Er Remove the "++", I added those to mark what I added in the function. Quote Share this post Link to post Share on other sites
Rinor 59 Report post Posted September 26, 2020 @XObedient Done, i'd suggest to edit main post to these fixes. 2 hours ago, XObedient said: Note: It's not complete yet, character is not attached properly to the mount bone. You will notice the animation is pretty static, however if anyone finds a solution for it, you can share it here. Also the camera doesn't quite follow while moving around map. Quote Share this post Link to post Share on other sites
mkhzaleh 137 Report post Posted September 26, 2020 its funny sharing code made by me and @Snre3n 1 1 Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 26, 2020 14 minutes ago, mkhzaleh said: its funny sharing code made by me and @Snre3n Code was shared because it got leaked, we don't want people to profit from other's work. 1 Quote Share this post Link to post Share on other sites
mkhzaleh 137 Report post Posted September 26, 2020 code was shared when @MiniMan sold a source to @K1D0 and you have no right to write Quote I decided to share the plus its old undone code and wasn't sold out Quote Share this post Link to post Share on other sites
K1D0 99 Report post Posted September 26, 2020 2 hours ago, mkhzaleh said: code was shared when @MiniMan sold a source to @K1D0 and you have no right to write plus its old undone code and wasn't sold out That’s a lie I don’t have the source codes of the mounts, Miniman just took the money and passed me nothing. Quote Share this post Link to post Share on other sites
K1D0 99 Report post Posted September 26, 2020 If I had these Source Codes I would be using them on my Corsair server, which I ended up closing two months ago. Quote Share this post Link to post Share on other sites
mkhzaleh 137 Report post Posted September 26, 2020 1 hour ago, K1D0 said: That’s a lie I don’t have the source codes of the mounts, Miniman just took the money and passed me nothing. its true. he sent same incomplete code. and he already showed your refund cases with him lol Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 26, 2020 Code is done by @mkhzaleh & @Snre3n, I do not own it, it was shared because it got leaked. All credits for the code going to the truly owners. Quote Share this post Link to post Share on other sites
K1D0 99 Report post Posted September 26, 2020 32 minutes ago, mkhzaleh said: its true. he sent same incomplete code. and he already showed your refund cases with him lol Yes, but unfortunately he won the refund dispute, He's a scammer Quote Share this post Link to post Share on other sites
K1D0 99 Report post Posted September 26, 2020 5 minutes ago, XObedient said: Code is done by @mkhzaleh & @Snre3n, I do not own it, it was shared because it got leaked. All credits for the code going to the truly owners. You should be banned from PKOdev for publishing a file that does not belong to you. @V3ct0r check this please Quote Share this post Link to post Share on other sites
wizel1 0 Report post Posted September 27, 2020 (edited) @XObedient can you upload a character.cpp and character.h that have its? is fail for build or @Rinor can you put fix version here? Edited September 27, 2020 by wizel1 Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 27, 2020 11 hours ago, K1D0 said: You should be banned from PKOdev for publishing a file that does not belong to you. @V3ct0r check this please Can you even think a bit? I said the code got shared because it got leaked. Quote Share this post Link to post Share on other sites
K1D0 99 Report post Posted September 27, 2020 7 hours ago, XObedient said: Can you even think a bit? I said the code got shared because it got leaked. "leaked" bugged codes like this one? Quote Share this post Link to post Share on other sites
Devorn 0 Report post Posted September 27, 2020 Just stop attacking "XObedient" you greedy people. This is a pirate forum. I am happy someone is sharing something. This game will die completely if it werent for people like "XObedient". You are nagging about a leaked code for an illegal server.. You guys are funny. Quote Share this post Link to post Share on other sites
Devorn 0 Report post Posted September 27, 2020 I hope more people will grow up and start sharing. Quote Share this post Link to post Share on other sites
Devorn 0 Report post Posted September 27, 2020 BTW "XObedient", could you upload the complete fixed "Character.cpp" file? I dont understand how to add that text into my file. I would appreciate it. Quote Share this post Link to post Share on other sites
Devorn 0 Report post Posted September 27, 2020 And maybe all the other files needed? Quote Share this post Link to post Share on other sites
XObedient 5 Report post Posted September 28, 2020 11 hours ago, Devorn said: BTW "XObedient", could you upload the complete fixed "Character.cpp" file? I dont understand how to add that text into my file. I would appreciate it. 11 hours ago, Devorn said: And maybe all the other files needed? You can show here what's wrong, i'll help. Quote Share this post Link to post Share on other sites