Skip to main content

Interface: UniPlayer

Extension of UniMover class for functionality only available on the current loggedin player.

Usage example:

// grab UniCore
const { UniCore } = require("UniCore");

// lets setup a simple tickhandler that works with currentPlayer
UniCore.On("tick", () => {
// fetch instance of UniPlayer
const currentPlayer = UniCore.GetCurrentPlayer();

console.log(`Current player name is "${currentPlayer.get("name")}".`)
});

Extends

Properties

Inventory

Inventory: UniPlayerInventory


Quests

Quests: UniPlayerQuests

Methods

Click()

Click(): void

Returns

void

Inherited from

UniHuman.Click


CompareName()

CompareName(name): boolean

Parameters

name: string

Returns

boolean

Inherited from

UniHuman.CompareName


get()

get<T>(name): IPlayer[T]

Accesss internal properties of the underlying IFlyffMover object.

Type Parameters

T extends "name" | "worldName" | keyof IFlyffEntity | "targetID" | "targeting" | "attacking" | "following" | "HP" | "isDead" | "isRedMob" | "animationState" | "actionState" | "flyingState" | "buffs" | "premiumItems" | "premiumItems2" | "movingTowards" | "isMasquerpet" | "isNPC" | "g" | "title" | "maxHP" | "maxMP" | "maxFP" | "castTimeReduction" | "FP" | "MP" | "baseStats" | "jobID" | "jobName" | "continent" | "isInSameParty" | "guildName" | "hasPrivateShopOpen" | "EXP" | "penya" | "bonusStats" | "remainingStatPoints" | "remainingSkillPoints" | "maxInventorySlots" | "lockedInventorySlots" | "inventory" | "equips" | "isRotatingCW" | "isRotatingCCW" | "isAutoRunning" | "isCSPetSpawned" | "isExpLockEnabled" | "expLockMobCount" | "skillCooldowns" | "skills" | "flySpeed" | "lastUsedPotionTimestamps" | "quests" | "isTeleportingOrMounting" | "canFly" | "lastUsedSkillID" | "isLastSkillFinished" | "queuedSkillID" | "isGrounded"

Parameters

name: T

Returns

IPlayer[T]

The value of the property on the internal IFlyffMover object. Returns undefined if the property does not exist.

Overrides

UniHuman.get


GetAttackingEntity()

GetAttackingEntity<T>(): T

Type Parameters

T extends UniHuman | UniMover | UniPlayer

Returns

T

Inherited from

UniHuman.GetAttackingEntity


GetCastingSkillID()

GetCastingSkillID(): number

Returns the ID of the currently casting skill. Returns -1 if no skill is currently being cast.

Returns

number


GetCombatOrigin()

GetCombatOrigin(): IVector3

Returns

IVector3

Inherited from

UniHuman.GetCombatOrigin


GetContinent()

GetContinent(): string

Returns

string

Inherited from

UniHuman.GetContinent


GetCurrentFP()

GetCurrentFP(): number

Returns

number


GetCurrentHealth()

GetCurrentHealth(): number

Returns the current healthpoints of the mover.

Returns

number

Inherited from

UniHuman.GetCurrentHealth


GetCurrentMP()

GetCurrentMP(): number

Returns

number


GetDistance()

GetDistance(is2D?): number

Parameters

is2D?: boolean

Returns

number

Inherited from

UniHuman.GetDistance


GetDistanceTo()

GetDistanceTo(otherPos): number

Parameters

otherPos: IVector3

Returns

number

Inherited from

UniHuman.GetDistanceTo


GetEquippedItemID()

GetEquippedItemID(slot): number

Parameters

slot: PLAYER_EQUIP_SLOT

Returns

number


GetFollowingEntity()

GetFollowingEntity<T>(): T

Type Parameters

T extends UniHuman | UniMover | UniPlayer

Returns

T

Inherited from

UniHuman.GetFollowingEntity


GetGamePropID()

GetGamePropID(): number

Returns

number

Inherited from

UniHuman.GetGamePropID


GetID()

GetID(): number

Returns

number

Inherited from

UniHuman.GetID


GetIsAbleToFly()

GetIsAbleToFly(): boolean

Used to tell weither or not the player can currently mount and start flying somewhere. If this returns false you need to navigate to closest takeoff position before mounting board to ensure you can start flying.

Returns

boolean


GetJob()

GetJob(): string

Returns

string


GetLevel()

GetLevel(): number

Returns

number

Inherited from

UniHuman.GetLevel


GetMaxHealth()

GetMaxHealth(): number

Returns the current maximum healthpoints of the mover.

Returns

number

Inherited from

UniHuman.GetMaxHealth


GetName()

GetName(): string

Returns

string

Inherited from

UniHuman.GetName


GetPosition()

GetPosition(): IVector3

Returns

IVector3

Inherited from

UniHuman.GetPosition


GetRank()

GetRank(): MonsterRank

Returns the rank of the mover. NOTE: Fallback to "normal" for any non masquerpets.

Returns

MonsterRank

Inherited from

UniHuman.GetRank


GetRemainingTimeOfBuff()

GetRemainingTimeOfBuff(buffSkillName): number

Returns the remaining time in milliseconds that this buff will be active for, returns 0 for non active buffs.

Parameters

buffSkillName: string

Name of the buff you want the remaining active time for.

Returns

number

Inherited from

UniHuman.GetRemainingTimeOfBuff


GetRemainingTimeOfSkillCooldown()

GetRemainingTimeOfSkillCooldown(skillName): number

Returns the remaining time in milliseconds that the skill has cooldown for, returns 0 for no cooldown.

Parameters

skillName: string

Name of the skill you want the remaining cooldown time for.

Returns

number


GetSkillLevel()

GetSkillLevel(skillID): number

Returns the level of the skill. Returns -1 if the skill is not leveled.

Parameters

skillID: number

The internal skillID

Returns

number


GetTargetedEntity()

GetTargetedEntity<T>(): T

Type Parameters

T extends UniHuman | UniMover | UniPlayer

Returns

T

Inherited from

UniHuman.GetTargetedEntity


IsDead()

IsDead(): boolean

Returns

boolean

Inherited from

UniHuman.IsDead


IsDespawned()

IsDespawned(): boolean

Returns true if the entity was not contained in a recent game state update. Data on this entity might be stale. Use .LastSeenAt() to check when the entity was last seen.

Returns

boolean

Inherited from

UniHuman.IsDespawned


IsEventMonster()

IsEventMonster(): boolean

Returns

boolean

Inherited from

UniHuman.IsEventMonster


IsFlying()

IsFlying(): boolean

Returns

boolean

Inherited from

UniHuman.IsFlying


IsGiant()

IsGiant(): boolean

Returns

boolean

Inherited from

UniHuman.IsGiant


IsHuman()

IsHuman(): boolean

Returns true if this UniMover represents a player.

Returns

boolean

Inherited from

UniHuman.IsHuman


IsInCombat()

IsInCombat(): boolean

Returns

boolean

Inherited from

UniHuman.IsInCombat


IsInParty()

IsInParty(): boolean

Returns

boolean


IsMasquerpet()

IsMasquerpet(): boolean

Returns

boolean

Inherited from

UniHuman.IsMasquerpet


IsNPC()

IsNPC(): boolean

Retruns true if the UniMover represents an NPC.

Returns

boolean

Inherited from

UniHuman.IsNPC


IsObstructed()

IsObstructed(): boolean

Returns

boolean

Inherited from

UniHuman.IsObstructed


IsOnScreen()

IsOnScreen(): boolean

Returns

boolean

Inherited from

UniHuman.IsOnScreen


IsRedMob()

IsRedMob(): boolean

Returns

boolean

Inherited from

UniHuman.IsRedMob


IsSittingDown()

IsSittingDown(): boolean

Returns true if the UniMover is currently sitting on ground.

Returns

boolean

Inherited from

UniHuman.IsSittingDown


IsTeleportingOrMounting()

IsTeleportingOrMounting(): boolean

Returns

boolean


IsVendorShop()

IsVendorShop(): boolean

Returns

boolean

Inherited from

UniHuman.IsVendorShop


LevelUpSkill()

LevelUpSkill(skillID, levelsToAdd): boolean

Levels up a skill.

Parameters

skillID: number

The internal skillID

levelsToAdd: number

How many levels to increase the skill by. Note that different skills require different amounts of skillpoints to go up by 1 level. This function will check internally and return false if the skill could not be leveled, so feel free to call it as needed.

Returns

boolean


On()

On(event, callback)

On(event, callback): void

Parameters

event: "skillcast"

callback

Returns

void

Overrides

UniHuman.On

On(event, callback)

On(event, callback): void

Parameters

event: string

callback

Returns

void

Overrides

UniHuman.On


Timer()

Timer(timerName): number

Exposes the timers that the script runtime manages for this entity.

Parameters

timerName: keyof TUniEntity_Timers

Returns

number

Inherited from

UniHuman.Timer


UseSkill()

UseSkill(skillID): void

Parameters

skillID: Skills

Returns

void