Jump to content

lose pv with quest(affect.add_collect)


Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Open function with that in your quest:a

affect.command007()

[File: Src/Server/game/questlua_affect.cpp]

#ifdef ENABLE_NEW_QA_TEST			
			{ "command007",		affect_command007		},			
#endif		
#ifdef ENABLE_NEW_QA_TEST
	int affect_command007(lua_State * L) {
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		lua_pushnumber(L, ch->TryAffect());
		return 1;
	}
#endif

[File: Src/Server/game/char.h]

#ifdef ENABLE_NEW_QA_TEST
		void			TryAffect();
#endif

[File: Src/Server/game/char.cpp]

#ifdef ENABLE_NEW_QA_TEST
void CHARACTER::TryAffect()
{
	if (!FindAffect(BIOLOG_AFFECT_1))
	{
		AddAffect(BIOLOG_AFFECT_1, POINT_MAX_HP, BONUS_VALUE_BIO_1, 0, TIME_AFFECT_BIO_1, 0, true);
		ChatPacket(CHAT_TYPE_NOTICE, "[AFFECT_BIO_1] was added %u hp!", BONUS_VALUE_BIO_1);
	}
}
#endif

[File: Src/Server/game/affect.h]

#ifdef ENABLE_NEW_QA_TEST	
	BIOLOG_AFFECT_1,
#endif

[File: Src/Server/common/length.h.h]

#ifdef ENABLE_NEW_QA_TEST
enum ETypeBiologBonus
{
	TIME_AFFECT_BIO_1 = 60*60*24*365,
	BONUS_VALUE_BIO_1 = 30000,	// Value hp
	
};	
#endif

I am not tested,only write but it should work 100%.

Link to comment
Share on other sites

2 hours ago, VegaS said:

Open function with that in your quest:a


affect.command007()

[File: Src/Server/game/questlua_affect.cpp]


#ifdef ENABLE_NEW_QA_TEST			
			{ "command007",		affect_command007		},			
#endif		

#ifdef ENABLE_NEW_QA_TEST
	int affect_command007(lua_State * L) {
		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
		lua_pushnumber(L, ch->TryAffect());
		return 1;
	}
#endif

[File: Src/Server/game/char.h]


#ifdef ENABLE_NEW_QA_TEST
		void			TryAffect();
#endif

[File: Src/Server/game/char.cpp]


#ifdef ENABLE_NEW_QA_TEST
void CHARACTER::TryAffect()
{
	if (!FindAffect(BIOLOG_AFFECT_1))
	{
		AddAffect(BIOLOG_AFFECT_1, POINT_MAX_HP, BONUS_VALUE_BIO_1, 0, TIME_AFFECT_BIO_1, 0, true);
		ChatPacket(CHAT_TYPE_NOTICE, "[AFFECT_BIO_1] was added %u hp!", BONUS_VALUE_BIO_1);
	}
}
#endif

[File: Src/Server/game/affect.h]


#ifdef ENABLE_NEW_QA_TEST	
	BIOLOG_AFFECT_1,
#endif

[File: Src/Server/common/length.h.h]


#ifdef ENABLE_NEW_QA_TEST
enum ETypeBiologBonus
{
	TIME_AFFECT_BIO_1 = 60*60*24*365,
	BONUS_VALUE_BIO_1 = 30000,	// Value hp
	
};	
#endif

I am not tested,only write but it should work 100%.

Every time i want to add hp with quest,add a new affect?

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.