Register for your free account! | Forgot your password?

You last visited: Today at 18:39

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

 

[C++] Affect blend potion

Reply
 
Old   #1
 
elite*gold: 10
Join Date: Jul 2013
Posts: 80
Received Thanks: 327
Post [C++] Affect blend potion

You must register and activate your account in order to view images.

Code:
######## CLIENT #########
#########################
#root/uiAffectShower.py
#1.) Search:
import math
#2.) Add after:
if app.ENABLE_NEW_AFFECT_POTION:
	mainAffectPotion = {
		"affect" : [
			chr.AFFECT_POTION_1, chr.AFFECT_POTION_2, chr.AFFECT_POTION_3, chr.AFFECT_POTION_4, chr.AFFECT_POTION_5, chr.AFFECT_POTION_6
		],

		"image" : [
			("icon/item/5082%d.tga" % (i + 1)) for i in xrange(len("affect"))
		],

		"desc" : [
			localeInfo.TOOLTIP_AFFECT_POTION_1, localeInfo.TOOLTIP_AFFECT_POTION_2, localeInfo.TOOLTIP_AFFECT_POTION_3, localeInfo.TOOLTIP_AFFECT_POTION_4, localeInfo.TOOLTIP_AFFECT_POTION_5, localeInfo.TOOLTIP_AFFECT_POTION_6
		]
	}

#1.) Search:
		if type < 500:
			return
#2.) Delete and replaced with:
		if app.ENABLE_NEW_AFFECT_POTION:
			if type < 500 and not type in mainAffectPotion["affect"]:
				return
		else:
			if type < 500:
				return

#1.) Search:
	if app.ENABLE_DRAGON_SOUL_SYSTEM:
		AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK1] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK1, "d:/ymir work/ui/dragonsoul/buff_ds_sky1.tga")
		AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK2] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK2, "d:/ymir work/ui/dragonsoul/buff_ds_land1.tga")
#2.) Add after:
	if app.ENABLE_NEW_AFFECT_POTION:
		for i in xrange(len(mainAffectPotion["affect"])):
			AFFECT_DATA_DICT[mainAffectPotion["affect"][i]] = (mainAffectPotion["desc"][i], mainAffectPotion["image"][i])
			
#locale/en/locale_game.txt
#Add where you want:
TOOLTIP_AFFECT_POTION_1	Potion Red	SNA
TOOLTIP_AFFECT_POTION_2	Potion Orange	SNA
TOOLTIP_AFFECT_POTION_3	Potion Yellow	SNA
TOOLTIP_AFFECT_POTION_4	Potion Green	SNA
TOOLTIP_AFFECT_POTION_5	Potion Blue	SNA
TOOLTIP_AFFECT_POTION_6	Potion White	SNA

//@src/Svn/Client/UserInterface/InstanceBase.h
//1.) Search for:
			NEW_AFFECT_NOG_POCKET_ABILITY = 302,
//2.) Add after:
#ifdef ENABLE_NEW_AFFECT_POTION
			AFFECT_POTION_1 = 303,
			AFFECT_POTION_2 = 304,
			AFFECT_POTION_3 = 305,
			AFFECT_POTION_4 = 306,
			AFFECT_POTION_5 = 307,
			AFFECT_POTION_6 = 308,
#endif

//@src/Svn/Client/UserInterface/PythonApplicationModule.cpp
//1.) Search for:
#ifdef ENABLE_COSTUME_SYSTEM
	PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",	1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",	0);
#endif
//2.) Add after:
#ifdef ENABLE_NEW_AFFECT_POTION
	PyModule_AddIntConstant(poModule, "ENABLE_NEW_AFFECT_POTION",	1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_NEW_AFFECT_POTION",	0);
#endif

//@src/Svn/Client/UserInterface/PythonCharacterModule.cpp
//1.) Search for:
	PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_DECK2",		CInstanceBase::NEW_AFFECT_DRAGON_SOUL_DECK2);
//2.) Add after:
#ifdef ENABLE_NEW_AFFECT_POTION
	PyModule_AddIntConstant(poModule, "AFFECT_POTION_1",		CInstanceBase::AFFECT_POTION_1);
	PyModule_AddIntConstant(poModule, "AFFECT_POTION_2",		CInstanceBase::AFFECT_POTION_2);
	PyModule_AddIntConstant(poModule, "AFFECT_POTION_3",		CInstanceBase::AFFECT_POTION_3);
	PyModule_AddIntConstant(poModule, "AFFECT_POTION_4",		CInstanceBase::AFFECT_POTION_4);
	PyModule_AddIntConstant(poModule, "AFFECT_POTION_5",		CInstanceBase::AFFECT_POTION_5);
	PyModule_AddIntConstant(poModule, "AFFECT_POTION_6",		CInstanceBase::AFFECT_POTION_6);
#endif

//@src/Svn/Client/UserInterface/Locale_inc.h
//1.) Add where you want:
#define ENABLE_NEW_AFFECT_POTION

######## SERVER #########
#########################
//@src/Svn/Server/game/src/char_affect.cpp
//1.) Search for:
			if ( IS_NO_CLEAR_ON_DEATH_AFFECT(pkAff->dwType) || IS_NO_SAVE_AFFECT(pkAff->dwType) )
			{
				++it;
				continue;
			}
//2.) Add after:
#ifdef ENABLE_NEW_AFFECT_POTION         
            int listAffects[] = {
				AFFECT_POTION_1, AFFECT_POTION_2, AFFECT_POTION_3, AFFECT_POTION_4, AFFECT_POTION_5, AFFECT_POTION_6};
			
			for (int i = 0; i < _countof(listAffects); i++)
			{
				if (pkAff->dwType == listAffects[i])
				{
					++it;
					continue;
				}
			}
#endif

//@src/Svn/Server/game/src/char_item.cpp
//1.) Search for:
void CHARACTER::UseSilkBotary(void)
{
	[........]
}
//2.) Add after:
#ifdef ENABLE_NEW_AFFECT_POTION
void CHARACTER::SetAffectPotion(LPITEM item)
{
	int listAffectPotion[] =
	{
		AFFECT_POTION_1, AFFECT_POTION_2, AFFECT_POTION_3, AFFECT_POTION_4, AFFECT_POTION_5, AFFECT_POTION_6};

	int listVnums[] =
	{
		50821, 50822, 50823, 50824, 50825, 50826};
	
	for (int i = 0; i < _countof(listVnums); i++)
	{
		if (item->GetVnum() == listVnums[i])
		{
			AddAffect(listAffectPotion[i], APPLY_NONE, 0, AFF_NONE, item->GetSocket(2), 0, false, false);
			ChatPacket(CHAT_TYPE_INFO, "<Affect Potion> Set icon ingame for item: [%s]", item->GetName());			
		}
	}
}
#endif

//1.) Search for:
							AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
//2.) Add before:
						#ifdef ENABLE_NEW_AFFECT_POTION
							SetAffectPotion(item);
						#endif

//@src/Svn/Server/game/src/char.h
//1.) Search:
		void			FlushDelayedSaveItem();
//2.) Add bellow:
#ifdef ENABLE_NEW_AFFECT_POTION	
		void			SetAffectPotion(LPITEM item);
#endif	

//@src/Svn/Server/game/src/affect.h
//1.) Search:
	AFFECT_HOLLY_STONE_POWER = 303,
//2.) Delete and replaced with: (WARNING: Delete -> AFFECT_HOLLY_STONE_POWER = 303,) ! and add bellow:
#ifdef ENABLE_NEW_AFFECT_POTION	
	AFFECT_POTION_1 = 303,
	AFFECT_POTION_2 = 304,
	AFFECT_POTION_3 = 305,
	AFFECT_POTION_4 = 306,
	AFFECT_POTION_5 = 307,
	AFFECT_POTION_6 = 308,
#endif

//@src/Svn/Server/common/service.h
//Add where you want:
#define ENABLE_NEW_AFFECT_POTION
Attached Files
File Type: rar [Source] Affect potion.rar (4.3 KB, 268 views)



VegaS ♆ is offline  
Thanks
9 Users
Old   #2
 
elite*gold: 0
Join Date: Sep 2016
Posts: 96
Received Thanks: 56
Didn't you already release the same thing months ago?


</nQQpls> is offline  
Thanks
1 User
Old   #3
 
elite*gold: 10
Join Date: Jul 2013
Posts: 80
Received Thanks: 327
Quote:
Originally Posted by </nQQpls> View Post
Didn't you already release the same thing months ago?
Oh ****, true. I checked now and exist a topic from summer 2016, i delete him and i put redirect here now.
When i post something i put in more forums and i forget about that, but here is a bit more then old functions.

Thanks ^^
VegaS ♆ is offline  
Old   #4
 
elite*gold: 0
Join Date: Nov 2016
Posts: 37
Received Thanks: 6
very nice =)

Kann man das im chat irgendwie verbergen ?


YoooOOO000 is offline  
Old   #5
 
elite*gold: 0
Join Date: Oct 2009
Posts: 4,020
Received Thanks: 3,753
Quote:
Originally Posted by YoooOOO000 View Post
very nice =)

Kann man das im chat irgendwie verbergen ?
Kommentier das aus

PHP Code:
ChatPacket(CHAT_TYPE_INFO"<Affect Potion> Set icon ingame for item: [%s]"item->GetName()); 
Ocelot2606 is offline  
Thanks
2 Users
Old   #6
wherever the light ends

 
elite*gold: 244
Join Date: Feb 2011
Posts: 4,823
Received Thanks: 2,777
All buffs and debuffs should be displayed there, such a change is long overdue. Good job!
Nick is offline  
Thanks
1 User
Old   #7
 
elite*gold: 0
Join Date: Apr 2016
Posts: 82
Received Thanks: 3

What is Wrong?

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndexError'>:list index out of range
iL0riS is offline  
Old   #8
 
elite*gold: 0
Join Date: Oct 2016
Posts: 51
Received Thanks: 24
Schöner Release.
Danke dir.

Great Release.
Thank you.

MfG,

Arroganz
xArroganz is offline  
Thanks
1 User
Old   #9
 
elite*gold: 150
Join Date: Feb 2009
Posts: 543
Received Thanks: 494
Fix_01:


Fix_02:


Help_01:


MfG
Cyber
Cyber36 is offline  
Old   #10
 
elite*gold: 0
Join Date: Jun 2011
Posts: 16
Received Thanks: 1
It's necessery, it works with Python 2.7 !!!!

'FIX_01' is fail, because self. metod not argumentum with 'AFFECT_DATA_DICT'.
Pisti16 is offline  
Old   #11
 
elite*gold: 150
Join Date: Feb 2009
Posts: 543
Received Thanks: 494
Quote:
Originally Posted by Pisti16 View Post
It's necessery, it works with Python 2.7 !!!!

'FIX_01' is fail, because self. metod not argumentum with 'AFFECT_DATA_DICT'.
Mh. In my client it was an error, which was fixxed by that. Sorry for that.

MfG
Cyber
Cyber36 is offline  
Old   #12
 
elite*gold: 0
Join Date: Aug 2011
Posts: 81
Received Thanks: 166
I dont have any errors but icons dont show ! I tryed 4 times from 0 idk what can be the problem.
P.O.X is offline  
Old   #13
 
elite*gold: 0
Join Date: Apr 2017
Posts: 16
Received Thanks: 0
Great system! thanks for your release!


Reason2Believe is offline  
Reply

Tags
c++, python



« Previous Thread | Next Thread »

Similar Threads
[Help]Blend.txt
Hello EPVP. Im here to ask you its there a limit of how many potions i can create in Blend.txt? Is there somthing wrong with those Blends?...
0 Replies - Metin2 PServer - Discussions / Questions
BLEND bug fix.
Hi, epvp. Search char_item.cpp ITEM_BLEND : replace with this. case ITEM_BLEND: sys_log(0,"ITEM_BLEND!!"); if...
1 Replies - Metin2 PServer Guides & Strategies
DJ BLEND
he is banned , can anyone get his ip ?? i'll find him and get him down !!!
9 Replies - DarkOrbit
Moon potion(auto potion)
i found close plz
0 Replies - Metin2 PServer - Discussions / Questions
Blend.txt
könnte mir jemand eine normale blend.txt schicken. hab beim umändern was falsch gemacht und jetzt funktioniert es nicht mehr ;> bitte ;>
3 Replies - Metin2 PServer - Discussions / Questions



All times are GMT +2. The time now is 18:39.


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

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.