|
You last visited: Today at 21:39
Advertisement
[Release] Server Buffs based on Online Player Count
Discussion on [Release] Server Buffs based on Online Player Count within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.
02/23/2019, 16:53
|
#16
|
elite*gold: 0
Join Date: May 2011
Posts: 101
Received Thanks: 0
|
please help me with these errors [Imgur](  )
|
|
|
02/26/2019, 15:04
|
#17
|
elite*gold: 0
Join Date: Jul 2018
Posts: 93
Received Thanks: 59
|
Quote:
Originally Posted by campomanes25
please help me with these errors [Imgur](  )
|
Check your code on User.cpp en User.h. Misplaced lines can cause this error.
|
|
|
03/03/2019, 13:50
|
#18
|
elite*gold: 0
Join Date: Apr 2014
Posts: 193
Received Thanks: 3
|
System does not work for me. Compiled without problems, but get no buff if i reach the count.
|
|
|
04/27/2019, 11:04
|
#19
|
elite*gold: 0
Join Date: Feb 2018
Posts: 32
Received Thanks: 3
|
Hey there.
Can anyone send one line for the propItem entries ?
|
|
|
06/20/2019, 15:27
|
#20
|
elite*gold: 0
Join Date: Jul 2012
Posts: 272
Received Thanks: 16
|
Quote:
Originally Posted by TestUrSkillz
Hey there.
Can anyone send one line for the propItem entries ?
|
BUFF_ITEM
II_SYS_SYS_LS_CHEERING
|
|
|
06/21/2020, 16:23
|
#21
|
elite*gold: 0
Join Date: Mar 2014
Posts: 243
Received Thanks: 11
|
Quote:
Originally Posted by Naltalah
Edit: The consensus of the feedback so far is, that this code is very performance inefficient. If I have the time, I will rewrite the code and reupdate.
I coded this for a friend and thought why not share it with everyone.
Disclaimer: I'm still kind of new to coding, so if you have any suggestions on how to improve the code, let me know <3
I won't be adding a guide on how to create the items that are used as the a buff, there are enough guides on that out there.
ProjectCmn.cpp
before
PHP Code:
BOOL CProject::LoadJobItem(LPCTSTR lpszFilename)
add
PHP Code:
#ifdef __SYS_ONLINECOUNT_BUFFS BOOL CProject::LoadOnlineCountFile(LPCTSTR lpszFilename) { CScript script; if (script.Load(lpszFilename) == FALSE) return FALSE; script.GetToken(); int nOnlineCount; DWORD dwBuffId; while (script.tok != FINISHED) { dwBuffId = atoi(script.Token); nOnlineCount = script.GetNumber(); script.GetToken(); m_aOnlineCountBuffs.insert(make_pair(nOnlineCount, dwBuffId)); } return TRUE; } #endif // __SYS_ONLINECOUNT_BUFFS
Project.cpp
after:
PHP Code:
CTitleManager::Instance()->LoadTitle("honorList.txt");
add
PHP Code:
#if defined(__WORLDSERVER) && defined(__SYS_ONLINECOUNT_BUFFS) LoadOnlineCountFile("onlinebuff.inc"); #endif
Project.h
after
PHP Code:
void LoadSkill();
add
PHP Code:
#ifdef __SYS_ONLINECOUNT_BUFFS #ifdef __WORLDSERVER BOOL LoadOnlineCountFile(LPCSTR lpszFilename); map<int, DWORD> m_aOnlineCountBuffs; #endif // __WORLDSERVER #endif // __SYS_ONLINECOUNT_BUFFS
User.h
after:
PHP Code:
void SendNewRandomOption( unsigned char id, DWORD dwSerialNumber, __int64 n64NewRandomOption );
add
PHP Code:
#ifdef __SYS_ONLINECOUNT_BUFFS const int GetClosestCount(); vector<int> GetValidCounts(); void RemoveOnlineBuffs(); void ApplyOnlineBuff(); #endif
User.cpp
in CUser::Process()
after
PHP Code:
if( IsLive() ) {
add
PHP Code:
#ifdef __SYS_ONLINECOUNT_BUFFS this->ApplyOnlineBuff(); #endif // __SYS_ONLINECOUNT_BUFFS
at the end of the file add this:
PHP Code:
#ifdef __SYS_ONLINECOUNT_BUFFS const int CUser::GetClosestCount() { int nNum = 0; for (auto it : prj.m_aOnlineCountBuffs) { if (g_UserMng.GetCount() >= it.first) nNum = it.first; } return nNum; } vector<int> CUser::GetValidCounts() { vector<int> nValidBuffs; for (auto it : prj.m_aOnlineCountBuffs) { if (g_UserMng.GetCount() >= it.first) nValidBuffs.push_back(it.second); }
return nValidBuffs; } void CUser::RemoveOnlineBuffs() { vector<int> nValidBuffs = GetValidCounts(); for (auto it : prj.m_aOnlineCountBuffs) { if (__SYS_ONLINECOUNT_BUFFS_MODE == 1) { auto vec_it = std::find(nValidBuffs.begin(),nValidBuffs.end(),it.second); if (HasBuff(BUFF_ITEM, it.second) && vec_it == nValidBuffs.end()) this->RemoveBuff(BUFF_ITEM, it.second); } else { if (this->HasBuff(BUFF_ITEM, it.second) && GetClosestCount() != it.first) this->RemoveBuff(BUFF_ITEM, it.second); } } } void CUser::ApplyOnlineBuff() { this->RemoveOnlineBuffs();
if (__SYS_ONLINECOUNT_BUFFS_MODE == 1) { vector<int> nValidBuffs = GetValidCounts(); for (auto it : nValidBuffs) { ItemProp* pProp = prj.GetItemProp(it); if (pProp && !HasBuff(BUFF_ITEM, it)) DoApplySkill(this, pProp, NULL); } } else { int nCount = GetClosestCount(); if (prj.m_aOnlineCountBuffs.find(nCount) == prj.m_aOnlineCountBuffs.end()) return;
ItemProp* pProp = prj.GetItemProp(prj.m_aOnlineCountBuffs.at(nCount)); if (pProp && !HasBuff(BUFF_ITEM, pProp->dwID)) DoApplySkill(this, pProp, NULL); }
} #endif // __SYS_ONLINECOUNT_BUFFS
VersionCommon.h (WorldServer)
add this:
PHP Code:
#define __SYS_ONLINECOUNT_BUFFS #ifdef __SYS_ONLINECOUNT_BUFFS #define __SYS_ONLINECOUNT_BUFFS_MODE 1 // 0 = Only highest buff will be active, 1 = All buffs will be active #endif // __SYS_ONLINECOUNT_BUFFS
Resource
You will need to create a new file called onlinebuff.inc.
It has to look like this:
PHP Code:
// dwBuffID Online Count II_ONLINEBUFF_LEVEL1 10 II_ONLINEBUFF_LEVEL2 20
First comes the ID of the buff, after that the amount of users that have to be online to apply this buff.
Please note that this does not work for multiple channels.
I also added these instruction as an attachment if you want to save it for later.
|
i do have get error in user.cpp
User.cpp
User.cpp(10140) : error C2059: syntax error : ':'
User.cpp(10141) : error C2143: syntax error : missing ';' before '{'
User.cpp(10142) : error C2228: left of '.first' must have class/struct/union type
type is 'int'
User.cpp(10143) : error C2228: left of '.first' must have class/struct/union type
type is 'int'
User.cpp(10150) : error C2143: syntax error : missing ',' before ':'
User.cpp(10151) : error C2143: syntax error : missing ';' before '{'
User.cpp(10152) : error C2228: left of '.first' must have class/struct/union type
type is 'int'
User.cpp(10153) : error C2228: left of '.second' must have class/struct/union type
type is 'int'
User.cpp(10161) : error C2143: syntax error : missing ',' before ':'
User.cpp(10162) : error C2143: syntax error : missing ';' before '{'
User.cpp(10165) : error C2228: left of '.second' must have class/struct/union type
type is 'int'
User.cpp(10165) : error C2665: 'std::find' : none of the 3 overloads can convert parameter 1 from type 'std::vector<_Ty>::iterator'
with
[
_Ty=int
]
C:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Vc7\include\algorithm(36): could be 'const char *std::find(const char *,const char *,int)'
C:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Vc7\include\algorithm(42): or 'const signed char *std::find(const signed char *,const signed char *,int)'
C:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Vc7\include\algorithm(50): or 'const unsigned char *std::find(const unsigned char *,const unsigned char *,int)'
while trying to match the argument list '<Unknown>'
with
[
_Ty=int
]
and
[
_Ty=int
]
User.cpp(10166) : error C2228: left of '.second' must have class/struct/union type
type is 'int'
User.cpp(10166) : error C2678: binary '==' : no operator found which takes a left-hand operand of type 'int' (or there is no acceptable conversion)
User.cpp(10167) : error C2228: left of '.second' must have class/struct/union type
type is 'int'
User.cpp(10171) : error C2228: left of '.second' must have class/struct/union type
type is 'int'
User.cpp(10171) : error C2228: left of '.first' must have class/struct/union type
type is 'int'
User.cpp(10172) : error C2228: left of '.second' must have class/struct/union type
type is 'int'
User.cpp(10183) : error C2143: syntax error : missing ',' before ':'
User.cpp(10184) : error C2143: syntax error : missing ';' before '{'
please help.
|
|
|
07/04/2020, 15:21
|
#22
|
elite*gold: 0
Join Date: Apr 2017
Posts: 15
Received Thanks: 1
|
Hello everybody!Help.where to define EventDrop.lua so that the server reads it, except for LuaFunc
|
|
|
01/02/2022, 05:06
|
#23
|
elite*gold: 0
Join Date: Apr 2017
Posts: 15
Received Thanks: 1
|
help please fix
1> User.cpp (11189): Warning C4244: Argument: Convert "DWORD" to "WORD", possible data loss
1> User.cpp (11190): warning C4244: argument: convert "DWORD" to "WORD", possible data loss
1> User.cpp (11194): warning C4244: argument: convert "DWORD" to "WORD", possible data loss
1> User.cpp (11195): warning C4244: argument: convert "DWORD" to "WORD", possible data loss
1> User.cpp (11220): Warning C4244: Argument: Convert "DWORD" to "WORD", possible data loss
|
|
|
 |
|
Similar Threads
|
[Release]Offset Kill Count EP 6.0 / Battlefield Rune Kill Count
02/25/2016 - Shaiya PServer Guides & Releases - 0 Replies
Closed#
|
Navicat [Err1136] - Column count doesn't match value count at row 1
02/21/2012 - Metin2 Private Server - 2 Replies
Hallöchen Liebe Com,
Als ich gerade in der Querry Table auf meinem Server die 80er Rüstungen erneut einfügen wollte, stoß ich auf diesen Fehler:
INSERT INTO `item_proto` VALUES ('12039', 'Auraplattenpanzer+9', 'Auraplattenpanzer +9', '2','0','0','2','300','1','1','0','3000','10000',' 1','90','0','0','8','4294967290','37','20','10','4 0','0','154','0','26','0','45','0','64944','127',' 65008','21631','4855','0','0','15','100','3');
1136 - Column count doesn't match value count at row 1
|
Navicat - [Err] 1136 - Column count doesn't match value count at row 1
01/14/2012 - Metin2 Private Server - 1 Replies
Hallo x(
Ich weis nicht ob ich zu doof bin ein loch in den Schnee zu pissen oder ob wirklich was falsch hier ist..
Aufjedenfall muss ich die Querry für die 12 neuen metin steine in Serverside einfügen aber jedesmal bekomme ich die meldung:
INSERT INTO mob_proto VALUES(8028, 'Metin der Hoffnung', 'Metin der Hoffnung', 5, 2, 3, 95, '', 'NOMOVE', 0, '', 'STUN,SLOW,CURSE,TERROR', 0, '', 0, 0, 0, 60, 0, 0, 0, 999999, 5, 1, 184800, 92400, 540, 57, 9529, 9530, 0, 2000, 175, 0, 0, 0, 0, 0, 0, 0,...
|
column count doesn't match value count value at row 1 fehler beheben. wie?
12/15/2011 - Metin2 Private Server - 1 Replies
Hallo Epvp ich habe bei den 1678 serverfiles von daroo diesen fehler hier column count doesn't match value count value at row 1 wenn ich etwas in die item_proto oder in die mob_proto hinzufügen will z.B wenn ich querys einfügen will kommt dieser fehler habe schon alles ausprobiert mit 6 0en hinten dran aber es klappt einfach nichts Bitte helft mir :)
Bitte helft mir :( :(
|
Daroo Files Lehrer [Err] 1136 - Column count doesn't match value count at row 1
12/08/2011 - Metin2 Private Server - 3 Replies
Hallo ,
Wollte bei den Daroo Files die LKehrer bestücken.
Manche habe ich schon doch ich habe ehrlich keine
Lust mehr bekommen. Und habe gehofft das es hier welche
Released haben. Ich habe auch 2 Themen dazu gefunden mit
den Release.
Doch wenn ich sie einfügen will kommt dieser Fehler
1136 - Column count doesn't match value count at row 1
|
All times are GMT +1. The time now is 21:40.
|
|