Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ENABLE_GM_FLAG_IF_TEST_SERVER
- // #define ENABLE_GM_FLAG_FOR_LOW_WIZARD
- void CHARACTER::SetPlayerProto(const TPlayerTable * t)
- {
- if (!GetDesc() || !*GetDesc()->GetHostName())
- sys_err("cannot get desc or hostname");
- else
- SetGMLevel();
- m_PlayerSlots = std::make_unique<PlayerSlotT>(); // @fixme199
- m_bCharType = CHAR_TYPE_PC;
- m_dwPlayerID = t->id;
- m_iAlignment = t->lAlignment;
- m_iRealAlignment = t->lAlignment;
- m_points.voice = t->voice;
- m_points.skill_group = t->skill_group;
- m_pointsInstant.bBasePart = t->part_base;
- SetPart(PART_HAIR, t->parts[PART_HAIR]);
- m_points.iRandomHP = t->sRandomHP;
- m_points.iRandomSP = t->sRandomSP;
- // REMOVE_REAL_SKILL_LEVLES
- if (m_pSkillLevels)
- M2_DELETE_ARRAY(m_pSkillLevels);
- m_pSkillLevels = M2_NEW TPlayerSkill[SKILL_MAX_NUM];
- thecore_memcpy(m_pSkillLevels, t->skills, sizeof(TPlayerSkill) * SKILL_MAX_NUM);
- // END_OF_REMOVE_REAL_SKILL_LEVLES
- if (t->lMapIndex >= 10000)
- {
- m_posWarp.x = t->lExitX;
- m_posWarp.y = t->lExitY;
- m_lWarpMapIndex = t->lExitMapIndex;
- }
- SetRealPoint(POINT_PLAYTIME, t->playtime);
- m_dwLoginPlayTime = t->playtime;
- SetRealPoint(POINT_ST, t->st);
- SetRealPoint(POINT_HT, t->ht);
- SetRealPoint(POINT_DX, t->dx);
- SetRealPoint(POINT_IQ, t->iq);
- SetPoint(POINT_ST, t->st);
- SetPoint(POINT_HT, t->ht);
- SetPoint(POINT_DX, t->dx);
- SetPoint(POINT_IQ, t->iq);
- SetPoint(POINT_STAT, t->stat_point);
- SetPoint(POINT_SKILL, t->skill_point);
- SetPoint(POINT_SUB_SKILL, t->sub_skill_point);
- SetPoint(POINT_HORSE_SKILL, t->horse_skill_point);
- SetPoint(POINT_STAT_RESET_COUNT, t->stat_reset_count);
- SetPoint(POINT_LEVEL_STEP, t->level_step);
- SetRealPoint(POINT_LEVEL_STEP, t->level_step);
- SetRace(t->job);
- SetLevel(t->level);
- SetExp(t->exp);
- SetGold(t->gold);
- #ifdef ENABLE_CHEQUE_SYSTEM
- SetCheque(t->cheque);
- #endif
- SetMapIndex(t->lMapIndex);
- SetXYZ(t->x, t->y, t->z);
- ComputePoints();
- SetHP(t->hp);
- SetSP(t->sp);
- SetStamina(t->stamina);
- #ifndef ENABLE_GM_FLAG_IF_TEST_SERVER
- if (!test_server)
- #endif
- {
- #ifdef ENABLE_GM_AFFECTS
- if (GetGMLevel() == GM_IMPLEMENTOR)
- {
- m_afAffectFlag.Set(AFF_YMIR_IMPLEMENTOR);
- m_bPKMode = PK_MODE_PROTECT;
- }
- else if (GetGMLevel() == GM_HIGH_WIZARD)
- {
- m_afAffectFlag.Set(AFF_YMIR_HIGH_WIZARD);
- m_bPKMode = PK_MODE_PROTECT;
- }
- else if (GetGMLevel() == GM_GOD)
- {
- m_afAffectFlag.Set(AFF_YMIR_GOD);
- m_bPKMode = PK_MODE_PROTECT;
- }
- else if (GetGMLevel() == GM_LOW_WIZARD)
- {
- m_afAffectFlag.Set(AFF_YMIR_LOW_WIZARD);
- m_bPKMode = PK_MODE_PROTECT;
- }
- #else
- #ifdef ENABLE_GM_FLAG_FOR_LOW_WIZARD
- if (GetGMLevel() > GM_PLAYER)
- #else
- if (GetGMLevel() > GM_LOW_WIZARD)
- #endif
- {
- m_afAffectFlag.Set(AFF_YMIR);
- m_bPKMode = PK_MODE_PROTECT;
- }
- #endif
- }
- if (GetLevel() < PK_PROTECT_LEVEL)
- m_bPKMode = PK_MODE_PROTECT;
- SetHorseData(t->horse);
- if (GetHorseLevel() > 0)
- UpdateHorseDataByLogoff(t->logoff_interval);
- thecore_memcpy(m_aiPremiumTimes, t->aiPremiumTimes, sizeof(t->aiPremiumTimes));
- m_dwLogOffInterval = t->logoff_interval;
- sys_log(0, "PLAYER_LOAD: %s PREMIUM %d %d, LOGGOFF_INTERVAL %u PTR: %p", t->name, m_aiPremiumTimes[0], m_aiPremiumTimes[1], t->logoff_interval, this);
- if (GetGMLevel() != GM_PLAYER)
- {
- LogManager::instance().CharLog(this, GetGMLevel(), "GM_LOGIN", "");
- sys_log(0, "GM_LOGIN(gmlevel=%d, name=%s(%d), pos=(%d, %d)", GetGMLevel(), GetName(), GetPlayerID(), GetX(), GetY());
- }
- #ifdef __PET_SYSTEM__
- if (m_petSystem)
- {
- m_petSystem->Destroy();
- delete m_petSystem;
- }
- m_petSystem = M2_NEW CPetSystem(this);
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement