Player 테이블의 나머지 읽기 함수입니다. 공통 조건: 캐릭터가 로그인한 상태여야 합니다(LOGGED 상태 이상). 유효하지 않으면 각 함수에 기재된 대로 0 / 빈 문자열 / false를 반환합니다. 대부분의 함수는 aIndex(integer, 캐릭터 인덱스) 매개변수 하나만 받으며, 매개변수가 더 있는 함수는 별도로 명시합니다.

PK

Player.GetPKCount

캐릭터의 현재 살인 횟수(PK 점수)를 반환합니다.

Player.GetPKCount(aIndex) -> integer

매개변수: aIndex. 반환값: PK 수; 유효하지 않으면 0. 짧은 이름: GetObjectPKCount.

local pk = Player.GetPKCount(aIndex)

Player.GetPKLevel

PK 등급(영웅 / 일반 / 살인자 상태)을 반환합니다.

Player.GetPKLevel(aIndex) -> integer

매개변수: aIndex. 반환값: PK 등급; 유효하지 않으면 0. 짧은 이름: GetObjectPKLevel.

값의미
0Hero (영웅)
1Hero 2단계
2Hero 1단계
3일반 (Commoner)
4살인자 1단계
5살인자 2단계
6살인자 3단계
local lv = Player.GetPKLevel(aIndex)

Player.GetPKTimer

캐릭터의 PK 점수 / 시간 카운터를 반환합니다(GameServer의 PKPoints 값).

Player.GetPKTimer(aIndex) -> integer

매개변수: aIndex. 반환값: 카운터 값; 유효하지 않으면 0. 짧은 이름: GetObjectPKTimer.

local t = Player.GetPKTimer(aIndex)

Player.GetPKTotalCount

캐릭터가 다른 플레이어를 처치한 총 횟수 통계를 반환합니다.

Player.GetPKTotalCount(aIndex) -> integer

매개변수: aIndex. 반환값: 총 횟수; 유효하지 않으면 0.

local total = Player.GetPKTotalCount(aIndex)

파티와 길드

Player.GetPartyNumber

캐릭터의 파티 번호를 반환합니다.

Player.GetPartyNumber(aIndex) -> integer

매개변수: aIndex. 반환값: 파티 번호; 파티가 없으면 -1. 짧은 이름: GetObjectPartyNumber.

local party = Player.GetPartyNumber(aIndex)
if party == -1 then return end

Player.GetGuildNumber

캐릭터의 길드 번호를 반환합니다.

Player.GetGuildNumber(aIndex) -> integer

매개변수: aIndex. 반환값: 길드 번호; 유효하지 않거나 캐릭터에게 길드가 없으면 0. 짧은 이름: GetObjectGuildNumber.

local g = Player.GetGuildNumber(aIndex)

Player.GetGuildStatus

캐릭터의 길드 내 직위를 반환합니다.

Player.GetGuildStatus(aIndex) -> integer

매개변수: aIndex. 반환값: 128 길드 마스터, 64 부길드 마스터, 32 전투 마스터, 0 일반 멤버, -1 길드 없음. 짧은 이름: GetObjectGuildStatus.

if Player.GetGuildStatus(aIndex) == 128 then Message.Send(aIndex, 1, "당신은 길드 마스터입니다") end

Player.GetGuildName

캐릭터의 길드 이름을 반환합니다.

Player.GetGuildName(aIndex) -> string

매개변수: aIndex. 반환값: 길드 이름; 길드가 없으면 빈 문자열. 짧은 이름: GetObjectGuildName.

local gname = Player.GetGuildName(aIndex)

Player.GetGuildRelationship

두 캐릭터 간의 길드 관계를 반환합니다.

Player.GetGuildRelationship(aIndex, bIndex) -> integer
매개변수타입설명
aIndexinteger첫 번째 캐릭터 인덱스
bIndexinteger두 번째 캐릭터 인덱스

반환값: 관계 코드; 두 캐릭터 중 하나라도 유효하지 않으면 0. 짧은 이름: GetObjectGuildRelationship.

값의미
0관계 없음 (또는 둘 중 하나가 길드가 없음)
1같은 연합 (alliance)
2적대 (적대 길드로 지정됨. 상대방과 같은 연합의 길드와 적대하는 경우 포함)
local rel = Player.GetGuildRelationship(aIndex, bIndex)

Player.GetGuildUnionNumber

캐릭터 길드의 연합(alliance) 번호를 반환합니다.

Player.GetGuildUnionNumber(aIndex) -> integer

매개변수: aIndex. 반환값: 연합 번호; 없으면 0. 짧은 이름: GetObjectGuildUnionNumber.

local union = Player.GetGuildUnionNumber(aIndex)

Player.GetGuildUnionName

연합 맹주 길드의 이름을 반환합니다.

Player.GetGuildUnionName(aIndex) -> string

매개변수: aIndex. 반환값: 연합 맹주 길드 이름; 없으면 빈 문자열. 짧은 이름: GetObjectGuildUnionName.

local un = Player.GetGuildUnionName(aIndex)

Player.GetCastleSiegeSide

캐릭터가 공성전에서 속한 진영을 반환합니다.

Player.GetCastleSiegeSide(aIndex) -> integer

매개변수: aIndex. 반환값: 공격 / 수비 진영 코드(아래 표 참조); 유효하지 않거나 참가하지 않으면 0. 짧은 이름: GetObjectCSGuildSide.

값의미
0참가하지 않음
1수비 진영
2, 3, 4공격 진영 (공격 1, 2, 3)
local side = Player.GetCastleSiegeSide(aIndex)

Gens

Player.GetGensRank

캐릭터의 Gens 순위를 반환합니다.

Player.GetGensRank(aIndex) -> integer

매개변수: aIndex. 반환값: 순위; 유효하지 않으면 0. 짧은 이름: GetObjectGensRank.

local r = Player.GetGensRank(aIndex)

Player.GetGensSymbol

캐릭터의 Gens 계급(심볼)을 반환합니다.

Player.GetGensSymbol(aIndex) -> integer

매개변수: aIndex. 반환값: Gens 계급; 유효하지 않으면 0. 짧은 이름: GetObjectGensSymbol.

local s = Player.GetGensSymbol(aIndex)

Player.GetGensFamily

캐릭터의 Gens 진영을 반환합니다.

Player.GetGensFamily(aIndex) -> integer

매개변수: aIndex. 반환값: 1 Duprian, 2 Vanert (서버에 저장된 값); 진영이 없거나 유효하지 않으면 0.

짧은 이름 GetObjectGensFamily는 두 진영을 반대로 반환합니다. Vanert에 1, Duprian에 2를 반환합니다. 혼동하지 않도록 한 스크립트 안에서는 한 가지 방식만 사용하십시오.
if Player.GetGensFamily(aIndex) == 1 then Log.Add("Duprian") end

Player.GetGensContribution

Gens 공헌도 점수를 반환합니다.

Player.GetGensContribution(aIndex) -> integer

매개변수: aIndex. 반환값: 공헌도 점수; 유효하지 않으면 0. 짧은 이름: GetObjectGensContribution.

local c = Player.GetGensContribution(aIndex)

GM 권한

Player.GetAuthority

계정의 권한 코드(authority)를 반환합니다.

Player.GetAuthority(aIndex) -> integer

매개변수: aIndex. 반환값: 권한 코드; 유효하지 않으면 0. 짧은 이름: GetObjectAuthority.

local a = Player.GetAuthority(aIndex)

Player.IsGameMaster

캐릭터가 GM이며 권한이 활성화되어 있는지(.auth 명령) 확인합니다.

Player.IsGameMaster(aIndex) -> boolean

매개변수: aIndex. 반환값: GM이며 권한이 활성화되어 있으면 true, 그렇지 않으면 false. 짧은 이름: CommandCheckGameMasterLevel(aIndex, level)은 1 / 0을 반환하며 level 매개변수는 무시합니다.

if not Player.IsGameMaster(aIndex) then return 0 end

Player.HasAdminFlag

GM이 특정 권한 플래그를 가지고 있는지 확인합니다.

Player.HasAdminFlag(aIndex, flag) -> boolean
매개변수타입설명
aIndexinteger캐릭터 인덱스
flaginteger권한 플래그 코드 (0보다 큼)

반환값: 캐릭터가 GM이고 해당 플래그를 가지고 있으면 true, 그렇지 않으면 false.

플래그는 합산되는 비트이며 캐릭터 데이터(게임 데이터베이스의 캐릭터 권한 플래그 컬럼)에 저장됩니다. 각 플래그의 값은 다음과 같습니다.

값플래그값플래그
1PARTY2048TALK
2TRADE4096MOVE
4GLOBAL8192RELOAD
8TRACE16384MONSTER
16KICK32768ZEN
32EVENTS65536GUILD_TALK
64MUTE131072RESTRICTION
128ITEM262144SHUTDOWN
256ITEM_EVENT524288PANEL
512BAN1048576BUFF
1024POST2097152MASIVE

이 함수는 전달한 flag 값과 비트 AND 연산으로 확인합니다.

if Player.HasAdminFlag(aIndex, 1) then ... end

계정과 PC

Player.GetIP

플레이어의 IP 주소를 반환합니다.

Player.GetIP(aIndex) -> string

매개변수: aIndex. 반환값: IP 문자열; 유효하지 않으면 빈 문자열. 짧은 이름: GetObjectIpAddress.

local ip = Player.GetIP(aIndex)

Player.GetMac

계정이 서버로 전송한 플레이어 PC의 MAC 주소를 반환합니다.

Player.GetMac(aIndex) -> string

매개변수: aIndex. 반환값: MAC 문자열; 유효하지 않으면 빈 문자열. 짧은 이름: GetPlayerMac.

local mac = Player.GetMac(aIndex)

Player.GetDiskSerial

플레이어 PC의 하드 디스크 시리얼 번호를 반환합니다.

Player.GetDiskSerial(aIndex) -> integer

매개변수: aIndex. 반환값: 하드 디스크 시리얼; 유효하지 않으면 0. 짧은 이름: GetPlayerSerial (문자열 형태로 반환).

local serial = Player.GetDiskSerial(aIndex)

Player.GetHardwareId

MAC과 하드 디스크 시리얼을 MAC-SERIAL 형식(시리얼은 8자리 16진수)으로 결합한 PC 식별 코드를 반환합니다.

Player.GetHardwareId(aIndex) -> string

매개변수: aIndex. 반환값: PC 식별 문자열; 유효하지 않으면 빈 문자열. 짧은 이름: GetObjectHardwareId.

local hw = Player.GetHardwareId(aIndex)

Player.GetCodePage

계정에 저장된 코드 페이지(code page) 값을 반환합니다.

Player.GetCodePage(aIndex) -> integer

매개변수: aIndex. 반환값: 코드 페이지 값; 유효하지 않으면 0.

local cp = Player.GetCodePage(aIndex)

Player.IsOffline

캐릭터가 오프라인 모드인지 확인합니다.

Player.IsOffline(aIndex) -> boolean

매개변수: aIndex. 반환값: 오프라인이면 true, 그렇지 않으면 false. 짧은 이름: GetObjectOfflineFlag (1 / 0 반환).

if Player.IsOffline(aIndex) then return end

상태

Player.GetInterface

캐릭터가 열고 있는 인터페이스 창의 코드(창고, 거래, 상점 등)를 반환합니다.

Player.GetInterface(aIndex) -> string

매개변수: aIndex. 반환값: 창 코드 문자열; 유효하지 않으면 빈 문자열. 짧은 이름: GetObjectInterface.

열려 있는 창이 없으면 함수는 "interface_none"을 반환합니다. 그 외의 문자열: interface_shop, interface_warehouse, interface_chaos_machine, interface_blood_castle_entrance, interface_devil_square_entrance, interface_party, interface_trade, interface_guild, interface_guild_request, interface_guild_alliance, interface_duel, interface_duel_gate, interface_pet_trainer, interface_quest_support_giver, interface_quest_evolution_giver, interface_mix_jewel, interface_cash_shop, interface_harmony_refine, interface_harmony_smelt, interface_harmony_restore, interface_lucky, interface_seed_creation, interface_seed_research, interface_chaos_card, interface_castle_siege_lever, interface_lord_mix, interface_land_of_trials_guard, interface_castle_guard, interface_castle_siege_machine, interface_personal_store_open, interface_illusion_temple_entrance, interface_guild_war_request, interface_arca_battle_lesnar, interface_arka_war_sign_register, interface_arka_war_exchange, interface_adniel, interface_mining, interface_chaos_castle_mait, interface_acheron_entrance, interface_cent_town, interface_cent_entrance, interface_eunice_town, interface_eunice_entrance, interface_moss_merchant, interface_mix_recovery.

local ui = Player.GetInterface(aIndex)

Player.GetDeathLocation

현재 로그인 세션에서 캐릭터가 마지막으로 사망한 위치를 반환합니다.

Player.GetDeathLocation(aIndex) -> map, x, y | nil

매개변수: aIndex. 반환값: 3개의 값 map, x, y; 이번 로그인에서 캐릭터가 한 번도 사망하지 않았다면 nil. 짧은 이름: GetObjectDeathMap, GetObjectDeathMapX, GetObjectDeathMapY (없으면 -1 반환).

local map, x, y = Player.GetDeathLocation(aIndex)
if map then Player.MoveTo(aIndex, map, x, y) end

Player.GetAccumulatedDamage

GameServer의 카운터 기준으로 캐릭터의 누적 피해량을 반환합니다.

Player.GetAccumulatedDamage(aIndex) -> number

매개변수: aIndex. 반환값: 누적 값; 유효하지 않으면 0.

이 카운터는 플레이어(또는 그의 Dark Spirit)가 공성전에서 석상 / 성문을 공격하고 Potion of Bless / Potion of Soul 버프가 없을 때만 증가합니다. 100을 넘을 때마다 GameServer는 공성전에서 무기 내구도를 감소시킨 뒤 카운터를 0으로 되돌립니다. 카운터는 캐릭터 데이터가 초기화될 때(게임 입장 / 퇴장)에도 0이 됩니다.

local dmg = Player.GetAccumulatedDamage(aIndex)

Player.GetTradeZen

캐릭터가 거래 창에 올려 둔 젠(zen) 수량을 반환합니다.

Player.GetTradeZen(aIndex) -> integer

매개변수: aIndex. 반환값: 거래 중인 젠 수량; 거래 중이 아니거나 유효하지 않으면 0.

local z = Player.GetTradeZen(aIndex)

Player.GetMuteTime

채팅 금지가 끝날 때까지 남은 초를 반환합니다.

Player.GetMuteTime(aIndex) -> integer

매개변수: aIndex. 반환값: 남은 초; 채팅 금지 상태가 아니거나 유효하지 않으면 0.

if Player.GetMuteTime(aIndex) > 0 then Message.Send(aIndex, 1, "채팅이 금지되었습니다") end

Player.IsActionBlocked

캐릭터의 특정 행동이 Player.BlockAction에 의해 차단되어 있는지 확인합니다.

Player.IsActionBlocked(aIndex, action) -> boolean
매개변수타입설명
aIndexinteger캐릭터 인덱스
actioninteger행동 코드, System\Constants.lua의 ACTION_* 상수 (0 ~ 26)

반환값: 행동이 차단되어 있으면 true; 차단되지 않았거나 매개변수가 잘못되었으면 false. 짧은 이름: PermissionCheck(aIndex, perm) (Player.BlockAction 참조).

if Player.IsActionBlocked(aIndex, ACTION_TRADE) then ... end