ENTITIES (PC or NPC or MOB)
entity:getName() -- Returns the database name for the entity specified. Example: NPC name: "Treasure Chest" but in database is "TreasureChest" so entity:getName() will return the string "TreasureChest".
entity:getId() -- Identifies the target's ID
entity:getMainJob() -- Identifies the target's job
entity:getMainLvl() -- Identifies the target's level
entity:getSubJob() -- Identifies the target's subjob
entity:getSubLvl() -- Identifies the target's subjob level
entity:getHP() -- Identifies the target's HP
entity:getMP() -- Identifies the target's MP
entity:getStat(stat) -- Identifies the target's specified stat level. 1 = STR, 2 = DEX, etc. up to 7 = CHR
entity:setHP(hp) -- Alters the target's HP to the specified amount
entity:setMP(mp) -- Alters the target's MP to the specified amount
entity:getMaxHP() -- Identifies the target's Max HP
entity:getMaxMP() -- Identifies the target's Max MP
entity:addHP(amount) -- Adds the specified amount of HP to the target
entity:addMP(amount) -- Adds the specified amount of MP to the target
entity:removeHP(amount) -- Removes the specified amount of HP to the target
entity:removeMP(amount) -- Removes the specified amount of MP to the target
entity:getXPos() -- Locates the target's position on the X axis (east-west)
entity:getYPos() -- Locates the target's position on the Y axis (below-above)
entity:getZPos() -- Locates the target's position on the Z axis (north-south)
entity:getRot() -- Identifies the target's angle of heading relative to east
entity:getZone() -- Identifies the zone containing the target
entity:isPlayer() -- Checks if the target is a player
entity:isNPC() -- Checks if the target is an NPC
entity:isMob() -- Checks if the target is a monster
entity:updateEnmity(initiator,VE,CE) -- Adds enmity. The initiator should be the entity dealing the damage/ability/spell. This will make a monster attack a PC.
entity:getFamily() -- Gets the targets family id.
PLAYER ONLY
player:getRace() -- Identifies the player's race
player:getNation() -- Identifies the player's nation of alligience
player:getRank() -- Identifies the player's rank
player:getVar(variable) -- Reads a specified value from the database. If it does not exist, the value will be 0.
player:setVar(variable,value) -- Writes a specified value to the specified variable in the database. If it does not exist, it will be created.
player:startEvent(event) -- Starts a specified cutscene for the player
player:updateEvent(param1,[param2,param3,etc]) -- Continues a cutscene for the player, using the specified parameters. At least one parameter is required, with a maximum of 8.
player:addAndEquip(itemID,slotID) -- Adds a specified item to the player's inventory, and equips it in the specified slot
player:addItem(itemID[,quantity,locationID]) -- Adds a specified item to the player's inventory.If quantity and/or locationID are not specified, quantity 1 and locationID 0 are assumed. Quantity has a max of 12 if item is stackable.
player:sendRelease([release type]) -- Releases the player from a cutscene or dialogue. The release type can optionally be specified.
player:showText(npc,textID) -- Displays the specified dialogue to the player from the specified NPC.
player:getPrevZone() -- Identifies the previous zone that the player was in
player:getCurrGil() -- Identifies the amount of gil that the player has
player:setCurrGil(amount) -- Alters the player's total gil to the specified amount
player:addGil(amount) -- Gives the specified amount of gil to the player
player:removeGil(amount) -- Takes the specified amount of gil from the player
player:hasItem(itemID) -- Checks if the player has the specified item
player:removeItem(itemID[,quantity,locationID]) -- Removes a number of specified items from locationID. Default, without quantity or locationID specified, It's removed with quantity 1 and locationID 0 (player's inventory). This function tries to remove quantity specified items even if more than 12 are speficed and player has them.
player:addKeyItem(KeyitemID) -- Gives the specified key item to the player
player:hasKeyItem(KeyitemID) -- Checks if the player has the specified key item
player:seenKeyItem(KeyitemID) -- Checks if the player has examined the specified key item
player:removeKeyItem(KeyitemID) -- Takes the specified key item to the player
player:setPos(x,y,z[,rotation,zone]) -- Teleports the player to the specified location. Rotation and zone are optional.
player:getFame(nation) -- Identifies the amount of total fame accumulated by the player in the specified region
player:getFameLevel(nation) -- Identifies the player's fame level in the specified region
player:setFame(nation,amount) -- Alters the player's fame in the specified region to the specified amount
player:addFame(nation,amount) -- Adds the specified amount of fame in the specified region to the player
player:setAnimation(animation) -- Alters the player's animation to the specified animation
player:setRank(rank) -- Alters the player's rank to the specified level
player:setNation(nation) -- Alters the player's nation of alligience to the specified nation
player:sendMenu(1) -- Opens the moghouse menu for the player. Other menus will be added later.
player:createShop(nation) -- Creates a shop for the player, with prices based on the player's fame in the specified nation
player:sendShop() -- Opens the created shop for the player
player:sendGuild() -- Opens the specified guild shop for the player
player:getSkill(skillID) -- Returns the current value of the skill parameter.
player:getSkillRank(skillID) -- Identifies the player's specified craft skill rank
player:setSkillRank(skillID,rank) -- Alters the player's specified craft skill rank
player:getEquip(slotID) -- Identifies the player's equipped item in the specified slot
player:specialMessage(textID,param1[,param2,etc]) -- Displays the specified text line with the specified parameters to the player. At least one parameter is required.
player:addQuest(logID,questID) -- Adds the specified quest (Quest's Index is listed in POLUtils String Table) to be listed under the specified log.
player:completeQuest(logID,questID) -- Completes the specified quest listed under the specified log.
player:getQuestStatus(logID,questID) -- Returns 1 if the player is on the Quest, 2 if the player has completed the Quest, and 0 otherwise.
player:currentMission(logID,missionID) -- Adds the specified mission (Mission's Index is listed in POLUtils String Table) to be listed under the specified log.
player:completeMission(logID,missionID) -- Completes the specified mission listed under the specified log.
player:getMissionStatus(logID,missionID) -- Returns 1 if the player is on the Mission, 2 if the player has completed the Mission, and 0 otherwise.
player:getTitle(titleID) -- Returns 1 if the player has ever had the specified title, and 0 otherwise.
player:setTitle(titleID) -- Allows you to add the specified title to the character.
player:getFreeSlotCount(LocationID) -- Returns the number of free slots in the specified "inventory".
player:gainEXP(Experience_points) -- Adds the Experience_points specified to the player.
NPC ONLY
npc:getState() -- Identifies the door's (or object's) state of opened or closed
npc:setState(time) -- Opens the door (or object) for the specified amount of seconds
TRADE ONLY
trade:getGil() -- Identifies the amount of gil traded to the NPC
trade:getItem(TC_slotID) -- Returns the itemID of the item traded with the NPC in the specified TC_slotID
trade:getItemQty(itemID) -- Identifies how many of the specified item is traded to the NPC
trade:getSlotQty() -- Identifies the amount of slots used in the trade to the NPC
trade:getItemCount() -- Identifies how many total items are traded to the NPC
trade:hasItemQty(itemID,amount) -- Checks if the trade includes the specified amount of the specified item
trade:isComplete() -- Removes all traded items from the player's inventory
SHOP ONLY
shop:addItem(itemID,baseprice) -- Stocks the shop with the specified item, at the specified max fame price. The price is automatically adjusted for lower fame levels, based on the nation specified at shop creation (see above).
EVENTS (Cutscenes) ONLY
event:setCallbackFile(file) -- Specifies the file to be read containing instructions for pXI to execute at the end of the cutscene
event:setCallbackFunc(function) -- Specifies the function to be called containing instructions for pXI to execute at the end of the cutscene
event:setParams(param1[,param2,param3,etc]) -- Specifies the parameters to be used in the cutscene. At least one parameter is required, with a max of 8.
SPELLS ONLY
spell:getMPCost() -- Identifies the MP Cost of the spell
spell:getTargNum() -- Identifies how many targets will be affected by the spell
spell:getCurrTargNum() -- Identifies how many targets have been affected by the spell so far
spell:setMsg(messageID) -- Sets the message to be displayed upon completion of the spell
ZONE ONLY
zone:getWeather -- Identifies the current weather in the zone
zone:spawnMob(name,x,y,z,rot,owner) -- Spawns the named mob. Mob needs to be in db.
GLOBAL
Event(eventID) -- Creates an object which executes the specified cutscene. See event functions above.
Zone(zoneID) -- Creates an object containing the specified zone. See zone functions above.
registerRegion(zoneID,regionID,west,east,high,low, south,north) -- Creates a region in which events will be executed when a player enters it. The region ID can be whatever the scripter wants, and the other parameters are the region boundaries (rectangular prism).
getVanaYear() -- Identifies the Vana'diel year
getVanaMonth() -- Identifies the Vana'diel month
getVanaDay() -- Identifies the Vana'diel day
getVanaDayElement() -- Identifies the Vana'diel day of the week
getVanaHour() -- Identifies the Vana'diel hour
getVanaMinute() -- Identifies the Vana'diel minute
getGlobalVar(variable) -- Reads the value of the database variable to be used by the entire server. It must be created first with setGlobalVar (see below), or the player's client will freeze.
setGlobalVar(variable,value) -- Writes the specified value to the specified database variable to be used by the entire server. If it does not exist, it will be created.
getNPCById(NPCID,zoneID) -- Identifies an NPC by the specified ID and the zoneID
getNPCByTargId() -- Identifies an NPC by the specified Target ID
sendTellMsg(name,message) -- Sends the specified message from the specified name to the player