CaptainLucifer 3 Posted June 25, 2022 Share Posted June 25, 2022 Hello, I want players with mounts not to be able to attack other players while on their mounts. Can it be dne with this quest? Link to comment Share on other sites More sharing options...
Premium Syreldar 1874 Posted June 25, 2022 Premium Share Posted June 25, 2022 That's not something you can do via quest, no. "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
CaptainLucifer 3 Posted June 25, 2022 Author Share Posted June 25, 2022 2 minutes ago, Syreldar said: That's not something you can do via quest, no. But we have pc.is_pvp and pc.is_mount, pc.unmound quest functions? Link to comment Share on other sites More sharing options...
Premium Syreldar 1874 Posted June 25, 2022 Premium Share Posted June 25, 2022 (edited) 20 minutes ago, CaptainLucifer said: But we have pc.is_pvp and pc.is_mount, pc.unmound quest functions? Okay? How do you plan on blocking the player from actually hitting another player with those? Even assuming you wanted to apply a solution as dirty as "If they hit a player while on mount, they dismount", no such trigger exists by default in Metin2's sources. If you had it, you could write: quest mount_dismount_pvp begin state start begin when damage with npc.is_pc() begin if (pc.is_mount()) then pc.unmount(); end -- if pc.setqf("last_pc_damage_time", get_time()); end -- when end -- state end -- quest And then, in your mount quest: -- -- when MOUNTSEAL_VNUM.use begin local last_pc_damage_time = pc.getf("mount_dismount_pvp", "last_pc_damage_time"); local cur_time, time_to_wait = get_time(), 3; if (cur_time - last_pc_damage_time < time_to_wait) then return syschat(string.format("You gotta wait %d more seconds to mount after damaging another character.", last_pc_damage_time + time_to_wait - cur_time)); end -- if pc.mount(vnum, mount_duration); pc.mount_bonus(apply_id, apply_vnum, apply_duration) end -- when -- -- But this solution is so bad I don't even want to look at it.. and I wrote it, lol. Also, this doesn't prevent damage at all, it just prevents players being on a mount while hitting other players after the first hit. Edited June 25, 2022 by Syreldar "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
CaptainLucifer 3 Posted June 27, 2022 Author Share Posted June 27, 2022 On 6/25/2022 at 3:52 PM, Syreldar said: Okay? How do you plan on blocking the player from actually hitting another player with those? Even assuming you wanted to apply a solution as dirty as "If they hit a player while on mount, they dismount", no such trigger exists by default in Metin2's sources. Quote state start begin when login begin cleartimer("kontrol") loop_timer("kontrol", 1) end when kontrol.timer begin if pc.is_mount() then if pc.get_local_x() == 500 and pc.get_local_y() == 500 then syschat("İn lan aşşa ") pc.unmount() else return end else return end end end What do you think about it. Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10266 Posted June 28, 2022 Forum Moderator Share Posted June 28, 2022 (edited) Quote I want players with mounts not to be able to attack other players while on their mounts. Srcs/game/src/pvp.cpp bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) { [...] if (pkChr && pkVictim && (pkChr->GetMountVnum() && pkVictim->GetMountVnum())) return false; [...] } Srcs/Client/InstanceBase.cpp bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) { [...] if (IsMountingHorse() && rkInstVictim.IsMountingHorse()) return false; [...] } I don't really understand why you want to do this, but this is what you asked for. You can ignore the client part if you just want a server-side solution to not do damage. Edited June 28, 2022 by VegaS™ 1 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Premium Syreldar 1874 Posted June 28, 2022 Premium Share Posted June 28, 2022 9 hours ago, CaptainLucifer said: What do you think about it. Trash that makes 0 sense. That's what I think about it. 7 hours ago, VegaS™ said: Srcs/game/src/pvp.cpp bool CPVPManager::CanAttack(LPCHARACTER pkChr, LPCHARACTER pkVictim) { [...] if (pkChr && pkVictim && (pkChr->GetMountVnum() && pkVictim->GetMountVnum())) return false; [...] } Srcs/Client/InstanceBase.cpp bool CInstanceBase::IsAttackableInstance(CInstanceBase& rkInstVictim) { [...] if (IsMountingHorse() && rkInstVictim.IsMountingHorse()) return false; [...] } I don't really understand why you want to do this, but this is what you asked for. You can ignore the client part if you just want a server-side solution to not do damage. They meant for when the player attacks other players while on a mount, so not if both the player and the victim are on a mount. "Nothing's free in this life. Ignorant people have an obligation to make up for their ignorance by paying those who help them. Either you got the brains or cash, if you lack both you're useless." Syreldar Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now