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
CompareName()
CompareName(
name
):boolean
Parameters
• name: string
Returns
boolean
Inherited from
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
GetAttackingEntity()
GetAttackingEntity<
T
>():T
Type Parameters
• T extends UniHuman
| UniMover
| UniPlayer
Returns
T
Inherited from
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
GetContinent()
GetContinent():
string
Returns
string
Inherited from
GetCurrentFP()
GetCurrentFP():
number
Returns
number
GetCurrentHealth()
GetCurrentHealth():
number
Returns the current healthpoints of the mover.
Returns
number
Inherited from
GetCurrentMP()
GetCurrentMP():
number
Returns
number
GetDistance()
GetDistance(
is2D
?):number
Parameters
• is2D?: boolean
Returns
number
Inherited from
GetDistanceTo()
GetDistanceTo(
otherPos
):number
Parameters
• otherPos: IVector3
Returns
number
Inherited from
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
GetGamePropID()
GetGamePropID():
number
Returns
number
Inherited from
GetID()
GetID():
number
Returns
number
Inherited from
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
GetMaxHealth()
GetMaxHealth():
number
Returns the current maximum healthpoints of the mover.
Returns
number
Inherited from
GetName()
GetName():
string
Returns
string
Inherited from
GetPosition()
GetPosition():
IVector3
Returns
IVector3
Inherited from
GetRank()
GetRank():
MonsterRank
Returns the rank of the mover. NOTE: Fallback to "normal" for any non masquerpets.
Returns
MonsterRank
Inherited from
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
IsDead()
IsDead():
boolean
Returns
boolean
Inherited from
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
IsEventMonster()
IsEventMonster():
boolean
Returns
boolean
Inherited from
IsFlying()
IsFlying():
boolean
Returns
boolean
Inherited from
IsGiant()
IsGiant():
boolean
Returns
boolean
Inherited from
IsHuman()
IsHuman():
boolean
Returns true if this UniMover represents a player.
Returns
boolean
Inherited from
IsInCombat()
IsInCombat():
boolean
Returns
boolean
Inherited from
IsInParty()
IsInParty():
boolean
Returns
boolean
IsMasquerpet()
IsMasquerpet():
boolean
Returns
boolean
Inherited from
IsNPC()
IsNPC():
boolean
Retruns true if the UniMover represents an NPC.
Returns
boolean
Inherited from
IsObstructed()
IsObstructed():
boolean
Returns
boolean
Inherited from
IsOnScreen()
IsOnScreen():
boolean
Returns
boolean
Inherited from
IsRedMob()
IsRedMob():
boolean
Returns
boolean
Inherited from
IsSittingDown()
IsSittingDown():
boolean
Returns true if the UniMover is currently sitting on ground.
Returns
boolean
Inherited from
IsTeleportingOrMounting()
IsTeleportingOrMounting():
boolean
Returns
boolean
IsVendorShop()
IsVendorShop():
boolean
Returns
boolean
Inherited from
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
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
UseSkill()
UseSkill(
skillID
):void
Parameters
• skillID: Skills
Returns
void