Anyone 15 Posted June 27, 2017 Share Posted June 27, 2017 Hi. I see this features in Metin2 Official. When you die and you're riding, when you restart from here, your character will ride automatically the mount (I have done this only with Pony). Open game/src/char_horse.cpp Check: bool CHARACTER::StartRiding() Check: if(test_server) sys_log(0, "Ride Horse : %s ", GetName()); Add under: m_HorseNSystem = 1; Check: bool CHARACTER::StopRiding() { Check: if (!IsDead() && !IsStun()) { Add under: m_HorseNSystem = 0; Check: m_HorseNSystem = 0; ComputePoints(); UpdatePacket(); Add above: m_dwMountVnum = 0; Open game/src/char.h Check: PIXEL_POSITION m_posSafeboxOpen; Add under: public: int m_HorseNSystem; Open game/src/cmd_general.cpp Check: ch->ChatPacket(CHAT_TYPE_COMMAND, "CloseRestartWindow"); ch->GetDesc()->SetPhase(PHASE_GAME); ch->SetPosition(POS_STANDING); ch->StartRecoveryEvent(); Add under: if (ch->m_HorseNSystem == 1) { ch->StartRiding(); ch->m_HorseNSystem = 0; } Open game/src/char_battle.cpp Check: void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { Check: if (IsHorseRiding()) { StopRiding(); Add under: m_HorseNSystem = 1; Check: else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); Add under: m_HorseNSystem = 1; The code was written in a few minutes for a personal test. Updates: Fast method: Open game/src/char_battle.cpp Check: void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); } } Edit like this: void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; /* { if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); } }*/ Best Regards, Anyone. 1 Link to comment Share on other sites More sharing options...
txtxtx 16 Posted June 28, 2017 Share Posted June 28, 2017 Why all this fuss only Search 1-char_battle.cpp this void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); } } Edit to void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { /* if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); }*/ } All right 1 Link to comment Share on other sites More sharing options...
Anyone 15 Posted June 28, 2017 Author Share Posted June 28, 2017 Mh yes you can do the same. I just wrote this code in two seconds for test this and I release it and I don't check very well all code Link to comment Share on other sites More sharing options...
Riner 0 Posted July 28, 2017 Share Posted July 28, 2017 so all this for the horse? but thx for all Link to comment Share on other sites More sharing options...
Shang 368 Posted July 28, 2017 Share Posted July 28, 2017 En 28/6/2017 a las 8:52, txtxtx dijo: Why all this fuss only Search 1-char_battle.cpp this void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); } } Edit to void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { /* if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); }*/ } All right Did you test what you wrote? If i'm not wrong, if u die and not unmount the horse, the player won't do the die animation, it will die but you will see it ridding the horse. Link to comment Share on other sites More sharing options...
Premium msnas 1416 Posted July 28, 2017 Premium Share Posted July 28, 2017 On 28/06/2017 at 7:52 AM, txtxtx said: Why all this fuss only Search 1-char_battle.cpp this void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { /* if (IsHorseRiding()) { StopRiding(); } else if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); }*/ } Don't do this in no circumstance, you don't have to be a genius to realize what he did by commenting the else if (GetMountVnum()): RemoveAffect(AFFECT_MOUNT_BONUS); If you die, the bonus from the mount will not be remove as they are supposed to. So, if you want to do something, do it properly: void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead) { if (IsDead()) return; { if (GetMountVnum()) { RemoveAffect(AFFECT_MOUNT_BONUS); m_dwMountVnum = 0; UnEquipSpecialRideUniqueItem(); UpdatePacket(); } } Link to comment Share on other sites More sharing options...
txtxtx 16 Posted July 29, 2017 Share Posted July 29, 2017 Such as the official death when you ride horse / Mount When he returns, he appears above the animal Link to comment Share on other sites More sharing options...
Recommended Posts