-
Posts
656 -
Joined
-
Last visited
-
Days Won
187 -
Feedback
100%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by VegaS™
-
-
Already i posted that in another forum some years ago, but i can't share the link here, check your inbox.
- 1
-
If you want to do it like @Alphax Wolf, you can do a update query and copy the vnum to name just if the vnum from item_proto exists inside of mob_proto.drop_item by a specific mob.
UPDATE player.item_proto SET name = vnum WHERE vnum IN (SELECT drop_item FROM player.mob_proto WHERE drop_item > 0); # Affected rows: 83 # Time: 35.919ms
And if you want to see what monsters are using etc_drop_item, there's a ex select query.
SELECT DISTINCT drop_item FROM player.mob_proto where drop_item > 0;
Btw, i would change the structure of reading the file instead of doing this, here's a hint.
- 3
-
2019-04-16 14:54:48 Tuesday (Video - Click) - 345 additions and 160 deletions.
- Added a check for attr types and values min - max.
- You can't insert wrong bonuses into a specific item.
- Eg. Add 2000 MAX_HP on your Sword+9, was possible, now not.
- Eg. Add +500 INT to your shield, now there's a check for min-max value of player.item_attr Lv.1 - Lv.5 and your 500 INT value will be replaced with max value from lvl5 of bonus, like 12 (lv5), that happen with all the bonuses, same thing with the values lower than lvl1, like 5 HP_REGEN on your neck, when the minimum (lv1) is 10, the value will be replaced with 10.
- If the bonus type can't be added into a specific item, the bonus will be ignored > deleted. (example: critical pct to armor)
- Refactorized all the code and moved all features into .
- C++11 or higher is required for checking attributes.
Spoiler# Test unknown types + higher and lower values in game. INSERT INTO `player`.`item_award`(`login`, `vnum`, `count`, `attrtype0`, `attrvalue0`, `attrtype1`, `attrvalue1`, `attrtype2`, `attrvalue2`, `attrtype3`, `attrvalue3`, `attrtype4`, `attrvalue4`, `mall`) VALUES ( 'test', 149, 1, 17, 25, -- ATTBONUS_HUMAN 22, 35, -- ATTBONUS_DEVIL, 32, 175, -- RESIST_BELL 33, -150, -- RESIST_FAN 48, 1, -- IMMUNE_STUN 1 ); # See the min-max values for all the bonuses from weapon. SELECT apply+0 AS `index`, apply AS `name`, lv1 as `min_value`, lv5 as `max_value` FROM `item_attr` WHERE weapon > 0; # See if a specific bonus is included in bonuses of weapon. SELECT apply, apply+0 FROM `item_attr` WHERE weapon > 0 AND apply in ('ATTBONUS_HUMAN', 'ATTBONUS_DEVIL', 'RESIST_BELL', 'RESIST_FAN', 'IMMUNE_STUN');
- 2
- 1
- 7
-
onPressKeyDict[app.DIK_F5] = lambda : self.GetItemData() import player, dbg def GetItemData(self): slotIndex = 0 # Slot index (position) window_type = player.INVENTORY # INVENTORY, SAFEBOX, MALL, DRAGON_SOUL_INVENTORY, BELT_INVENTORY ... itemVnum = player.GetItemIndex(window_type, slotIndex) if not itemVnum: return metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)] attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)] dbg.TraceError("slotIndex({}), window_type({}), itemVNum({})".format(slotIndex, window_type, itemVnum)) dbg.TraceError("metinSlot: {}".format(metinSlot)) dbg.TraceError("attrSlot: {}".format(attrSlot)) >>> 0419 16:37:40825 :: slotIndex(0), window_type(1), itemVNum(12019) >>> 0419 16:37:40825 :: metinSlot: [28442, 28441, 28438] >>> 0419 16:37:40825 :: attrSlot: [(1, 2000), (29, 15), (30, 15), (31, 15), (32, 15), (0, 0), (0, 0)]
-
(2.5) Questions & Answers specific rules
- Don't modify your thread (or reply to it) to mark it solved, and not explain the solution to the issue.
- Please use our tag system and vote good/bad answers so everyone can clearly see what matters!
- 1
-
On 4/12/2019 at 5:56 PM, kondzio299 said:
0412 16:45:37904 :: File "uiWhisper.py", line 303, in OnUpdate
0412 16:45:37906 :: AttributeError
0412 16:45:37906 :: :
0412 16:45:37907 :: 'NoneType' object has no attribute 'GetText'
0412 16:45:37908 ::You should replace the condition in function OnUpdate:
#if 0 != self.targetName: if self.targetName and self.chatLine:
- 1
-
M2 Download Center
( Internal )
( GitHub )
Builtin Debug Formatter
A simple debug class which is used for output the messages for debugging.
The class doesn't need to be called, we've added the functions into built-in functions.
The purpose was to ease the work of developers.
What's the difference between them?
- Using the new method:
TraceError("str", 1, 4.0, (31, 22), [100, 200], True) Tracef("str", 1, 4.0, (31, 22), [100, 200], True) LogBox("str", 1, 4.0, (31, 22), [100, 200], True) sys_err("str", 1, 4.0, (31, 22), [100, 200], True) # No import needed, is a built-in function, you can call it everywhere. # The function sys_err or TraceError doing the same thing. # Allow to pass unlimited argument-lines, no data types check, can be everything you want: <int, float, string, tuple, list, boolean>.
- Using the old method:
import dbg dbg.TraceError("just_one_string_allowed") dbg.Tracef("just_one_string_allowed") dbg.LogBox("just_one_string_allowed") # Need to import the module dbg every time in every file where you want to use it. # Allow to pass just one argument-line which need to be string, otherwise nothing happen.
Built-In-Functions:
Built in or inbuilt function are that type of functions which are already defined or created in a program or in programming framework. User don’t need to create these type of functions. User or developer can directly use built in function by only call it. This function is built into an application and can it can be accessed by end-users with simply call it.
How-It-Works:
- TraceError(args) - function prints the given arguments to the text stream file syserr.txt
- Tracef(args) - function prints the given arguments to the console window (screen) while executable is compiled in a debug mode.
- LogBox(args) - function prints the given arguments to the dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information.
- sys_err(args) - same as TraceError.
How-To-Call-Ex :
sys_err('warning', 'error', 'unknown') << 415 17:8:1130 :: warning << 415 17:8:1130 :: error << 415 17:8:1130 :: unknown sys_err(100/2==50, 'set value to {}'.format(25)) << 415 17:6:1083 :: True << 415 17:6:1083 :: set value to 25 sys_err([45, 100], (200, 1500, 32), 42.8, 500, "donald-trump", False) << 415 17:8:1094 :: [45, 100] << 415 17:8:1094 :: (200, 1500, 32) << 415 17:8:1094 :: 42.8 << 415 17:8:1094 :: 500 << 415 17:8:1094 :: donald-trump << 415 17:8:1094 :: False sys_err("what-you-want") << 415 17:8:1072 :: what-you-want
GitHub repository:
- 5
- 2
- 2
- 20
-
-
1 hour ago, avertuss said:
but probably he wanted to change these bonuses like att to monster instead of attack speed etc.
Even if he wanted to change the bonus type, you still need how calculation works, you'll add Att Monster instead of Max HP and at Perfect Master, the value will be 1.862?
So he still need the calculations, before doing this, also for change the type of bonus isn't so easy, at least you need to know some things.The current party bonuses are saved just as a point-value, not as a real bonus, the real bonus is calculated from another parts.
PARTY_ROLE_SKILL_MASTER > POINT_PARTY_SKILL_MASTER_BONUS
case POINT_MAX_SP: { SetPoint(type, GetPoint(type) + amount); const int iRealPointSP = GetRealPoint(POINT_MAX_SP); int iAddSP = MIN(800, iRealPointSP * GetPoint(POINT_MAX_SP_PCT) / 100); iAddSP += GetPoint(POINT_MAX_SP); // Add SP to current value by party skill bonus iAddSP += GetPoint(POINT_PARTY_SKILL_MASTER_BONUS); SetMaxSP(iRealPointSP + iAddSP); val = GetMaxSP(); } break;
- POINT_PARTY_ATTACKER_BONUS
Spoiler- POINT_PARTY_TANKER_BONUS
Spoiler- POINT_PARTY_BUFFER_BONUS
Spoiler- POINT_PARTY_SKILL_MASTER_BONUS
Spoiler- POINT_PARTY_HASTE_BONUS
Spoiler- POINT_PARTY_DEFENDER_BONUS
SpoilerSo if you want to change the bonuses, you've to rewrite all the calculations from those functions (remove the lines += GetPoint(..), and make them static, depends of you how and where, you can add it inside party.cpp after ComputePoints of each bonus like.
// Set as melee ch->PointChange(POINT_ATTBONUS_MONSTER, ch->GetPoint(POINT_PARTY_BUFFER_BONUS));
- 2
-
- Srcs/Server/game/src/party.cpp
float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) ) / 100.0f; // PARTY_ROLE_ATTACKER int iBonus = (int) (10 + 60 * k); // PARTY_ROLE_TANKER int iBonus = (int) (50 + 1450 * k); // PARTY_ROLE_BUFFER int iBonus = (int) (5 + 45 * k); // PARTY_ROLE_SKILL_MASTER int iBonus = (int) (25 + 600 * k); // PARTY_ROLE_HASTE int iBonus = (int) (1+5*k); // PARTY_ROLE_DEFENDER int iBonus = (int) (5+30*k);
- float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) ) / 100.0f;
m_iLeadership = Leader skill ship skill level which is increased by (book vnum: 50301, 50302, 50303)
int CHARACTER::GetSkillPowerByLevel(int level, bool bMob) const { return CTableBySkill::instance().GetSkillPowerByLevelFromType(GetJob(), GetSkillGroup(), MINMAX(0, level, SKILL_MAX_LEVEL), bMob); } int CTableBySkill::GetSkillPowerByLevelFromType(int job, int skillgroup, int skilllevel, bool bMob) const { if (bMob) return m_aiSkillPowerByLevelFromType[0][skilllevel]; if (job >= JOB_MAX_NUM || skillgroup == 0) return 0; int idx = (job * 2) + (skillgroup - 1); return m_aiSkillPowerByLevelFromType[idx][skilllevel]; }
Let's take a example, a warrior, skill group 1.
- idx = 0 * 2 + 1 - 1 = 0
- skilllevel = m_iLeadership
- m_iLeadership = 40 (Skill Perfect Master)
// 0 5 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 50 52 54 56 58 60 63 66 69 72 82 85 88 91 94 98 102 106 110 115 125 125 125 125 125 m_aiSkillPowerByLevelFromType[0][40] = 125
PARTY_ROLE_DEFENDER: (5+30*k)
- k = 125 / 100 = 1.25
- iBonus = 5 + 30 * 1.25 = 42.5 (converted to integer will be 42)
Output from skill P:
// PARTY_ROLE_ATTACKER - Set as attacker 10 + 60 * (125 / 100) = 85 // PARTY_ROLE_TANKER - Set as berserker 1 + 5 * (125 / 100) = 7.25 = 7 // PARTY_ROLE_BUFFER - Set as melee 50 + 1450 * (125 / 100) = 1862.5 = 1862 // PARTY_ROLE_SKILL_MASTER - Set as blocker 5 + 45 * (125 / 100) = 61.25 = 61 // PARTY_ROLE_HASTE - Set as defender 5 + 30 * (125 / 100) = 42.5 = 42 // PARTY_ROLE_DEFENDER - Set as wizzard 25 + 600 * (125 / 100) = 775
Is a fast explanation, i hope you understand it.
- 4
-
Thanks to @ProfessorEnte for reports.
2019-04-12 02:31:18 Friday - 170 additions and 50 deletions.
- Fixed unique items based on the real time.
- Fixed unstackable items.
- Fixed if item count overflow occured, then set it to maximum.
- Added support for books. (check skill types, unknown skill), skill vnum need to be saved into socket0, (4=Aura of the Sword < player.skill_proto), if the skill vnum is unknown, there will be a random book based on pc races, excluded skills PASSIVE, GUILD, SUPPORT.
- Added a to-do for ITEM_BLEND, check if apply_type exists in bonuses, check if apply_value/apply_duration is equal with grades (1/2/3/4/5) from settings, blend.txt
- Added auto query.
# Random book INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 50300, 1, 1); # Specific book by skill vnum INSERT INTO player.item_award(`login`, `vnum`, `count`, `socket0`, `mall`) VALUES ('account', 50300, 1, 4, 1);
- 6
-
Spoiler
- 11
-
M2 Download Center
( Internal )
( GitHub )
Metin2 Extended Item Award
You can store all bonuses and stones for items.
I wrote that as request from @ProfessorEnte, more informations at repository.
2018-04-02 14:02:11 Monday
- Fixed problem with save bonus after reload items.
- Fixed problem with unknown values.
- Correction for socket real time and more.
- Fixed unknown average/skill damage bonus value. player.item_proto.addon_type = -1 (Eg. 189, 199, 299, 1139, 1179, 2159, 2179, 3169, 3219, 5119, 5129, 6019, 6069, 6079, 7169)[+0 - +9] That's for the items which have addon type (-1) and you added them in item shop without bonuses like skill damage or hit damage, value x, y as default, so they'll will be without bonuses and get bugged. Now when the item will be inserted there'll be a check if item doesn't have those bonuses (from query) add a random average/skill damage bonus value.
INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 189, 1, 1);
2019-04-12 02:31:18 Friday
- Fixed unique items based on the real time.
- Fixed unstackable items.
- Fixed if item count overflow occured, then set it to maximum.
- Added support for books. (check skill types, unknown skill), skill vnum need to be saved into socket0, (4=Aura of the Sword < player.skill_proto), if the skill vnum is unknown, there will be a random book based on pc races, excluded skills PASSIVE, GUILD, SUPPORT.
- Added a to-do for ITEM_BLEND, check if apply_type exists in bonuses, check if apply_value/apply_duration is equal with grades (1/2/3/4/5) from settings, blend.txt
- Added auto query.
# Random book INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 50300, 1, 1); # Specific book by skill vnum INSERT INTO player.item_award(`login`, `vnum`, `count`, `socket0`, `mall`) VALUES ('account', 50300, 1, 4, 1);
2019-04-16 14:54:48 Tuesday (Video - Click)
- Added a check for attr types and values min - max.
- You can't insert wrong bonuses into a specific item.
- Eg. Add 2000 MAX_HP on your Sword+9, was possible, now not.
- Eg. Add +500 INT to your shield, now there's a check for min-max value of player.item_attr Lv.1 - Lv.5 and your 500 INTvalue will be replaced with max value from lvl5 of bonus, like 12 (lv5), that happen with all the bonuses, same thing with the values lower than lvl1, like 5 HP_REGEN on your neck, when the minimum (lv1) is 10, the value will be replaced with 10.
- If the bonus type can't be added into a specific item, the bonus will be ignored > deleted. (example: critical pct to armor)
- Refactorized all the code and moved all features into .
- C++11 or higher is required for checking attributes.
# Test unknown types + higher and lower values in game. INSERT INTO `player`.`item_award`(`login`, `vnum`, `count`, `attrtype0`, `attrvalue0`, `attrtype1`, `attrvalue1`, `attrtype2`, `attrvalue2`, `attrtype3`, `attrvalue3`, `attrtype4`, `attrvalue4`, `mall`) VALUES ( 'test', 149, 1, 17, 25, -- ATTBONUS_HUMAN 22, 35, -- ATTBONUS_DEVIL, 32, 175, -- RESIST_BELL 33, -150, -- RESIST_FAN 48, 1, -- IMMUNE_STUN 1 ); # See the min-max values for all the bonuses from weapon. SELECT apply+0 AS `index`, apply AS `name`, lv1 as `min_value`, lv5 as `max_value` FROM `item_attr` WHERE weapon > 0; # See if a specific bonus is included in bonuses of weapon. SELECT apply, apply+0 FROM `item_attr` WHERE weapon > 0 AND apply in ('ATTBONUS_HUMAN', 'ATTBONUS_DEVIL', 'RESIST_BELL', 'RESIST_FAN', 'IMMUNE_STUN');
2019-10-30 03:48:12 Wednesday
- Fixed expression is not assignable.
- Break a for loop after the bonus has found.
Sockets & attrs
INSERT INTO `player`.`item_award`(`login`, `vnum`, `count`, `given_time`, `why`, `socket0`, `socket1`, `socket2`, `attrtype0`, `attrvalue0`, `attrtype1`, `attrvalue1`, `attrtype2`, `attrvalue2`, `attrtype3`, `attrvalue3`, `attrtype4`, `attrvalue4`, `mall`) VALUES ( 'test', -- ACCOUNT_NAME 12029, -- ITEM_VNUM 1, -- ITEM_COUNT '2018-03-25 05:53:17', -- GIVEN_TIME 'ITEM_SHOP', -- REASON 28442, 28441, 28438, -- SOCKET 1 & 2 & 3 1, 1500, -- APPLY_MAX_HP 29, 10, -- APPLY_RESIST_SWORD, 30, 10, -- APPLY_RESIST_TWOHAND 31, 10, -- APPLY_RESIST_DAGGER 32, 10, -- APPLY_RESIST_BELL 1 -- MALL );
For those who use @martysama0134 source:
//@Srcs/Server/db/src/ClientManager.cpp #define ENABLE_ITEMAWARD_REFRESH // Should be enabled
Github repository or :
- 67
- 1
- 2
- 1
- 2
- 24
- 4
- 53
-
21 minutes ago, alibaba said:
return false once an item is found no need to continue the loop
You should check the repository, already is before your comment.
Update:
- - removed count method
- + added support for c++11
- 3
-
@Kori Check now, i added it on GIt.
- 1
-
-
- Src/Server/game/src/cmd_general.cpp
ACMD(do_cmd) { [...] if (ch->IsHack(false, true, nExitLimitTime) && ...) { [...] } [...] }
- Src/Server/game/src/char.cpp
bool CHARACTER::IsHack(bool bSendMsg, bool bCheckShopOwner, int limittime) { [...] //PREVENT_PORTAL_AFTER_EXCHANGE if (iPulse - GetExchangeTime() < PASSES_PER_SEC(limittime)) { if (bSendMsg) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("거래 후 %d초 이내에는 다른지역으로 이동 할 수 없습니다."), limittime ); return true; } //END_PREVENT_PORTAL_AFTER_EXCHANGE [...] }
- 1
-
-
Src/Server/game/src/char_battle.cpp
struct FuncAggregateMonster { [.....] if (number(1, 100) <= 50) // 50% chance for pulling if (DISTANCE_APPROX(ch->GetX() - m_ch->GetX(), ch->GetY() - m_ch->GetY()) < 5000) // approximate distance 5000 if (ch->CanBeginFight()) ch->BeginFight(m_ch); [.....] };
- 2
-
Src/Server/game/src/char_battle.cpp
-
Texture of the ground is a little bit weird, but in the end looks good.
Spoiler- 4
-
M2 Download Center
( Internal )
( GitHub )
Get bonus name from tooltip affect dictionary as string, ignore the %value% and function SA, SNA etc.
& , is just to test how function works.
Ignore theJust follow tutorial from
.import localeInfo import item # FormatBonusNameString print localeInfo.FormatBonusNameString(item.APPLY_RESIST_SWORD) # FormatBonusNameDict for bonusIndex, bonusName in localeInfo.FormatBonusNameDict().iteritems(): print '{:d}: {:s}'.format(bonusIndex, bonusName)
GitHub repository:
- 59
- 1
- 1
- 3
- 1
- 1
- 1
- 13
- 1
- 29
-
7 hours ago, WeedHex said:
(Better to use a const int for the %)
Better to use for both of them since you don't change anything and also cast the (dam/100), the result can be floating point data type, since you want a integer, is a good practice to do it.
const uint8_t iPrctMana = 31; const int32_t iDamageSPPart = static_cast<int32_t>(dam / 100) * iPrctMana;
- 1
-
On 4/1/2019 at 6:45 PM, BigBoss said:
Bump I have the same error, any solutions?
You declared the variable into a if condition and then you try to call it from outside, that's wrong.
def main(condition): if condition: variable = 100 print variable main(True) << 100 main(False) << Traceback (most recent call last): << File "main.py", line 6, in <module> << main(False) << File "main.py", line 4, in main << print variable << UnboundLocalError: local variable 'variable' referenced before assignment
So, your problem is exchangeButton, declare it before condition if self.isShowButton, like:
def OnUpdate(self): exchangeButton = self.buttonDict[locale.TARGET_BUTTON_EXCHANGE] [.....]
- 3
-
51 minutes ago, filipw1 said:
I can't recommend Vegas. I paid for the system and waited a month to get it. He sent it only because I wanted a refund
I had a lot of problems with polish guys, so that isn't something new. There's a lot of guys which trying to make shit.
The main problem of me, time = bad seller.
I don't have enough time since 2018, also as you saw, i wasn't actived in forums In period 2016-2019 too much, disappeared because i have more important things to do than metin2.
The metin2 remained just as a hobby and do some shits when i have some free time, I've to study for university and other activities.
A good point for people which still trying to contact me, write me on WhatsApp, not Skype, there's small chances to answer in Skype because i've over 4500+ contacts and hundreds of requests (photo) and messages since a lot of time, i don't have time to answer on them, i just answer to people which are friendly and random ones.As you know, i'm not a scammer, so if i didn't answered to you x weeks/months, that doesn't mean i stole your money, as i said, my problem is time, and that make me a bad person in some eyes. But in the end, everything is fine and the customer will get what he paid, even if x time passed.
- There still exist some guys which i still didn't answered to them because of many factors, but if they'll write me again with a good behaviour, be sure i'll reply to you back.
- I've no reason to put peoples to wait for my systems, if i do this there exist some factors, depends of: my time, your character and how you talk, spamming, no patience etc.
- I know is easy to talk, "yo vegas is shit seller, he didn't answer since months, years" but did you think about me? when you've hundreds of messages from all countries and try to talk with them as you can, and there's a lot of bastards guys which are resellers and try to buy your work and try to find them out?
Let's don't a off-topic in this subject.
40 minutes ago, mackabro2 said:Promised me updates of the Contact System and Combat Zone that do not work right. Until now I expect the updates.
Send me a message in Skype and we'll fix it.
- 5
-
- Added a gist link for download.
- Fixed NumberToMoneyString format method. (thanks to @Syreldar)
- 2
Quiver System
in Features & Metin2 Systems
Posted