-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Metatable:Player
The Player metatable contains all of the methods that handle/require players.
The player metatable is an extention of the Creature metatable, and so can handle those methods as well.
Creating an instance of the Player metatable (2 options):
local player = Player(uid)
local player = Player(name or wildcard)
addBlessing(blessing)
addExperience(experience, sendText = false)
addItem(itemId, count = 1, canDropOnMap = true, subType = 1, slot = CONST_SLOT_WHEREEVER)
addItemEx(item, canDropOnMap = false, index = INDEX_WHEREEVER, flags = 0)
addItemEx(item, canDropOnMap = true, slot = CONST_SLOT_WHEREEVER)
addManaSpent(amount)
addMapMark(position, type, description)
addMoney(money)
addMount(mountId)
addOutfit(lookType)
addOutfitAddon(lookType, addon)
addPremiumDays(days)
addSkillTries(skillType, tries)
addSoul(soulChange)
canLearnSpell(spellName)
channelSay(speaker, type, text, channelId)
forgetSpell(spellName)
getAccountId()
getAccountType()
getBankBalance()
getBaseMagicLevel()
getCapacity()
getClient()
getContainerById(id)
getContainerId(container)
getContainerIndex(id)
getDeathPenalty()
getDepotChest(depotId, autoCreate = false)
getEffectiveSkillLevel(skillType)
getExperience()
getFreeCapacity()
getGroup()
getGuid()
getGuild()
getGuildLevel()
getGuildNick()
getHouse()
getInbox()
getIp()
getItemById(itemId, deepSearch, subType = -1)
getItemCount(itemId, subType = -1)
getLastLoginSaved()
getLastLogout()
getLevel()
getMagicLevel()
getManaSpent()
getMaxSoul()
getMoney()
getParty()
getPremiumDays()
getSex()
getSkillLevel(skillType)
getSkillPercent(skillType)
getSkillTries(skillType)
getSkullTime()
getSlotItem(slot)
getSoul()
getStamina()
getStorageValue(key)
getTown()
getVocation()
hasBlessing(blessing)
hasLearnedSpell(spellName)
hasMount(mountId)
hasOutfit(lookType, addon = 0)
isPlayer()
isPzLocked()
learnSpell(spellName)
openChannel(channelId)
popupFYI(message)
removeBlessing(blessing)
removeExperience(experience, sendText = false)
removeItem(itemId, count, subType = -1, ignoreEquipped = false)
removeMoney(money)
removeMount(mountId)
removeOutfit(lookType)
removeOutfitAddon(lookType, addon)
removePremiumDays(days)
save()
sendChannelMessage(author, text, type, channelId)
sendOutfitWindow()
sendPrivateMessage(speaker, text, type)
sendTextMessage(type, text, position, primaryValue = 0, primaryColor = TEXTCOLOR_NONE, secondaryValue = 0, secondaryColor = TEXTCOLOR_NONE)
sendTutorial(tutorialId)
setAccountType(accountType)
setBankBalance(bankBalance)
setCapacity(capacity)
setGhostMode(enabled)
setGroup(group)
setGuild(guild)
setGuildLevel(level)
setGuildNick(nick)
setMaxMana(maxMana)
setSex(newSex)
setSkullTime(skullTime)
setStamina(stamina)
setStorageValue(key, value)
setTown(town)
setVocation(vocation)
showTextDialog(itemId, text, canWrite, length)
Description: N/A
Parameters:Returns: N/A
- blessing - No description
Example:
local player = Player(...)
player:addBlessing(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- experience - No description
- sendText - (optional, default: false)
Example:
local player = Player(...)
player:addExperience(100, false)
[To the top] Added in version: 1.0
Description: This function gives the player a newly created item.
Parameters:Returns: N/A
- itemId - Type of item created.
- count - How many items that are created. (optional, default = 1)
- canDropOnMap - Drops any remaining items on the map. (optional, default: true)
- subType - Subtype the item(s) should have. (optional, default: 1)
- slot - Slot the item should be assigned to. (optional, default: CONST_SLOT_WHEREEVER)
Example:
local player = Player(...)
player:addItem(2400, 1, true, 1, CONST_SLOT_WHEREEVER)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- item - No description
- canDropOnMap - (optional, default: false)
- index - (optional, default: INDEX_WHEREEVER)
- flags - (optional, default: 0)
Example:
local player = Player(...)
player:addItemEx(some_userdata, false, INDEX_WHEREEVER, 0)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- item - No description
- canDropOnMap - (optional, default: true)
- slot - (optional, default: CONST_SLOT_WHEREEVER)
Example:
local player = Player(...)
player:addItemEx(some_userdata, true, CONST_SLOT_WHEREEVER)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- amount - No description
Example:
local player = Player(...)
player:addManaSpent(100)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- position - No description
- type - No description
- description - No description
Example:
local player = Player(...)
player:addMapMark(Position(), MAPMARK_LOCK, any_string)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- money - No description
Example:
local player = Player(...)
player:addMoney(100)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- mountId - No description
Example:
local player = Player(...)
player:addMount(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- lookType - No description
Example:
local player = Player(...)
player:addOutfit(128)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- lookType - No description
- addon - No description
Example:
local player = Player(...)
player:addOutfitAddon(128, 2)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- days - No description
Example:
local player = Player(...)
player:addPremiumDays(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- skillType - No description
- tries - No description
Example:
local player = Player(...)
player:addSkillTries(SKILL_FIST, 10)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- soulChange - No description
Example:
local player = Player(...)
player:addSoul(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- spellName - No description
Example:
local player = Player(...)
player:canLearnSpell(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- speaker - No description
- type - No description
- text - The sentence you want the recipient to read
- channelId - No description
Example:
local player = Player(...)
player:channelSay(some_userdata, TALKTYPE_SAY, any_string, unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- spellName - No description
Example:
local player = Player(...)
player:forgetSpell(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getAccountId()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getAccountType()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getBankBalance()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getBaseMagicLevel()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getCapacity()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getClient()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- id - No description
Example:
local player = Player(...)
player:getContainerById(some_id)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- container - No description
Example:
local player = Player(...)
player:getContainerId(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- id - No description
Example:
local player = Player(...)
player:getContainerIndex(some_id)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getDeathPenalty()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- depotId - No description
- autoCreate - (optional, default: false)
Example:
local player = Player(...)
player:getDepotChest(0, false)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- skillType - No description
Example:
local player = Player(...)
player:getEffectiveSkillLevel(SKILL_FIST)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getExperience()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getFreeCapacity()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getGroup()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getGuid()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getGuild()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getGuildLevel()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getGuildNick()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getHouse()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getInbox()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getIp()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemId - No description
- deepSearch - No description
- subType - (optional, default: -1)
Example:
local player = Player(...)
player:getItemById(2400, false, -1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemId - No description
- subType - (optional, default: -1)
Example:
local player = Player(...)
player:getItemCount(2400, -1)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getLastLoginSaved()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getLastLogout()
[To the top] Added in version: 1.1
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getLevel()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getMagicLevel()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getManaSpent()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getMaxSoul()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getMoney()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getParty()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getPremiumDays()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getSex()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- skillType - No description
Example:
local player = Player(...)
player:getSkillLevel(SKILL_FIST)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- skillType - No description
Example:
local player = Player(...)
player:getSkillPercent(SKILL_FIST)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- skillType - No description
Example:
local player = Player(...)
player:getSkillTries(SKILL_FIST)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getSkullTime()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- slot - No description
Example:
local player = Player(...)
player:getSlotItem(CONST_SLOT_LEFT)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getSoul()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getStamina()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- key - No description
Example:
local player = Player(...)
player:getStorageValue(1000)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getTown()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:getVocation()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- blessing - No description
Example:
local player = Player(...)
player:hasBlessing(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- spellName - No description
Example:
local player = Player(...)
player:hasLearnedSpell(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- mountId - No description
Example:
local player = Player(...)
player:hasMount(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- lookType - No description
- addon - (optional, default: 0)
Example:
local player = Player(...)
player:hasOutfit(128, 0)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:isPlayer()
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:isPzLocked()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- spellName - No description
Example:
local player = Player(...)
player:learnSpell(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- channelId - No description
Example:
local player = Player(...)
player:openChannel(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- message - No description
Example:
local player = Player(...)
player:popupFYI(any_string)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- blessing - No description
Example:
local player = Player(...)
player:removeBlessing(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- experience - No description
- sendText - (optional, default: false)
Example:
local player = Player(...)
player:removeExperience(100, false)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemId - No description
- count - No description
- subType - (optional, default: -1)
- ignoreEquipped - (optional, default: false)
Example:
local player = Player(...)
player:removeItem(2400, 1, -1, false)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- money - No description
Example:
local player = Player(...)
player:removeMoney(100)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- mountId - No description
Example:
local player = Player(...)
player:removeMount(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- lookType - No description
Example:
local player = Player(...)
player:removeOutfit(128)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- lookType - No description
- addon - No description
Example:
local player = Player(...)
player:removeOutfitAddon(128, 2)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- days - No description
Example:
local player = Player(...)
player:removePremiumDays(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:save()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- author - No description
- text - The sentence you want the recipient to read
- type - No description
- channelId - No description
Example:
local player = Player(...)
player:sendChannelMessage(some_name, any_string, TALKTYPE_SAY, unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters: None
Returns: N/A
Example:
local player = Player(...)
player:sendOutfitWindow()
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- speaker - No description
- text - The sentence you want the recipient to read
- TalkType - (optional)
Example:
local player = Player(...)
player:sendPrivateMessage(some_userdata, any_string, nil)
[To the top] Added in version: 1.0
sendTextMessage(type, text[, position, primaryValue = 0, primaryColor = TEXTCOLOR_NONE[, secondaryValue = 0, secondaryColor = TEXTCOLOR_NONE]])
Description: N/A
Parameters:Returns: N/A
- Message type - No description
- text - The sentence you want the recipient to read
- position - (optional)
- primaryValue - (optional, default: 0)
- primaryColor - (optional, default: TEXTCOLOR_NONE)
- secondaryValue - (optional, default: 0)
- secondaryColor - (optional, default: TEXTCOLOR_NONE)
Example:
local player = Player(...)
player:sendTextMessage(MESSAGE_STATUS_WARNING, any_string, nil, 0, TEXTCOLOR_NONE, 0, TEXTCOLOR_NONE)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- tutorialId - No description
Example:
local player = Player(...)
player:sendTutorial(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- accountType - No description
Example:
local player = Player(...)
player:setAccountType(ACCOUNT_TYPE_GOD)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- bankBalance - No description
Example:
local player = Player(...)
player:setBankBalance(100)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- capacity - No description
Example:
local player = Player(...)
player:setCapacity(15000)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- enabled - No description
Example:
local player = Player(...)
player:setGhostMode(true)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- group - No description
Example:
local player = Player(...)
player:setGroup(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- guild - No description
Example:
local player = Player(...)
player:setGuild(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- level - No description
Example:
local player = Player(...)
player:setGuildLevel(1)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- nick - No description
Example:
local player = Player(...)
player:setGuildNick(some_name)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- maxMana - No description
Example:
local player = Player(...)
player:setMaxMana(35)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- newSex - No description
Example:
local player = Player(...)
player:setSex(PLAYERSEX_MALE)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- skullTime - No description
Example:
local player = Player(...)
player:setSkullTime(unknown)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- stamina - No description
Example:
local player = Player(...)
player:setStamina(50)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- key - No description
- value - No description
Example:
local player = Player(...)
player:setStorageValue(1000, any_number)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- town - No description
Example:
local player = Player(...)
player:setTown(Town(0))
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- vocation - No description
Example:
local player = Player(...)
player:setVocation(some_userdata)
[To the top] Added in version: 1.0
Description: N/A
Parameters:Returns: N/A
- itemId - No description
- text - (optional)
- canWrite - (optional)
- length - (optional)
Example:
local player = Player(...)
player:showTextDialog(2400, nil, nil, nil)
[To the top] Added in version: 1.0