Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 02:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Monster Buffs Extension

Discussion on Monster Buffs Extension within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 202
Join Date: Feb 2019
Posts: 42
Received Thanks: 4
Monster Buffs Extension

Hello all,

I started learning programming using a clean V15 Flyff Source.
I'm currently working with VS2017 and the files released by Blouflash.
I implemented following the tutorial the monsterbuffs system and now wanted to extend it with probability and time for the buffs.

I basically don't want getting this buff everytime, but with a specific probability for about 30 Seconds to get a little bonus for leveling/grinding.

My idea was doing it like the randomoption.inc where i add 2 new colums for the probability and the duration for the buffs.

My Problem is that I don't really have a clue how to implement it in the source...

Can someone help me out?

Thanks in advance
Duscansi is offline  
Old 03/20/2019, 20:54   #2
 
elite*gold: 0
Join Date: Dec 2009
Posts: 51
Received Thanks: 22
Add this in Project.h
Code:
#ifdef __MONSTER_BUFFS
struct MonsterBuffData
{
	int m_BuffId;
	int m_Chance;
};
#endif
Then change the corresponding code:
Code:
#ifdef __MONSTER_BUFFS
	map<int, MonsterBuffData>   m_mapMonsterBuffs;
	BOOL			LoadMonsterBuffs(LPCTSTR lpszFilename);
#endif // __MONSTER_BUFFS
Code:
#ifdef __MONSTER_BUFFS
BOOL CProject::LoadMonsterBuffs(LPCTSTR lpszFilename)
{
	CScript script;
	if (script.Load(lpszFilename) == FALSE)
	{
		Error("Failed to load: %s", lpszFilename);
		return FALSE;
	}

	int monsterID = script.GetNumber();
	while (script.tok != FINISHED)
	{
		MonsterBuffData data;
		data.m_BuffId = script.GetNumber();
		data.m_Chance = script.GetNumber();
		m_mapMonsterBuffs.insert(make_pair(monsterID, data));
		monsterID = script.GetNumber();
	}
	return TRUE;
}
#endif // __MONSTER_BUFFS
Code:
#ifdef __MONSTER_BUFFS
	map< int, MonsterBuffData >::iterator it = prj.m_mapMonsterBuffs.find(m_pDefender->m_dwIndex);
	if (prj.m_mapMonsterBuffs.end() != it)
	{
		MonsterBuffData data = it->second;
		if ((int)xRandom(1000) < data.m_Chance)
		{
			ItemProp* pProp = prj.GetItemProp(data.m_BuffId);
			if (pProp)
				m_pAttacker->DoApplySkill(m_pAttacker, pProp, NULL);
		}
	}
#endif // __MONSTER_BUFFS
Now you cann add another column in your MonsterBuffs.inc:
Code:
MI_AIBATT1	II_SYS_SYS_LS_LOVE  500
MI_AIBATT2	II_SYS_SYS_LS_BLESSING 100
10 = 1%
Crimal is offline  
Old 03/21/2019, 09:38   #3
 
elite*gold: 202
Join Date: Feb 2019
Posts: 42
Received Thanks: 4
Quote:
Originally Posted by Crimal View Post
Add this in Project.h
Code:
#ifdef __MONSTER_BUFFS
struct MonsterBuffData
{
	int m_BuffId;
	int m_Chance;
};
#endif
Then change the corresponding code:
Code:
#ifdef __MONSTER_BUFFS
	map<int, MonsterBuffData>   m_mapMonsterBuffs;
	BOOL			LoadMonsterBuffs(LPCTSTR lpszFilename);
#endif // __MONSTER_BUFFS
Code:
#ifdef __MONSTER_BUFFS
BOOL CProject::LoadMonsterBuffs(LPCTSTR lpszFilename)
{
	CScript script;
	if (script.Load(lpszFilename) == FALSE)
	{
		Error("Failed to load: %s", lpszFilename);
		return FALSE;
	}

	int monsterID = script.GetNumber();
	while (script.tok != FINISHED)
	{
		MonsterBuffData data;
		data.m_BuffId = script.GetNumber();
		data.m_Chance = script.GetNumber();
		m_mapMonsterBuffs.insert(make_pair(monsterID, data));
		monsterID = script.GetNumber();
	}
	return TRUE;
}
#endif // __MONSTER_BUFFS
Code:
#ifdef __MONSTER_BUFFS
	map< int, MonsterBuffData >::iterator it = prj.m_mapMonsterBuffs.find(m_pDefender->m_dwIndex);
	if (prj.m_mapMonsterBuffs.end() != it)
	{
		MonsterBuffData data = it->second;
		if ((int)xRandom(1000) < data.m_Chance)
		{
			ItemProp* pProp = prj.GetItemProp(data.m_BuffId);
			if (pProp)
				m_pAttacker->DoApplySkill(m_pAttacker, pProp, NULL);
		}
	}
#endif // __MONSTER_BUFFS
Now you cann add another column in your MonsterBuffs.inc:
Code:
MI_AIBATT1	II_SYS_SYS_LS_LOVE  500
MI_AIBATT2	II_SYS_SYS_LS_BLESSING 100
10 = 1%
Thank you very much
Duscansi is offline  
Reply


Similar Threads Similar Threads
[Release] Monster Buffs
05/08/2021 - Flyff PServer Guides & Releases - 27 Replies
https://www.youtube.com/watch?v=fhT5yWWhlHA search for: #ifdef __IMPROVE_MAP_SYSTEM #ifdef __CLIENT m_MapInformationManager.LoadMapInformationData() ; #endif // __CLIENT #endif // __IMPROVE_MAP_SYSTEM
[TuT] How To Change Pk2 Extension To Any Extension And Change File Name
06/16/2014 - SRO PServer Guides & Releases - 7 Replies
In This tutorial i'll show you how to change .pk2 extension and change the file name for anything you want . We can do it in two ways .. First using Ollydbg Second using Hex Workshop ....
typo3 extension problem (mooflow)
10/20/2008 - General Coding - 5 Replies
Moin die Damen, ich hab gestern ne Typo3 Extension installiert, finde nirgendswo nen Fehler nur dass es nicht angezeigt wird. Kennt sich jemand mit MooFlow aus bzw hatte schonmal ein ähnliches Prob ? Studio-DO: Willkommen bei Studio-DO
Hotkey tabs extension hack?
06/07/2008 - Perfect World - 1 Replies
I hear that the hotkey tabs can be extended, can someone post a hack for it if it can be done please?
What extension does .JZP go to???
05/30/2008 - General Coding - 10 Replies
Found an ftp ip for Archlord patch/update files. ftp hosting site for them.. but they end in dot JZP here is 1 of them: Patch0071.JZP & here is a couple lines, if opened in notepad



All times are GMT +1. The time now is 02:31.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.