Jump to content

Sonitex

Premium
  • Posts

    521
  • Joined

  • Days Won

    12
  • Feedback

    100%

Everything posted by Sonitex

  1. You should't use d.new_jump_party and d.notice in the same timer. Rather move d.notice to login state because it might happen you will not see it since you are still in client's login phase.
  2. Here are some functions that can help you out. I have some global variables for dungeon types so you might wanna adapt that to your own needs. function CheckMembersItem() if (is_test_server()) then syschat("Skipping group item check due to debugging mode being enabled.") return true end local not_allowed_users = {} local pids = {party.get_member_pids()} local item_vnum = ITEM_VNUM_HERE for i = 1, table.getn(pids) do q.begin_other_pc_block(pids[i]) if (pc.count_item(item_vnum) < 1) then --and not pc.is_gm() then table.insert(not_allowed_users, pc.get_name()) end q.end_other_pc_block() end if table.getn(not_allowed_users) == 0 then return true end if table.getn(not_allowed_users) > 0 then say_npc() say("The following players do not meet the item") say("requirements.") say("") say("") say_item_vnum(item_vnum) say("") say("") for x = 1, table.getn(not_allowed_users), 1 do say(color(1,1,0), " " .. not_allowed_users[x]) end return false end -- Should never happen return false end function remove_entrance_item(dungeon_type) local item_vnum = ITEM_VNUM_HERE if dungeon_type != DUNGEON_TYPE_SOLO then local pids = {party.get_member_pids()} for i = 1, table.getn(pids) do q.begin_other_pc_block(pids[i]) if not pc.is_gm() then pc.remove_item(item_vnum, 1) end q.end_other_pc_block() end else pc.remove_item(item_vnum, 1) end end
  3. I am just curious but this would purge the items from memory, right? If added at the end of the function at input_main.cpp? for (auto const& item : s_vec_item) { M2_DESTROY_ITEM(item); }
  4. int percentage = 31; int iDamageSPPart = (dam / 100) * percentage; Is this what you are asking for?
  5. After four years you should be reading(at least) Metin2 code easily, this is not an excuse. Problem is, you do nothing on your own and always ask others to do it for you, literally. Not to brag or anything but I've started this p-server thing at the same year as you did and right now I am able to read, modify, add or remove code without any issues. That is because I wanted to learn and I eventually did. You should do the same. This is the truth, take it or leave it.
  6. If I remember correctly, snow dungeon quest had this feature, you should check it out.
  7. int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes) { [...] //Disable linking items in shout chat std::string str = chatbuf_global; std::string str2("|Hitem:"); std::size_t found = str.find(str2); if (found!=std::string::npos) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("SHOUT_CHAT_ITEM_HYPERLINK_MESSAGE")); return(iExtraLen); } [...] } Good enough for ya
  8. if (IsAffectFlag(AFF_MANASHIELD)) { int iDamageSPPart = dam / 3; int iDamageToSP = iDamageSPPart * GetPoint(POINT_MANASHIELD) / 100; int iSP = GetSP(); if (iDamageToSP <= iSP) { PointChange(POINT_SP, -iDamageToSP); dam -= iDamageSPPart; } else { PointChange(POINT_SP, -GetSP()); dam -= iSP * 100 / MAX(GetPoint(POINT_MANASHIELD), 1); } } As you can see, dam is the received damage and it is reduced by one third. I have no idea why YMIR added scaling for this skill if it was always constant and description in client is wrong as well... You could modify it and get damage reduction from skill power by adding this. Please note that this was just a quick guess, it may not work or I even miss understood something... iDamageSPPart is an int type percentage of damage that should be reduced(I believe ?). CSkillProto* pkSk = CSkillManager::instance().Get(SKILL_MANASHILED); if (NULL != pkSk) { pkSk->SetPointVar("k", 1.0f * GetSkillPower(SKILL_MANASHILED) / 100.0f); pkSk->SetPointVar("iq", GetPoint(POINT_IQ)); int iDamageSPPart = static_cast<int>(pkSk->kPointPoly.Eval()); } dam -= (dam / 100) * iDamageSPPart
  9. You can call the function from input_main.cpp and other source files which handle received packets. Same goes for sent packets Like so: //input_main.cpp case HEADER_CG_PARTY_INVITE: PartyInvite(ch, c_pData); timed_event_cancel((ch); break;
  10. It's the Nine Tails Chest probably as that mob vnum is from Elite Nine Tails... Replace that name with an item vnum
  11. In item_manager_read_tables.cpp search for: bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName) Inside find this, it may not be same as yours: else { CSpecialItemGroup * pkGroup = M2_NEW CSpecialItemGroup(iVnum, type); for (int k = 1; k < 256; ++k) { char buf[4]; snprintf(buf, sizeof(buf), "%d", k); if (loader.GetTokenVector(buf, &pTok)) { const std::string& name = pTok->at(0); DWORD dwVnum = 0; if (!GetVnumByOriginalName(name.c_str(), dwVnum)) { if (name == "exp") { dwVnum = CSpecialItemGroup::EXP; } else if (name == "mob") { dwVnum = CSpecialItemGroup::MOB; } else if (name == "slow") { dwVnum = CSpecialItemGroup::SLOW; } else if (name == "drain_hp") { dwVnum = CSpecialItemGroup::DRAIN_HP; } else if (name == "poison") { dwVnum = CSpecialItemGroup::POISON; } else if (name == "bleed") { dwVnum = CSpecialItemGroup::BLEED; } else if (name == "group") { dwVnum = CSpecialItemGroup::MOB_GROUP; } else { str_to_number(dwVnum, name.c_str()); if (!ITEM_MANAGER::instance().GetTable(dwVnum)) { sys_err("ReadSpecialDropItemFile : there is no item %s : node %s", name.c_str(), stName.c_str()); M2_DELETE(pkGroup); return false; } } } And add this below <if (name == "exp")> else if (name == "yang") { dwVnum = CSpecialItemGroup::GOLD; } I just tested it so it should work fine :=)
  12. Replace those Chinese characters with 'exp'. if (name == "경험치" || name == "exp") { dwVnum = CSpecialItemGroup::EXP; }
  13. This is already public just search for 'metin2 death quest trigger' and to warp a player use warp_to_village().
  14. Actually I was wrong, there would have to be more than or equal to 10000 dungeons of same type because, (mapIndex * 10000 + 10000) / 10000 > mapIndex and we wouldn't get original mapIndex but mapIndex+1 or more, depends on dungeon instances. For some reason I thought it would round up the number, but it's type is integer so it is not possible ? so I just said 3500 just to give an idea. I apologise for that. Sure, I would love to see that happen. There isn't a server with more than 3000 unique players right now, but you would need more than 10000 unique players(as I corrected myself earlier), each one creating their own dungeon, good luck with that one. If you are referring to having more than 10000 dungeons, it is just not possible, if not I'd love to hear those 'new bugs' and will happily fix them.
  15. Hey community! When you specify which music you want to play in your dungeon map at settings.lua, it is always getting replaced with previous map's one(From which you were teleported to). This is happening because each dungeon has it's own unique map index and game cannot locate it from settings. Here is a simple fix to get original index of that map, it should work as long as you do not have like 10000 dungeon instances of same type, which isn't possible with current Metin2 player count I believe. In char.cpp search for: void CHARACTER::MainCharacterPacket() Replace this variable with the following: const unsigned mapIndex = GetMapIndex(); const unsigned mapIndex = GetMapIndex() < 10000 ? GetMapIndex() : GetMapIndex() / 10000; Greetings, Sonitex
  16. Not the hero we deserve but the hero we need Amazing work!
  17. Ugh sorry for not understanding you, I guess you have to list every single NPC in there, there is no way around it sadly unless you edit source...
  18. when 9001.take begin if item.vnum == 19 then ... end end
  19. That is because client searches sound file for each effect in client, but not all effects have sound files.. Another weird code by YMIR :/
  20. char_battle.cpp static void GiveExp(LPCHARACTER from, LPCHARACTER to, int iExp) iExp = MIN(to->GetNextExp() / 10, iExp); You can not receive more than 10% of experience. Comment this line if you wish to remove this feature.
  21. void CInstanceBase::Update() if (IsPet()) { if (CPythonSystem::instance().IsHidePets()) { if (!IsAffect(AFFECT_INVISIBILITY)) { __SetAffect(AFFECT_INVISIBILITY, true); m_kAffectFlagContainer.Set(AFFECT_INVISIBILITY, true); } } else { if (IsAffect(AFFECT_INVISIBILITY)) { __SetAffect(AFFECT_INVISIBILITY, false); m_kAffectFlagContainer.Set(AFFECT_INVISIBILITY, false); } } }
  22. That happens because engine only loads terrain close to you. You would have to make some source changes to load whole map at once and display it to player but that may cause some performance issues.
  23. Yeah it has that feature already built in and it is very easy to use. It is under "A" section, first you select brush shape and size. Then you select what kind of block type you would like to apply to terrain, either water surface, block collision or block any kind of battle action in the area. With "Edit" button you can apply those 3 to the map while "Eraser" obviously removes them. Happy mapping (You can add multiple types on the same area)
  24. There is a tutorial on this forum about different waters in different maps and functions exactly as you said.-> [HowTo]Get different watertypes (For some reason I cannot link the topic) Collisions are set with 3ds program and are exported there too. There should be some tutorials regarding that, but it is pretty easy to learn to be honest. Greetings, Sonitex
×
×
  • 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.