Hey Com,
ich bin gerade dabei das Pet System like offical einzufügen... Bekomme aber den Server Source nicht compiled.
Bekomme immer diese Fehler Meldung:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Code: NewPetSystem.cpp
- #include "stdafx.h"
- #include "utils.h"
- #include "vector.h"
- #include "char.h"
- #include "sectree_manager.h"
- #include "char_manager.h"
- #include "mob_manager.h"
- #include "New_PetSystem.h"
- #include "../../common/VnumHelper.h"
- #include "packet.h"
- #include "item_manager.h"
- #include "item.h"
- #include "db.h"
- extern int passes_per_sec;
- EVENTINFO(newpetsystem_event_info)
- {
- CNewPetSystem* pPetSystem;
- };
- EVENTINFO(newpetsystem_event_infoe)
- {
- CNewPetSystem* pPetSystem;
- };
- EVENTFUNC(newpetsystem_update_event)
- {
- newpetsystem_event_info* info = dynamic_cast<newpetsystem_event_info*>( event->info );
- if ( info == NULL )
- {
- sys_err( "check_speedhack_event> <Factor> Null pointer" );
- return 0;
- }
- CNewPetSystem* pPetSystem = info->pPetSystem;
- if (NULL == pPetSystem)
- return 0;
- pPetSystem->Update(0);
- // 0.25Ãʸ¶´Ù °»½Å.
- return PASSES_PER_SEC(1) / 4;
- }
- EVENTFUNC(newpetsystem_expire_event)
- {
- newpetsystem_event_infoe* info = dynamic_cast<newpetsystem_event_infoe*>(event->info);
- if (info == NULL)
- {
- sys_err("check_speedhack_event> <Factor> Null pointer");
- return 0;
- }
- CNewPetSystem* pPetSystem = info->pPetSystem;
- if (NULL == pPetSystem)
- return 0;
- pPetSystem->UpdateTime();
- // 0.25Ãʸ¶´Ù °»½Å.
- return PASSES_PER_SEC(1);
- }
- /// NOTE: 1ij¸¯ÅÍ°¡ ¸î°³ÀÇ ÆêÀ» °¡Áú ¼ö ÀÖ´ÂÁö Á¦ÇÑ... ij¸¯Å͸¶´Ù °³¼ö¸¦ ´Ù¸£°Ô ÇҰŶó¸é º¯¼ö·Î ³Öµî°¡... À½..
- /// °¡Áú ¼ö ÀÖ´Â °³¼ö¿Í µ¿½Ã¿¡ ¼ÒȯÇÒ ¼ö ÀÖ´Â °³¼ö°¡ Ʋ¸± ¼ö Àִµ¥ ÀÌ·±°Ç ±âȹ ¾øÀ¸´Ï ÀÏ´Ü ¹«½Ã
- const float PET_COUNT_LIMIT = 3;
- ///////////////////////////////////////////////////////////////////////////////////////
- // CPetActor
- ///////////////////////////////////////////////////////////////////////////////////////
- CNewPetActor::CNewPetActor(LPCHARACTER owner, DWORD vnum, DWORD options)
- {
- m_dwVnum = vnum;
- m_dwVID = 0;
- m_dwlevel = 1;
- m_dwlevelstep = 0;
- m_dwExpFromMob = 0;
- m_dwExpFromItem = 0;
- m_dwexp = 0;
- m_dwexpitem = 0;
- m_dwOptions = options;
- m_dwLastActionTime = 0;
- m_pkChar = 0;
- m_pkOwner = owner;
- m_originalMoveSpeed = 0;
- m_dwSummonItemVID = 0;
- m_dwSummonItemID = 0;
- m_dwSummonItemVnum = 0;
- m_dwevolution = 0;
- m_dwduration = 0;
- m_dwtduration = 0;
- m_dwTimePet = 0;
- m_dwslotimm = 0;
- m_dwImmTime = 0;
- m_dwskill[0] = 0;
- m_dwskill[1] = 0;
- m_dwskill[2] = 0;
- for (int s = 0; s < 9; ++s) {
- m_dwpetslotitem[s] = -1;
- }
- //Riferimento allo slot -1 se non disp 0 disp non set > 0 setted
- m_dwskillslot[0] = -1;
- m_dwskillslot[0] = -1;
- m_dwskillslot[0] = -1;
- for (int x = 0; x < 3; ++x) //Inizializzazione bonus del pet
- {
- int btype[3] = { 1, 54, 2};
- m_dwbonuspet[x][0] = btype[x];
- m_dwbonuspet[x][1] = 0;
- }
- }
- CNewPetActor::~CNewPetActor()
- {
- this->Unsummon();
- m_pkOwner = 0;
- }
- void CNewPetActor::SetName(const char* name)
- {
- //std::string petName = m_pkOwner->GetName();
- std::string petName = "";
- if (0 != m_pkOwner &&
- 0 == name &&
- 0 != m_pkOwner->GetName())
- {
- petName += "'s Pet";
- }
- else
- petName += name;
- if (true == IsSummoned())
- m_pkChar->SetName(petName);
- m_name = petName;
- }
- void CNewPetActor::SetItemCube(int pos, int invpos) {
- if (m_dwpetslotitem[pos] != -1) //Controllo se l'item e' gia settato
- return;
- if (pos > 180 || pos < 0)
- return;
- m_dwpetslotitem[pos] = invpos;
- }
- void CNewPetActor::ItemCubeFeed(int type)
- {
- for (int i = 0; i < 9; ++i) {
- if (m_dwpetslotitem[i] != -1) {
- LPITEM itemxp = m_pkOwner->GetInventoryItem(m_dwpetslotitem[i]);
- if (!itemxp)
- return;
- if (itemxp->GetID() == ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetID() || m_pkOwner->GetExchange() || m_pkOwner->GetMyShop() || m_pkOwner->GetShopOwner() || m_pkOwner->IsOpenSafebox() || m_pkOwner->IsCubeOpen())
- return;
- if(type == 1)
- {
- if (itemxp->GetVnum() >= 55401 && itemxp->GetVnum() <= 55405 || itemxp->GetVnum() >= 55701 && itemxp->GetVnum() <= 55705 || itemxp->GetVnum() == 55001) {
- if(itemxp->GetVnum() == 55001)
- {
- int tmp_dur = m_dwtduration/2;
- if (m_dwduration+tmp_dur > m_dwtduration)
- m_dwduration = m_dwtduration;
- else
- m_dwduration += tmp_dur;
- }
- else
- {
- int tmp_dur = m_dwtduration * 3 / 100;
- if (m_dwduration+tmp_dur > m_dwtduration)
- m_dwduration = m_dwtduration;
- else
- m_dwduration += tmp_dur;
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetDuration %d %d", m_dwduration, m_dwtduration);
- }
- ITEM_MANAGER::instance().RemoveItem(itemxp);
- }
- }
- else if(type == 3)
- {
- if(itemxp->GetType() == 1 || itemxp->GetType() == 2)
- {
- SetExp(itemxp->GetShopBuyPrice() / 2, 1);
- ITEM_MANAGER::instance().RemoveItem(itemxp);
- }
- }
- }
- }
- for (int s = 0; s < 9; ++s) {
- m_dwpetslotitem[s] = -1;
- }
- }
- bool CNewPetActor::IncreasePetSkill(int skill) {
- if (GetLevel() < 82 && m_dwevolution < 3)
- return false;
- for (int i = 0; i < 3; ++i) { //Itero gli slot per cercare la skill
- if (m_dwskillslot[i] == skill) { //Se trova la skill o la aumenta oppure e' gi?max
- if (m_dwskill[i] < 20) {
- m_dwskill[i] += 1;
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Skillul ta a atins nivelul:%d", m_dwskill[i]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", i, m_dwskillslot[i], m_dwskill[i]);
- return true;
- }
- else {
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Skillul tau a atins deja nivelul maxim!");
- return false;
- }
- }
- }
- for (int i = 0; i < 3; ++i) {
- if (m_dwskillslot[i] == 0 || m_dwskillslot[i] == -1) {
- m_dwskillslot[i] = skill;
- m_dwskill[i] = 1;
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Animalul tau de companie a invatat un nou skill!");
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", i, m_dwskillslot[i], m_dwskill[i]);
- return true;
- }
- }
- /* Qualora il pet non soddisfi le condizioni precedenti
- Allora tutti gli slot sono pieni e quind non pu?
- imparare nuove skill
- */
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Animalul tau de companie nu este capabil sa invete alte abilitati!");
- return false;
- }
- bool CNewPetActor::IncreasePetEvolution() {
- if (m_dwevolution < 3) {
- if (GetLevel() == 40 && m_dwevolution < 1 || GetLevel() == 81 && m_dwevolution < 2 || GetLevel() == 81 && m_dwevolution < 3) {
- m_dwevolution += 1;
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetEvolution %d", m_dwevolution);
- if (m_dwevolution == 3) {
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 0, m_dwskillslot[0], m_dwskill[0]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 1, m_dwskillslot[1], m_dwskill[1]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 2, m_dwskillslot[2], m_dwskill[2]);
- }
- }
- else
- return false;
- }
- else {
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Animalul tau de companie a atins evolutia maxima!");
- return false;
- }
- return true;
- }
- void CNewPetActor:: IncreasePetBonus() {
- int tmplevel = GetLevel();
- if (tmplevel % 5 == 0) {
- m_dwbonuspet[0][1] += number(1, 6);
- }
- if (tmplevel % 7 == 0) {
- m_dwbonuspet[1][1] += number(1, 6);
- }
- if (tmplevel % 4 == 0) {
- m_dwbonuspet[2][1] += number(1, 6);
- }
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetBonus %d %d %d", m_dwbonuspet[0][1], m_dwbonuspet[1][1], m_dwbonuspet[2][1]);
- LPITEM pSummonItem = ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID());
- if (pSummonItem != NULL){
- for (int b = 0; b < 3; b++){
- pSummonItem->SetForceAttribute(b, 1, m_dwbonuspet[b][1]);
- }
- }
- }
- void CNewPetActor::SetNextExp(int nextExp)
- {
- m_dwExpFromMob = (nextExp/10)* 9;
- m_dwExpFromItem = nextExp - m_dwExpFromMob;
- }
- void CNewPetActor::SetLevel(DWORD level)
- {
- m_pkChar->SetLevel(static_cast<char>(level));
- m_dwlevel = level;
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetLevel %d", m_dwlevel);
- SetNextExp(m_pkChar->PetGetNextExp());
- m_pkChar->UpdatePacket();
- m_pkOwner->UpdatePacket();
- }
- void CNewPetActor::SetEvolution(int lv) {
- if (lv == 40)
- m_dwevolution = 1;
- else if (lv == 81 && GetEvolution() == 1)
- m_dwevolution = 2;
- else if (lv == 81 && GetEvolution() == 2)
- m_dwevolution = 3;
- }
- void CNewPetActor::SetExp(DWORD exp, int mode)
- {
- if (exp < 0)
- exp = MAX(m_dwexp - exp, 0);
- if(mode == 0){
- if(GetExp() + exp >= GetNextExpFromMob() && GetExpI() >= GetNextExpFromItem())
- {
- if(GetEvolution() == 0 && GetLevel() == 40)
- return;
- else if(GetEvolution() == 1 && GetLevel() == 81)
- return;
- }
- }else if(mode == 1)
- {
- if(GetExpI() + exp >= GetNextExpFromItem() && GetExp() >= GetNextExpFromMob())
- {
- if(GetEvolution() == 0 && GetLevel() == 40)
- return;
- else if(GetEvolution() == 1 && GetLevel() == 81)
- return;
- }
- }
- if (mode == 0) {
- if (GetExp() + exp >= GetNextExpFromMob()) {
- if (GetExpI() >= GetNextExpFromItem()){
- SetLevel(GetLevel() + 1);
- m_pkChar->SendPetLevelUpEffect(m_pkChar->GetVID(), 1, GetLevel(), 1);
- IncreasePetBonus();
- m_dwlevelstep = 0;
- m_dwexp = 0;
- m_dwexpitem = 0;
- m_pkChar->SetExp(0);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- return;
- }else {
- m_dwlevelstep = 4;
- exp = GetNextExpFromMob() - GetExp();
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- }
- }
- m_dwexp += exp;
- m_pkChar->SetExp(m_dwexp);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- if (GetLevelStep() < 4) {
- if (GetExp() >= GetNextExpFromMob() / 4 * 3 && m_dwlevelstep != 3) {
- m_dwlevelstep = 3;
- //m_pkChar->SendPetLevelUpEffect(m_pkChar->GetVID(), 25, GetLevel(), 1);
- }else if (GetExp() >= GetNextExpFromMob() / 4 * 2 && m_dwlevelstep != 2) {
- m_dwlevelstep = 2;
- //m_pkChar->SendPetLevelUpEffect(m_pkChar->GetVID(), 25, GetLevel(), 1);
- }else if (GetExp() >= GetNextExpFromMob() / 4 && m_dwlevelstep != 1) {
- m_dwlevelstep = 1;
- //m_pkChar->SendPetLevelUpEffect(m_pkChar->GetVID(), 25, GetLevel(), 1);
- }
- }
- }else if(mode == 1) {
- if (GetExpI() + exp >= GetNextExpFromItem()) {
- if (GetExp() >= GetNextExpFromMob()) { //Set anche exp da mob e' piena livello e conservo exp restante
- m_dwexpitem = GetExpI() + exp - GetNextExpFromItem(); //Nel caso in cui livelli setta exp in eccesso 0 se ==
- m_dwexp = 0;
- m_pkChar->SetExp(0);
- m_dwlevelstep = 0;
- SetLevel(GetLevel() + 1);
- m_pkChar->SendPetLevelUpEffect(m_pkChar->GetVID(), 1, GetLevel(), 1);
- IncreasePetBonus();
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- //SetEvolution(GetLevel());
- return;
- if (GetExpI() > GetNextExpFromItem()) { //Controllo che in caso exp avanzata sia superiore al livello successivo venga solo maxata ma non superi il limite
- m_dwexpitem = GetNextExpFromItem(); //setto exp come massima ma non >
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- }
- }else {
- exp = GetNextExpFromItem() - GetExpI();
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- }
- }
- m_dwexpitem += exp;
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- }
- }
- bool CNewPetActor::Mount()
- {
- if (0 == m_pkOwner)
- return false;
- if (true == HasOption(EPetOption_Mountable))
- m_pkOwner->MountVnum(m_dwVnum);
- return m_pkOwner->GetMountVnum() == m_dwVnum;;
- }
- void CNewPetActor::UpdateTime()
- {
- m_dwTimePet += 1;
- if (m_dwTimePet >= 60) {
- m_dwduration -= 1;
- m_dwTimePet = 0;
- LPITEM pSummonItem = ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID());
- if (pSummonItem != NULL){
- pSummonItem->SetForceAttribute(3, 1, m_dwduration);
- pSummonItem->SetForceAttribute(4, 1, m_dwtduration);
- }
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetDuration %d %d", m_dwduration, m_dwtduration);
- }
- }
- void CNewPetActor::Unmount()
- {
- if (0 == m_pkOwner)
- return;
- if (m_pkOwner->IsHorseRiding())
- m_pkOwner->StopRiding();
- }
- void CNewPetActor::Unsummon()
- {
- if (true == this->IsSummoned())
- {
- DBManager::instance().DirectQuery("UPDATE new_petsystem SET level = %d, evolution=%d, exp=%d, expi=%d, bonus0=%d, bonus1=%d, bonus2=%d, skill0=%d, skill0lv= %d, skill1=%d, skill1lv= %d, skill2=%d, skill2lv= %d, duration=%d, tduration=%d WHERE id = %lu ", this->GetLevel(), this->m_dwevolution, this->GetExp(), this->GetExpI(), this->m_dwbonuspet[0][1], this->m_dwbonuspet[1][1], this->m_dwbonuspet[2][1], this->m_dwskillslot[0], this->m_dwskill[0], this->m_dwskillslot[1], this->m_dwskill[1], this->m_dwskillslot[2], this->m_dwskill[2], this->m_dwduration, this->m_dwtduration, ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetID());
- this->ClearBuff();
- LPITEM pSummonItem = ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID());
- if (pSummonItem != NULL){
- for (int b = 0; b < 3; b++){
- pSummonItem->SetForceAttribute(b, 1, m_dwbonuspet[b][1]);
- }
- pSummonItem->SetForceAttribute(3, 1, m_dwduration);
- pSummonItem->SetForceAttribute(4, 1, m_dwtduration);
- pSummonItem->SetSocket(1,m_dwlevel);
- pSummonItem->SetSocket(0, false);
- pSummonItem->Lock(false);
- }
- this->SetSummonItem(NULL);
- if (NULL != m_pkOwner)
- m_pkOwner->ComputePoints();
- if (NULL != m_pkChar)
- M2_DESTROY_CHARACTER(m_pkChar);
- m_pkChar = 0;
- m_dwVID = 0;
- m_dwlevel = 1;
- m_dwlevelstep = 0;
- m_dwExpFromMob = 0;
- m_dwExpFromItem = 0;
- m_dwexp = 0;
- m_dwexpitem = 0;
- m_dwTimePet = 0;
- m_dwImmTime = 0;
- m_dwslotimm = 0;
- for (int s = 0; s < 9; ++s) {
- m_dwpetslotitem[s] = -1;
- }
- ClearBuff();
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetUnsummon");
- }
- }
- DWORD CNewPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)
- {
- long x = m_pkOwner->GetX();
- long y = m_pkOwner->GetY();
- long z = m_pkOwner->GetZ();
- if (true == bSpawnFar)
- {
- x += (number(0, 1) * 2 - 1) * number(2000, 2500);
- y += (number(0, 1) * 2 - 1) * number(2000, 2500);
- }
- else
- {
- x += number(-100, 100);
- y += number(-100, 100);
- }
- if (0 != m_pkChar)
- {
- m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
- m_dwVID = m_pkChar->GetVID();
- return m_dwVID;
- }
- m_pkChar = CHARACTER_MANAGER::instance().SpawnMob(
- m_dwVnum,
- m_pkOwner->GetMapIndex(),
- x, y, z,
- false, (int)(m_pkOwner->GetRotation()+180), false);
- if (0 == m_pkChar)
- {
- sys_err("[CPetSystem::Summon] Failed to summon the pet. (vnum: %d)", m_dwVnum);
- return 0;
- }
- m_pkChar->SetNewPet();
- // m_pkOwner->DetailLog();
- // m_pkChar->DetailLog();
- //ÆêÀÇ ±¹°¡¸¦ ÁÖÀÎÀÇ ±¹°¡·Î ¼³Á¤ÇÔ.
- m_pkChar->SetEmpire(m_pkOwner->GetEmpire());
- m_dwVID = m_pkChar->GetVID();
- char szQuery1[1024];
- snprintf(szQuery1, sizeof(szQuery1), "SELECT name,level,exp,expi,bonus0,bonus1,bonus2,skill0,skill0lv,skill1,skill1lv,skill2,skill2lv,duration,tduration,evolution FROM new_petsystem WHERE id = %lu ", pSummonItem->GetID());
- std::auto_ptr<SQLMsg> pmsg2(DBManager::instance().DirectQuery(szQuery1));
- if (pmsg2->Get()->uiNumRows > 0) {
- MYSQL_ROW row = mysql_fetch_row(pmsg2->Get()->pSQLResult);
- this->SetName(row[0]);
- this->SetLevel(atoi(row[1]));
- this->SetExp(atoi(row[2]), 0);
- this->SetExp(atoi(row[3]), 1);
- this->m_dwbonuspet[0][1] = atoi(row[4]);
- this->m_dwbonuspet[1][1] = atoi(row[5]);
- this->m_dwbonuspet[2][1] = atoi(row[6]);
- this->m_dwskillslot[0] = atoi(row[7]);
- this->m_dwskill[0] = atoi(row[8]);
- this->m_dwskillslot[1] = atoi(row[9]);
- this->m_dwskill[1] = atoi(row[10]);
- this->m_dwskillslot[2] = atoi(row[11]);
- this->m_dwskill[2] = atoi(row[12]);
- this->m_dwduration = atoi(row[13]);
- this->m_dwtduration = atoi(row[14]);
- this->m_dwevolution = atoi(row[15]);
- }else
- this->SetName(petName);
- // SetSummonItem(pSummonItem)¸¦ ºÎ¸¥ ÈÄ¿¡ ComputePoints¸¦ ºÎ¸£¸é ¹öÇÁ Àû¿ëµÊ.
- this->SetSummonItem(pSummonItem);
- //this->SetNextExp(m_pkChar->PetGetNextExp());
- m_pkOwner->ComputePoints();
- m_pkChar->Show(m_pkOwner->GetMapIndex(), x, y, z);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetIcon %d", m_dwSummonItemVnum);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetEvolution %d", m_dwevolution);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetName %s", m_name.c_str());
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetLevel %d", m_dwlevel);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetDuration %d %d", m_dwduration, m_dwtduration);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetBonus %d %d %d", m_dwbonuspet[0][1], m_dwbonuspet[1][1], m_dwbonuspet[2][1]);
- if (GetLevel() > 81 && m_dwevolution == 3 ){
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 0, m_dwskillslot[0], m_dwskill[0]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 1, m_dwskillslot[1], m_dwskill[1]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 2, m_dwskillslot[2], m_dwskill[2]);
- }
- else {
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 0, -1, m_dwskill[0]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 1, -1, m_dwskill[1]);
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", 2, -1, m_dwskill[2]);
- }
- m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetExp %d %d %d", m_dwexp, m_dwexpitem, m_pkChar->PetGetNextExp());
- this->GiveBuff();
- for (int b = 0; b < 3; b++){
- pSummonItem->SetForceAttribute(b, 1, m_dwbonuspet[b][1]);
- }
- pSummonItem->SetForceAttribute(3, 1, m_dwduration);
- pSummonItem->SetForceAttribute(4, 1, m_dwtduration);
- pSummonItem->SetSocket(1,m_dwlevel);
- //m_pkOwner->AddAffect( AFFECT_AUTO_SP_RECOVERY, POINT_NONE, 4, pSummonItem->GetID(), INFINITE_AFFECT_DURATION, 0, true, false);
- pSummonItem->SetSocket(0,true);
- pSummonItem->Lock(true);
- return m_dwVID;
- }
- bool CNewPetActor::_UpdatAloneActionAI(float fMinDist, float fMaxDist)
- {
- float fDist = number(fMinDist, fMaxDist);
- float r = (float)number (0, 359);
- float dest_x = GetOwner()->GetX() + fDist * cos(r);
- float dest_y = GetOwner()->GetY() + fDist * sin(r);
- //m_pkChar->SetRotation(number(0, 359)); // ¹æÇâÀº ·£´ýÀ¸·Î ¼³Á¤
- //GetDeltaByDegree(m_pkChar->GetRotation(), fDist, &fx, &fy);
- // ´À½¼ÇÑ ¸ø°¨ ¼Ó¼º üũ; ÃÖÁ¾ À§Ä¡¿Í Áß°£ À§Ä¡°¡ °¥¼ö¾ø´Ù¸é °¡Áö ¾Ê´Â´Ù.
- //if (!(SECTREE_MANAGER::instance().IsMovablePosition(m_pkChar->GetMapIndex(), m_pkChar->GetX() + (int) fx, m_pkChar->GetY() + (int) fy)
- // && SECTREE_MANAGER::instance().IsMovablePosition(m_pkChar->GetMapIndex(), m_pkChar->GetX() + (int) fx/2, m_pkChar->GetY() + (int) fy/2)))
- // return true;
- m_pkChar->SetNowWalking(true);
- //if (m_pkChar->Goto(m_pkChar->GetX() + (int) fx, m_pkChar->GetY() + (int) fy))
- // m_pkChar->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
- if (!m_pkChar->IsStateMove() && m_pkChar->Goto(dest_x, dest_y))
- m_pkChar->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
- m_dwLastActionTime = get_dword_time();
- return true;
- }
- // char_state.cpp StateHorseÇÔ¼ö ±×³É C&P -_-;
- bool CNewPetActor::_UpdateFollowAI()
- {
- if (0 == m_pkChar->m_pkMobData)
- {
- //sys_err("[CPetActor::_UpdateFollowAI] m_pkChar->m_pkMobData is NULL");
- return false;
- }
- // NOTE: ij¸¯ÅÍ(Æê)ÀÇ ¿ø·¡ À̵¿ ¼Óµµ¸¦ ¾Ë¾Æ¾ß Çϴµ¥, ÇØ´ç °ª(m_pkChar->m_pkMobData->m_table.sMovingSpeed)À» Á÷Á¢ÀûÀ¸·Î Á¢±ÙÇؼ ¾Ë¾Æ³¾ ¼öµµ ÀÖÁö¸¸
- // m_pkChar->m_pkMobData °ªÀÌ invalidÇÑ °æ¿ì°¡ ÀÚÁÖ ¹ß»ýÇÔ. ÇöÀç ½Ã°£°ü°è»ó ¿øÀÎÀº ´ÙÀ½¿¡ ÆľÇÇÏ°í ÀÏ´ÜÀº m_pkChar->m_pkMobData °ªÀ» ¾Æ¿¹ »ç¿ëÇÏÁö ¾Êµµ·Ï ÇÔ.
- // ¿©±â¼ ¸Å¹ø °Ë»çÇÏ´Â ÀÌÀ¯´Â ÃÖÃÊ ÃʱâÈ ÇÒ ¶§ Á¤»ó °ªÀ» Á¦´ë·Î ¸ø¾ò¾î¿À´Â °æ¿ìµµ ÀÖÀ½.. -_-;; ¤Ð¤Ð¤Ð¤Ð¤Ð¤Ð¤Ð¤Ð¤Ð
- if (0 == m_originalMoveSpeed)
- {
- const CMob* mobData = CMobManager::Instance().Get(m_dwVnum);
- if (0 != mobData)
- m_originalMoveSpeed = mobData->m_table.sMovingSpeed;
- }
- float START_FOLLOW_DISTANCE = 300.0f; // ÀÌ °Å¸® ÀÌ»ó ¶³¾îÁö¸é ÂѾư¡±â ½ÃÀÛÇÔ
- float START_RUN_DISTANCE = 900.0f; // ÀÌ °Å¸® ÀÌ»ó ¶³¾îÁö¸é ¶Ù¾î¼ ÂѾư¨.
- float RESPAWN_DISTANCE = 4500.f; // ÀÌ °Å¸® ÀÌ»ó ¸Ö¾îÁö¸é ÁÖÀÎ ¿·À¸·Î ¼ÒȯÇÔ.
- int APPROACH = 290; // Á¢±Ù °Å¸®
- bool bDoMoveAlone = true; // ij¸¯ÅÍ¿Í °¡±îÀÌ ÀÖÀ» ¶§ È¥ÀÚ ¿©±âÀú±â ¿òÁ÷ÀÏ°ÇÁö ¿©ºÎ -_-;
- bool bRun = false; // ¶Ù¾î¾ß Çϳª?
- DWORD currentTime = get_dword_time();
- long ownerX = m_pkOwner->GetX(); long ownerY = m_pkOwner->GetY();
- long charX = m_pkChar->GetX(); long charY = m_pkChar->GetY();
- float fDist = DISTANCE_APPROX(charX - ownerX, charY - ownerY);
- if (fDist >= RESPAWN_DISTANCE)
- {
- float fOwnerRot = m_pkOwner->GetRotation() * 3.141592f / 180.f;
- float fx = -APPROACH * cos(fOwnerRot);
- float fy = -APPROACH * sin(fOwnerRot);
- if (m_pkChar->Show(m_pkOwner->GetMapIndex(), ownerX + fx, ownerY + fy))
- {
- return true;
- }
- }
- if (fDist >= START_FOLLOW_DISTANCE)
- {
- if( fDist >= START_RUN_DISTANCE)
- {
- bRun = true;
- }
- m_pkChar->SetNowWalking(!bRun); // NOTE: ÇÔ¼ö À̸§º¸°í ¸ØÃߴ°ÇÁÙ ¾Ë¾Ò´Âµ¥ SetNowWalking(false) ÇÏ¸é ¶Ù´Â°ÅÀÓ.. -_-;
- Follow(APPROACH);
- m_pkChar->SetLastAttacked(currentTime);
- m_dwLastActionTime = currentTime;
- }
- //else
- //{
- // if (fabs(m_pkChar->GetRotation() - GetDegreeFromPositionXY(charX, charY, ownerX, ownerX)) > 10.f || fabs(m_pkChar->GetRotation() - GetDegreeFromPositionXY(charX, charY, ownerX, ownerX)) < 350.f)
- // {
- // m_pkChar->Follow(m_pkOwner, APPROACH);
- // m_pkChar->SetLastAttacked(currentTime);
- // m_dwLastActionTime = currentTime;
- // }
- //}
- // Follow ÁßÀÌÁö¸¸ ÁÖÀΰú ÀÏÁ¤ °Å¸® À̳»·Î °¡±î¿öÁ³´Ù¸é ¸ØÃã
- else
- m_pkChar->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
- //else if (currentTime - m_dwLastActionTime > number(5000, 12000))
- //{
- // this->_UpdatAloneActionAI(START_FOLLOW_DISTANCE / 2, START_FOLLOW_DISTANCE);
- //}
- return true;
- }
- bool CNewPetActor::Update(DWORD deltaTime)
- {
- bool bResult = true;
- // Æê ÁÖÀÎÀÌ Á×¾ú°Å³ª, ¼ÒȯµÈ ÆêÀÇ »óÅ°¡ ÀÌ»óÇÏ´Ù¸é ÆêÀ» ¾ø¾Ú. (NOTE: °¡²û°¡´Ù ÀÌ·± Àú·± ÀÌÀ¯·Î ¼ÒȯµÈ ÆêÀÌ DEAD »óÅ¿¡ ºüÁö´Â °æ¿ì°¡ ÀÖÀ½-_-;)
- // ÆêÀ» ¼ÒȯÇÑ ¾ÆÀÌÅÛÀÌ ¾ø°Å³ª, ³»°¡ °¡Áø »óÅ°¡ ¾Æ´Ï¶ó¸é ÆêÀ» ¾ø¾Ú.
- if (IsSummoned()) {
- if (m_pkOwner->IsImmortal() && Pet_Skill_Table[16][2 + m_dwskill[m_dwslotimm]] <= (get_global_time() - m_dwImmTime)*10) {
- //m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "%d - %d diff %d Skilltable %d", get_global_time(), m_dwImmTime, (get_global_time() - m_dwImmTime) * 10, Pet_Skill_Table[16][2 + m_dwskill[m_dwslotimm]]);
- m_dwImmTime = 0;
- m_pkOwner->SetImmortal(0);
- }
- }
- if (m_pkOwner->IsDead() || (IsSummoned() && m_pkChar->IsDead()) || (IsSummoned() && (m_pkOwner->GetExchange() || m_pkOwner->GetMyShop() || m_pkOwner->GetShopOwner() || m_pkOwner->IsOpenSafebox() || m_pkOwner->IsCubeOpen() || m_dwduration <= 0))
- || NULL == ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())
- || ITEM_MANAGER::instance().FindByVID(this->GetSummonItemVID())->GetOwner() != this->GetOwner()
- )
- {
- this->Unsummon();
- return true;
- }
- if (this->IsSummoned() && HasOption(EPetOption_Followable))
- bResult = bResult && this->_UpdateFollowAI();
- return bResult;
- }
- //NOTE : ÁÖÀÇ!!! MinDistance¸¦ Å©°Ô ÀâÀ¸¸é ±× º¯À§¸¸ÅÀÇ º¯Èµ¿¾ÈÀº followÇÏÁö ¾Ê´Â´Ù,
- bool CNewPetActor::Follow(float fMinDistance)
- {
- // °¡·Á´Â À§Ä¡¸¦ ¹Ù¶óºÁ¾ß ÇÑ´Ù.
- if( !m_pkOwner || !m_pkChar)
- return false;
- float fOwnerX = m_pkOwner->GetX();
- float fOwnerY = m_pkOwner->GetY();
- float fPetX = m_pkChar->GetX();
- float fPetY = m_pkChar->GetY();
- float fDist = DISTANCE_SQRT(fOwnerX - fPetX, fOwnerY - fPetY);
- if (fDist <= fMinDistance)
- return false;
- m_pkChar->SetRotationToXY(fOwnerX, fOwnerY);
- float fx, fy;
- float fDistToGo = fDist - fMinDistance;
- GetDeltaByDegree(m_pkChar->GetRotation(), fDistToGo, &fx, &fy);
- if (!m_pkChar->Goto((int)(fPetX+fx+0.5f), (int)(fPetY+fy+0.5f)) )
- return false;
- m_pkChar->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0, 0);
- return true;
- }
- void CNewPetActor::SetSummonItem (LPITEM pItem)
- {
- if (NULL == pItem)
- {
- m_dwSummonItemVID = 0;
- m_dwSummonItemID = 0;
- m_dwSummonItemVnum = 0;
- return;
- }
- m_dwSummonItemVID = pItem->GetVID();
- m_dwSummonItemID = pItem->GetID();
- m_dwSummonItemVnum = pItem->GetVnum();
- }
- void CNewPetActor::GiveBuff()
- {
- //Inizializzo i bonus del NewPetSystem //hp sp e def
- // 559 Affect NewPet
- int cbonus[3] = { m_pkOwner->GetMaxHP(), m_pkOwner->GetPoint(POINT_DEF_GRADE), m_pkOwner->GetMaxSP() };
- for (int i = 0; i < 3; ++i) {
- m_pkOwner->AddAffect(AFFECT_NEW_PET, aApplyInfo[m_dwbonuspet[i][0]].bPointType, (int)(cbonus[i]*m_dwbonuspet[i][1]/1000), 0, 60 * 60 * 24 * 365, 0, false);
- }
- //Inizializzo le skill del pet inattive No 10-17-18 No 0 no -1
- //Condizione lv > 81 evo 3 Solo Skill Passive
- if (GetLevel() > 81 && m_dwevolution == 3) {
- for (int s = 0; s < 3; s++) {
- switch (m_dwskillslot[s]) {
- /*
- Pet_Skill_Table[m_dwskillslot[s] - 1][0]; //Mi ritorna il type della skill
- Pet_Skill_Table[m_dwskillslot[s] - 1][1]; // Mi ritorna attiva/passiva della skill
- Pet_Skill_Table[m_dwskillslot[s] - 1][2]; // Mi ritorna il cd della skill
- Pet_Skill_Table[m_dwskillslot[s] - 1][2 + m_dwskill[s]]; //Mi ritorna l'apply della skill
- */
- case 1: //Resistenza Guerriero 78 Punti
- case 2: //Resistenza Sura 80
- case 3: //Resistenza Ninja 79
- case 4: //Resistenza Shamani 81
- case 5: //Resistenza Lycan 93
- case 6: //Valore Attacco 53 Punti
- case 7: //Antimagia 97
- case 8: //Velocit?Magia %
- case 9: //Perforazione 16 Punti
- case 11: //Sotto Hp Avv Punti
- case 12: //Sotto MP Avv Punti
- case 13: // Blocco corp 27 Punti
- case 14: // Riflessione 28 Punti
- case 15: // Drop Yang 44 Punti
- case 16: // Portata Arco 172 Punti
- m_pkOwner->AddAffect(AFFECT_NEW_PET, aApplyInfo[Pet_Skill_Table[m_dwskillslot[s] - 1][0]].bPointType, Pet_Skill_Table[m_dwskillslot[s] - 1][2 + m_dwskill[s]], 0, 60 * 60 * 24 * 365, 0, false);
- break;
- default:
- return;
- }
- }
- }
- }
- void CNewPetActor::ClearBuff()
- {
- m_pkOwner->RemoveAffect(AFFECT_NEW_PET);
- return ;
- }
- void CNewPetActor::DoPetSkill(int skillslot) {
- if (GetLevel() < 82 || m_dwevolution < 3)
- return;
- switch (m_dwskillslot[skillslot]) {
- case 10:
- {
- if (get_global_time() - m_pkOwner->GetNewPetSkillCD(0) <= 480) {
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Abilitatea se reincarca!%ds ramase", 480 - (get_global_time() - m_pkOwner->GetNewPetSkillCD(0)));
- return;
- }
- if (m_pkOwner->GetHPPct() > 20) {
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Poti utiliza aceasta abilitate numai cu pv-ul <= 20%!");
- return;
- }
- m_pkOwner->SetNewPetSkillCD(0, get_global_time());
- int riphp = MIN(m_pkOwner->GetHP() + (int)Pet_Skill_Table[9][2 + m_dwskill[skillslot]], m_pkOwner->GetMaxHP());
- m_pkOwner->PointChange(POINT_HP, riphp);
- m_pkOwner->EffectPacket(SE_HPUP_RED);
- }
- break;
- case 17:
- {
- if (get_global_time() - m_pkOwner->GetNewPetSkillCD(1) <= 600) {
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Abilitatea se reincarca!%ds ramase", 600 - (get_global_time() - m_pkOwner->GetNewPetSkillCD(1)));
- return;
- }
- m_pkOwner->SetNewPetSkillCD(1, get_global_time());
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Ai devenit nemuritor!");
- m_pkOwner->SetImmortal(1);
- m_dwslotimm = skillslot;
- m_dwImmTime = get_global_time();
- }
- break;
- case 18:
- {
- if (get_global_time() - m_pkOwner->GetNewPetSkillCD(2) <= 480) {
- m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Abilitatea se reincarca!%ds ramase", 480 -(get_global_time() - m_pkOwner->GetNewPetSkillCD(2)));
- return;
- }
- m_pkOwner->SetNewPetSkillCD(2, get_global_time());
- m_pkOwner->RemoveBadAffect();
- }
- break;
- default:
- return;
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////
- // CPetSystem
- ///////////////////////////////////////////////////////////////////////////////////////
- CNewPetSystem::CNewPetSystem(LPCHARACTER owner)
- {
- // assert(0 != owner && "[CPetSystem::CPetSystem] Invalid owner");
- m_pkOwner = owner;
- m_dwUpdatePeriod = 400;
- m_dwLastUpdateTime = 0;
- }
- CNewPetSystem::~CNewPetSystem()
- {
- Destroy();
- }
- bool CNewPetSystem::IncreasePetSkill(int skill) {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->IncreasePetSkill(skill);
- }
- }
- }
- return false;
- }
- bool CNewPetSystem::IncreasePetEvolution() {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->IncreasePetEvolution();
- }
- }
- }
- return false;
- }
- void CNewPetSystem::Destroy()
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (0 != petActor)
- {
- delete petActor;
- }
- }
- event_cancel(&m_pkNewPetSystemUpdateEvent);
- event_cancel(&m_pkNewPetSystemExpireEvent);
- m_petActorMap.clear();
- }
- void CNewPetSystem::UpdateTime()
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (0 != petActor && petActor->IsSummoned())
- {
- petActor->UpdateTime();
- }
- }
- }
- /// Æê ½Ã½ºÅÛ ¾÷µ¥ÀÌÆ®. µî·ÏµÈ ÆêµéÀÇ AI ó¸® µîÀ» ÇÔ.
- bool CNewPetSystem::Update(DWORD deltaTime)
- {
- bool bResult = true;
- DWORD currentTime = get_dword_time();
- // CHARACTER_MANAGER¿¡¼ ij¸¯ÅÍ·ù UpdateÇÒ ¶§ ¸Å°³º¯¼ö·Î ÁÖ´Â (Pulse¶ó°í µÇ¾îÀÖ´Â)°ªÀÌ ÀÌÀü ÇÁ·¹ÀÓ°úÀÇ ½Ã°£Â÷ÀÌÀÎÁÙ ¾Ë¾Ò´Âµ¥
- // ÀüÇô ´Ù¸¥ °ªÀ̶ó¼-_-; ¿©±â¿¡ ÀÔ·ÂÀ¸·Î µé¾î¿À´Â deltaTimeÀº Àǹ̰¡ ¾øÀ½¤Ð¤Ð
- if (m_dwUpdatePeriod > currentTime - m_dwLastUpdateTime)
- return true;
- std::vector <CNewPetActor*> v_garbageActor;
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (0 != petActor && petActor->IsSummoned())
- {
- LPCHARACTER pPet = petActor->GetCharacter();
- if (NULL == CHARACTER_MANAGER::instance().Find(pPet->GetVID()))
- {
- v_garbageActor.push_back(petActor);
- }
- else
- {
- bResult = bResult && petActor->Update(deltaTime);
- }
- }
- }
- for (std::vector<CNewPetActor*>::iterator it = v_garbageActor.begin(); it != v_garbageActor.end(); it++)
- DeletePet(*it);
- m_dwLastUpdateTime = currentTime;
- return bResult;
- }
- /// °ü¸® ¸ñ·Ï¿¡¼ ÆêÀ» Áö¿ò
- void CNewPetSystem::DeletePet(DWORD mobVnum)
- {
- TNewPetActorMap::iterator iter = m_petActorMap.find(mobVnum);
- if (m_petActorMap.end() == iter)
- {
- sys_err("[CPetSystem::DeletePet] Can't find pet on my list (VNUM: %d)", mobVnum);
- return;
- }
- CNewPetActor* petActor = iter->second;
- if (0 == petActor)
- sys_err("[CPetSystem::DeletePet] Null Pointer (petActor)");
- else
- delete petActor;
- m_petActorMap.erase(iter);
- }
- /// °ü¸® ¸ñ·Ï¿¡¼ ÆêÀ» Áö¿ò
- void CNewPetSystem::DeletePet(CNewPetActor* petActor)
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- if (iter->second == petActor)
- {
- delete petActor;
- m_petActorMap.erase(iter);
- return;
- }
- }
- sys_err("[CPetSystem::DeletePet] Can't find petActor(0x%x) on my list(size: %d) ", petActor, m_petActorMap.size());
- }
- void CNewPetSystem::Unsummon(DWORD vnum, bool bDeleteFromList)
- {
- CNewPetActor* actor = this->GetByVnum(vnum);
- if (0 == actor)
- {
- sys_err("[CPetSystem::GetByVnum(%d)] Null Pointer (petActor)", vnum);
- return;
- }
- actor->Unsummon();
- if (true == bDeleteFromList)
- this->DeletePet(actor);
- bool bActive = false;
- for (TNewPetActorMap::iterator it = m_petActorMap.begin(); it != m_petActorMap.end(); it++)
- {
- bActive |= it->second->IsSummoned();
- }
- if (false == bActive)
- {
- event_cancel(&m_pkNewPetSystemUpdateEvent);
- event_cancel(&m_pkNewPetSystemExpireEvent);
- m_pkNewPetSystemUpdateEvent = NULL;
- m_pkNewPetSystemExpireEvent = NULL;
- }
- }
- DWORD CNewPetSystem::GetNewPetITemID()
- {
- DWORD itemid = 0;
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- itemid = petActor->GetSummonItemID();
- break;
- }
- }
- }
- return itemid;
- }
- bool CNewPetSystem::IsActivePet()
- {
- bool state = false;
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- state = true;
- break;
- }
- }
- }
- return state;
- }
- int CNewPetSystem::GetLevelStep()
- {
- int step = 4;
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- step = petActor->GetLevelStep();
- break;
- }
- }
- }
- return step;
- }
- void CNewPetSystem::SetExp(int iExp, int mode)
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- petActor->SetExp(iExp, mode);
- break;
- }
- }
- }
- }
- int CNewPetSystem::GetEvolution()
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->GetEvolution();
- }
- }
- }
- return -1;
- }
- int CNewPetSystem::GetLevel()
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->GetLevel();
- }
- }
- }
- return -1;
- }
- int CNewPetSystem::GetExp()
- {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->GetExp();
- }
- }
- }
- return 0;
- }
- void CNewPetSystem::SetItemCube(int pos, int invpos) {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->SetItemCube(pos, invpos);
- }
- }
- }
- }
- void CNewPetSystem::ItemCubeFeed(int type) {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->ItemCubeFeed(type);
- }
- }
- }
- }
- void CNewPetSystem::DoPetSkill(int skillslot) {
- for (TNewPetActorMap::iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (petActor != 0)
- {
- if (petActor->IsSummoned()) {
- return petActor->DoPetSkill(skillslot);
- }
- }
- }
- }
- CNewPetActor* CNewPetSystem::Summon(DWORD mobVnum, LPITEM pSummonItem, const char* petName, bool bSpawnFar, DWORD options)
- {
- CNewPetActor* petActor = this->GetByVnum(mobVnum);
- // µî·ÏµÈ ÆêÀÌ ¾Æ´Ï¶ó¸é »õ·Î »ý¼º ÈÄ °ü¸® ¸ñ·Ï¿¡ µî·ÏÇÔ.
- if (0 == petActor)
- {
- petActor = M2_NEW CNewPetActor(m_pkOwner, mobVnum, options);
- m_petActorMap.insert(std::make_pair(mobVnum, petActor));
- }
- DWORD petVID = petActor->Summon(petName, pSummonItem, bSpawnFar);
- if (NULL == m_pkNewPetSystemUpdateEvent)
- {
- newpetsystem_event_info* info = AllocEventInfo<newpetsystem_event_info>();
- info->pPetSystem = this;
- m_pkNewPetSystemUpdateEvent = event_create(newpetsystem_update_event, info, PASSES_PER_SEC(1) / 4); // 0.25ÃÊ
- }
- if (NULL == m_pkNewPetSystemExpireEvent)
- {
- newpetsystem_event_infoe* infoe = AllocEventInfo<newpetsystem_event_infoe>();
- infoe->pPetSystem = this;
- m_pkNewPetSystemExpireEvent = event_create(newpetsystem_expire_event, infoe, PASSES_PER_SEC(1) ); // 1 volata per sec
- }
- return petActor;
- }
- CNewPetActor* CNewPetSystem::GetByVID(DWORD vid) const
- {
- CNewPetActor* petActor = 0;
- bool bFound = false;
- for (TNewPetActorMap::const_iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- petActor = iter->second;
- if (0 == petActor)
- {
- sys_err("[CPetSystem::GetByVID(%d)] Null Pointer (petActor)", vid);
- continue;
- }
- bFound = petActor->GetVID() == vid;
- if (true == bFound)
- break;
- }
- return bFound ? petActor : 0;
- }
- /// µî·Ï µÈ Æê Áß¿¡¼ ÁÖ¾îÁø ¸÷ VNUMÀ» °¡Áø ¾×Å͸¦ ¹ÝȯÇÏ´Â ÇÔ¼ö.
- CNewPetActor* CNewPetSystem::GetByVnum(DWORD vnum) const
- {
- CNewPetActor* petActor = 0;
- TNewPetActorMap::const_iterator iter = m_petActorMap.find(vnum);
- if (m_petActorMap.end() != iter)
- petActor = iter->second;
- return petActor;
- }
- size_t CNewPetSystem::CountSummoned() const
- {
- size_t count = 0;
- for (TNewPetActorMap::const_iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (0 != petActor)
- {
- if (petActor->IsSummoned())
- ++count;
- }
- }
- return count;
- }
- void CNewPetSystem::RefreshBuff()
- {
- for (TNewPetActorMap::const_iterator iter = m_petActorMap.begin(); iter != m_petActorMap.end(); ++iter)
- {
- CNewPetActor* petActor = iter->second;
- if (0 != petActor)
- {
- if (petActor->IsSummoned())
- {
- petActor->ClearBuff();
- petActor->GiveBuff();
- }
- }
- }
- }
Code: affect.h
- #ifndef __INC_AFFECT_H
- #define __INC_AFFECT_H
- class CAffect
- {
- public:
- DWORD dwType;
- BYTE bApplyOn;
- long lApplyValue;
- DWORD dwFlag;
- long lDuration;
- long lSPCost;
- static CAffect* Acquire();
- static void Release(CAffect* p);
- };
- enum EAffectTypes
- {
- AFFECT_NONE,
- AFFECT_MOV_SPEED = 200,
- AFFECT_ATT_SPEED,
- AFFECT_ATT_GRADE,
- AFFECT_INVISIBILITY,
- AFFECT_STR,
- AFFECT_DEX, // 205
- AFFECT_CON,
- AFFECT_INT,
- AFFECT_FISH_MIND_PILL,
- AFFECT_POISON,
- AFFECT_STUN, // 210
- AFFECT_SLOW,
- AFFECT_DUNGEON_READY,
- AFFECT_DUNGEON_UNIQUE,
- AFFECT_BUILDING,
- AFFECT_REVIVE_INVISIBLE, // 215
- AFFECT_FIRE,
- AFFECT_CAST_SPEED,
- AFFECT_HP_RECOVER_CONTINUE,
- AFFECT_SP_RECOVER_CONTINUE,
- AFFECT_POLYMORPH, // 220
- AFFECT_MOUNT,
- AFFECT_WAR_FLAG, // 222
- AFFECT_BLOCK_CHAT, // 223
- AFFECT_CHINA_FIREWORK,
- AFFECT_BOW_DISTANCE, // 225
- AFFECT_DEF_GRADE, // 226
- #ifdef NEW_PET_SYSTEM
- AFFECT_PET,
- #endif
- AFFECT_PREMIUM_START = 500,
- AFFECT_EXP_BONUS = 500, // 경험의 반지
- AFFECT_ITEM_BONUS = 501, // 도둑의 장갑
- AFFECT_SAFEBOX = 502, // PREMIUM_SAFEBOX,
- AFFECT_AUTOLOOT = 503, // PREMIUM_AUTOLOOT,
- AFFECT_FISH_MIND = 504, // PREMIUM_FISH_MIND,
- AFFECT_MARRIAGE_FAST = 505, // 원앙의 깃털
- AFFECT_GOLD_BONUS = 506, // 돈 드롭확률 50%증가
- AFFECT_PREMIUM_END = 509,
- AFFECT_MALL = 510, // 몰 아이템 에펙트
- AFFECT_NO_DEATH_PENALTY = 511, // 용신의 가호 (경험치가 패널티를 한번 막아준다)
- AFFECT_SKILL_BOOK_BONUS = 512, // 선인의 교훈 (책 수련 성공 확률이 50% 증가)
- AFFECT_SKILL_NO_BOOK_DELAY = 513, // 주안술서
- AFFECT_HAIR = 514, // 헤어 효과
- AFFECT_COLLECT = 515, //수집퀘스트
- AFFECT_EXP_BONUS_EURO_FREE = 516, // 경험의 반지 (유럽 버전 14 레벨 이하 기본 효과)
- AFFECT_EXP_BONUS_EURO_FREE_UNDER_15 = 517,
- AFFECT_UNIQUE_ABILITY = 518,
- AFFECT_CUBE_1,
- AFFECT_CUBE_2,
- AFFECT_CUBE_3,
- AFFECT_CUBE_4,
- AFFECT_CUBE_5,
- AFFECT_CUBE_6,
- AFFECT_CUBE_7,
- AFFECT_CUBE_8,
- AFFECT_CUBE_9,
- AFFECT_CUBE_10,
- AFFECT_CUBE_11,
- AFFECT_CUBE_12,
- AFFECT_BLEND,
- AFFECT_HORSE_NAME,
- AFFECT_MOUNT_BONUS,
- #ifdef NEW_PET_SYSTEM
- AFFECT_NEW_PET = 559,
- #endif
- AFFECT_AUTO_HP_RECOVERY = 534,
- AFFECT_AUTO_SP_RECOVERY = 535,
- AFFECT_DRAGON_SOUL_QUALIFIED = 540,
- AFFECT_DRAGON_SOUL_DECK_0 = 541,
- AFFECT_DRAGON_SOUL_DECK_1 = 542,
- AFFECT_RAMADAN_ABILITY = 300,
- AFFECT_RAMADAN_RING = 301,
- AFFECT_NOG_ABILITY = 302,
- AFFECT_HOLLY_STONE_POWER = 303,
- AFFECT_QUEST_START_IDX = 1000
- };
- enum EAffectBits
- {
- AFF_NONE,
- AFF_YMIR,
- AFF_INVISIBILITY,
- AFF_SPAWN,
- AFF_POISON,
- AFF_SLOW,
- AFF_STUN,
- AFF_DUNGEON_READY, // 던전에서 준비 상태
- AFF_DUNGEON_UNIQUE, // 던전 유니크 (클라이언트에서 컬링되지않음)
- AFF_BUILDING_CONSTRUCTION_SMALL,
- AFF_BUILDING_CONSTRUCTION_LARGE,
- AFF_BUILDING_UPGRADE,
- AFF_MOV_SPEED_POTION,
- AFF_ATT_SPEED_POTION,
- AFF_FISH_MIND,
- AFF_JEONGWIHON, // 전귀혼
- AFF_GEOMGYEONG, // 검경
- AFF_CHEONGEUN, // 천근추
- AFF_GYEONGGONG, // 경공술
- AFF_EUNHYUNG, // 은형법
- AFF_GWIGUM, // 귀검
- AFF_TERROR, // 공포
- AFF_JUMAGAP, // 주마갑
- AFF_HOSIN, // 호신
- AFF_BOHO, // 보호
- AFF_KWAESOK, // 쾌속
- AFF_MANASHIELD, // 마나쉴드
- AFF_MUYEONG, // 무영진 affect
- AFF_REVIVE_INVISIBLE, // 부활시 잠시동안 무적
- AFF_FIRE, // 지속 불 데미지
- AFF_GICHEON, // 기천대공
- AFF_JEUNGRYEOK, // 증력술
- AFF_TANHWAN_DASH, // 탄환격용 달리기어펙트
- AFF_PABEOP, // 파법술
- AFF_CHEONGEUN_WITH_FALL, // 천근추
- AFF_POLYMORPH,
- AFF_WAR_FLAG1,
- AFF_WAR_FLAG2,
- AFF_WAR_FLAG3,
- AFF_CHINA_FIREWORK,
- AFF_HAIR, // 헤어
- AFF_GERMANY, // 독일
- AFF_BITS_MAX
- };
- extern void SendAffectAddPacket(LPDESC d, CAffect * pkAff);
- // AFFECT_DURATION_BUG_FIX
- enum AffectVariable
- {
- // Affect가 무한대로 들어가 있어야 할 경우 사용.
- // 시간을 계속 줄이기 때문에 매우 큰값으로 무한대를 에뮬레이션함.
- //// 24비트는 적으므로 25비트를 사용.
- // ... 25비트 사용한다고 해놓고선 29bit 사용하고 있는 엄청난 주석이란...
- // collect quest에서 무한 시간을 60년으로 사용하고 있으므로, 여기도 60년으로 하자.
- INFINITE_AFFECT_DURATION = 60 * 365 * 24 * 60 * 60
- };
- // END_AFFECT_DURATION_BUG_FIX
- #endif
Code: constans.cpp
- #include "stdafx.h"
- #include "char.h"
- TJobInitialPoints JobInitialPoints[JOB_MAX_NUM] =
- /*
- {
- int st, ht, dx, iq;
- int max_hp, max_sp;
- int hp_per_ht, sp_per_iq;
- int hp_per_lv_begin, hp_per_lv_end;
- int sp_per_lv_begin, sp_per_lv_end;
- int max_stamina;
- int stamina_per_con;
- int stamina_per_lv_begin, stamina_per_lv_end;
- }
- */
- {
- // str con dex int 초기HP 초기SP CON/HP INT/SP HP랜덤/lv MP랜덤/lv 초기stam stam/con stam/lv
- { 6, 4, 3, 3, 600, 200, 40, 20, 36, 44, 18, 22, 800, 5, 1, 3 }, // JOB_WARRIOR 16
- { 4, 3, 6, 3, 650, 200, 40, 20, 36, 44, 18, 22, 800, 5, 1, 3 }, // JOB_ASSASSIN 16
- { 5, 3, 3, 5, 650, 200, 40, 20, 36, 44, 18, 22, 800, 5, 1, 3 }, // JOB_SURA 16
- { 3, 4, 3, 6, 700, 200, 40, 20, 36, 44, 18, 22, 800, 5, 1, 3 } // JOB_SHAMANa 16
- };
- const TMobRankStat MobRankStats[MOB_RANK_MAX_NUM] =
- /*
- {
- int iGoldPercent;
- }
- */
- {
- { 20, }, // MOB_RANK_PAWN,
- { 20, }, // MOB_RANK_S_PAWN,
- { 25, }, // MOB_RANK_KNIGHT,
- { 30, }, // MOB_RANK_S_KNIGHT,
- { 50, }, // MOB_RANK_BOSS,
- { 100, } // MOB_RANK_KING,
- };
- TBattleTypeStat BattleTypeStats[BATTLE_TYPE_MAX_NUM] =
- /*
- {
- int AttGradeBias;
- int DefGradeBias;
- int MagicAttGradeBias;
- int MagicDefGradeBias;
- }
- */
- {
- { 0, 0, 0, -10 }, // BATTLE_TYPE_MELEE,
- { 10, -20, -10, -15 }, // BATTLE_TYPE_RANGE,
- { -5, -5, 10, 10 }, // BATTLE_TYPE_MAGIC,
- { 0, 0, 0, 0 }, // BATTLE_TYPE_SPECIAL,
- { 10, -10, 0, -15 }, // BATTLE_TYPE_POWER,
- { -10, 10, -10, 0 }, // BATTLE_TYPE_TANKER,
- { 20, -20, 0, -10 }, // BATTLE_TYPE_SUPER_POWER,
- { -20, 20, -10, 0 }, // BATTLE_TYPE_SUPER_TANKER,
- };
- const DWORD * exp_table = NULL;
- #ifdef NEW_PET_SYSTEM
- DWORD * exppet_table = NULL;
- //const DWORD pets = 4;
- const DWORD Pet_Table[4][2] =
- {
- { 55701, 34041 },
- { 55702, 34045 },
- { 55703, 34049 },
- { 55704, 34053 }
- };
- const DWORD Pet_Skill_Table[18][23] =
- {
- //Level Like Index ->> Bonus Value --> typeSkill --> CoolDown -->> Percentage
- { 78, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12 },
- { 80, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12 },
- { 79, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12 },
- { 81, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12 },
- { 93, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12 }, //5
- { 53, 0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 10 },
- { 97, 0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 12 },
- { 9, 0, 0, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, 16, 17, 17, 17 },
- { 16, 0, 0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9 },
- { 4, 1, 480, 17, 68, 153, 272, 425, 612, 833, 1088, 1377, 1700, 2057, 2448, 2873, 3332, 3825, 4352, 4913, 5508, 6137, 6800 }, //10
- { 23, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5 },
- { 24, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6 },
- { 27, 0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11 },
- { 28, 0, 0, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7 },
- { 44, 0, 0, 5, 10, 15, 20, 25, 31, 36, 41, 46, 51, 56, 61, 67, 72, 77, 82, 87, 92, 97, 103 }, //15
- { 52, 0, 0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6 },
- { 11, 1, 600, 2, 4, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 25, 26, 27 },
- { 6, 1, 480, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
- };
- const DWORD Pet_SKill_TablePerc[3][20] =
- {
- { 2, 5, 8, 11, 13, 16, 19, 22, 24, 27, 30, 33, 35, 38, 41, 44, 46, 49, 52, 55 },
- { 2, 5, 7, 10, 12, 15, 17, 20, 23, 25, 27, 30, 32, 35, 37, 40, 42, 45, 47, 50 },
- { 2, 5, 8, 11, 13, 16, 19, 22, 25, 27, 30, 33, 36, 38, 41, 44, 47, 50, 52, 55 }
- };
- DWORD exppet_table_common[121];
- #endif
- const DWORD exp_table_euckr[PLAYER_EXP_TABLE_MAX + 1] =
- {
- 0, // 0
- 100,
- 150,
- 260,
- 380,
- 600,
- 1300,
- 3300,
- 5700,
- 8700,
- 12800, // 10
- 18000,
- 25000,
- 36000,
- 52000,
- 73000,
- 100000,
- 125000,
- 160000,
- 220000,
- 280000, // 20
- 370000,
- 540000,
- 670000,
- 880000,
- 1000000,
- 1237000,
- 1418000,
- 1624000,
- 1857000,
- 2122000, // 30
- 2421000,
- 2761000,
- 3145000,
- 3580000,
- 4073000,
- 4632000,
- 5194000,
- 5717000,
- 6264000,
- 6837000, // 40
- 7600000,
- 8274000,
- 8990000,
- 9753000,
- 10560000,
- 11410000,
- 12320000,
- 13270000,
- 14280000,
- 15340000, // 50
- 16870000,
- 18960000,
- 19980000,
- 21420000,
- 22930000,
- 24530000,
- 26200000,
- 27960000,
- 29800000,
- 32780000, // 60
- 36060000,
- 39670000,
- 43640000,
- 48000000,
- 52800000,
- 58080000,
- 63890000,
- 70280000,
- 77310000,
- 85040000, // 70
- 93540000,
- 102900000,
- 113200000,
- 124500000,
- 137000000,
- 150700000,
- 165700000,
- 236990000,
- 260650000,
- 286780000, // 80
- 315380000,
- 346970000,
- 381680000,
- 419770000,
- 461760000,
- 508040000,
- 558740000,
- 614640000,
- 676130000,
- 743730000, // 90
- 1041222000,
- 1145344200,
- 1259878620,
- 1385866482,
- 1524453130,
- 1676898443,
- 1844588288,
- 2029047116,
- 2100000000, // 99 99레벨일 때 필요경험치 (100레벨이 되기 위한)
- 2100000000, // 100
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000, // 105
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000, // 110
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000, // 115
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000,
- 2100000000, // 120
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, // 130
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, // 140
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, //?50
- };
- const DWORD exp_table_common[PLAYER_EXP_TABLE_MAX + 1] =
- {
- 0, // 0
- 300,
- 800,
- 1500,
- 2500,
- 4300,
- 7200,
- 11000,
- 17000,
- 24000,
- 33000, // 10
- 43000,
- 58000,
- 76000,
- 100000,
- 130000,
- 169000,
- 219000,
- 283000,
- 365000,
- 472000, // 20
- 610000,
- 705000,
- 813000,
- 937000,
- 1077000,
- 1237000,
- 1418000,
- 1624000,
- 1857000,
- 2122000, // 30
- 2421000,
- 2761000,
- 3145000,
- 3580000,
- 4073000,
- 4632000,
- 5194000,
- 5717000,
- 6264000,
- 6837000, // 40
- 7600000,
- 8274000,
- 8990000,
- 9753000,
- 10560000,
- 11410000,
- 12320000,
- 13270000,
- 14280000,
- 15340000, // 50
- 16870000,
- 18960000,
- 19980000,
- 21420000,
- 22930000,
- 24530000,
- 26200000,
- 27960000,
- 29800000,
- 32780000, // 60
- 36060000,
- 39670000,
- 43640000,
- 48000000,
- 52800000,
- 58080000,
- 63890000,
- 70280000,
- 77310000,
- 85040000, // 70
- 93540000,
- 102900000,
- 113200000,
- 124500000,
- 137000000,
- 150700000,
- 165700000,
- 236990000,
- 260650000,
- 286780000, // 80
- 315380000,
- 346970000,
- 381680000,
- 419770000,
- 461760000,
- 508040000,
- 558740000,
- 614640000,
- 676130000,
- 743730000, // 90
- 1041222000,
- 1145344200,
- 1259878620,
- 1385866482,
- 1524453130,
- 1676898443,
- 1844588288,
- 2029047116,
- 2050000000, // 99레벨 일 때 필요경험치 (100레벨이 되기 위한)
- 2150000000, // 100
- 2210000000,
- 2250000000,
- 2280000000,
- 2310000000,
- 2330000000, // 105
- 2350000000,
- 2370000000,
- 2390000000,
- 2400000000,
- 2410000000, // 110
- 2420000000,
- 2430000000,
- 2440000000,
- 2450000000,
- 2460000000, // 115
- 2470000000,
- 2480000000,
- 2490000000,
- 2490000000,
- 2500000000, // 120
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, // 130
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, // 140
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, //?50
- };
- const DWORD exp_table_newcibn[PLAYER_EXP_TABLE_MAX + 1 ] =
- {
- 300, // 0
- 800, // 1
- 1500,
- 2500,
- 4300,
- 7200,
- 11400,
- 17000,
- 24000,
- 33000,
- 46000, // 10
- 62000,
- 83000,
- 111000,
- 149000,
- 200000,
- 268000,
- 360000,
- 482000,
- 647000,
- 868000, // 20
- 996000,
- 1143000,
- 1312000,
- 1506000,
- 1729000,
- 1984000,
- 2277000,
- 2614000,
- 3000000,
- 3443000, // 30
- 3952000,
- 4536000,
- 5206000,
- 5975000,
- 6858000,
- 7730000,
- 8504000,
- 9307000,
- 10140000,
- 11330000, // 40
- 12320000,
- 13370000,
- 14490000,
- 15670000,
- 16920000,
- 18240000,
- 19630000,
- 21090000,
- 22630000,
- 24670000, // 50
- 26890000,
- 29310000,
- 31950000,
- 34820000,
- 37960000,
- 41370000,
- 45100000,
- 49160000,
- 53580000,
- 58400000, // 60
- 63660000,
- 69390000,
- 75630000,
- 82440000,
- 89860000,
- 97950000,
- 106760000,
- 136370000,
- 151800000,
- 168300000, // 70
- 250000000,
- 340000000,
- 450000000,
- 570000000,
- 690000000,
- 810000000,
- 912600000,
- 1004000000,
- 1094000000,
- 1182000000, // 80
- 1269000000,
- 1354000000,
- 1438000000,
- 1521000000,
- 1603000000,
- 1684000000,
- 1764000000,
- 1844000000,
- 1922000000,
- 2000000000, // 90
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000, // 99 99레벨일 때 필요경험치 (100레벨이 되기 위한).. 현재 CIBN이 어떻게 운영하고 있는 지 모르니 신규 테이블을 쓰지 않고 기존값 계속 연장 유지
- 2000000000, // 100
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000, // 105
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000, // 110
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000, // 115
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000,
- 2000000000, // 120
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, // 130
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, // 140
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000,
- 2500000000, //?50
- };
- const int * aiPercentByDeltaLev = NULL;
- const int * aiPercentByDeltaLevForBoss = NULL;
- // 적과 나와의 레벨차이에 의한 계산에 사용되는 테이블
- // MIN(MAX_EXP_DELTA_OF_LEV - 1, (적렙 + 15) - 내렙))
- const int aiPercentByDeltaLevForBoss_euckr[MAX_EXP_DELTA_OF_LEV] =
- {
- 1, // -15 0
- 3, // -14 1
- 5, // -13 2
- 7, // -12 3
- 15, // -11 4
- 30, // -10 5
- 60, // -9 6
- 90, // -8 7
- 91, // -7 8
- 92, // -6 9
- 93, // -5 10
- 94, // -4 11
- 95, // -3 12
- 97, // -2 13
- 99, // -1 14
- 100, // 0 15
- 105, // 1 16
- 110, // 2 17
- 115, // 3 18
- 120, // 4 19
- 125, // 5 20
- 130, // 6 21
- 135, // 7 22
- 140, // 8 23
- 145, // 9 24
- 150, // 10 25
- 155, // 11 26
- 160, // 12 27
- 165, // 13 28
- 170, // 14 29
- 180 // 15 30
- };
- const int aiPercentByDeltaLev_euckr[MAX_EXP_DELTA_OF_LEV] =
- {
- 1, // -15 0
- 5, // -14 1
- 10, // -13 2
- 20, // -12 3
- 30, // -11 4
- 50, // -10 5
- 70, // -9 6
- 80, // -8 7
- 85, // -7 8
- 90, // -6 9
- 92, // -5 10
- 94, // -4 11
- 96, // -3 12
- 98, // -2 13
- 100, // -1 14
- 100, // 0 15
- 105, // 1 16
- 110, // 2 17
- 115, // 3 18
- 120, // 4 19
- 125, // 5 20
- 130, // 6 21
- 135, // 7 22
- 140, // 8 23
- 145, // 9 24
- 150, // 10 25
- 155, // 11 26
- 160, // 12 27
- 165, // 13 28
- 170, // 14 29
- 180, // 15 30
- };
- const DWORD party_exp_distribute_table[PLAYER_MAX_LEVEL_CONST + 1] =
- {
- 0,
- 10, 10, 10, 10, 15, 15, 20, 25, 30, 40, // 1 - 10
- 50, 60, 80, 100, 120, 140, 160, 184, 210, 240, // 11 - 20
- 270, 300, 330, 360, 390, 420, 450, 480, 510, 550, // 21 - 30
- 600, 640, 700, 760, 820, 880, 940, 1000, 1100, 1180, // 31 - 40
- 1260, 1320, 1380, 1440, 1500, 1560, 1620, 1680, 1740, 1800, // 41 - 50
- 1860, 1920, 2000, 2100, 2200, 2300, 2450, 2600, 2750, 2900, // 51 - 60
- 3050, 3200, 3350, 3500, 3650, 3800, 3950, 4100, 4250, 4400, // 61 - 70
- 4600, 4800, 5000, 5200, 5400, 5600, 5800, 6000, 6200, 6400, // 71 - 80
- 6600, 6900, 7100, 7300, 7600, 7800, 8000, 8300, 8500, 8800, // 81 - 90
- 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000, 9000, // 91 - 100
- 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, 10000, // 101 - 110
- 12000, 12000, 12000, 12000, 12000, 12000, 12000, 12000, 12000, 12000, // 111 - 120
- };
- Coord aArroundCoords[ARROUND_COORD_MAX_NUM] =
- {
- { 0, 0 },
- { 0, 50 },
- { 35, 35 },
- { 50, -0 },
- { 35, -35 },
- { 0, -50 },
- { -35, -35 },
- { -50, 0 },
- { -35, 35 },
- { 0, 100 },
- { 71, 71 },
- { 100, -0 },
- { 71, -71 },
- { 0, -100 },
- { -71, -71 },
- { -100, 0 },
- { -71, 71 },
- { 0, 150 },
- { 106, 106 },
- { 150, -0 },
- { 106, -106 },
- { 0, -150 },
- { -106, -106 },
- { -150, 0 },
- { -106, 106 },
- { 0, 200 },
- { 141, 141 },
- { 200, -0 },
- { 141, -141 },
- { 0, -200 },
- { -141, -141 },
- { -200, 0 },
- { -141, 141 },
- { 0, 250 },
- { 177, 177 },
- { 250, -0 },
- { 177, -177 },
- { 0, -250 },
- { -177, -177 },
- { -250, 0 },
- { -177, 177 },
- { 0, 300 },
- { 212, 212 },
- { 300, -0 },
- { 212, -212 },
- { 0, -300 },
- { -212, -212 },
- { -300, 0 },
- { -212, 212 },
- { 0, 350 },
- { 247, 247 },
- { 350, -0 },
- { 247, -247 },
- { 0, -350 },
- { -247, -247 },
- { -350, 0 },
- { -247, 247 },
- { 0, 400 },
- { 283, 283 },
- { 400, -0 },
- { 283, -283 },
- { 0, -400 },
- { -283, -283 },
- { -400, 0 },
- { -283, 283 },
- { 0, 450 },
- { 318, 318 },
- { 450, -0 },
- { 318, -318 },
- { 0, -450 },
- { -318, -318 },
- { -450, 0 },
- { -318, 318 },
- { 0, 500 },
- { 354, 354 },
- { 500, -0 },
- { 354, -354 },
- { 0, -500 },
- { -354, -354 },
- { -500, 0 },
- { -354, 354 },
- { 0, 550 },
- { 389, 389 },
- { 550, -0 },
- { 389, -389 },
- { 0, -550 },
- { -389, -389 },
- { -550, 0 },
- { -389, 389 },
- { 0, 600 },
- { 424, 424 },
- { 600, -0 },
- { 424, -424 },
- { 0, -600 },
- { -424, -424 },
- { -600, 0 },
- { -424, 424 },
- { 0, 650 },
- { 460, 460 },
- { 650, -0 },
- { 460, -460 },
- { 0, -650 },
- { -460, -460 },
- { -650, 0 },
- { -460, 460 },
- { 0, 700 },
- { 495, 495 },
- { 700, -0 },
- { 495, -495 },
- { 0, -700 },
- { -495, -495 },
- { -700, 0 },
- { -495, 495 },
- { 0, 750 },
- { 530, 530 },
- { 750, -0 },
- { 530, -530 },
- { 0, -750 },
- { -530, -530 },
- { -750, 0 },
- { -530, 530 },
- { 0, 800 },
- { 566, 566 },
- { 800, -0 },
- { 566, -566 },
- { 0, -800 },
- { -566, -566 },
- { -800, 0 },
- { -566, 566 },
- { 0, 850 },
- { 601, 601 },
- { 850, -0 },
- { 601, -601 },
- { 0, -850 },
- { -601, -601 },
- { -850, 0 },
- { -601, 601 },
- { 0, 900 },
- { 636, 636 },
- { 900, -0 },
- { 636, -636 },
- { 0, -900 },
- { -636, -636 },
- { -900, 0 },
- { -636, 636 },
- { 0, 950 },
- { 672, 672 },
- { 950, -0 },
- { 672, -672 },
- { 0, -950 },
- { -672, -672 },
- { -950, 0 },
- { -672, 672 },
- { 0, 1000 },
- { 707, 707 },
- { 1000, -0 },
- { 707, -707 },
- { 0, -1000 },
- { -707, -707 },
- { -1000, 0 },
- { -707, 707 },
- };
- const DWORD guild_exp_table[GUILD_MAX_LEVEL+1] =
- {
- 0,
- 15000UL,
- 45000UL,
- 90000UL,
- 160000UL,
- 235000UL,
- 325000UL,
- 430000UL,
- 550000UL,
- 685000UL,
- 835000UL,
- 1000000UL,
- 1500000UL,
- 2100000UL,
- 2800000UL,
- 3600000UL,
- 4500000UL,
- 6500000UL,
- 8000000UL,
- 10000000UL,
- 42000000UL
- };
- // INTERNATIONAL_VERSION 길드경험치
- const DWORD guild_exp_table2[GUILD_MAX_LEVEL+1] =
- {
- 0,
- 6000UL,
- 18000UL,
- 36000UL,
- 64000UL,
- 94000UL,
- 130000UL,
- 172000UL,
- 220000UL,
- 274000UL,
- 334000UL,
- 400000UL,
- 600000UL,
- 840000UL,
- 1120000UL,
- 1440000UL,
- 1800000UL,
- 2600000UL,
- 3200000UL,
- 4000000UL,
- 16800000UL
- };
- // END_OF_INTERNATIONAL_VERSION 길드경험치
- const int aiMobEnchantApplyIdx[MOB_ENCHANTS_MAX_NUM] =
- {
- APPLY_CURSE_PCT,
- APPLY_SLOW_PCT,
- APPLY_POISON_PCT,
- APPLY_STUN_PCT,
- APPLY_CRITICAL_PCT,
- APPLY_PENETRATE_PCT,
- };
- const int aiMobResistsApplyIdx[MOB_RESISTS_MAX_NUM] =
- {
- APPLY_RESIST_SWORD,
- APPLY_RESIST_TWOHAND,
- APPLY_RESIST_DAGGER,
- APPLY_RESIST_BELL,
- APPLY_RESIST_FAN,
- APPLY_RESIST_BOW,
- APPLY_RESIST_FIRE,
- APPLY_RESIST_ELEC,
- APPLY_RESIST_MAGIC,
- APPLY_RESIST_WIND,
- APPLY_POISON_REDUCE,
- };
- const int aiSocketPercentByQty[5][4] =
- {
- { 0, 0, 0, 0 },
- { 3, 0, 0, 0 },
- { 10, 1, 0, 0 },
- { 15, 10, 1, 0 },
- { 20, 15, 10, 1 }
- };
- const int aiWeaponSocketQty[WEAPON_NUM_TYPES] =
- {
- 3, // WEAPON_SWORD,
- 3, // WEAPON_DAGGER,
- 3, // WEAPON_BOW,
- 3, // WEAPON_TWO_HANDED,
- 3, // WEAPON_BELL,
- 3, // WEAPON_FAN,
- 0, // WEAPON_ARROW,
- 0, // WEAPON_MOUNT_SPEAR
- };
- const int aiArmorSocketQty[ARMOR_NUM_TYPES] =
- {
- 3, // ARMOR_BODY,
- 1, // ARMOR_HEAD,
- 1, // ARMOR_SHIELD,
- 0, // ARMOR_WRIST,
- 0, // ARMOR_FOOTS,
- 0 // ARMOR_ACCESSORY
- };
- TItemAttrMap g_map_itemAttr;
- TItemAttrMap g_map_itemRare;
- const TApplyInfo aApplyInfo[MAX_APPLY_NUM] =
- /*
- {
- DWORD dwPointType;
- }
- */
- {
- // Point Type
- { POINT_NONE, }, // APPLY_NONE, 0
- { POINT_MAX_HP, }, // APPLY_MAX_HP, 1
- { POINT_MAX_SP, }, // APPLY_MAX_SP, 2
- { POINT_HT, }, // APPLY_CON, 3
- { POINT_IQ, }, // APPLY_INT, 4
- { POINT_ST, }, // APPLY_STR, 5
- { POINT_DX, }, // APPLY_DEX, 6
- { POINT_ATT_SPEED, }, // APPLY_ATT_SPEED, 7
- { POINT_MOV_SPEED, }, // APPLY_MOV_SPEED, 8
- { POINT_CASTING_SPEED, }, // APPLY_CAST_SPEED, 9
- { POINT_HP_REGEN, }, // APPLY_HP_REGEN, 10
- { POINT_SP_REGEN, }, // APPLY_SP_REGEN, 11
- { POINT_POISON_PCT, }, // APPLY_POISON_PCT, 12
- { POINT_STUN_PCT, }, // APPLY_STUN_PCT, 13
- { POINT_SLOW_PCT, }, // APPLY_SLOW_PCT, 14
- { POINT_CRITICAL_PCT, }, // APPLY_CRITICAL_PCT, 15
- { POINT_PENETRATE_PCT, }, // APPLY_PENETRATE_PCT, 16
- { POINT_ATTBONUS_HUMAN, }, // APPLY_ATTBONUS_HUMAN, 17
- { POINT_ATTBONUS_ANIMAL, }, // APPLY_ATTBONUS_ANIMAL, 18
- { POINT_ATTBONUS_ORC, }, // APPLY_ATTBONUS_ORC, 19
- { POINT_ATTBONUS_MILGYO, }, // APPLY_ATTBONUS_MILGYO, 20
- { POINT_ATTBONUS_UNDEAD, }, // APPLY_ATTBONUS_UNDEAD, 21
- { POINT_ATTBONUS_DEVIL, }, // APPLY_ATTBONUS_DEVIL, 22
- { POINT_STEAL_HP, }, // APPLY_STEAL_HP, 23
- { POINT_STEAL_SP, }, // APPLY_STEAL_SP, 24
- { POINT_MANA_BURN_PCT, }, // APPLY_MANA_BURN_PCT, 25
- { POINT_DAMAGE_SP_RECOVER, }, // APPLY_DAMAGE_SP_RECOVER,26
- { POINT_BLOCK, }, // APPLY_BLOCK, 27
- { POINT_DODGE, }, // APPLY_DODGE, 28
- { POINT_RESIST_SWORD, }, // APPLY_RESIST_SWORD, 29
- { POINT_RESIST_TWOHAND, }, // APPLY_RESIST_TWOHAND, 30
- { POINT_RESIST_DAGGER, }, // APPLY_RESIST_DAGGER, 31
- { POINT_RESIST_BELL, }, // APPLY_RESIST_BELL, 32
- { POINT_RESIST_FAN, }, // APPLY_RESIST_FAN, 33
- { POINT_RESIST_BOW, }, // APPLY_RESIST_BOW, 34
- { POINT_RESIST_FIRE, }, // APPLY_RESIST_FIRE, 35
- { POINT_RESIST_ELEC, }, // APPLY_RESIST_ELEC, 36
- { POINT_RESIST_MAGIC, }, // APPLY_RESIST_MAGIC, 37
- { POINT_RESIST_WIND, }, // APPLY_RESIST_WIND, 38
- { POINT_REFLECT_MELEE, }, // APPLY_REFLECT_MELEE, 39
- { POINT_REFLECT_CURSE, }, // APPLY_REFLECT_CURSE, 40
- { POINT_POISON_REDUCE, }, // APPLY_POISON_REDUCE, 41
- { POINT_KILL_SP_RECOVER, }, // APPLY_KILL_SP_RECOVER, 42
- { POINT_EXP_DOUBLE_BONUS, }, // APPLY_EXP_DOUBLE_BONUS, 43
- { POINT_GOLD_DOUBLE_BONUS, }, // APPLY_GOLD_DOUBLE_BONUS,44
- { POINT_ITEM_DROP_BONUS, }, // APPLY_ITEM_DROP_BONUS, 45
- { POINT_POTION_BONUS, }, // APPLY_POTION_BONUS, 46
- { POINT_KILL_HP_RECOVERY, }, // APPLY_KILL_HP_RECOVER, 47
- { POINT_IMMUNE_STUN, }, // APPLY_IMMUNE_STUN, 48
- { POINT_IMMUNE_SLOW, }, // APPLY_IMMUNE_SLOW, 49
- { POINT_IMMUNE_FALL, }, // APPLY_IMMUNE_FALL, 50
- { POINT_NONE, }, // APPLY_SKILL, 51
- { POINT_BOW_DISTANCE, }, // APPLY_BOW_DISTANCE, 52
- { POINT_ATT_GRADE_BONUS, }, // APPLY_ATT_GRADE, 53
- { POINT_DEF_GRADE_BONUS, }, // APPLY_DEF_GRADE, 54
- { POINT_MAGIC_ATT_GRADE_BONUS, }, // APPLY_MAGIC_ATT_GRADE, 55
- { POINT_MAGIC_DEF_GRADE_BONUS, }, // APPLY_MAGIC_DEF_GRADE, 56
- { POINT_CURSE_PCT, }, // APPLY_CURSE_PCT, 57
- { POINT_MAX_STAMINA }, // APPLY_MAX_STAMINA 58
- { POINT_ATTBONUS_WARRIOR }, // APPLY_ATTBONUS_WARRIOR 59
- { POINT_ATTBONUS_ASSASSIN }, // APPLY_ATTBONUS_ASSASSIN 60
- { POINT_ATTBONUS_SURA }, // APPLY_ATTBONUS_SURA 61
- { POINT_ATTBONUS_SHAMAN }, // APPLY_ATTBONUS_SHAMAN 62
- { POINT_ATTBONUS_MONSTER }, // APPLY_ATTBONUS_MONSTER 63
- { POINT_ATT_BONUS }, // 64 // APPLY_MALL_ATTBONUS
- { POINT_MALL_DEFBONUS }, // 65
- { POINT_MALL_EXPBONUS }, // 66 APPLY_MALL_EXPBONUS
- { POINT_MALL_ITEMBONUS }, // 67
- { POINT_MALL_GOLDBONUS }, // 68
- { POINT_MAX_HP_PCT }, // 69
- { POINT_MAX_SP_PCT }, // 70
- { POINT_SKILL_DAMAGE_BONUS }, // 71
- { POINT_NORMAL_HIT_DAMAGE_BONUS }, // 72
- // DEFEND_BONUS_ATTRIBUTES
- { POINT_SKILL_DEFEND_BONUS }, // 73
- { POINT_NORMAL_HIT_DEFEND_BONUS }, // 74
- // END_OF_DEFEND_BONUS_ATTRIBUTES
- // PC_BANG_ITEM_ADD
- { POINT_PC_BANG_EXP_BONUS }, // 75
- { POINT_PC_BANG_DROP_BONUS }, // 76
- // END_PC_BANG_ITEM_ADD
- { POINT_NONE, }, // 77 사용시 HP 소모 APPLY_EXTRACT_HP_PCT
- { POINT_RESIST_WARRIOR, }, // 78 무사에게 저항 APPLY_RESIST_WARRIOR
- { POINT_RESIST_ASSASSIN, }, // 79 자객에게 저항 APPLY_RESIST_ASSASSIN
- { POINT_RESIST_SURA, }, // 80 수라에게 저항 APPLY_RESIST_SURA
- { POINT_RESIST_SHAMAN, }, // 81 무당에게 저항 APPLY_RESIST_SHAMAN
- { POINT_ENERGY }, // 82 기력
- { POINT_DEF_GRADE }, // 83 방어력. DEF_GRADE_BONUS는 클라에서 두배로 보여지는 의도된 버그(...)가 있다.
- { POINT_COSTUME_ATTR_BONUS }, // 84 코스튬에 붙은 속성에 대해서만 보너스를 주는 기력
- { POINT_MAGIC_ATT_BONUS_PER }, // 85 마법 공격력 +x%
- { POINT_MELEE_MAGIC_ATT_BONUS_PER }, // 86 APPLY_MELEE_MAGIC_ATTBONUS_PER
- { POINT_RESIST_ICE, }, // APPLY_RESIST_ICE, 87
- { POINT_RESIST_EARTH, }, // APPLY_RESIST_EARTH, 88
- { POINT_RESIST_DARK, }, // APPLY_RESIST_DARK, 89
- { POINT_RESIST_CRITICAL, }, // APPLY_ANTI_CRITICAL_PCT, 90
- { POINT_RESIST_PENETRATE, }, // APPLY_ANTI_PENETRATE_PCT, 91
- };
- const int aiItemMagicAttributePercentHigh[ITEM_ATTRIBUTE_MAX_LEVEL] =
- {
- //25, 25, 40, 8, 2,
- 30, 40, 20, 8, 2
- };
- const int aiItemMagicAttributePercentLow[ITEM_ATTRIBUTE_MAX_LEVEL] =
- {
- //45, 25, 20, 10, 0,
- 50, 40, 10, 0, 0
- };
- // ADD_ITEM_ATTRIBUTE
- const int aiItemAttributeAddPercent[ITEM_ATTRIBUTE_MAX_NUM] =
- {
- 100, 80, 60, 50, 30, 0, 0,
- };
- // END_OF_ADD_ITEM_ATTRIBUTE
- const int aiExpLossPercents[PLAYER_EXP_TABLE_MAX + 1] =
- {
- 0,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, // 1 - 10
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 11 - 20
- 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, // 21 - 30
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 31 - 40
- 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, // 41 - 50
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 51 - 60
- 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, // 61 - 70
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 71 - 80
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 81 - 90
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 91 - 100
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 101 - 110
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 111 - 120
- };
- const int aiSkillBookCountForLevelUp[10] =
- {
- 3, 3, 3, 3, 3, 4, 4, 5, 5, 6
- };
- // ADD_GRANDMASTER_SKILL
- const int aiGrandMasterSkillBookCountForLevelUp[10] =
- {
- 3, 3, 5, 5, 7, 7, 10, 10, 10, 20,
- };
- const int aiGrandMasterSkillBookMinCount[10] =
- {
- // 1, 1, 3, 5, 10, 15, 20, 30, 40, 50,
- // 3, 3, 5, 5, 10, 10, 15, 15, 20, 30
- 1, 1, 1, 2, 2, 3, 3, 4, 5, 6
- };
- const int aiGrandMasterSkillBookMaxCount[10] =
- {
- // 6, 15, 30, 45, 60, 80, 100, 120, 160, 200,
- // 6, 10, 15, 20, 30, 40, 50, 60, 70, 80
- 5, 7, 9, 11, 13, 15, 20, 25, 30, 35
- };
- // END_OF_ADD_GRANDMASTER_SKILL
- const int CHN_aiPartyBonusExpPercentByMemberCount[9] =
- {
- 0, 0, 12, 18, 26, 40, 53, 70, 100
- };
- // UPGRADE_PARTY_BONUS
- const int KOR_aiPartyBonusExpPercentByMemberCount[9] =
- {
- 0,
- 0,
- 30, // 66% * 2 - 100
- 60, // 53% * 3 - 100
- 75, // 44% * 4 - 100
- 90, // 38% * 5 - 100
- 105, // 34% * 6 - 100
- 110, // 30% * 7 - 100
- 140, // 30% * 8 - 100
- };
- const int KOR_aiUniqueItemPartyBonusExpPercentByMemberCount[9] =
- {
- 0,
- 0,
- 15*2,
- 14*3,
- 13*4,
- 12*5,
- 11*6,
- 10*7,
- 10*8,
- };
- // END_OF_UPGRADE_PARTY_BONUS
- const int * aiChainLightningCountBySkillLevel = NULL;
- const int aiChainLightningCountBySkillLevel_euckr[SKILL_MAX_LEVEL+1] =
- {
- 0, // 0
- 2, // 1
- 2, // 2
- 2, // 3
- 2, // 4
- 2, // 5
- 2, // 6
- 2, // 7
- 2, // 8
- 3, // 9
- 3, // 10
- 3, // 11
- 3, // 12
- 3, // 13
- 3, // 14
- 3, // 15
- 3, // 16
- 3, // 17
- 3, // 18
- 4, // 19
- 4, // 20
- 4, // 21
- 4, // 22
- 4, // 23
- 5, // 24
- 5, // 25
- 5, // 26
- 5, // 27
- 5, // 28
- 5, // 29
- 5, // 30
- 5, // 31
- 5, // 32
- 5, // 33
- 5, // 34
- 5, // 35
- 5, // 36
- 5, // 37
- 5, // 38
- 5, // 39
- 5, // 40
- };
- const SStoneDropInfo aStoneDrop[STONE_INFO_MAX_NUM] =
- {
- // mob pct {+0 +1 +2 +3 +4}
- {8005, 60, {30, 30, 30, 9, 1} },
- {8006, 60, {28, 29, 31, 11, 1} },
- {8007, 60, {24, 29, 32, 13, 2} },
- {8008, 60, {22, 28, 33, 15, 2} },
- {8009, 60, {21, 27, 33, 17, 2} },
- {8010, 60, {18, 26, 34, 20, 2} },
- {8011, 60, {14, 26, 35, 22, 3} },
- {8012, 60, {10, 26, 37, 24, 3} },
- {8013, 60, {2, 26, 40, 29, 3} },
- {8014, 60, {0, 26, 41, 30, 3} },
- };
- const char * c_apszEmpireNames[EMPIRE_MAX_NUM] =
- {
- "전제국",
- "신수국",
- "천조국",
- "진노국"
- };
- const char * c_apszPrivNames[MAX_PRIV_NUM] =
- {
- "",
- "아이템이 나올 확률",
- "돈이 나올 확률",
- "돈 대박이 나올 확률",
- "경험치 배율",
- };
- const int aiPolymorphPowerByLevel[SKILL_MAX_LEVEL + 1] =
- {
- 10, // 1
- 11, // 2
- 11, // 3
- 12, // 4
- 13, // 5
- 13, // 6
- 14, // 7
- 15, // 8
- 16, // 9
- 17, // 10
- 18, // 11
- 19, // 12
- 20, // 13
- 22, // 14
- 23, // 15
- 24, // 16
- 26, // 17
- 27, // 18
- 29, // 19
- 31, // 20
- 33, // 21
- 35, // 22
- 37, // 23
- 39, // 24
- 41, // 25
- 44, // 26
- 46, // 27
- 49, // 28
- 52, // 29
- 55, // 30
- 59, // 31
- 62, // 32
- 66, // 33
- 70, // 34
- 74, // 35
- 79, // 36
- 84, // 37
- 89, // 38
- 94, // 39
- 100, // 40
- };
- TGuildWarInfo KOR_aGuildWarInfo[GUILD_WAR_TYPE_MAX_NUM] =
- /*
- {
- long lMapIndex;
- int iWarPrice;
- int iWinnerPotionRewardPctToWinner;
- int iLoserPotionRewardPctToWinner;
- int iInitialScore;
- int iEndScore;
- };
- */
- {
- { 0, 0, 0, 0, 0, 0 },
- { 110, 0, 100, 50, 0, 100 },
- { 111, 0, 100, 50, 0, 10 },
- };
- //
- // 악세서리 소켓용 수치들
- //
- // 다이아몬드로 소켓을 추가할 때 확률
- const int aiAccessorySocketAddPct[ITEM_ACCESSORY_SOCKET_MAX_NUM] =
- {
- 50, 50, 50
- };
- // 악세서리 수치 값의 몇%만큼의 성능을 추가하는지
- const int aiAccessorySocketEffectivePct[ITEM_ACCESSORY_SOCKET_MAX_NUM + 1] =
- {
- 0, 10, 20, 40
- };
- // 소켓 지속시간 24, 12, 6
- const int aiAccessorySocketDegradeTime[ITEM_ACCESSORY_SOCKET_MAX_NUM + 1] =
- {
- 0, 3600 * 24, 3600 * 12, 3600 * 6
- };
- // 소켓 장착 성공률
- const int aiAccessorySocketPutPct[ITEM_ACCESSORY_SOCKET_MAX_NUM + 1] =
- {
- 90, 80, 70, 0
- };
- // END_OF_ACCESSORY_REFINE
- #include "../../common/length.h"
- // from import_item_proto.c
- typedef struct SValueName
- {
- const char * c_pszName;
- long lValue;
- } TValueName;
- TValueName c_aApplyTypeNames[] =
- {
- { "STR", APPLY_STR },
- { "DEX", APPLY_DEX },
- { "CON", APPLY_CON },
- { "INT", APPLY_INT },
- { "MAX_HP", APPLY_MAX_HP },
- { "MAX_SP", APPLY_MAX_SP },
- { "MAX_STAMINA", APPLY_MAX_STAMINA },
- { "POISON_REDUCE", APPLY_POISON_REDUCE },
- { "EXP_DOUBLE_BONUS", APPLY_EXP_DOUBLE_BONUS },
- { "GOLD_DOUBLE_BONUS", APPLY_GOLD_DOUBLE_BONUS },
- { "ITEM_DROP_BONUS", APPLY_ITEM_DROP_BONUS },
- { "HP_REGEN", APPLY_HP_REGEN },
- { "SP_REGEN", APPLY_SP_REGEN },
- { "ATTACK_SPEED", APPLY_ATT_SPEED },
- { "MOVE_SPEED", APPLY_MOV_SPEED },
- { "CAST_SPEED", APPLY_CAST_SPEED },
- { "ATT_BONUS", APPLY_ATT_GRADE_BONUS },
- { "DEF_BONUS", APPLY_DEF_GRADE_BONUS },
- { "MAGIC_ATT_GRADE",APPLY_MAGIC_ATT_GRADE },
- { "MAGIC_DEF_GRADE",APPLY_MAGIC_DEF_GRADE },
- { "SKILL", APPLY_SKILL },
- { "ATTBONUS_ANIMAL",APPLY_ATTBONUS_ANIMAL },
- { "ATTBONUS_UNDEAD",APPLY_ATTBONUS_UNDEAD },
- { "ATTBONUS_DEVIL", APPLY_ATTBONUS_DEVIL },
- { "ATTBONUS_HUMAN", APPLY_ATTBONUS_HUMAN },
- { "ADD_BOW_DISTANCE",APPLY_BOW_DISTANCE },
- { "DODGE", APPLY_DODGE },
- { "BLOCK", APPLY_BLOCK },
- { "RESIST_SWORD", APPLY_RESIST_SWORD },
- { "RESIST_TWOHAND", APPLY_RESIST_TWOHAND },
- { "RESIST_DAGGER", APPLY_RESIST_DAGGER },
- { "RESIST_BELL", APPLY_RESIST_BELL },
- { "RESIST_FAN", APPLY_RESIST_FAN },
- { "RESIST_BOW", APPLY_RESIST_BOW },
- { "RESIST_FIRE", APPLY_RESIST_FIRE },
- { "RESIST_ELEC", APPLY_RESIST_ELEC },
- { "RESIST_MAGIC", APPLY_RESIST_MAGIC },
- { "RESIST_WIND", APPLY_RESIST_WIND },
- { "REFLECT_MELEE", APPLY_REFLECT_MELEE },
- { "REFLECT_CURSE", APPLY_REFLECT_CURSE },
- { "RESIST_ICE", APPLY_RESIST_ICE },
- { "RESIST_EARTH", APPLY_RESIST_EARTH },
- { "RESIST_DARK", APPLY_RESIST_DARK },
- { "RESIST_CRITICAL", APPLY_ANTI_CRITICAL_PCT },
- { "RESIST_PENETRATE", APPLY_ANTI_PENETRATE_PCT },
- { "POISON", APPLY_POISON_PCT },
- { "SLOW", APPLY_SLOW_PCT },
- { "STUN", APPLY_STUN_PCT },
- { "STEAL_HP", APPLY_STEAL_HP },
- { "STEAL_SP", APPLY_STEAL_SP },
- { "MANA_BURN_PCT", APPLY_MANA_BURN_PCT },
- { "CRITICAL", APPLY_CRITICAL_PCT },
- { "PENETRATE", APPLY_PENETRATE_PCT },
- { "KILL_SP_RECOVER",APPLY_KILL_SP_RECOVER },
- { "KILL_HP_RECOVER",APPLY_KILL_HP_RECOVER },
- { "PENETRATE_PCT", APPLY_PENETRATE_PCT },
- { "CRITICAL_PCT", APPLY_CRITICAL_PCT },
- { "POISON_PCT", APPLY_POISON_PCT },
- { "STUN_PCT", APPLY_STUN_PCT },
- { "ATT_BONUS_TO_WARRIOR", APPLY_ATTBONUS_WARRIOR },
- { "ATT_BONUS_TO_ASSASSIN", APPLY_ATTBONUS_ASSASSIN },
- { "ATT_BONUS_TO_SURA", APPLY_ATTBONUS_SURA },
- { "ATT_BONUS_TO_SHAMAN", APPLY_ATTBONUS_SHAMAN },
- { "ATT_BONUS_TO_MONSTER", APPLY_ATTBONUS_MONSTER },
- { "ATT_BONUS_TO_MOB", APPLY_ATTBONUS_MONSTER },
- { "MALL_ATTBONUS", APPLY_MALL_ATTBONUS },
- { "MALL_EXPBONUS", APPLY_MALL_EXPBONUS },
- { "MALL_DEFBONUS", APPLY_MALL_DEFBONUS },
- { "MALL_ITEMBONUS", APPLY_MALL_ITEMBONUS },
- { "MALL_GOLDBONUS", APPLY_MALL_GOLDBONUS },
- { "MAX_HP_PCT", APPLY_MAX_HP_PCT },
- { "MAX_SP_PCT", APPLY_MAX_SP_PCT },
- { "SKILL_DAMAGE_BONUS", APPLY_SKILL_DAMAGE_BONUS },
- { "NORMAL_HIT_DAMAGE_BONUS",APPLY_NORMAL_HIT_DAMAGE_BONUS },
- { "SKILL_DEFEND_BONUS", APPLY_SKILL_DEFEND_BONUS },
- { "NORMAL_HIT_DEFEND_BONUS",APPLY_NORMAL_HIT_DEFEND_BONUS },
- { "PCBANG_EXP_BONUS", APPLY_PC_BANG_EXP_BONUS },
- { "PCBANG_DROP_BONUS", APPLY_PC_BANG_DROP_BONUS },
- { "RESIST_WARRIOR", APPLY_RESIST_WARRIOR},
- { "RESIST_ASSASSIN", APPLY_RESIST_ASSASSIN},
- { "RESIST_SURA", APPLY_RESIST_SURA},
- { "RESIST_SHAMAN", APPLY_RESIST_SHAMAN},
- // by mhh game/affect.h 정의되어있음. INFINITE_AFFECT_DURATION = 0x1FFFFFFF
- { "INFINITE_AFFECT_DURATION", 0x1FFFFFFF },
- { "ENERGY", APPLY_ENERGY }, // 기력
- { "COSTUME_ATTR_BONUS", APPLY_COSTUME_ATTR_BONUS }, // 기력
- { "MAGIC_ATTBONUS_PER", APPLY_MAGIC_ATTBONUS_PER },
- { "MELEE_MAGIC_ATTBONUS_PER", APPLY_MELEE_MAGIC_ATTBONUS_PER },
- { NULL, 0 }
- };
- // from import_item_proto.c
- long FN_get_apply_type(const char *apply_type_string)
- {
- TValueName *value_name;
- for (value_name = c_aApplyTypeNames; value_name->c_pszName; ++value_name)
- {
- if (0==strcasecmp(value_name->c_pszName, apply_type_string))
- return value_name->lValue;
- }
- return 0;
- }
Wäre nett wenn mir jemand helfen könnte
Edit: char.h hinzugefügt
Edit2: Problem mit der questlua_petnew.cpp behoben dafür neues Problem