Jump to content

Syreldar

Premium
  • Posts

    1297
  • Joined

  • Last visited

  • Days Won

    38
  • Feedback

    100%

Everything posted by Syreldar

  1. The IsResistFallen() Check still needs to be moved after SetBlendingPosition in __Push.
  2. In that case, sorry, but we don't offer support for leaked system in this community.
  3. That'll also fix the issue. But based on what I see here, it means the target will also be pushed way farther than intended while usually targets with Immunity to Fall (mental warriors) get pushed way less.
  4. This solution fixes the issue that you presented. So it's the appropriate solution. If it generates another bug, post it and we'll try to fix it, else, don't look for something that doesn't exist.
  5. Hello, This system belongs to @ VegaS™. ([Hidden Content]) If you bought it from him, he'll for sure provide you support. If you didn't, you're not welcome here.
  6. It's worth noting that this bug only ever occurs if the mental warrior stands absolutely still doing nothing, and so it's not relevant anyhow under normal circumstances, but: ActorInstanceSync.cpp: bool CActorInstance::IsPushing() { return m_PhysicsObject.isBlending(); } to: bool CActorInstance::IsPushing() { return !IsResistFallen() && m_PhysicsObject.isBlending(); }
  7. Source/Client/UserInterface/PythonPlayerInput.cpp: In: void CPythonPlayer::__OnPressItem(CInstanceBase & rkInstMain, DWORD dwPickedItemID) search for: rkInstMain.NEW_Stop(); add above: NEW_SetMouseSmartState(MBS_CLICK, false); By the way, You should really start marking your topics where you got an answer as solved, and also start giving at least reactions to them, you know, it would be the bare minimum since you've been here asking things and help for years.
  8. syreldar = {}; syreldar.this = {}; syreldar.this.is = {}; syreldar.this.is.a = {}; syreldar.this.is.a.test = "This is a test"; quest test begin state start begin when 20005.chat.syreldar["this"].is.a.test begin say("hi") end -- when end -- state end -- quest As I said, that syntax is valid, and works perfectly fine. Check the array
  9. This is not a bug by the way, it was intended since Flame Spirit is not considered a self-buff. And you can't use skills while on mounts. Still, if you wish to fix it: // Find the function: int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel) // Inside of it, find: if (bCanUseHorseSkill && pkSk->dwType != SKILL_TYPE_HORSE // and add to the check: && pkSk->dwVnum != SKILL_MUYEONG)
  10. Either part of that array doesn't exist or pc.get_language() doesn't return a valid element index from inside that array. The syntax is valid.
  11. ? My quest works like you want. (Don't allow empire change if you're in a group, and supports different map/core/channel) Doesn't rly get better than this. C++ work would be pointless. Also the 'quest' you tried to write makes no sense whatsoever.
  12. Your quest doesn't have errors @Mefarious, but the reason why it doesn't work for you is that you probably removed the "apply" array, resulting in calling a nil value on the 1st parameter of add_collect. Either you restore it or use the bonus id directly: 53 for ATT_GRADE_BONUS. In case you want to restore it, copy this into your questlib.lua, then /reload q and try the quest again: apply = { ["MAX_HP"] = 1, ["MAX_SP"] = 2, ["CON"] = 3, ["INT"] = 4, ["STR"] = 5, ["DEX"] = 6, ["ATT_SPEED"] = 7, ["MOV_SPEED"] = 8, ["CAST_SPEED"] = 9, ["HP_REGEN"] = 10, ["SP_REGEN"] = 11, ["POISON_PCT"] = 12, ["STUN_PCT"] = 13, ["SLOW_PCT"] = 14, ["CRITICAL_PCT"] = 15, ["PENETRATE_PCT"] = 16, ["ATTBONUS_HUMAN"] = 17, ["ATTBONUS_ANIMAL"] = 18, ["ATTBONUS_ORC"] = 19, ["ATTBONUS_MILGYO"] = 20, ["ATTBONUS_UNDEAD"] = 21, ["ATTBONUS_DEVIL"] = 22, ["STEAL_HP"] = 23, ["STEAL_SP"] = 24, ["MANA_BURN_PCT"] = 25, ["DAMAGE_SP_RECOVER"] = 26, ["BLOCK"] = 27, ["DODGE"] = 28, ["RESIST_SWORD"] = 29, ["RESIST_TWOHAND"] = 30, ["RESIST_DAGGER"] = 31, ["RESIST_BELL"] = 32, ["RESIST_FAN"] = 33, ["RESIST_BOW"] = 34, ["RESIST_FIRE"] = 35, ["RESIST_ELEC"] = 36, ["RESIST_MAGIC"] = 37, ["RESIST_WIND"] = 38, ["REFLECT_MELEE"] = 39, ["REFLECT_CURSE"] = 40, ["POISON_REDUCE"] = 41, ["KILL_SP_RECOVER"] = 42, ["EXP_DOUBLE_BONUS"] = 43, ["GOLD_DOUBLE_BONUS"] = 44, ["ITEM_DROP_BONUS"] = 45, ["POTION_BONUS"] = 46, ["KILL_HP_RECOVER"] = 47, ["IMMUNE_STUN"] = 48, ["IMMUNE_SLOW"] = 49, ["IMMUNE_FALL"] = 50, ["SKILL"] = 51, ["BOW_DISTANCE"] = 52, ["ATT_GRADE_BONUS"] = 53, ["DEF_GRADE_BONUS"] = 54, ["MAGIC_ATT_GRADE"] = 55, ["MAGIC_DEF_GRADE"] = 56, ["CURSE_PCT"] = 57, ["MAX_STAMINA"] = 58, ["ATTBONUS_WARRIOR"] = 59, ["ATTBONUS_ASSASSIN"] = 60, ["ATTBONUS_SURA"] = 61, ["ATTBONUS_SHAMAN"] = 62, ["ATTBONUS_MONSTER"] = 63, ["MALL_ATTBONUS"] = 64, ["MALL_DEFBONUS"] = 65, ["MALL_EXPBONUS"] = 66, ["MALL_ITEMBONUS"] = 67, ["MALL_GOLDBONUS"] = 68, ["MAX_HP_PCT"] = 69, ["MAX_SP_PCT"] = 70, ["SKILL_DAMAGE_BONUS"] = 71, ["NORMAL_HIT_DAMAGE_BONUS"] = 72, ["SKILL_DEFEND_BONUS"] = 73, ["NORMAL_HIT_DEFEND_BONUS"] = 74, ["PC_BANG_EXP_BONUS"] = 75, ["PC_BANG_DROP_BONUS"] = 76, ["EXTRACT_HP_PCT"] = 77, ["RESIST_WARRIOR"] = 78, ["RESIST_ASSASSIN"] = 79, ["RESIST_SURA"] = 80, ["RESIST_SHAMAN"] = 81, ["ENERGY"] = 82, ["DEF_GRADE"] = 83, ["COSTUME_ATTR_BONUS"] = 84, ["MAGIC_ATTBONUS_PER"] = 85, ["MELEE_MAGIC_ATTBONUS_PER"] = 86, ["RESIST_ICE"] = 87, ["RESIST_EARTH"] = 88, ["RESIST_DARK"] = 89, ["ANTI_CRITICAL_PCT"] = 90, ["ANTI_PENETRATE_PCT"] = 91, ["BLEEDING_REDUCE"] = 92, ["BLEEDING_PCT"] = 93, ["ATTBONUS_WOLFMAN"] = 94, ["RESIST_WOLFMAN"] = 95, ["RESIST_CLAW"] = 96, };
  13. party_get_member_count only returns the count of the members in your current map, and only if they're online, so no. What he needs is a way of determining whether or not the player's party exists, even if the player itself is in a different map/core/channel. It's doable in Lua without having to add anything sourceside, albeit definitely tricky. The suggestion to add a party.leave() function wouldn't work either, because the party instance from a different channel won't exist. So they could just change channel, change empire, and then return back to the original channel, pretty dirty. So it's better to prevent the empire change altogether instead. This solution is for sure not optimal, but it works, without any bugs, and doesn't require any source changes. So, let's start by making a simple quest: quest get_party_data begin state start begin when login or logout begin local qf_name = "last_channel"; local channel_id = pc.get_channel_id() -- We save the index of the last channel the player was in a party in. if (party.is_party() and pc.getqf(qf_name) == 0) then pc.setqf(qf_name, channel_id); -- if the player relogs back to the registered channel but with no party -- either it has been deleted or they got kicked, so we reset the qf. elseif (pc.getqf(qf_name) == channel_id and not party.is_party()) then pc.setqf(qf_name, 0); end -- if/elseif end -- when end -- state end -- quest Then, in our empire_change quest: .. .. -- add this somewhere within the main state.. function IsPlayerInParty() local idx, qf = "get_party_data", "last_channel" -- if the player's current channel is the registered one, but with no party.. -- ..it means the party was disbanded while the player was on the same channel.. -- ..in which they joined it. if (pc.getf(idx, qf) == pc.get_channel_id() and not party.is_party()) then pc.setf(idx, qf, 0); -- we reset the qf right now so they won't need to relog in this case. end -- if -- If the registered channel qf is still active.. -- ..it means the player has just changed core/ch, but the party still exists. return party.is_party() or pc.getf(idx, qf) > 0; end -- function -- ..and upon opening the empire change item, add this check: if (QUESTNAME.IsPlayerInParty()) then -- substitute QUESTNAME with the name of your empire change quest. return say_reward("Can't change empire, the player is in a party."); end -- if .. .. Overall, if we really gotta be picky, the only unoptimal factor is that if the party disbands/the player gets kicked while they were in a different channel, then they'll need to relog back to the channel from which they joined the party in order to let the game know the party was disbanded, which is not even a factor considering the nature of the problem, cause unless they're precisely trying to reproduce the bug @ ReFresh mentioned in this topic, they won't even notice this little thing, which itself is not a bug, and still prevents them from performing the bug anyway. Overall, it's not worth applying source changes to fix this little thing in my opinion, but anyone is welcome to propose a better solution. This one still works well and without bugs if you can't be arsed implementing C++ things.
  14. You're free to use semicolons if you like them. Lua doesn't rly care. They're used to write multiple statements in a single line, but I use them regardless cause they're one of my many signatures, they don't change the code flow anyway.
  15. You need to 'pc.select' the vid of the actor in order to get its pc_name without manually typing it. You need the npc instance to not be null in order to get its vid and apply it to 'pc.select'. npc instance is null unless called by a trigger which links to an npc, like .chat or.take, and will just crash your core if called in other circumstances. So it's not possible with basic Metin2 features to do this via quest. 'target.' functions are not related to your current target, but to a target instance, which you may recognize as the big arrow that can be on a location or on an NPC's head when doing quests.
  16. name = tonumber(input()) Your input only accepts numerical values and you didn't make any input validation. If "name" is supposed to be the name of a player this will never work because of that. It should be: name = input() and then add some validation to check if the name exist and the player is online, if necessary. quest private_voice_chat begin state start begin when 40003.use begin local item_vnum = item.get_vnum(); say_event_title(string.format("%s:[ENTER]", item_vnum)) say_light_blue("Type the receiver's name:[ENTER]") local name = tonumber(input()); say_event_title(string.format("%s:[ENTER]", item_vnum)) if (not name) then return say_reward("Insert a name, please.[ENTER]"); end -- if say_light_blue("Choose the channel:[ENTER]") local voice_channels_list = {}; local voice_channels_num = 2; -- Add as many as you want. for i = 1, voice_channels_num do table.insert(voice_channels_list, string.format("Voice n.%d", i)); end -- for table.insert(voice_channels_list, "Abort"); local voice_selection = select_table(voice_channels_list); if (voice_selection == table.getn(voice_channels_list)) then return; -- Abort end -- if command(string.format("voice_chat %s %d", name, voice_selection)); end -- when end -- state end -- quest
  17. @ Ikarus_ made a mistake when initializing the var in the topic, and @ Speachless didn't catch it. Happens. Rename it to:
  18. It depends, what are you trying to do? What's the command supposed to send/receive? command("code "..name.." 1"); command(string.format("code %s 1", name)); These are both written with valid syntax and do the same thing.
  19. Making a mob_drop_item in lua is not only possible, but also very convenient and way more manageable than the .txt counterpart: you can basically do whatever you want with it, like apply drop eventflags to increase/decrease drops at will. The only downside is that systems such as the info_drop will stop working, since they work by string parsing the .txt.
  20. ? Sir, I don't think you have any idea how timers work. Also... The green part is doable in lua, via the method @Owsap explained, the .pick trigger. The red part is not doable in lua, since there's no trigger for exchange. Timers would be useless here, but they don't "EAT YOUR CPU". It's easy to make a new trigger for that, but you have to make changes to the sourcecode, you can't do that with what the default Metin2 triggers.
  21. 25/12/2021: Added is_valid_number, is_integer_number. (safe funcs you should be using on numerical inputs) table_shuffle now creates a copy of the table and works on it instead of changing the table itself. The end result is the same, but the table passed as argument remains untouched. Reworked get_time_format. Renamed IsOdd to is_odd. Merry christmas!
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.