Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Everything posted by VegaS™

  1. Search for: local bonuses = { [1] = {3,40,"Ενέργεια Ζωής "}, [2] = {4,40,"Ευφυΐα "}, [3] = {5,40,"Δύναμη "}, [4] = {6,40,"Ευκινησία "}, [5] = {11,20,"Ενέργεια Ζωής & Δύναμη "}, [6] = {11,20,"Ευφυΐα & Δύναμη "}, [7] = {11,20,"Ευφυΐα & Ευκινησία "}, [8] = {11,20,"Δύναμη & Ευκινησία "}, } affect.add(567, bonuses[s][1], bonuses[s][2], bonuses[s][3], bonuses[s][4], bonuses[s][5], bonuses[s][6], bonuses[s][7], bonuses[s][8], 60*60*24*365*2) Replace with: [Hidden Content]
  2. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Based idea: [Hidden Content] Doing the same thing, but here's my faster version coded in python, with source code, no executable. Read the informations from repository, how to use it. clearSpecialSymbols.py [Hidden Content] clearSpecialSymbols.bat python "clearSpecialSymbols.py" %* pause GitHub repository: [Hidden Content]
  3. 2019-10-30 03:48:12 Wednesday Fixed expression is not assignable. Break a for loop after the bonus has found.
  4. There's a better version instead of what i did some time ago, which find the differences directly, without check each progress index. [Hidden Content]
  5. Good idea, if somebody wants the source code, here's my faster python version, when i've time i'll upload to git.
  6. You've two options. 1. Set a limit for text, you can do it based on your image width size, Parameter_Slot_05.sub. # Search for: self.titleName = GetObject("titlename") # Add after: self.titleName.SetLimitWidth(130) 2. Rearrange the text. [Hidden Content]
  7. Just now arrived from work, sorry for late answer. If he do what you said, 604800 - current_timestamp = > -1kkk. The correct way and single way to do it properly, is the the next one: [Hidden Content]
  8. I don't understand very well what you want, but you can try something like this. static const DWORD COSTUME_EXTEND_TIME_LIMIT = 7 * 24 * 60 * 60; const DWORD remain_sec = item2->GetSocket(ITEM_SOCKET_REMAIN_SEC); if (remain_sec >= COSTUME_EXTEND_TIME_LIMIT) { ChatPacket(CHAT_TYPE_INFO, "COSTUME_EXTEND_TIME_LIMIT"); return false; }
  9. slotIndex = Your index position from inventory. Python import player attrCount = 0 for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM): if player.GetItemAttribute(player.INVENTORY, slotIndex, i): attrCount += 1 print(attrCount) C++ [Hidden Content]
  10. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Hello cowboys, since i was at job and i was bored while coding in other languages, i thought would be funny if i code something in Python, so an idea came in mind, doing a general text file loader for parsing different data, with different structs, normal variables, groups and lists, like ymir idea for parsing the files (.mse, .msa, .msm, .txt like mob_drop_item.txt, group.txt, etc) This tool can be used everywhere, for metin2 or else, i wrote this from scratch using ymir idea, also you can run it in any version of Python. If you use this for metin2, change USING_METIN2_CLIENT to True. benchmark.txt TextFileLoader.py [Hidden Content] Full source repository: [Hidden Content]
  11. @Mali61 Good idea, but what i did doesn't work like this. You've to check each dragon soul from all pages if they aren't expired and the specific page is activated too. [Hidden Content]
  12. I don't like so much Lua, but i did something fast, i hope that's what you wanted. Replace npc.get_level() with npc.get_level0() if you use marty source. quest common_drop_quest begin state start begin function CanDrop(pc_level, npc_level, isPC) local DIFF_LEVEL_CONST = 10 return not isPC and math.abs(pc_level - npc_level) <= DIFF_LEVEL_CONST end function GetSettings() local PLAYER_MAX_LEVEL_CONST = 105 return { { 20, 40, {27001, 27001, 27001, 27001, 27001, 27001} }, -- from 20 to 39 { 40, 60, {27002, 27002, 27002, 27002, 27002, 27002} }, -- from 40 to 59 { 60, 80, {27003, 27003, 27003, 27003, 27003, 27003} }, -- from 60 to 79 { 80, 100, {27004, 27004, 27004, 27004, 27004, 27004} }, -- from 80 to 99 { 100, PLAYER_MAX_LEVEL_CONST + 1, {27005, 27005, 27005, 27005, 27005, 27005} }, -- from 100 to PLAYER_MAX_LEVEL_CONST } end when kill with common_drop_quest.CanDrop(pc.get_level(), npc.get_level(), npc.is_pc()) begin local common_drop_table = common_drop_quest.GetSettings() for i = 1, table.getn(common_drop_table) do local dropLevelMin, dropLevelMax, dropItemTable = unpack(common_drop_table[i]) local dropItemVnum = dropItemTable[number(1, table.getn(dropItemTable))] if pc.get_level() >= dropLevelMin and pc.get_level() < dropLevelMax then if number(1, 10000) <= 100 then game.drop_item_with_ownership(dropItemVnum) break end end end end end end
  13. M2 Download Center Download Here ( Internal ) [Hidden Content]
  14. Already app.GetGlobalTimeStamp() (#1 #2) doing that, returns the server timestamp (sent by TPacketGCTime to client) on each enter in game, you just need to convert the timestamp with a proper method. cur_time_stamp = app.GetGlobalTimeStamp() seconds = cur_time_stamp % 60 minutes = (cur_time_stamp / 60) % 60 hours = (cur_time_stamp / 60) / 60 % 24 self.textLine.SetText("%02i:%02i:%02i" % (hours, minutes, seconds))
  15. I posted the code some months ago and i thought is fine to be here too, not just in category of q&a.
  16. CLICK FOR VIDEO Server\src\game\src\DragonSoul.h Server\src\game\src\DragonSoul.cpp How-To-How-To-How-To-Use-Ex: [Hidden Content]
  17. That's what he requested in private, if someone need it, those are not my calculations/code. void CItemAddonManager::ApplyAddonTo(int iAddonType, LPITEM pItem) { if (!pItem) { sys_err("ITEM pointer null"); return; } bool bCustomizedAddon = false; switch (pItem->GetVnum()) { case 1129: case 2129: case 3129: case 5129: bCustomizedAddon = true; break; } int iSkillBonus = MINMAX(-30, static_cast<int>(gauss_random(0, 5) + 0.5f), 30); int iNormalHitBonus = 0; if (bCustomizedAddon) { if (abs(iSkillBonus) <= 0) iNormalHitBonus = (-1 * iSkillBonus) / 2 + abs(number(-2, 2) + number(-2, 2)) + number(1, 2); else iNormalHitBonus = (-1 * iSkillBonus) / 2 + abs(number(-3, 6)); if (abs(iSkillBonus) <= 0) iSkillBonus = (1 * iSkillBonus) / 2 + abs(number(-1, 1) + number(-1, 1)) + number(1, 2); else iSkillBonus = (1 * iSkillBonus) / 2 + abs(number(-3, 1)); } else { if (abs(iSkillBonus) <= 20) iNormalHitBonus = -2 * iSkillBonus + abs(number(-8, 8) + number(-8, 8)) + number(1, 4); else iNormalHitBonus = -2 * iSkillBonus + number(1, 5); } pItem->RemoveAttributeType(APPLY_SKILL_DAMAGE_BONUS); pItem->RemoveAttributeType(APPLY_NORMAL_HIT_DAMAGE_BONUS); pItem->AddAttribute(APPLY_NORMAL_HIT_DAMAGE_BONUS, iNormalHitBonus); pItem->AddAttribute(APPLY_SKILL_DAMAGE_BONUS, iSkillBonus); }
  18. V1 You can use unlimited arguments on functions, now is using the apply method which returns the result of a function or class object called with supplied arguments, with the old structure you could use just one argument. You can lock/unlock an event for being processed, it's like a prevent in some actions, if the event is created and you want to do something, you should lock the event, do some actions then you can unlock it again and the process function will run where remained. Delete an event instantly and force it to stop the process. Adding return t.EXIT inside of the running function, will delete the event too. Functions to check if an event exists or is locked or not. Check if the function is a method type. Delete the events with a properly method. Using app.GetGlobalTimeStamp() now will give you the chance to run the event after teleport where timer remained instantly. V2 Fixed non-returning time for processing, if the specific event function has no value from returning, it runs continuously. Fixed the check if an event exist, now will be replaced with the new one. Removed types library (i heard that some people don't have it) and using builtin functions, instead of types.MethodType now we're using callable(object), which check if the event function can be called, now you can insert classes and others callable methods, not just simple functions. Added a reset time event function. Next update: (when i'll have some free time again) Insert a new type of event, which you can run an event by specific counter like: t.AppendEvent(eventName='RUN', eventStartTime=5, eventRunCount=10, eventFunc=self.Run, eventFuncArgs=player.GetLevel()) The following things will happen: The function Run(args), will start to run in 5 seconds for 10 times. PS: Check my first reply for code.
  19. No, we don't need a timer for this, you're right that you can't do this inside of login because the POINT_MOUNT is seted after, so, this method is for all types of mounts/horses: [Hidden Content] Not tested.
  20. Then your problem is that you've costume mount slot, not the default mount, replace the code what i gave you with: #ifdef ENABLE_BLOCK_RIDING_IN_DUNGEON if (ch && ch->GetDungeon()) { const LPITEM pMount = ch->GetWear(WEAR_COSTUME_MOUNT); if (pMount && pMount->IsEquipped()) ch->UnequipItem(pMount); if (ch->IsHorseRiding()) { ch->StopRiding(); ch->HorseSummon(false); } } #endif Be careful to have on all of your vnums type: ITEM_COSTUME < 28, sub type: COSTUME_MOUNT < 2
  21. You added it wrong, not inside of GetHorseLevel > 0, outside of condition.
  22. Not tested, but you can try to do something like: Srcs/Server/game/src/questlua_horse.cpp Srcs/Server/game/src/questlua_pc.cpp Srcs/Server/game/src/input_login.cpp Srcs/Server/game/service.h
  23. Update (work arround) - Added all of the virtual-key codes from mouse & keyboard, by pressing any key now you'll skip the intro logo.
×
×
  • 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.