[MEGA RELEASE] Serverfiles complet / Sursă.[Testat si functional]

Nu recomandam folosirea lor pentru a deschide un server. Aici găsiți serverfiles din care puteți extrage foarte multe resurse.
Avatar utilizator
Cyrus
Nivel 2

Nivel 2
Mesaje: 195
Membru din: 25 Iun 2020, 15:36
Server: play-Ravensmetin2.co
Regat: Shinsoo
Aprecieri: 376  
Mulţumiri: 25  
  Rezolvări prob.: 1
 Contact:
Medalii

aia e pentru ca nu a stiut da reboot corespunzator
Avatar utilizator
thebestadam
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 240
Membru din: 08 Aug 2013, 15:26
Server: Server interzis - Spam.ro
Regat: Jinno
Aprecieri: 120  
Mulţumiri: 277  
 Contact:
Medalii

Wizz. scrie: ↑30 Iun 2019, 23:21 Serverul este stabil, îl puteți folosi cu încredere. :ymhug:
Sursa este aceea de la serenity îmbunătățită și cu foarte multe fix-uri.
Sursa game este compatibila cu gcc49

service.h sursă game.
#ifndef __INC_METIN2_COMMON_DEFINES_H__
#define __INC_METIN2_COMMON_DEFINES_H__

enum eCommonDefines {
	MAP_ALLOW_LIMIT = 64, // 32 default
};

#define ENABLE_PLAYER_PER_ACCOUNT5
#define ENABLE_PORT_SECURITY

/* SYSTEME PRINCIPALE JUCATORI*/
#define __WJ_SHOW_MOB_INFO__
#define __SEND_TARGET_INFO__
#define __SPECIAL_STORAGE__
#define __7AND8TH_SKILLS__
#define __TITLE_SYSTEM__
#define __TIMER_ELIXIR__
#define __SASH_SYSTEM__
#define __MULTI_SHOP__
#define __BIOLOG_TIME__
#define __BIOLOG_SYSTEM__
#define __CHANGE_SEX_WR__
#define __REFINE_SYSTEM__
#define __CHANGELOOK_SYSTEM__
#define __CHANGELOOK_EXTEND__
#define __EXTENDED_ITEM_NAME__
#define __EXPANDED_BOOK_NAME__
#define __WEAPON_COSTUME_SYSTEM__
#define __COSTUME_ATTR_SYSTEM__
#define __COSTUME_RING_SYSTEM__
#define __SEQUENCE_SYSTEM__
#define __SHOW_CHEST_DROP__
#define __ATTENDANCE_EVENT__
#define __ENABLE_BATTLE_FIELD__
#define __DUNGEON_INFO_SYSTEM__
#define __SKILLS_LEVEL_OVER_P__
#define __VIEW_TARGET_PLAYER_HP__
#define __VIEW_TARGET_DECIMAL_HP__


// #ifndef ENABLE_ANNOUNCEMENT_REFINE_SUCCES
	// #define ENABLE_ANNOUNCEMENT_REFINE_SUCCES
	// #define ENABLE_ANNOUNCEMENT_REFINE_SUCCES_MIN_LEVEL 9
// #endif

#define ENABLE_NEW_QUICK_SLOT_SYSTEM
//#define WJ_GUILD_LEADER_SYSTEM
#define WJ_ENABLE_PICKUP_ITEM_EFFECT
#define WJ_ENABLE_TRADABLE_ICON

#define ENABLE_CHANGE_CHANNEL
#define ENABLE_ANTIEXP_RENEWAL
#define ENABLE_SORT_INVENTORY
#define ENABLE_CUBE_RENEWAL
#define ENABLE_DICE_SYSTEM
#define ENABLE_GLOBAL_CHAT
#define ENABLE_FISH_EVENT
#define ENABLE_GEM_SYSTEM
#define ENABLE_NEWSTUFF
#define ENABLE_PET_SLOT
#define NEW_PET_SYSTEM
#define NEW_PET_SUMMON

#define ENABLE_MOUNT_COSTUME_SYSTEM
#define ENABLE_SUPPORT_SYSTEM
#define ENABLE_AGGREGATE_MONSTER_EFFECT
#define ITEM_REMAINING


/* SYSTEME PENTRU ADMINISTRARE*/
#define __WHISPER_ADMIN__
#define __ADMIN_MANAGER__


/* OFFLINE SHOPS */
#define OFFLINE_SHOP // Offline shops system
#define GIFT_SYSTEM // gift system enable
#define FULL_YANG // Enable support for yang type long long
#define SHOP_TIME_REFRESH 1*60 // time for cycle checking older shops
#define SHOP_BLOCK_GAME99 //Blocking create shops on channel 99
//#define SHOP_DISTANCE // Show shops in pos distance like WoM2
#define SHOP_AUTO_CLOSE //Enable auto closing shop after sell last item
//#define SHOP_ONLY_ALLOWED_INDEX //Enable limiting for other map index which is not defined in player.shop_limit
//#define SHOP_HIDE_NAME // Enable hidding shop npc names like "Player's shop"
#define SHOP_GM_PRIVILEGES GM_IMPLEMENTOR //Minimum GM privileges to using Shop GM Panel
#define ENABLE_OFFLINE_SHOP_HIDE
#define SHOP_SEARCH
#define SHOP_SEARCH_PRICE_MIN //Price in gui is a minimum eq. price >= item_price if is commented price in gui is a maximum
/* END OFFLINE SHOPS */

/* SYSTEME TEMNITE */
#define __VERSION_162__
#ifdef __VERSION_162__
	#define HEALING_SKILL_VNUM 265
#endif

#define __DUNGEON_FOR_GUILD__
#ifdef __DUNGEON_FOR_GUILD__
	#define __MELEY_LAIR_DUNGEON__
	#ifdef __MELEY_LAIR_DUNGEON__
		#define __DESTROY_INFINITE_STATUES_GM__
		#define __LASER_EFFECT_ON_75HP__
		#define __LASER_EFFECT_ON_50HP__
	#endif
#endif
/* END SYSTEME TEMNITE */

#endif
Câteva imagini cu sistemele implementate.
ImagineImagineImagine

Mai multe imagini click aici https://imgur.com/a/QVVvwZV
Sursă game și serverfiles complet:
Imagine
Continut: Ascuns
Trebuie sa multumesti autorului pentru a putea vedea mesajul.

Sursă client + client complet cu toate programele necesare:
Imagine
Continut: Ascuns
Trebuie sa multumesti autorului pentru a putea vedea mesajul.


GCC49 Instalare manuala cu tutorial:
Continut: Ascuns
Trebuie sa multumesti autorului pentru a putea vedea mesajul.

Rezolvare problema la fereastra de logare:
În networkmodule.py

Caută:
		if self.curPhaseWindow:
			self.curtain.FadeIn()
			self.curPhaseWindow.SetFocus()
			
Înlocuiește cu:

		if self.curPhaseWindow:
			self.curtain.FadeIn()
			# self.curPhaseWindow.SetFocus()
		else:
			app.Exit()
Spor la cât mai multe servere!

DIN DATA DE 13.12.2019: NU MAI OFER SUPPORT GRATUIT.

------------------------------------------------------------------------------------------
Cateva rezolvari din partea super moderatorului vostru preferat,Kazuhiri
------------------------------------------------------------------------------------------
1.Rezolvare negot:
Pasul 1)intrati in usr/src/vlad/files/common/service.h
Pasul 2)inainte de ultimul #endif pune :
#define __NEW_EXCHANGE_WINDOW__
Pasul 3) intrati in usr/src/vlad/filles/game/exchange.cpp si cautati:
m_pGrid = M2_NEW CGrid(4, 3);
inlocuiti cu
#ifdef __NEW_EXCHANGE_WINDOW__
	m_pGrid = M2_NEW CGrid(6, 4);
#else
	m_pGrid = M2_NEW CGrid(4, 3);
#endif
Pasul 4)intrati in usr/src/vlad/filles/game/exchange.h si cautati:
EXCHANGE_ITEM_MAX_NUM = 12,
inlocuiti cu
#ifdef __NEW_EXCHANGE_WINDOW__
	EXCHANGE_ITEM_MAX_NUM = 24,
#else
	EXCHANGE_ITEM_MAX_NUM = 12,
#endif
compilati si aia e
2.Daca apasati pe moneda dragon,aia care se invarte de jos,va da pe un item-shop,o reclama "indirecta"...
Pasul 1) intrati in fiecare config,din fiecare canal,cautati MALL_URL si puneti orice nume(de ex salampower.tk/item-shop)in cazul meu am
MALL_URL: kazu.ro/item-shop.php
Pasul 2)Reboot
3.Rezolvare gaya
Pasul 1)intrati in quest,facei un fisier numit gaya_create.lua si puneti asta
Pasul 2)scriem ./qc gaya_create.lua,intram in joc,dam un /reload q si gata.
4.Rezolvare insotitori:
Intrati in quest si creati un folder numit
-newpetstaff.quest si adaugati
-PetSystemIncubator.lua si adaugati
-PetSystems.lua si adaugati
Apoi in putty scriem ./qc newpetstaff.quest ./qc PetSystemIncubator.lua ./qc PetSystems.lua
reload q in joc si aia e
5.Nu merg unele mape
Ei bine,daca nu merg unele mape,nu va teleporteaza in ele,uitati cum rezolvati:
-intrati in sysser din ch1,si daca apare ceva de genul
cannot find map location index 73
,ne uitam dupa index,in cazul meu 73
-mergem in fiecare config din fiecare ch,iar la map Allow adaugam acest numar/index (ATENTIE,sa fie in ordine crescatoare sirul,nu puneti acel index in capat sau la inceput,puneti in asa fel in cat sa fie crescator)
Dupa ce am facut toate astea dam reboot si gata,avem mapele functionale
6.Pornirea serverului
Multi imi dati msj ca"auzi,l-ai ajutat pe ala sa porneasca sv,ma ajuti si pe mine plss?"m-am decis sa pun aici tutorial cum sa porniti sv..
Pasul 1)punem https://mega.nz/#!s5sETahQ!bbkvaCffDlq9 ... FrV8J6hSAA in usr/lib,usr/lib32 si /lib
Pasul 2)intram in fiecare config din ch+conf.txt din datebase si la BIND_ip punem ip-ul nostru
Pasul 3)intram in navicat si dam empty la urmatoarele tabele
-account
-gmlist
-player
-player_gift
-player_index
-player_shop
-player_shop_item
Pasul 4)reboot
Bafta

Fix biolog de la Kratos
https://gyazo.com/8c9e2c178ce94657be02395254c76ede
https://www67.zippyshare.com/v/aGchNqJm/file.html
salut cine imid a si mie fix-ul de la biolog , link0ul este invalid
Pentru acest mesaj, thebestadam a primit 11 (de) mulţumiri
Galatan922 • teohereth • Celodrix • xdiviner • vasilache90 • sergiudj21 • LiveMatch • discoteca12 • Rafinel • Marian [Desmond] • PikerNCA
Afișează semnătura
Avatar utilizator
Cyrus
Nivel 2

Nivel 2
Mesaje: 195
Membru din: 25 Iun 2020, 15:36
Server: play-Ravensmetin2.co
Regat: Shinsoo
Aprecieri: 376  
Mulţumiri: 25  
  Rezolvări prob.: 1
 Contact:
Medalii

Ma poate ajuta cineva sa scot skilurile Over P?
ca de bagate bine nu is bagate si nu reusesc nici cum sa ii dau de cap
Va rog
Avatar utilizator
Goldfish
Nivel 1

Nivel 1
Mesaje: 96
Membru din: 16 Dec 2019, 09:39
Aprecieri: 359  
Mulţumiri: 95  
Medalii

Cyrus scrie: ↑02 Iul 2020, 01:05 Ma poate ajuta cineva sa scot skilurile Over P?
ca de bagate bine nu is bagate si nu reusesc nici cum sa ii dau de cap
Va rog
mai bine le-ai scoate
Avatar utilizator
Cyrus
Nivel 2

Nivel 2
Mesaje: 195
Membru din: 25 Iun 2020, 15:36
Server: play-Ravensmetin2.co
Regat: Shinsoo
Aprecieri: 376  
Mulţumiri: 25  
  Rezolvări prob.: 1
 Contact:
Medalii

Vreau sa le scot , dar nu stiu cum...m am tot chinuit si nu pot, ma poti ajuta?
Avatar utilizator
Areș
Membru Club

Membru Club
Mesaje: 202
Membru din: 29 Ian 2017, 22:03
Regat: Jinno
Aprecieri: 354  
Mulţumiri: 382  
Discord: Copiază ID
Medalii

#define ENABLE_MAGIC_REDUCTION_SYSTEM
in services.h cine vrea sa activeze bonusu de la anti-magie care este deja in sursa
Metin2GH scrie: ↑30 Iun 2020, 11:08 Ma poate ajuta cineva cu problema de la mapa pvp?
Nu stiu ce poate aveam am teleportez iun ea si imi e negru ecranu
pentru harta metin2_map_duel trebuie pus in atlasinfo.txt din locale/ro/ deoarece nu este pusa si de aia apare cu negru
metin2_map_duel	844800	0	1	1
Cyrus scrie: ↑04 Iul 2020, 22:34 Vreau sa le scot , dar nu stiu cum...m am tot chinuit si nu pot, ma poti ajuta?
In sursa binary in locale_inc.h pui // inainte la #define SKILLS_OVER_P
In sursa game in services.h sau CommonDevines.h pui // inainte la #define SKILLS_OVER_P

thebestadam scrie: ↑29 Iun 2020, 13:19 salut cine imid a si mie fix-ul de la biolog , link0ul este invalid
biolog.cpp
/*********************************************************************
* title_name		: Professional Biolog System
* date_created		: 2016.08.07
* filename			: biolog.cpp
* author			: VegaS
*/
#include "stdafx.h"
#include "desc.h"
#include "utils.h"
#include "char.h"
#include "affect.h"
#include <string>
#include <algorithm>
#include <boost/algorithm/string/replace.hpp>
#include "biolog.h"
#include "biologDefines.h"

const char* pTableStringGlobal[5][10] =
{  
	{"biolog_lv30.collect_count_actual", "biolog_lv40.collect_count_actual", "biolog_lv50.collect_count_actual", "biolog_lv60.collect_count_actual", "biolog_lv70.collect_count_actual", "biolog_lv80.collect_count_actual", "biolog_lv85.collect_count_actual", "biolog_lv90.collect_count_actual", "biolog_lv92.collect_count_actual", "biolog_lv94.collect_count_actual"},{"biolog_lv30.left_time", "biolog_lv40.left_time", "biolog_lv50.left_time", "biolog_lv60.left_time", "biolog_lv70.left_time", "biolog_lv80.left_time", "biolog_lv85.left_time", "biolog_lv90.left_time", "biolog_lv92.left_time", "biolog_lv94.left_time"},{"biolog_lv30.duration_send", "biolog_lv40.duration_send", "biolog_lv50.duration_send", "biolog_lv60.duration_send", "biolog_lv70.duration_send", "biolog_lv80.duration_send", "biolog_lv85.duration_send", "biolog_lv90.duration_send", "biolog_lv92.duration_send", "biolog_lv94.duration_send"},{"biolog_lv30.completed", "biolog_lv40.completed", "biolog_lv50.completed", "biolog_lv60.completed", "biolog_lv70.completed", "biolog_lv80.completed", "biolog_lv85.completed", "biolog_lv90.completed", "biolog_lv92.completed", "biolog_lv94.completed"}		
};			

const char* pxCountTable[] =
{
	pTableStringGlobal[0][0], pTableStringGlobal[0][1], pTableStringGlobal[0][2], pTableStringGlobal[0][3], pTableStringGlobal[0][4], pTableStringGlobal[0][5], pTableStringGlobal[0][6], pTableStringGlobal[0][7], pTableStringGlobal[0][8], pTableStringGlobal[0][9]
};		

int pTableAffect[] =
{
	AFF_BIO_1, AFF_BIO_2, AFF_BIO_3, AFF_BIO_4, AFF_BIO_5, AFF_BIO_6, AFF_BIO_7, AFF_BIO_8, AFF_BIO_9, AFF_BIO_10, AFF_BIO_11, AFF_BIO_12, AFF_BIO_13, AFF_BIO_14, AFF_BIO_15, AFF_BIO_16, AFF_BIO_17, AFF_BIO_18, AFF_BIO_19, AFF_BIO_20
};


BiologManager::BiologManager()
{	
}

BiologManager::~BiologManager()
{
}
void BiologManager::RestartTime(LPCHARACTER ch)
{
	#define TIME_FOR_WAIT_TO_USE_AGAIN	0*60*60 // You can use one item once every 6 hours, that means 4 items per day.

	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};
	
	char szBuf[CHAT_MAX_LEN + 1];
	snprintf(szBuf, sizeof(szBuf), "BIOLOG.ITEM_RESTART_TIME");

	int curTime = ch->GetQuestFlag(szBuf);
	
	if (curTime && get_global_time() < curTime)
	{
		int c = curTime - get_global_time();
		int mSec = c % 60;
			c/=60;
		int mMin = c % 60;
			c/=60;
		int mHours = c % 24;
					
		ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Trebuie sa astepti [%d H] [%d M] [%d S] pentru a restarta din nou timpul la biolog.", mHours, mMin, mSec);
		return;
	}

	for (int i=0; i<=9; i++){
		for (int j=1; j<=2; j++)
			ch->SetBiologState(pTableStringGlobal[j], 0);
	}

	ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Timpul a fost inlaturat cu succes, acum poti trimite un nou obiect pentru analizare.");
	ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][0] - init_biologTime(), pTableString[0][0], pTableCountMax[0], pTableVnum[0]);instance().SendUpdate_Binary(ch);
}
/*********************************************************************
* Initialization
*/
bool BiologManager::Send_FinishedRefresh(LPCHARACTER ch)
{
	ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", 0, 0, 0, 0);
}
/*********************************************************************
* Sending message as it is, failure, success and completed.
*/							
void SendMessage(LPCHARACTER ch, const char* pType)
{
	std::string szText("");

	if (!strcmp(pType, "succes"))
		szText = pTable_Translate[0];
	
	if (!strcmp(pType, "failed"))
		szText = pTable_Translate[1];
			
	if (!strcmp(pType, "completed"))
		szText = pTable_Translate[2];
	
	boost::algorithm::replace_all(szText, " ", "$");

	char buf[512+1];
	snprintf(buf, sizeof(buf), "BINARY_Biolog_SendMessage %s", szText.c_str());
	ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
/*********************************************************************
* Send messages to the client when you finish a degree biologist with arguments reward
*/
void SendMessagePopUp(LPCHARACTER ch, const char* iRewardType, int iRewardItem, const char* iBonusName_1, int iBonusValue_1, const char* iBonusName_2, int iBonusValue_2)
{
	std::string pRewardType = iRewardType;		boost::algorithm::replace_all(pRewardType, " ", "$");
	std::string pBonusName_1 = iBonusName_1;	boost::algorithm::replace_all(pBonusName_1, " ", "$");
	std::string pBonusName_2 = iBonusName_2;	boost::algorithm::replace_all(pBonusName_2, " ", "$");
	
	char buf[2048];
	snprintf(buf, sizeof(buf), "BINARY_Biolog_PopUp %s %d %s %d %s %d", pRewardType.c_str(), (int)iRewardItem, pBonusName_1.c_str(), (int)iBonusValue_1, pBonusName_2.c_str(), (int)iBonusValue_2);
	ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
/*********************************************************************
* Send bonuses for biolog 30-90
*/
void BiologManager::SendBonusType(LPCHARACTER ch, int argument)
{
	switch (argument)
	{
		case 0:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[0], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 1:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[1], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 2:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[2], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 3:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[3], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 4:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], pPopUp[argument][2], (int)tableBonus[argument][3]);		
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[4], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[5], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			break;
		case 5:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], pPopUp[argument][2], (int)tableBonus[argument][3]);		
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[6], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[7], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			break;
		case 6:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0); 
			ch->AutoGiveItem(pTableRewardItem[argument]);								
			ch->AddAffect(pTableAffect[8], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[9], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[10], tableBonus[argument][4], tableBonus[argument][5], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[11], tableBonus[argument][6], tableBonus[argument][7], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[12], tableBonus[argument][8], tableBonus[argument][9], 0, unlimited, 0, true);
			break;
		case 7:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);		
			ch->AutoGiveItem(pTableRewardItem[argument]);									
			ch->AddAffect(pTableAffect[13], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[14], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[15], tableBonus[argument][4], tableBonus[argument][5], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[16], tableBonus[argument][6], tableBonus[argument][7], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[17], tableBonus[argument][8], tableBonus[argument][9], 0, unlimited, 0, true);
			break;	
		}
}
/*********************************************************************
* Receiving bonuses when you select the box when finished 92-94 biologist.
*/	
void BiologManager::SelectBonusType(LPCHARACTER ch, const char* iReward)
{
	int pSelectReward[] =
	{
		(ch->GetQuestFlag("biolog_lv92.reward")), (ch->GetQuestFlag("biolog_lv94.reward"))
	};
	
	if (pSelectReward[0] == 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
	{	
		if (!strcmp(iReward, "92_reward_1") && pSelectReward[0] == 0){	
			ch->AddAffect(pTableAffect[18], tableBonus[8][0], tableBonus[8][1], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][1], (int)tableBonus[8][1], "$", (int)0);
			pSelectReward[0] == 1;
		}

		if (!strcmp(iReward, "92_reward_2") && pSelectReward[0] == 0){
			ch->AddAffect(pTableAffect[18], tableBonus[8][2], tableBonus[8][3], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][2], (int)tableBonus[8][3], "$", (int)0);
			pSelectReward[0] == 1;
		}		
		if (!strcmp(iReward, "92_reward_3") && pSelectReward[0] == 0){
			ch->AddAffect(pTableAffect[18], tableBonus[8][4], tableBonus[8][5], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][3], (int)tableBonus[8][5], "$", (int)0);
			pSelectReward[0] == 1;
		}
	/*	if (pSelectReward[0] != 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
		{
			if (!strcmp(iReward, "92_reward_1")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
			if (!strcmp(iReward, "92_reward_2")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
			if (!strcmp(iReward, "92_reward_3")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
		}*/
		ch->SetBiologState("biolog_lv92.used_window", 1);
		ch->SetBiologState("biolog_lv92.reward", 1);
	}
	 if (pSelectReward[0] != 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
	{
		if (!strcmp(iReward, "92_reward_1") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "92_reward_2") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "92_reward_3") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
	}
	if (pSelectReward[1] == 0 && ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{						
		if (!strcmp(iReward, "94_reward_1")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][0], tableBonus[9][1], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][1], (int)tableBonus[9][1], "$", (int)0);	
			pSelectReward[1] == 1;
		}
				
		if (!strcmp(iReward, "94_reward_2")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][2], tableBonus[9][3], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][2], (int)tableBonus[9][3], "$", (int)0);
			pSelectReward[1] == 1;
		}
					
		if (!strcmp(iReward, "94_reward_3")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][4], tableBonus[9][5], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][3], (int)tableBonus[9][5], "$", (int)0);	
			pSelectReward[1] == 1;
		}
		ch->SetBiologState("biolog_lv94.used_window", 1);
		ch->SetBiologState("biolog_lv94.reward", 1);
	}
	if (pSelectReward[1] != 0 && ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{
		if (!strcmp(iReward, "94_reward_1") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "94_reward_2") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "94_reward_3") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
	}
}
/*********************************************************************
* Open window to select reward biologist 92-94
*/	
void BiologManager::SendWindow_SelectType(LPCHARACTER ch, int iType)
{	
	int pGetCompleted[] = {(ch->GetQuestFlag("biolog_lv92.used_window")), (ch->GetQuestFlag("biolog_lv94.used_window"))};
	
	switch (iType)
	{
		case 1:
			if (pGetCompleted[0] != 1)	
			{	
				std::string arg1 = (const char*) pPopUp[8][0];		boost::algorithm::replace_all(arg1, " ", "$");
				std::string arg2 = (const char*) pPopUp[8][1];		boost::algorithm::replace_all(arg2, " ", "$");
				std::string arg3 = (const char*) pPopUp[8][2];		boost::algorithm::replace_all(arg3, " ", "$");	
				std::string arg4 = (const char*) pPopUp[8][3];		boost::algorithm::replace_all(arg4, " ", "$");		
				
				char buf[512+1];
				snprintf(buf, sizeof(buf), "BINARY_Biolog_SelectReward %d %s %s %d %s %d %s %d", (int)1, arg1.c_str(), arg2.c_str(), (int)tableBonus[8][1], arg3.c_str(), (int)tableBonus[8][3], arg4.c_str(), (int)tableBonus[8][5]);
				ch->ChatPacket(CHAT_TYPE_COMMAND, buf);	
			}
		break;
		case 2:	
			if (pGetCompleted[1] != 1)
			{	
				std::string arg1 = (const char*) pPopUp[9][0];		boost::algorithm::replace_all(arg1, " ", "$");
				std::string arg2 = (const char*) pPopUp[9][1];		boost::algorithm::replace_all(arg2, " ", "$");
				std::string arg3 = (const char*) pPopUp[9][2];		boost::algorithm::replace_all(arg3, " ", "$");	
				std::string arg4 = (const char*) pPopUp[9][3];		boost::algorithm::replace_all(arg4, " ", "$");		
				
				char buf[512+1];
				snprintf(buf, sizeof(buf), "BINARY_Biolog_SelectReward %d %s %s %d %s %d %s %d", (int)2, arg1.c_str(), arg2.c_str(), (int)tableBonus[8][1], arg3.c_str(), (int)tableBonus[8][3], arg4.c_str(), (int)tableBonus[8][5]);
				ch->ChatPacket(CHAT_TYPE_COMMAND, buf);		
			}
		break;
	}	
}
/*********************************************************************
* Function to display the send button count.
*/	
bool SendBiolog_Data(LPCHARACTER ch, int argument)
{
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};							

	int iPass_percent = pTablePercentage[1];
	int iRandom = number(1, 100);	
	
	if (ch->GetLevel() < pTableLevel[argument])
	{
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[5], pTableLevel[argument]);
		return false;		
	}	
	
	if (init_biologTime() < pTableString[2][argument] + pTableTime[argument])
	{
		int amount = pTableString[1][argument] - init_biologTime();
		
		int secs=amount%60;
			amount/=60;
		int mins=amount%60;
			amount/=60;
		int hours=amount%24;
		int days=amount/24;

		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[3], days, hours, mins, secs);
		return false;
	}

	if (ch->CountSpecifyItem(pTableVnum[argument]) > 0)
	{	
		if (ch->CountSpecifyItem(pTablePercentage[0]) > 0)
		{
			iPass_percent = pTablePercentage[2];
			ch->RemoveSpecifyItem(pTablePercentage[0], 1);
		}
			
		if (iRandom <= iPass_percent)
		{
			if (pTableString[0][argument] < pTableCountMax[argument] - 1)
			{
				ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Felicitari itemul a fost luat cu succes!");
				ch->SetBiologState(pTableStringGlobal[0][argument], pTableString[0][argument] + 1);
				ch->SetBiologState(pTableStringGlobal[1][argument], init_biologTime() + pTableTime[argument]);
				ch->SetBiologState(pTableStringGlobal[2][argument], init_biologTime());
				ch->RemoveSpecifyItem(pTableVnum[argument], 1);
				BiologManager::instance().SendUpdate_Binary(ch);
				return false;
			}
				if (argument <= 7)
				{
					ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Felicitari, ai terminat aceasta misiune!"); 
				}
				
				ch->SetBiologState(pTableStringGlobal[0][argument], pTableString[0][argument] + 1);
				ch->SetBiologState(pTableStringGlobal[1][argument], 0);
				ch->SetBiologState(pTableStringGlobal[2][argument], 0);
				ch->SetBiologState(pTableStringGlobal[3][argument], 1);
				ch->RemoveSpecifyItem(pTableVnum[argument], 1);		
				BiologManager::instance().SendUpdate_Binary(ch);
				
				if (argument <= 7)
				{
					BiologManager::instance().SendBonusType(ch, argument); }
				
				if (argument == 8)
				{
					BiologManager::instance().SendWindow_SelectType(ch, 1); }
					
				if (argument == 9)
				{
					BiologManager::instance().SendWindow_SelectType(ch, 2);
					BiologManager::instance().Send_FinishedRefresh(ch); }
				
				return false;
		}
			ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Scuze, acest item a fost putred!"); 
			ch->RemoveSpecifyItem(pTableVnum[argument], 1);
			return false;
	}
	else
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[4]);
}	
/*********************************************************************
* Function to display the send button count. - first check after send in SendBiolog_Data
*/	
bool BiologManager::SendButton(LPCHARACTER ch)
{
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};	
	
	if (ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{ 
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[6]);
		return false;
	}

	if (pTableString[0][0] < pTableCountMax[0])
	{
		SendBiolog_Data(ch, 0);
		return false;
	}		
		
	for (int btn = 1; btn < 10; btn++)
	{	
		if (pTableString[0][btn] < pTableCountMax[btn])
		{
			SendBiolog_Data(ch, btn);
			break;
		}	
	}	
}
/*********************************************************************
* Update in binary data.
*/	
bool BiologManager::SendUpdate_Binary(LPCHARACTER ch) 
{				
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};	
	
	for (int count = 0; count < _countof(pxCountTable); count++)
	{
		if (ch->GetBiologState(pxCountTable[count]) < 1)
		{	
			BiologManager::instance().Send_FinishedRefresh(ch);
		}	
	}

	for (int grade = 0; grade < 9; grade++)
	{	
		if (ch->GetBiologState(pTableStringGlobal[3][0]) != 1)
		{
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][0] - init_biologTime(), pTableString[0][0], pTableCountMax[0], pTableVnum[0]);
		}
		
		if (ch->GetBiologState(pTableStringGlobal[3][grade]) == 1)
		{
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][grade+1] - init_biologTime(), pTableString[0][grade+1], pTableCountMax[grade+1], pTableVnum[grade+1]);
		}		
	}	
}


Afișează semnătura
Avatar utilizator
Asky
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 1472
Membru din: 08 Oct 2014, 17:32
Regat: Chunjo
Aprecieri: 98  
Mulţumiri: 4811  
Discord: Copiază ID
 Contact:
Medalii

Fix biolog.

Imagine
Afișează semnătura
Avatar utilizator
thebestadam
Ţepar / Untrusted User

Ţepar / Untrusted User
Mesaje: 240
Membru din: 08 Aug 2013, 15:26
Server: Server interzis - Spam.ro
Regat: Jinno
Aprecieri: 120  
Mulţumiri: 277  
 Contact:
Medalii

Alpha.x Wolf scrie: ↑05 Iul 2020, 00:28 #define ENABLE_MAGIC_REDUCTION_SYSTEM
in services.h cine vrea sa activeze bonusu de la anti-magie care este deja in sursa
Metin2GH scrie: ↑30 Iun 2020, 11:08 Ma poate ajuta cineva cu problema de la mapa pvp?
Nu stiu ce poate aveam am teleportez iun ea si imi e negru ecranu
pentru harta metin2_map_duel trebuie pus in atlasinfo.txt din locale/ro/ deoarece nu este pusa si de aia apare cu negru
metin2_map_duel	844800	0	1	1
Cyrus scrie: ↑04 Iul 2020, 22:34 Vreau sa le scot , dar nu stiu cum...m am tot chinuit si nu pot, ma poti ajuta?
In sursa binary in locale_inc.h pui // inainte la #define SKILLS_OVER_P
In sursa game in services.h sau CommonDevines.h pui // inainte la #define SKILLS_OVER_P

thebestadam scrie: ↑29 Iun 2020, 13:19 salut cine imid a si mie fix-ul de la biolog , link0ul este invalid
biolog.cpp
/*********************************************************************
* title_name		: Professional Biolog System
* date_created		: 2016.08.07
* filename			: biolog.cpp
* author			: VegaS
*/
#include "stdafx.h"
#include "desc.h"
#include "utils.h"
#include "char.h"
#include "affect.h"
#include <string>
#include <algorithm>
#include <boost/algorithm/string/replace.hpp>
#include "biolog.h"
#include "biologDefines.h"

const char* pTableStringGlobal[5][10] =
{  
	{"biolog_lv30.collect_count_actual", "biolog_lv40.collect_count_actual", "biolog_lv50.collect_count_actual", "biolog_lv60.collect_count_actual", "biolog_lv70.collect_count_actual", "biolog_lv80.collect_count_actual", "biolog_lv85.collect_count_actual", "biolog_lv90.collect_count_actual", "biolog_lv92.collect_count_actual", "biolog_lv94.collect_count_actual"},{"biolog_lv30.left_time", "biolog_lv40.left_time", "biolog_lv50.left_time", "biolog_lv60.left_time", "biolog_lv70.left_time", "biolog_lv80.left_time", "biolog_lv85.left_time", "biolog_lv90.left_time", "biolog_lv92.left_time", "biolog_lv94.left_time"},{"biolog_lv30.duration_send", "biolog_lv40.duration_send", "biolog_lv50.duration_send", "biolog_lv60.duration_send", "biolog_lv70.duration_send", "biolog_lv80.duration_send", "biolog_lv85.duration_send", "biolog_lv90.duration_send", "biolog_lv92.duration_send", "biolog_lv94.duration_send"},{"biolog_lv30.completed", "biolog_lv40.completed", "biolog_lv50.completed", "biolog_lv60.completed", "biolog_lv70.completed", "biolog_lv80.completed", "biolog_lv85.completed", "biolog_lv90.completed", "biolog_lv92.completed", "biolog_lv94.completed"}		
};			

const char* pxCountTable[] =
{
	pTableStringGlobal[0][0], pTableStringGlobal[0][1], pTableStringGlobal[0][2], pTableStringGlobal[0][3], pTableStringGlobal[0][4], pTableStringGlobal[0][5], pTableStringGlobal[0][6], pTableStringGlobal[0][7], pTableStringGlobal[0][8], pTableStringGlobal[0][9]
};		

int pTableAffect[] =
{
	AFF_BIO_1, AFF_BIO_2, AFF_BIO_3, AFF_BIO_4, AFF_BIO_5, AFF_BIO_6, AFF_BIO_7, AFF_BIO_8, AFF_BIO_9, AFF_BIO_10, AFF_BIO_11, AFF_BIO_12, AFF_BIO_13, AFF_BIO_14, AFF_BIO_15, AFF_BIO_16, AFF_BIO_17, AFF_BIO_18, AFF_BIO_19, AFF_BIO_20
};


BiologManager::BiologManager()
{	
}

BiologManager::~BiologManager()
{
}
void BiologManager::RestartTime(LPCHARACTER ch)
{
	#define TIME_FOR_WAIT_TO_USE_AGAIN	0*60*60 // You can use one item once every 6 hours, that means 4 items per day.

	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};
	
	char szBuf[CHAT_MAX_LEN + 1];
	snprintf(szBuf, sizeof(szBuf), "BIOLOG.ITEM_RESTART_TIME");

	int curTime = ch->GetQuestFlag(szBuf);
	
	if (curTime && get_global_time() < curTime)
	{
		int c = curTime - get_global_time();
		int mSec = c % 60;
			c/=60;
		int mMin = c % 60;
			c/=60;
		int mHours = c % 24;
					
		ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Trebuie sa astepti [%d H] [%d M] [%d S] pentru a restarta din nou timpul la biolog.", mHours, mMin, mSec);
		return;
	}

	for (int i=0; i<=9; i++){
		for (int j=1; j<=2; j++)
			ch->SetBiologState(pTableStringGlobal[j], 0);
	}

	ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Timpul a fost inlaturat cu succes, acum poti trimite un nou obiect pentru analizare.");
	ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][0] - init_biologTime(), pTableString[0][0], pTableCountMax[0], pTableVnum[0]);instance().SendUpdate_Binary(ch);
}
/*********************************************************************
* Initialization
*/
bool BiologManager::Send_FinishedRefresh(LPCHARACTER ch)
{
	ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", 0, 0, 0, 0);
}
/*********************************************************************
* Sending message as it is, failure, success and completed.
*/							
void SendMessage(LPCHARACTER ch, const char* pType)
{
	std::string szText("");

	if (!strcmp(pType, "succes"))
		szText = pTable_Translate[0];
	
	if (!strcmp(pType, "failed"))
		szText = pTable_Translate[1];
			
	if (!strcmp(pType, "completed"))
		szText = pTable_Translate[2];
	
	boost::algorithm::replace_all(szText, " ", "$");

	char buf[512+1];
	snprintf(buf, sizeof(buf), "BINARY_Biolog_SendMessage %s", szText.c_str());
	ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
/*********************************************************************
* Send messages to the client when you finish a degree biologist with arguments reward
*/
void SendMessagePopUp(LPCHARACTER ch, const char* iRewardType, int iRewardItem, const char* iBonusName_1, int iBonusValue_1, const char* iBonusName_2, int iBonusValue_2)
{
	std::string pRewardType = iRewardType;		boost::algorithm::replace_all(pRewardType, " ", "$");
	std::string pBonusName_1 = iBonusName_1;	boost::algorithm::replace_all(pBonusName_1, " ", "$");
	std::string pBonusName_2 = iBonusName_2;	boost::algorithm::replace_all(pBonusName_2, " ", "$");
	
	char buf[2048];
	snprintf(buf, sizeof(buf), "BINARY_Biolog_PopUp %s %d %s %d %s %d", pRewardType.c_str(), (int)iRewardItem, pBonusName_1.c_str(), (int)iBonusValue_1, pBonusName_2.c_str(), (int)iBonusValue_2);
	ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
/*********************************************************************
* Send bonuses for biolog 30-90
*/
void BiologManager::SendBonusType(LPCHARACTER ch, int argument)
{
	switch (argument)
	{
		case 0:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[0], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 1:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[1], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 2:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[2], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 3:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[3], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 4:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], pPopUp[argument][2], (int)tableBonus[argument][3]);		
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[4], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[5], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			break;
		case 5:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], pPopUp[argument][2], (int)tableBonus[argument][3]);		
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[6], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[7], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			break;
		case 6:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0); 
			ch->AutoGiveItem(pTableRewardItem[argument]);								
			ch->AddAffect(pTableAffect[8], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[9], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[10], tableBonus[argument][4], tableBonus[argument][5], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[11], tableBonus[argument][6], tableBonus[argument][7], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[12], tableBonus[argument][8], tableBonus[argument][9], 0, unlimited, 0, true);
			break;
		case 7:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);		
			ch->AutoGiveItem(pTableRewardItem[argument]);									
			ch->AddAffect(pTableAffect[13], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[14], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[15], tableBonus[argument][4], tableBonus[argument][5], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[16], tableBonus[argument][6], tableBonus[argument][7], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[17], tableBonus[argument][8], tableBonus[argument][9], 0, unlimited, 0, true);
			break;	
		}
}
/*********************************************************************
* Receiving bonuses when you select the box when finished 92-94 biologist.
*/	
void BiologManager::SelectBonusType(LPCHARACTER ch, const char* iReward)
{
	int pSelectReward[] =
	{
		(ch->GetQuestFlag("biolog_lv92.reward")), (ch->GetQuestFlag("biolog_lv94.reward"))
	};
	
	if (pSelectReward[0] == 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
	{	
		if (!strcmp(iReward, "92_reward_1") && pSelectReward[0] == 0){	
			ch->AddAffect(pTableAffect[18], tableBonus[8][0], tableBonus[8][1], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][1], (int)tableBonus[8][1], "$", (int)0);
			pSelectReward[0] == 1;
		}

		if (!strcmp(iReward, "92_reward_2") && pSelectReward[0] == 0){
			ch->AddAffect(pTableAffect[18], tableBonus[8][2], tableBonus[8][3], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][2], (int)tableBonus[8][3], "$", (int)0);
			pSelectReward[0] == 1;
		}		
		if (!strcmp(iReward, "92_reward_3") && pSelectReward[0] == 0){
			ch->AddAffect(pTableAffect[18], tableBonus[8][4], tableBonus[8][5], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][3], (int)tableBonus[8][5], "$", (int)0);
			pSelectReward[0] == 1;
		}
	/*	if (pSelectReward[0] != 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
		{
			if (!strcmp(iReward, "92_reward_1")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
			if (!strcmp(iReward, "92_reward_2")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
			if (!strcmp(iReward, "92_reward_3")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
		}*/
		ch->SetBiologState("biolog_lv92.used_window", 1);
		ch->SetBiologState("biolog_lv92.reward", 1);
	}
	 if (pSelectReward[0] != 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
	{
		if (!strcmp(iReward, "92_reward_1") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "92_reward_2") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "92_reward_3") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
	}
	if (pSelectReward[1] == 0 && ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{						
		if (!strcmp(iReward, "94_reward_1")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][0], tableBonus[9][1], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][1], (int)tableBonus[9][1], "$", (int)0);	
			pSelectReward[1] == 1;
		}
				
		if (!strcmp(iReward, "94_reward_2")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][2], tableBonus[9][3], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][2], (int)tableBonus[9][3], "$", (int)0);
			pSelectReward[1] == 1;
		}
					
		if (!strcmp(iReward, "94_reward_3")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][4], tableBonus[9][5], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][3], (int)tableBonus[9][5], "$", (int)0);	
			pSelectReward[1] == 1;
		}
		ch->SetBiologState("biolog_lv94.used_window", 1);
		ch->SetBiologState("biolog_lv94.reward", 1);
	}
	if (pSelectReward[1] != 0 && ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{
		if (!strcmp(iReward, "94_reward_1") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "94_reward_2") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "94_reward_3") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
	}
}
/*********************************************************************
* Open window to select reward biologist 92-94
*/	
void BiologManager::SendWindow_SelectType(LPCHARACTER ch, int iType)
{	
	int pGetCompleted[] = {(ch->GetQuestFlag("biolog_lv92.used_window")), (ch->GetQuestFlag("biolog_lv94.used_window"))};
	
	switch (iType)
	{
		case 1:
			if (pGetCompleted[0] != 1)	
			{	
				std::string arg1 = (const char*) pPopUp[8][0];		boost::algorithm::replace_all(arg1, " ", "$");
				std::string arg2 = (const char*) pPopUp[8][1];		boost::algorithm::replace_all(arg2, " ", "$");
				std::string arg3 = (const char*) pPopUp[8][2];		boost::algorithm::replace_all(arg3, " ", "$");	
				std::string arg4 = (const char*) pPopUp[8][3];		boost::algorithm::replace_all(arg4, " ", "$");		
				
				char buf[512+1];
				snprintf(buf, sizeof(buf), "BINARY_Biolog_SelectReward %d %s %s %d %s %d %s %d", (int)1, arg1.c_str(), arg2.c_str(), (int)tableBonus[8][1], arg3.c_str(), (int)tableBonus[8][3], arg4.c_str(), (int)tableBonus[8][5]);
				ch->ChatPacket(CHAT_TYPE_COMMAND, buf);	
			}
		break;
		case 2:	
			if (pGetCompleted[1] != 1)
			{	
				std::string arg1 = (const char*) pPopUp[9][0];		boost::algorithm::replace_all(arg1, " ", "$");
				std::string arg2 = (const char*) pPopUp[9][1];		boost::algorithm::replace_all(arg2, " ", "$");
				std::string arg3 = (const char*) pPopUp[9][2];		boost::algorithm::replace_all(arg3, " ", "$");	
				std::string arg4 = (const char*) pPopUp[9][3];		boost::algorithm::replace_all(arg4, " ", "$");		
				
				char buf[512+1];
				snprintf(buf, sizeof(buf), "BINARY_Biolog_SelectReward %d %s %s %d %s %d %s %d", (int)2, arg1.c_str(), arg2.c_str(), (int)tableBonus[8][1], arg3.c_str(), (int)tableBonus[8][3], arg4.c_str(), (int)tableBonus[8][5]);
				ch->ChatPacket(CHAT_TYPE_COMMAND, buf);		
			}
		break;
	}	
}
/*********************************************************************
* Function to display the send button count.
*/	
bool SendBiolog_Data(LPCHARACTER ch, int argument)
{
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};							

	int iPass_percent = pTablePercentage[1];
	int iRandom = number(1, 100);	
	
	if (ch->GetLevel() < pTableLevel[argument])
	{
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[5], pTableLevel[argument]);
		return false;		
	}	
	
	if (init_biologTime() < pTableString[2][argument] + pTableTime[argument])
	{
		int amount = pTableString[1][argument] - init_biologTime();
		
		int secs=amount%60;
			amount/=60;
		int mins=amount%60;
			amount/=60;
		int hours=amount%24;
		int days=amount/24;

		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[3], days, hours, mins, secs);
		return false;
	}

	if (ch->CountSpecifyItem(pTableVnum[argument]) > 0)
	{	
		if (ch->CountSpecifyItem(pTablePercentage[0]) > 0)
		{
			iPass_percent = pTablePercentage[2];
			ch->RemoveSpecifyItem(pTablePercentage[0], 1);
		}
			
		if (iRandom <= iPass_percent)
		{
			if (pTableString[0][argument] < pTableCountMax[argument] - 1)
			{
				ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Felicitari itemul a fost luat cu succes!");
				ch->SetBiologState(pTableStringGlobal[0][argument], pTableString[0][argument] + 1);
				ch->SetBiologState(pTableStringGlobal[1][argument], init_biologTime() + pTableTime[argument]);
				ch->SetBiologState(pTableStringGlobal[2][argument], init_biologTime());
				ch->RemoveSpecifyItem(pTableVnum[argument], 1);
				BiologManager::instance().SendUpdate_Binary(ch);
				return false;
			}
				if (argument <= 7)
				{
					ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Felicitari, ai terminat aceasta misiune!"); 
				}
				
				ch->SetBiologState(pTableStringGlobal[0][argument], pTableString[0][argument] + 1);
				ch->SetBiologState(pTableStringGlobal[1][argument], 0);
				ch->SetBiologState(pTableStringGlobal[2][argument], 0);
				ch->SetBiologState(pTableStringGlobal[3][argument], 1);
				ch->RemoveSpecifyItem(pTableVnum[argument], 1);		
				BiologManager::instance().SendUpdate_Binary(ch);
				
				if (argument <= 7)
				{
					BiologManager::instance().SendBonusType(ch, argument); }
				
				if (argument == 8)
				{
					BiologManager::instance().SendWindow_SelectType(ch, 1); }
					
				if (argument == 9)
				{
					BiologManager::instance().SendWindow_SelectType(ch, 2);
					BiologManager::instance().Send_FinishedRefresh(ch); }
				
				return false;
		}
			ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Scuze, acest item a fost putred!"); 
			ch->RemoveSpecifyItem(pTableVnum[argument], 1);
			return false;
	}
	else
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[4]);
}	
/*********************************************************************
* Function to display the send button count. - first check after send in SendBiolog_Data
*/	
bool BiologManager::SendButton(LPCHARACTER ch)
{
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};	
	
	if (ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{ 
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[6]);
		return false;
	}

	if (pTableString[0][0] < pTableCountMax[0])
	{
		SendBiolog_Data(ch, 0);
		return false;
	}		
		
	for (int btn = 1; btn < 10; btn++)
	{	
		if (pTableString[0][btn] < pTableCountMax[btn])
		{
			SendBiolog_Data(ch, btn);
			break;
		}	
	}	
}
/*********************************************************************
* Update in binary data.
*/	
bool BiologManager::SendUpdate_Binary(LPCHARACTER ch) 
{				
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};	
	
	for (int count = 0; count < _countof(pxCountTable); count++)
	{
		if (ch->GetBiologState(pxCountTable[count]) < 1)
		{	
			BiologManager::instance().Send_FinishedRefresh(ch);
		}	
	}

	for (int grade = 0; grade < 9; grade++)
	{	
		if (ch->GetBiologState(pTableStringGlobal[3][0]) != 1)
		{
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][0] - init_biologTime(), pTableString[0][0], pTableCountMax[0], pTableVnum[0]);
		}
		
		if (ch->GetBiologState(pTableStringGlobal[3][grade]) == 1)
		{
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][grade+1] - init_biologTime(), pTableString[0][grade+1], pTableCountMax[grade+1], pTableVnum[grade+1]);
		}		
	}	
}




salut , SKILLS_OVER_P sunt skill L nu? imi poti spune te rog ce probleme au pe scurt?
Afișează semnătura
Avatar utilizator
Areș
Membru Club

Membru Club
Mesaje: 202
Membru din: 29 Ian 2017, 22:03
Regat: Jinno
Aprecieri: 354  
Mulţumiri: 382  
Discord: Copiază ID
Medalii

thebestadam scrie: ↑05 Iul 2020, 03:40
Alpha.x Wolf scrie: ↑05 Iul 2020, 00:28 #define ENABLE_MAGIC_REDUCTION_SYSTEM
in services.h cine vrea sa activeze bonusu de la anti-magie care este deja in sursa
Metin2GH scrie: ↑30 Iun 2020, 11:08 Ma poate ajuta cineva cu problema de la mapa pvp?
Nu stiu ce poate aveam am teleportez iun ea si imi e negru ecranu
pentru harta metin2_map_duel trebuie pus in atlasinfo.txt din locale/ro/ deoarece nu este pusa si de aia apare cu negru
metin2_map_duel	844800	0	1	1
Cyrus scrie: ↑04 Iul 2020, 22:34 Vreau sa le scot , dar nu stiu cum...m am tot chinuit si nu pot, ma poti ajuta?
In sursa binary in locale_inc.h pui // inainte la #define SKILLS_OVER_P
In sursa game in services.h sau CommonDevines.h pui // inainte la #define SKILLS_OVER_P

thebestadam scrie: ↑29 Iun 2020, 13:19 salut cine imid a si mie fix-ul de la biolog , link0ul este invalid
biolog.cpp
/*********************************************************************
* title_name		: Professional Biolog System
* date_created		: 2016.08.07
* filename			: biolog.cpp
* author			: VegaS
*/
#include "stdafx.h"
#include "desc.h"
#include "utils.h"
#include "char.h"
#include "affect.h"
#include <string>
#include <algorithm>
#include <boost/algorithm/string/replace.hpp>
#include "biolog.h"
#include "biologDefines.h"

const char* pTableStringGlobal[5][10] =
{  
	{"biolog_lv30.collect_count_actual", "biolog_lv40.collect_count_actual", "biolog_lv50.collect_count_actual", "biolog_lv60.collect_count_actual", "biolog_lv70.collect_count_actual", "biolog_lv80.collect_count_actual", "biolog_lv85.collect_count_actual", "biolog_lv90.collect_count_actual", "biolog_lv92.collect_count_actual", "biolog_lv94.collect_count_actual"},{"biolog_lv30.left_time", "biolog_lv40.left_time", "biolog_lv50.left_time", "biolog_lv60.left_time", "biolog_lv70.left_time", "biolog_lv80.left_time", "biolog_lv85.left_time", "biolog_lv90.left_time", "biolog_lv92.left_time", "biolog_lv94.left_time"},{"biolog_lv30.duration_send", "biolog_lv40.duration_send", "biolog_lv50.duration_send", "biolog_lv60.duration_send", "biolog_lv70.duration_send", "biolog_lv80.duration_send", "biolog_lv85.duration_send", "biolog_lv90.duration_send", "biolog_lv92.duration_send", "biolog_lv94.duration_send"},{"biolog_lv30.completed", "biolog_lv40.completed", "biolog_lv50.completed", "biolog_lv60.completed", "biolog_lv70.completed", "biolog_lv80.completed", "biolog_lv85.completed", "biolog_lv90.completed", "biolog_lv92.completed", "biolog_lv94.completed"}		
};			

const char* pxCountTable[] =
{
	pTableStringGlobal[0][0], pTableStringGlobal[0][1], pTableStringGlobal[0][2], pTableStringGlobal[0][3], pTableStringGlobal[0][4], pTableStringGlobal[0][5], pTableStringGlobal[0][6], pTableStringGlobal[0][7], pTableStringGlobal[0][8], pTableStringGlobal[0][9]
};		

int pTableAffect[] =
{
	AFF_BIO_1, AFF_BIO_2, AFF_BIO_3, AFF_BIO_4, AFF_BIO_5, AFF_BIO_6, AFF_BIO_7, AFF_BIO_8, AFF_BIO_9, AFF_BIO_10, AFF_BIO_11, AFF_BIO_12, AFF_BIO_13, AFF_BIO_14, AFF_BIO_15, AFF_BIO_16, AFF_BIO_17, AFF_BIO_18, AFF_BIO_19, AFF_BIO_20
};


BiologManager::BiologManager()
{	
}

BiologManager::~BiologManager()
{
}
void BiologManager::RestartTime(LPCHARACTER ch)
{
	#define TIME_FOR_WAIT_TO_USE_AGAIN	0*60*60 // You can use one item once every 6 hours, that means 4 items per day.

	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};
	
	char szBuf[CHAT_MAX_LEN + 1];
	snprintf(szBuf, sizeof(szBuf), "BIOLOG.ITEM_RESTART_TIME");

	int curTime = ch->GetQuestFlag(szBuf);
	
	if (curTime && get_global_time() < curTime)
	{
		int c = curTime - get_global_time();
		int mSec = c % 60;
			c/=60;
		int mMin = c % 60;
			c/=60;
		int mHours = c % 24;
					
		ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Trebuie sa astepti [%d H] [%d M] [%d S] pentru a restarta din nou timpul la biolog.", mHours, mMin, mSec);
		return;
	}

	for (int i=0; i<=9; i++){
		for (int j=1; j<=2; j++)
			ch->SetBiologState(pTableStringGlobal[j], 0);
	}

	ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Timpul a fost inlaturat cu succes, acum poti trimite un nou obiect pentru analizare.");
	ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][0] - init_biologTime(), pTableString[0][0], pTableCountMax[0], pTableVnum[0]);instance().SendUpdate_Binary(ch);
}
/*********************************************************************
* Initialization
*/
bool BiologManager::Send_FinishedRefresh(LPCHARACTER ch)
{
	ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", 0, 0, 0, 0);
}
/*********************************************************************
* Sending message as it is, failure, success and completed.
*/							
void SendMessage(LPCHARACTER ch, const char* pType)
{
	std::string szText("");

	if (!strcmp(pType, "succes"))
		szText = pTable_Translate[0];
	
	if (!strcmp(pType, "failed"))
		szText = pTable_Translate[1];
			
	if (!strcmp(pType, "completed"))
		szText = pTable_Translate[2];
	
	boost::algorithm::replace_all(szText, " ", "$");

	char buf[512+1];
	snprintf(buf, sizeof(buf), "BINARY_Biolog_SendMessage %s", szText.c_str());
	ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
/*********************************************************************
* Send messages to the client when you finish a degree biologist with arguments reward
*/
void SendMessagePopUp(LPCHARACTER ch, const char* iRewardType, int iRewardItem, const char* iBonusName_1, int iBonusValue_1, const char* iBonusName_2, int iBonusValue_2)
{
	std::string pRewardType = iRewardType;		boost::algorithm::replace_all(pRewardType, " ", "$");
	std::string pBonusName_1 = iBonusName_1;	boost::algorithm::replace_all(pBonusName_1, " ", "$");
	std::string pBonusName_2 = iBonusName_2;	boost::algorithm::replace_all(pBonusName_2, " ", "$");
	
	char buf[2048];
	snprintf(buf, sizeof(buf), "BINARY_Biolog_PopUp %s %d %s %d %s %d", pRewardType.c_str(), (int)iRewardItem, pBonusName_1.c_str(), (int)iBonusValue_1, pBonusName_2.c_str(), (int)iBonusValue_2);
	ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
}
/*********************************************************************
* Send bonuses for biolog 30-90
*/
void BiologManager::SendBonusType(LPCHARACTER ch, int argument)
{
	switch (argument)
	{
		case 0:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[0], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 1:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[1], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 2:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[2], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 3:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[3], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			break;
		case 4:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], pPopUp[argument][2], (int)tableBonus[argument][3]);		
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[4], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[5], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			break;
		case 5:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], pPopUp[argument][2], (int)tableBonus[argument][3]);		
			ch->AutoGiveItem(pTableRewardItem[argument]);	
			ch->AddAffect(pTableAffect[6], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[7], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			break;
		case 6:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0); 
			ch->AutoGiveItem(pTableRewardItem[argument]);								
			ch->AddAffect(pTableAffect[8], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[9], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[10], tableBonus[argument][4], tableBonus[argument][5], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[11], tableBonus[argument][6], tableBonus[argument][7], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[12], tableBonus[argument][8], tableBonus[argument][9], 0, unlimited, 0, true);
			break;
		case 7:
			SendMessagePopUp(ch, pPopUp[argument][0], (int)pTableRewardItem[argument], pPopUp[argument][1], (int)tableBonus[argument][1], "$", (int)0);		
			ch->AutoGiveItem(pTableRewardItem[argument]);									
			ch->AddAffect(pTableAffect[13], tableBonus[argument][0], tableBonus[argument][1], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[14], tableBonus[argument][2], tableBonus[argument][3], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[15], tableBonus[argument][4], tableBonus[argument][5], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[16], tableBonus[argument][6], tableBonus[argument][7], 0, unlimited, 0, true);
			ch->AddAffect(pTableAffect[17], tableBonus[argument][8], tableBonus[argument][9], 0, unlimited, 0, true);
			break;	
		}
}
/*********************************************************************
* Receiving bonuses when you select the box when finished 92-94 biologist.
*/	
void BiologManager::SelectBonusType(LPCHARACTER ch, const char* iReward)
{
	int pSelectReward[] =
	{
		(ch->GetQuestFlag("biolog_lv92.reward")), (ch->GetQuestFlag("biolog_lv94.reward"))
	};
	
	if (pSelectReward[0] == 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
	{	
		if (!strcmp(iReward, "92_reward_1") && pSelectReward[0] == 0){	
			ch->AddAffect(pTableAffect[18], tableBonus[8][0], tableBonus[8][1], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][1], (int)tableBonus[8][1], "$", (int)0);
			pSelectReward[0] == 1;
		}

		if (!strcmp(iReward, "92_reward_2") && pSelectReward[0] == 0){
			ch->AddAffect(pTableAffect[18], tableBonus[8][2], tableBonus[8][3], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][2], (int)tableBonus[8][3], "$", (int)0);
			pSelectReward[0] == 1;
		}		
		if (!strcmp(iReward, "92_reward_3") && pSelectReward[0] == 0){
			ch->AddAffect(pTableAffect[18], tableBonus[8][4], tableBonus[8][5], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[8][0], (int)pTableRewardItem[8], pPopUp[8][3], (int)tableBonus[8][5], "$", (int)0);
			pSelectReward[0] == 1;
		}
	/*	if (pSelectReward[0] != 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
		{
			if (!strcmp(iReward, "92_reward_1")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
			if (!strcmp(iReward, "92_reward_2")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
			if (!strcmp(iReward, "92_reward_3")){
				return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Test.");
			}
		}*/
		ch->SetBiologState("biolog_lv92.used_window", 1);
		ch->SetBiologState("biolog_lv92.reward", 1);
	}
	 if (pSelectReward[0] != 0 && ch->GetBiologState(pTableStringGlobal[3][8]) == 1)
	{
		if (!strcmp(iReward, "92_reward_1") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "92_reward_2") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "92_reward_3") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
	}
	if (pSelectReward[1] == 0 && ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{						
		if (!strcmp(iReward, "94_reward_1")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][0], tableBonus[9][1], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][1], (int)tableBonus[9][1], "$", (int)0);	
			pSelectReward[1] == 1;
		}
				
		if (!strcmp(iReward, "94_reward_2")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][2], tableBonus[9][3], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][2], (int)tableBonus[9][3], "$", (int)0);
			pSelectReward[1] == 1;
		}
					
		if (!strcmp(iReward, "94_reward_3")){	
			ch->AddAffect(pTableAffect[19], tableBonus[9][4], tableBonus[9][5], 0, unlimited, 0, true);
			SendMessagePopUp(ch, pPopUp[9][0], (int)pTableRewardItem[9], pPopUp[9][3], (int)tableBonus[9][5], "$", (int)0);	
			pSelectReward[1] == 1;
		}
		ch->SetBiologState("biolog_lv94.used_window", 1);
		ch->SetBiologState("biolog_lv94.reward", 1);
	}
	if (pSelectReward[1] != 0 && ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{
		if (!strcmp(iReward, "94_reward_1") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "94_reward_2") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
		if (!strcmp(iReward, "94_reward_3") && pSelectReward[0] != 0){
			return ch->ChatPacket(CHAT_TYPE_INFO, "<Biolog> Teapa, dc incerci buguri?.");
		}
	}
}
/*********************************************************************
* Open window to select reward biologist 92-94
*/	
void BiologManager::SendWindow_SelectType(LPCHARACTER ch, int iType)
{	
	int pGetCompleted[] = {(ch->GetQuestFlag("biolog_lv92.used_window")), (ch->GetQuestFlag("biolog_lv94.used_window"))};
	
	switch (iType)
	{
		case 1:
			if (pGetCompleted[0] != 1)	
			{	
				std::string arg1 = (const char*) pPopUp[8][0];		boost::algorithm::replace_all(arg1, " ", "$");
				std::string arg2 = (const char*) pPopUp[8][1];		boost::algorithm::replace_all(arg2, " ", "$");
				std::string arg3 = (const char*) pPopUp[8][2];		boost::algorithm::replace_all(arg3, " ", "$");	
				std::string arg4 = (const char*) pPopUp[8][3];		boost::algorithm::replace_all(arg4, " ", "$");		
				
				char buf[512+1];
				snprintf(buf, sizeof(buf), "BINARY_Biolog_SelectReward %d %s %s %d %s %d %s %d", (int)1, arg1.c_str(), arg2.c_str(), (int)tableBonus[8][1], arg3.c_str(), (int)tableBonus[8][3], arg4.c_str(), (int)tableBonus[8][5]);
				ch->ChatPacket(CHAT_TYPE_COMMAND, buf);	
			}
		break;
		case 2:	
			if (pGetCompleted[1] != 1)
			{	
				std::string arg1 = (const char*) pPopUp[9][0];		boost::algorithm::replace_all(arg1, " ", "$");
				std::string arg2 = (const char*) pPopUp[9][1];		boost::algorithm::replace_all(arg2, " ", "$");
				std::string arg3 = (const char*) pPopUp[9][2];		boost::algorithm::replace_all(arg3, " ", "$");	
				std::string arg4 = (const char*) pPopUp[9][3];		boost::algorithm::replace_all(arg4, " ", "$");		
				
				char buf[512+1];
				snprintf(buf, sizeof(buf), "BINARY_Biolog_SelectReward %d %s %s %d %s %d %s %d", (int)2, arg1.c_str(), arg2.c_str(), (int)tableBonus[8][1], arg3.c_str(), (int)tableBonus[8][3], arg4.c_str(), (int)tableBonus[8][5]);
				ch->ChatPacket(CHAT_TYPE_COMMAND, buf);		
			}
		break;
	}	
}
/*********************************************************************
* Function to display the send button count.
*/	
bool SendBiolog_Data(LPCHARACTER ch, int argument)
{
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};							

	int iPass_percent = pTablePercentage[1];
	int iRandom = number(1, 100);	
	
	if (ch->GetLevel() < pTableLevel[argument])
	{
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[5], pTableLevel[argument]);
		return false;		
	}	
	
	if (init_biologTime() < pTableString[2][argument] + pTableTime[argument])
	{
		int amount = pTableString[1][argument] - init_biologTime();
		
		int secs=amount%60;
			amount/=60;
		int mins=amount%60;
			amount/=60;
		int hours=amount%24;
		int days=amount/24;

		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[3], days, hours, mins, secs);
		return false;
	}

	if (ch->CountSpecifyItem(pTableVnum[argument]) > 0)
	{	
		if (ch->CountSpecifyItem(pTablePercentage[0]) > 0)
		{
			iPass_percent = pTablePercentage[2];
			ch->RemoveSpecifyItem(pTablePercentage[0], 1);
		}
			
		if (iRandom <= iPass_percent)
		{
			if (pTableString[0][argument] < pTableCountMax[argument] - 1)
			{
				ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Felicitari itemul a fost luat cu succes!");
				ch->SetBiologState(pTableStringGlobal[0][argument], pTableString[0][argument] + 1);
				ch->SetBiologState(pTableStringGlobal[1][argument], init_biologTime() + pTableTime[argument]);
				ch->SetBiologState(pTableStringGlobal[2][argument], init_biologTime());
				ch->RemoveSpecifyItem(pTableVnum[argument], 1);
				BiologManager::instance().SendUpdate_Binary(ch);
				return false;
			}
				if (argument <= 7)
				{
					ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Felicitari, ai terminat aceasta misiune!"); 
				}
				
				ch->SetBiologState(pTableStringGlobal[0][argument], pTableString[0][argument] + 1);
				ch->SetBiologState(pTableStringGlobal[1][argument], 0);
				ch->SetBiologState(pTableStringGlobal[2][argument], 0);
				ch->SetBiologState(pTableStringGlobal[3][argument], 1);
				ch->RemoveSpecifyItem(pTableVnum[argument], 1);		
				BiologManager::instance().SendUpdate_Binary(ch);
				
				if (argument <= 7)
				{
					BiologManager::instance().SendBonusType(ch, argument); }
				
				if (argument == 8)
				{
					BiologManager::instance().SendWindow_SelectType(ch, 1); }
					
				if (argument == 9)
				{
					BiologManager::instance().SendWindow_SelectType(ch, 2);
					BiologManager::instance().Send_FinishedRefresh(ch); }
				
				return false;
		}
			ch->ChatPacket(CHAT_TYPE_INFO, "[Biolog] Scuze, acest item a fost putred!"); 
			ch->RemoveSpecifyItem(pTableVnum[argument], 1);
			return false;
	}
	else
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[4]);
}	
/*********************************************************************
* Function to display the send button count. - first check after send in SendBiolog_Data
*/	
bool BiologManager::SendButton(LPCHARACTER ch)
{
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};	
	
	if (ch->GetBiologState(pTableStringGlobal[3][9]) == 1)
	{ 
		ch->ChatPacket(CHAT_TYPE_NOTICE, pTable_Translate[6]);
		return false;
	}

	if (pTableString[0][0] < pTableCountMax[0])
	{
		SendBiolog_Data(ch, 0);
		return false;
	}		
		
	for (int btn = 1; btn < 10; btn++)
	{	
		if (pTableString[0][btn] < pTableCountMax[btn])
		{
			SendBiolog_Data(ch, btn);
			break;
		}	
	}	
}
/*********************************************************************
* Update in binary data.
*/	
bool BiologManager::SendUpdate_Binary(LPCHARACTER ch) 
{				
	int pTableString[3][10] =
	{
		{(ch->GetBiologState(pTableStringGlobal[0][0])), (ch->GetBiologState(pTableStringGlobal[0][1])), (ch->GetBiologState(pTableStringGlobal[0][2])),(ch->GetBiologState(pTableStringGlobal[0][3])), (ch->GetBiologState(pTableStringGlobal[0][4])), (ch->GetBiologState(pTableStringGlobal[0][5])),(ch->GetBiologState(pTableStringGlobal[0][6])), (ch->GetBiologState(pTableStringGlobal[0][7])),(ch->GetBiologState(pTableStringGlobal[0][8])), (ch->GetBiologState(pTableStringGlobal[0][9]))}, {(ch->GetBiologState(pTableStringGlobal[1][0])), (ch->GetBiologState(pTableStringGlobal[1][1])), (ch->GetBiologState(pTableStringGlobal[1][2])),(ch->GetBiologState(pTableStringGlobal[1][3])), (ch->GetBiologState(pTableStringGlobal[1][4])), (ch->GetBiologState(pTableStringGlobal[1][5])),(ch->GetBiologState(pTableStringGlobal[1][6])), (ch->GetBiologState(pTableStringGlobal[1][7])),(ch->GetBiologState(pTableStringGlobal[1][8])), (ch->GetBiologState(pTableStringGlobal[1][9]))}, {(ch->GetBiologState(pTableStringGlobal[2][0])), (ch->GetBiologState(pTableStringGlobal[2][1])), (ch->GetBiologState(pTableStringGlobal[2][2])),(ch->GetBiologState(pTableStringGlobal[2][3])), (ch->GetBiologState(pTableStringGlobal[2][4])), (ch->GetBiologState(pTableStringGlobal[2][5])),(ch->GetBiologState(pTableStringGlobal[2][6])), (ch->GetBiologState(pTableStringGlobal[2][7])),(ch->GetBiologState(pTableStringGlobal[2][8])), (ch->GetBiologState(pTableStringGlobal[2][9]))}
	};	
	
	for (int count = 0; count < _countof(pxCountTable); count++)
	{
		if (ch->GetBiologState(pxCountTable[count]) < 1)
		{	
			BiologManager::instance().Send_FinishedRefresh(ch);
		}	
	}

	for (int grade = 0; grade < 9; grade++)
	{	
		if (ch->GetBiologState(pTableStringGlobal[3][0]) != 1)
		{
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][0] - init_biologTime(), pTableString[0][0], pTableCountMax[0], pTableVnum[0]);
		}
		
		if (ch->GetBiologState(pTableStringGlobal[3][grade]) == 1)
		{
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Biolog_Update %d %d %d %d", pTableString[1][grade+1] - init_biologTime(), pTableString[0][grade+1], pTableCountMax[grade+1], pTableVnum[grade+1]);
		}		
	}	
}




salut , SKILLS_OVER_P sunt skill L nu? imi poti spune te rog ce probleme au pe scurt?


salut, nu am spus ca au probleme, eu le-am folosit de la bun inceput si chiar n-am avut probleme cu ele, atata tot ca au fost necesare niste balansari.. din moment ce spre exemplu la sura ii creste furtul de viata la 24% la full... trebuie echilibrat putin si la partea de damage pe scurt deoarece creste puterea tuturor claselor... in schimb sistemul functioneaza perfect n-am avut problm cu el
Afișează semnătura
Avatar utilizator
Cyrus
Nivel 2

Nivel 2
Mesaje: 195
Membru din: 25 Iun 2020, 15:36
Server: play-Ravensmetin2.co
Regat: Shinsoo
Aprecieri: 376  
Mulţumiri: 25  
  Rezolvări prob.: 1
 Contact:
Medalii

Numai eu am problema asta?
Imagine
Nu am umblat prin skill desk si alea din locale
Răspunde
Răspunsuri
78
Vizualizări
16407
Răspunsuri
3
Vizualizări
986
Răspunsuri
22
Vizualizări
6629

Înapoi la “Serverfiles”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 7 vizitatori