-
Posts
46 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by semoka10
-
-
With the goal of creating metin2 systems, what key concepts should i understand? Any course on that would be appreciated. I have basic knowledge of C++ (arrays, loops, basics of classes) and less of Python, and I'm struggling to understand (big) parts of the source code. For example. the way packets are used, or how you use python and c++ together, or literally anything about the models in game
-
If it helps anyone, the problem was caused by the guild image because of the update to Visual Studio 2019 tutorial I used. Since then it was fixed so you won't get the error.
-
With this change, slow effect will also reduce attack speed, and will reduce movement speed more than before, making it a good bonus (and slow immunity relevant).
Video:
1. Client Source/UserInterface/InstanceBase.h Search: AFFECT_NUM = 64, Add above: AFFECT_SLOW_AS = 45, Search: NEW_AFFECT_BOW_DISTANCE, Add below: NEW_AFFECT_SLOW_AS = 227, PythonCharacterModule.cpp: Search: PyModule_AddIntConstant(poModule, "AFFECT_SLOW", CInstanceBase::AFFECT_SLOW); Add below: PyModule_AddIntConstant(poModule, "AFFECT_SLOW_AS", CInstanceBase::AFFECT_SLOW_AS); 2. game/src/affect.h Cauta: AFFECT_DEF_GRADE, Add below: AFFECT_SLOW_AS = 227, Cauta: AFF_BITS_MAX Add above: AFF_SLOW_AS=45, battle.cpp: Search: AttackAffect(pkAttacker, pkVictim, POINT_SLOW_PCT, IMMUNE_SLOW, AFFECT_SLOW, POINT_MOV_SPEED, -30, AFF_SLOW, 20, "SLOW"); Replace with: if (pkAttacker->GetPoint(POINT_SLOW_PCT) && !pkVictim->IsAffectFlag(AFF_SLOW)) { if (number(1, 100) <= pkAttacker->GetPoint(POINT_SLOW_PCT) && !pkVictim->IsImmune(IMMUNE_SLOW)) { pkVictim->AddAffect(AFFECT_SLOW, POINT_MOV_SPEED, -50, AFF_SLOW, 10, 0, true); pkVictim->AddAffect(AFFECT_SLOW_AS, POINT_ATT_SPEED, -40, AFF_SLOW_AS, 10, 0, true); } } char_affect.cpp: Search: RemoveAffect(AFFECT_SLOW); Add below: RemoveAffect(AFFECT_SLOW_AS); char_skill.cpp: Search: else if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_SLOW)) Replace the content with: { if (iPct && !pkChrVictim->IsAffectFlag(AFF_SLOW)) { if (number(1, 1000) <= iPct && !pkChrVictim->IsImmune(IMMUNE_SLOW)) { pkChrVictim->AddAffect(AFFECT_SLOW, POINT_MOV_SPEED, -50, AFF_SLOW, 10, 0, true); pkChrVictim->AddAffect(AFFECT_SLOW_AS, POINT_ATT_SPEED, -40, AFF_SLOW_AS, 10, 0, true); } } }
Note: to modify the values, change the values inside the AddAffect function call. Example:
pkChrVictim->AddAffect(AFFECT_SLOW_AS, POINT_ATT_SPEED, -40, AFF_SLOW_AS, 10, 0, true);
-40 is the value reduced, 10 is the duration of the debuff.
Spoiler- 11
- 4
- 2
- 6
-
Image:
1. Client Source/UserInterface/PythonNonPlayer.cpp
search:
DWORD CPythonNonPlayer::GetMonsterMaxHP(DWORD dwVnum)
below this function, add:
DWORD CPythonNonPlayer::GetMonsterRegenPercent(DWORD dwVnum) { const CPythonNonPlayer::TMobTable* c_pTable = GetTable(dwVnum); if (!c_pTable) { DWORD bRegenPercent = 0; return bRegenPercent; } return c_pTable->bRegenPercent; } DWORD CPythonNonPlayer::GetMonsterRegenRate(DWORD dwVnum) { const CPythonNonPlayer::TMobTable* c_pTable = GetTable(dwVnum); if (!c_pTable) { DWORD bRegenCycle = 0; return bRegenCycle; } return c_pTable->bRegenCycle; }
PythonNonPlayer.h:
search:
DWORD GetMonsterMaxHP(DWORD dwVnum);
below, add:
DWORD GetMonsterRegenRate(DWORD dwVnum); DWORD GetMonsterRegenPercent(DWORD dwVnum);
PythonNonPlayerModule.cpp:
search:
PyObject * nonplayerGetMonsterMaxHP(PyObject * poSelf, PyObject * poArgs)
add below:
PyObject * nonplayerGetMonsterRegenRate(PyObject * poSelf, PyObject * poArgs) { int race; if (!PyTuple_GetInteger(poArgs, 0, &race)) return Py_BuildException(); CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance(); return Py_BuildValue("i", rkNonPlayer.GetMonsterRegenRate(race)); } PyObject * nonplayerGetMonsterRegenPercent(PyObject * poSelf, PyObject * poArgs) { int race; if (!PyTuple_GetInteger(poArgs, 0, &race)) return Py_BuildException(); CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance(); return Py_BuildValue("i", rkNonPlayer.GetMonsterRegenPercent(race)); }
search:
{ "GetMonsterMaxHP", nonplayerGetMonsterMaxHP, METH_VARARGS },
below, add:
{ "GetMonsterRegenRate", nonplayerGetMonsterRegenRate, METH_VARARGS }, { "GetMonsterRegenPercent", nonplayerGetMonsterRegenPercent, METH_VARARGS },
2. client/pack/root/uitarget.py:
search:
self.AppendTextLine(localeInfo.TARGET_INFO_EXP % str(iExp))
add below:
self.AppendTextLine(localeInfo.TARGET_INFO_REGEN % (str(nonplayer.GetMonsterRegenPercent(race)), str(nonplayer.GetMonsterRegenRate(race))))
3. client/pack/locale/locale_game.txt
search:
TARGET_INFO_MAX_HP Max. HP : %s
add:
TARGET_INFO_REGEN HP Regen: %s%% every %s seconds
Done!
Bonus: If you don't want Target Info to show "Damage: 1-5" for Metin stones, in uitarget.py, replace:
self.AppendTextLine(localeInfo.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax)))
with
if not(nonplayer.IsMonsterStone(race)): self.AppendTextLine(localeInfo.TARGET_INFO_DAMAGE % (str(iDamMin), str(iDamMax)))
Spoiler- 3
- 1
- 2
- 2
- 7
-
I implemented penger's system for red name on item drop etc
but i have 1 problem, when I pick up skill books, the skill name is in korean. Anyone know where I can translate it?
I found this line in item.cpp but I don;t know where to go next
Quotecase ITEM_SKILLFORGET:{const DWORD dwSkillVnum = (GetVnum() == ITEM_SKILLBOOK_VNUM || GetVnum() == ITEM_SKILLFORGET_VNUM) ? GetSocket(0) : 0;const CSkillProto* pSkill = (dwSkillVnum != 0) ? CSkillManager::instance().Get(dwSkillVnum) : NULL;if (pSkill)len = snprintf(szItemName, sizeof(szItemName), "%s", pSkill->szName);break;}image of problem:
Figured it out, it reads from database skill_proto
Spoiler -
2 minutes ago, Asentrix said:
locale_game.txt
search for:
REFINE_SUCCESS_PROBALITY
you can edit the color from there
How precisely?
-
I can't figure out how to change the text color of a specific line in the client, to be specific the "Succes rate" of upgrading an item.
In uirefine.py i have
Spoilerdef Open(self, scrollItemPos, targetItemPos):
self.scrollItemPos = scrollItemPos
self.targetItemPos = targetItemPospercentage = self.GetRefineSuccessPercentage(scrollItemPos, targetItemPos)
if 0 == percentage:
return
self.successPercentage.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (percentage))itemIndex = player.GetItemIndex(targetItemPos)
self.toolTip.ClearToolTip()
metinSlot = []
for i in xrange(player.METIN_SOCKET_MAX_NUM):
metinSlot.append(player.GetItemMetinSocket(targetItemPos, i))
self.toolTip.AddItemData(itemIndex, metinSlot)self.UpdateDialog()
self.SetTop()
self.Show()I think i have to change the color before self.successPercentage.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (percentage)) but I couldn't find any function to do so. i'm really bad at Python, thanks for your help.
- 1
-
-
36 minutes ago, MrQuin said:
Weird question : What Packer are you using ?
EPack32
-
1 hour ago, MrQuin said:
Try using another python27.dll from another client.
Tried, same problem.
-
1. Description of the problem / Question :
When I teleport/logout/change character the client crashes. The 3 systems I added to a clean serverfile are great's offline shop, target info and decimal hp, it might be because one of them
2. SysErr ( Client / Server ) / SysLog ( Server )
empty, both client and server
4. Screenshots ?
if i debug the client with vs, it stops here:
Thanks, Sincerly,
[[ Username ]]Spoiler- 1
-
3 hours ago, Asentrix said:
You can find that ChatPacket in char_item.cpp in
bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)
specifically
if (pkItemToDrop->AddToGround(GetMapIndex(), pxPos))
you'll find:
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Here's the text"));
you can see if it isn't in locale_string.txt and solve it.
Thanks, that was the correct way.
-
When I throw an item, I get korean text instead of the normal one.
In server syserr I get locale_find: LOCALE_ERROR: "떨어진 아이템은 1분 후 사라집니다.";
I tried to add it to locale_string, but if I do that, all the other text in game is korean as well. (Note: If I add it first in locale_string, only that line I added works, if I add it last, none work at all)
So any solution for this? Or otherwise, where can I remove the text entirely? Thanks
- 1
-
Does anyone know how to add drop chance to the target info system(the one with damage/exp/item drops etc)? I tried to do it myself but couldn't figure it out, couldn't find an easy way like a function that returns drop chance for each item in part and I don't know how to obtain it(the drop chance). Any hint/idea is welcome
-
Try copying them to /var/db/mysql/player. Just guessing, no guarantee it works.
-
I need to import ctypes in uitarget.py (trying to do a small change to the target info system) so i can calculate string length in pixels, but i get this error and a client crash (when getting to character select)
QuotenetworkModule.SetSelectCharacterPhase - <type 'exceptions.ImportError'>:No module named _ctypes
I see it can't find the file, but I don't know how to solve this. I have a directory named ctypes in the client ( in the lib directory ), am i supposed to put it somewhere else?
-
1 minute ago, Jxxkub said:
i'm pretty sure they can be found inside the binary
I'm a beginner when it comes to coding - so I might be wrong
Yeah, just found them, they are .cpp files that have module in their name. For example PythonItemModule.cpp is for import item
- 1
-
7 minutes ago, Jxxkub said:
most of them are linked from files that can be found inside the same folder - others are modules importerd from python itself
all python files are located in root or root/uiscript
Do you know where I can find wndMgr and item for example? Cause they aren't in root, but I don't think they are default modules of python either
-
I'm trying to get a better understanding of the source code, what the functions do etc, but I can't find many of the included files. For example uitarget.py has
Spoilerimport app
import uiToolTip
import item
import ui
import player
import net
import wndMgr
import messenger
import guild
import chr
import nonplayer
import localeInfo
import constInfobut where exactly can i find these files?
-
Is there any reason not to make one huge map that contains all kingdoms/mobs etc?(except maybe separate instances for dungeons) Does that cause loading problems or something? Sorry if the answer is obvious.
- 1
-
I think poison resistance is related to how often you take damage drom poison after you are poisoned, and it doesn't affect the chance to poison the target. Not certain about it though.
-
10 hours ago, TMP4 said:
I don't think anyone will give you a c++ code, it's not 1-2 line.
Alternative solution:
You can make some shops for the same npc and at quest you open a random one. You can make a timer for it, or eventflag, or even you can use the date time or what meets your needs.
example:
when npcid.click begin
local x = math.random(1,3)
if x == 1 then npc.open_shop(1) end
if x == 2 then npc.open_shop(2) end
if x == 2 then npc.open_shop(3) end
end
-------------------------------------------------------------------
Or grab gaya system and change point_gem to point_gold.
You'll face some problem because it only support 1 slot items for example and the released one at turkmmo is quite bad made.
The quest idea with a timer is exactly what I need, considering I don't want it 100% random so that it may get annoying. Thanks for the idea, hope I will be able to implement it
-
Version of Files : XXX
[[ Hi / Hello / Hey... ]]
[[ It is a template to help you with your problem... ]]
1. Description of the problem / Question :
Is it possible to show random items from a bigger list of items for the npc shops, so they change every once in a while? If yes, I'm barely a beginner so I would really appreciate some guiding.
-
Version of Files : XXX
Hi, in what app can i make my own animations and effects?
Problem skill color
in Community Support - Questions & Answers
Posted
Indentation (spaces and tabs) have meaning in Python. The error tells you the indentation at line 3025 is not correct. Maybe you have missing/extra spaces or mixed tabs with spaces (as that also caused issues, I think)