Jump to content

question about c++


Go to solution Solved by VegaS™,

Recommended Posts

  • Forum Moderator
  • Solution

CLICK FOR VIDEO

  • Server\src\game\src\DragonSoul.h
//1.1) Search for:
	bool	DragonSoulItemInitialize(LPITEM pItem);
//1.2) Add after:
	bool	AreActivedAllSlotsDragonSoulByPage(const LPCHARACTER ch, const BYTE bPageIndex = DRAGON_SOUL_DECK_0) const;
  • Server\src\game\src\DragonSoul.cpp
//1.1) Search for:
BYTE GetStrengthIdx(DWORD dwVnum)
{
	return (dwVnum / 10) % 10;
}
//1.2) Add after:
bool DSManager::AreActivedAllSlotsDragonSoulByPage(const LPCHARACTER ch, const uint8_t bPageIndex) const
{
	// Check if all the slots are actived in a specific page of dragon soul - 18.05.2019 [Vegas]
	if (!ch || bPageIndex >= DRAGON_SOUL_DECK_MAX_NUM)
		return false;

	const uint16_t iDragonSoulDeckAffectType = AFFECT_DRAGON_SOUL_DECK_0 + bPageIndex; // 540 + [0 or 1]
	if (!ch->FindAffect(iDragonSoulDeckAffectType))
		return false;

	// start : 32 + ([0 or 1] * 6) = [32 or 38]
	// end : start + 6
	const uint8_t iStartSlotIndex = WEAR_MAX_NUM + (bPageIndex * DS_SLOT_MAX);
	const uint8_t iEndSlotIndex = iStartSlotIndex + DS_SLOT_MAX;
	
	BYTE bSlotActive = 0;
	for (uint8_t iSlotIndex = iStartSlotIndex; iSlotIndex < iEndSlotIndex; ++iSlotIndex) // {0: 32-38, 1: 38-44}
	{
		const LPITEM pkItem = ch->GetWear(iSlotIndex);
		if (pkItem && pkItem->IsDragonSoul())
		{
			if (IsTimeLeftDragonSoul(pkItem) && IsActiveDragonSoul(pkItem))
				++bSlotActive;
		}
	}

	return (bSlotActive == DS_SLOT_MAX);
}
  • How-To-Use-Example:
#include "DragonSoul.h"
  
if (DSManager::instance().AreActivedAllSlotsDragonSoulByPage(ch, DRAGON_SOUL_DECK_0))
{
	ch->ChatPacket(CHAT_TYPE_INFO, "DragonSoul: You've all the dragon souls active in page 1.");
	// do something
}

if (DSManager::instance().AreActivedAllSlotsDragonSoulByPage(ch, DRAGON_SOUL_DECK_1))
{
	ch->ChatPacket(CHAT_TYPE_INFO, "DragonSoul: You've all the dragon souls active in page 2.");
	// do something
}

The rest is up to you how you give a bonus or something, you've the function which do the check.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 5
Link to comment
Share on other sites

  • Forum Moderator

@Syriza
Rules
§2 Topics

(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!


Best regards
Raylee

  • Love 2
Link to comment
Share on other sites

Does a moderator exist on this board? If yes you can start deleting about 99% of the posts from this exygo kid.

 

@Kameyu

no, there is a System and it isnt there for fun usually there are rules just because there is no moderator here you cant talk shit. Writing a thank you is pushing the Thread meaningless. And i do think Vegas knows that im thankful since he already helped me so many times, People like exygo and you Can only shit talk

vor 2 Stunden schrieb Exygo:

First time when I saw the topic the first post was edited to "--"

Is it Fine now? Even brain retarded kids like you will unterstand for what i have asked, since you couldnt read the Code..

vor 8 Stunden schrieb Raylee:

 

Link to comment
Share on other sites

  • Forum Moderator
12 hours ago, Syriza said:

Does a moderator exist on this board? If yes you can start deleting about 99% of the posts from this exygo kid.

I mean what should I say now?
Maybe - "Put on your glasses first"!?

Obviously, now you're trying to blame others.
Nobody is interested in your negative behaviour.
Now you try to distract from the topic and direct the "BEEF" to Exygo.
(Because he said what others thought. AND YES! Exygo's comment is not a insult! It's a true statement!!)

The community is here to help each others!
So show them respect and stop to start a fight!


The point here is only:
There's nothing wrong with asking questions!
The problem is only your acting!
Because you deleted your question - and others who might want to know what Vegas release was for - would be glad if they can see your QUESTION/PROBLEM!!!.


There is no reason to delete questions!!
No one is omniscient.

 

Regards
Raylee

  • Love 2
Link to comment
Share on other sites

vor 2 Stunden schrieb Raylee:

I mean what should I say now?
Maybe - "Put on your glasses first"!?

Obviously, now you're trying to blame others.
Nobody is interested in your negative behaviour.
Now you try to distract from the topic and direct the "BEEF" to Exygo.
(Because he said what others thought. AND YES! Exygo's comment is not a insult! It's a true statement!!)

The community is here to help each others!
So show them respect and stop to start a fight!


The point here is only:
There's nothing wrong with asking questions!
The problem is only your acting!
Because you deleted your question - and others who might want to know what Vegas release was for - would be glad if they can see your QUESTION/PROBLEM!!!.


There is no reason to delete questions!!
No one is omniscient.

 

Regards
Raylee

 

If i say you are useless, dont worry, isnt a Insult - it's a true Statement.

Link to comment
Share on other sites

  • Honorable Member
2 hours ago, Syriza said:

 

If i say you are useless, dont worry, isnt a Insult - it's a true Statement.

Are you serious? We do most of the work in this board in our spare time, we all have work.

You should be respectful to all users, and yes @Exygo should it too. BUT you should be especially respectful to all our team members.

AND you should follow our rules, which you definitely didn't do in this case. You now have a little bit of time to think about how you reacted, and to reread our rules.

Kind regards,
DevChuckNorris

  • Love 1
Link to comment
Share on other sites

  • Premium
Le 20/05/2019 à 01:57, Syriza a dit :

People like exygo and you Can only shit talk

Okay so apparently giving my opinion makes me talking shit. I was just telling you that pushing a button is as meaningless as a simple download count.

What matter is whether they are sincere or not and you can see that better by an answer saying thank you than a simple button. Because the user took the time to thank you personally, even if it's just two words.

As DevChuckNorris said, you should be respectful to all users. Saying thank you and clicking a single button is practically the same but the feelings you put by writing down a thank you message is worth more than a notification saying you got one more internet point.

Now please can we focus on the actual topic ? Thank you.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.