Advertisement
Guest User

Untitled

a guest
Feb 17th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 27.33 KB | None | 0 0
  1. function newClass(constructor)
  2.     local methods = { }
  3.     local MT = {__index = methods}
  4.  
  5.     local call = function(self, ...)
  6.         local obj = constructor(...)
  7.         if not obj then
  8.             return nil
  9.         end
  10.  
  11.         return setmetatable(obj, MT)
  12.     end
  13.  
  14.     return setmetatable(methods, {__call = call})
  15. end
  16.  
  17.  
  18. Creature = newClass(function(param)
  19.     if type(param) == 'string' then
  20.         local cid = getPlayerByNameWildcard(param)
  21.         if not cid then
  22.             return nil
  23.         end
  24.         return {cid = cid}
  25.     elseif type(param) == 'number' then
  26.         if not getPlayerGUID(param) then
  27.             return nil
  28.         end
  29.         return {cid = param}
  30.     else
  31.         return nil
  32.     end
  33. end)
  34.  
  35. -- inherit all the metamethods of Creature
  36. Player, Npc, Monster = Creature, Creature, Creature
  37.  
  38. Game = {}
  39.  
  40. function Creature:getId()
  41.     return self.cid
  42. end
  43.  
  44. function Creature:getName()
  45.     return getCreatureName(self.cid)
  46. end
  47.  
  48. function Creature:getHealth()
  49.     return getCreatureHealth(self.cid)
  50. end
  51.  
  52. function Creature:getMaxHealth()
  53.     return getCreatureMaxHealth(self.cid)
  54. end
  55.  
  56. function Creature:getMana()
  57.     return getCreatureMana(self.cid)
  58. end
  59.  
  60. function Creature:getMaxMana()
  61.     return getCreatureMaxMana(self.cid)
  62. end
  63.  
  64. function Creature:getPosition()
  65.     return getCreaturePosition(self.cid)
  66. end
  67.  
  68. function Creature:getLookDir()
  69.     return getCreatureLookDirection(self.cid)
  70. end
  71.  
  72. function Creature:getSkull()
  73.     return getCreatureSkullType(self.cid)
  74. end
  75.  
  76. function Creature:getMaster()
  77.     return getCreatureMaster(self.cid)
  78. end
  79.  
  80. function Creature:getSummons()
  81.     return getCreatureSummons(self.cid)
  82. end
  83.  
  84. function Creature:getOutfit()
  85.     return getCreatureOutfit(self.cid)
  86. end
  87.  
  88. function Creature:getHiddenHealth()
  89.     return getCreatureHideHealth(self.cid)
  90. end
  91.  
  92. function Creature:setHideHealth(hide)
  93.     return doCreatureSetHideHealth(self.cid, hide)
  94. end
  95.  
  96. function Creature:getSpeakType()
  97.     return getCreatureSpeakType(self.cid)
  98. end
  99.  
  100. function Creature:setSpeakType(type)
  101.     return doCreatureSetSpeakType(self.cid, type)
  102. end
  103.  
  104. function Creature:getLookDirection()
  105.     return getCreatureLookDirection(self.cid)
  106. end
  107.  
  108. function Creature:getCreatureStorage(key)
  109.     return getCreatureStorage(self.cid, key)
  110. end
  111.  
  112. function Creature:isCreature()
  113.     return isCreature(self.cid)
  114. end
  115.  
  116. function Creature:say(text, type, ghost, cid, pos)
  117.     -- doCreatureSay(uid, text, type[, ghost = false[, cid = 0[, pos]]])
  118.     return doCreatureSay(self.cid, text, type, ghost, cid, pos)
  119. end
  120.  
  121. function Creature:setCreatureStorage(key, value)
  122.     return doCreatureSetStorage(self.cid, key, value)
  123. end
  124.  
  125. function Creature:getStorage(key)
  126.     return getStorage(key)
  127. end
  128.  
  129. function Creature:setStorage(key, value)
  130.     return doSetStorage(key, value)
  131. end
  132.  
  133. -- creature, npc, player, item
  134. function Creature:sendMagicEffect(type, player)
  135.     -- doSendMagicEffect(pos, type[, player])
  136.     return doSendMagicEffect(self:getPosition(), type, player)
  137. end
  138.  
  139. --------------------------------------
  140.  
  141.  
  142.  
  143.  
  144. function Npc:isNpc()
  145.     return isNpc(self.cid)
  146. end
  147.  
  148. function Monster:isMonster()
  149.     return isMonster(self.cid)
  150. end
  151.  
  152. ------------------------------------------
  153. -- Player
  154. function Player:isPlayer()
  155.     return isPlayer(self.cid)
  156. end
  157.  
  158. function Player:getLevel()
  159.     return getPlayerLevel(self.cid)
  160. end
  161.  
  162. function Player:getExperience()
  163.     return getPlayerExperience(self.cid)
  164. end
  165.  
  166. function Player:getMagicLevel(ignoreBuffs)
  167.     -- getPlayerMagLevel(cid [, ignoreBuffs = false])
  168.     return getPlayerMagLevel(self.cid, false)
  169. end
  170.  
  171. function Player:getSpentMana()
  172.     return getPlayerSpentMana(self.cid)
  173. end
  174.  
  175. function Player:getFood()
  176.     return getPlayerFood(self.cid)
  177. end
  178.  
  179. function Player:getAccess()
  180.     return getPlayerAccess(self.cid)
  181. end
  182.  
  183. function Player:getGhostAccess()
  184.     return getPlayerGhostAccess(self.cid)
  185. end
  186.  
  187. function Player:getSkillLevel(skillid)
  188.     return getPlayerSkillLevel(self.cid, skillid)
  189. end
  190.  
  191. function Player:getSkillTries(skillid)
  192.     return getPlayerSkillTries(self.cid, skillid)
  193. end
  194.  
  195. function Player:getTown()
  196.     return getPlayerTown(self.cid)
  197. end
  198.  
  199. function Player:getVocation()
  200.     return getPlayerVocation(self.cid)
  201. end
  202.  
  203. function Player:getIp()
  204.     return getPlayerIp(self.cid)
  205. end
  206.  
  207. function Player:getRequiredMana(magicLevel)
  208.     return getPlayerRequiredMana(self.cid, magicLevel)
  209. end
  210.  
  211. function Player:getRequiredSkillTries(skillId, skillLevel)
  212.     return getPlayerRequiredSkillTries(self.cid, skillId, skillLevel)
  213. end
  214.  
  215. function Player:getItemCount(itemid, subtype)
  216.     return getPlayerItemCount(self.cid, itemid, subType)
  217. end
  218.  
  219. function Player:getMoney()
  220.     return getPlayerMoney(self.cid)
  221. end
  222.  
  223. function Player:getSoul()
  224.     return getPlayerSoul(self.cid)
  225. end
  226.  
  227. function Player:getFreeCap()
  228.     return getPlayerFreeCap(self.cid)
  229. end
  230.  
  231. function Player:getLight()
  232.     return getPlayerLight(self.cid)
  233. end
  234.  
  235. function Player:getSlotItem(slot)
  236.     return getPlayerSlotItem(self.cid, slot)
  237. end
  238.  
  239. function Player:getWeapon(ignoreAmmo)
  240.     -- getPlayerWeapon(cid [, ignoreAmmo = false])
  241.     return getPlayerWeapon(self.cid, ignoreAmmo)
  242. end
  243.  
  244. function Player:getItemById(deepSearch, itemId, subType)
  245.     -- getPlayerItemById(cid, deepSearch, itemId[, subType = -1])
  246.     return getPlayerItemById(self.cid, deepSearch, itemId, subType)
  247. end
  248.  
  249. function Player:getDepotItems(depotid)
  250.     return getPlayerDepotItems(self.cid, depotid)
  251. end
  252.  
  253. function Player:getGuildId()
  254.     return getPlayerGuildId(self.cid)
  255. end
  256.  
  257. function Player:getGuildName()
  258.     return getPlayerGuildName(self.cid)
  259. end
  260.  
  261. function Player:getGuildRankId()
  262.     return getPlayerGuildRankId(self.cid)
  263. end
  264.  
  265. function Player:getGuildRank()
  266.     return getPlayerGuildRank(self.cid)
  267. end
  268.  
  269. function Player:getGuildNick()
  270.     return getPlayerGuildNick(self.cid)
  271. end
  272.  
  273. function Player:getGuildLevel()
  274.     return getPlayerGuildLevel(self.cid)
  275. end
  276.  
  277. function Player:getGuid()
  278.     return getPlayerGUID(self.cid)
  279. end
  280.  
  281. function Player:getNameDescription()
  282.     return getPlayerNameDescription(self.cid)
  283. end
  284.  
  285. function Player:setNameDescription(desc)
  286.     return doPlayerSetNameDescription(self.cid, desc)
  287. end
  288.  
  289. function Player:getSpecialDescription()
  290.     return getPlayerSpecialDescription(self.cid)
  291. end
  292.  
  293. function Player:setSpecialDescription(desc)
  294.     return doPlayerSetSpecialDescription(self.cid, desc)
  295. end
  296.    
  297. function Player:getAccountId()
  298.     return getPlayerAccountId(self.cid)
  299. end
  300.  
  301. function Player:getAccount()
  302.     return getPlayerAccount(self.cid)
  303. end
  304.  
  305. function Player:getFlagValue(flag)
  306.     return getPlayerFlagValue(self.cid, flag)
  307. end
  308.  
  309. function Player:getCustomFlagValue(flag)
  310.     return getPlayerCustomFlagValue(self.cid, flag)
  311. end
  312.  
  313. function Player:getPromotion()
  314.     return getPlayerPromotionLevel(self.cid)
  315. end
  316.  
  317. function Player:setPromotion(level)
  318.     return doPlayerSetPromotionLevel(self.cid, level)
  319. end
  320.  
  321. function Player:getGroupId()
  322.     return getPlayerGroupId(self.cid)
  323. end
  324.  
  325. function Player:setGroupId(newGroupId)
  326.     return doPlayerSetGroupId(self.cid, newGroupId)
  327. end
  328.  
  329. function Player:sendOutfitWindow()
  330.     return doPlayerSendOutfitWindow(self.cid)
  331. end
  332.  
  333. function Player:learnInstantSpell(name)
  334.     return doPlayerLearnInstantSpell(self.cid, name)
  335. end
  336.  
  337. function Player:unlearnInstantSpell(name)
  338.     return doPlayerUnlearnInstantSpell(self.cid, name)
  339. end
  340.  
  341. function Player:getLearnedInstantSpell(name)
  342.     return getPlayerLearnedInstantSpell(self.cid, name)
  343. end
  344.  
  345. function Player:getInstantSpellCount()
  346.     return getPlayerInstantSpellCount(self.cid)
  347. end
  348.  
  349. function Player:getInstantSpellInfo(index)
  350.     return type(index) == 'number' and getPlayerInstantSpellInfo(self.cid, index) or getInstantSpellInfo(self.cid, index)
  351. end
  352.  
  353.  
  354.  
  355.  
  356.  
  357. function Game.getUsersInChannel(channelId)
  358.     return getChannelUsers(channelId)
  359. end
  360.  
  361. function Game.getOnline()
  362.     return getPlayersOnline()
  363. end
  364.  
  365. function Tile:getTileInfo(pos)
  366.     return getTileInfo(pos and pos or self:getPosition())
  367. end
  368.  
  369. -- universal
  370. function Position:getThingFromPos(displayError)
  371.     -- getThingFromPos(pos[, displayError = true])
  372.     return getThingFromPos(self:getPosition(), displayError)
  373. end
  374.  
  375. -- creature, npc, player, item
  376. function Thing:
  377.     return getThing(self.uid)
  378. end
  379.    
  380. function Thing:
  381.     return doTileQueryAdd(self.uid, pos[, flags[, displayError = true]])
  382. end
  383.  
  384. function x:
  385.     return doItemRaidUnref(self.uid)
  386. end
  387.  
  388. -- creature, npc, player, item
  389. function Thing:getPosition()
  390.     return getThingPosition(self.cid)
  391. end
  392.  
  393. function Position:
  394.     return getTileItemById(pos, itemId[, subType = -1])
  395. end
  396.    
  397. function Position:
  398.     return getTileItemByType(pos, type)
  399. end
  400.  
  401. function Position:
  402.     return getTileThingByPos(pos)
  403. end
  404.  
  405. function Position:
  406.     return getTopCreature(pos)
  407. end
  408.  
  409. function Item:remove(count)
  410.     -- doRemoveItem(uid[, count])
  411.     return doRemoveItem(self.cid, count or 1)
  412. end
  413.    
  414. function Player:feed(food)
  415.     return doPlayerFeed(self.cid, food)
  416. end
  417.    
  418. function Player:sendCancelMessage(text, returnValue)
  419.     return returnValue and doPlayerSendDefaultCancel(self.cid, returnValue) or doPlayerSendCancel(self.cid, text)
  420. end
  421.  
  422. function x:
  423.     return getSearchString(fromPosition, toPosition[, fromIsCreature = false[, toIsCreature = false]])
  424. end
  425.    
  426. function x:getClosestFreePosition(targetpos, extended, ignoreHouse)
  427.     -- getClosestFreeTile(cid, targetpos[, extended = false[, ignoreHouse = true]])
  428.     return getClosestFreeTile(self.cid, targetpos, extended, ignoreHouse)
  429. end
  430.  
  431. -- universal
  432. function Thing:teleportTo(newpos, pushmove)
  433.     return doTeleportThing(self.cid, newpos, pushmove)
  434. end
  435.  
  436.  
  437. function Item:transform(newId, count)
  438.     return doTransformItem(self.cid, newId, count)
  439. end
  440.  
  441.  
  442.  
  443. -- creature, npc, player, item
  444. function Creature:sendMagicEffect(type, player)
  445.     -- doSendMagicEffect(pos, type[, player])
  446.     return doSendMagicEffect(self:getPosition(), type, player)
  447. end
  448.  
  449. -- creature, npc, player, item
  450. function Creature:sendDistanceEffect(toPos, type, player)
  451.     -- doSendDistanceShoot(fromPos, toPos, type[, player])
  452.     return doSendDistanceShoot(self:getPosition(), toPos, type, player)
  453. end
  454.  
  455. -- creature, npc, player, item, position
  456. function Creature:animateText(text, color, player)
  457.     -- doSendAnimatedText(pos, text, color[, player])
  458.     return doSendAnimatedText(self:getPosition(), text, color, player)
  459. end
  460.    
  461. function Player:addSkillTry(skillid, n, useMultiplier)
  462.     -- doPlayerAddSkillTry(cid, skillid, n[, useMultiplier])
  463.     return doPlayerAddSkillTry(self.cid, skillid, n[, useMultiplier])
  464. end
  465.  
  466. -- npc, creature, player
  467. function Creature:addHealth(health, hitEffect, hitColor, force)
  468.     -- doCreatureAddHealth(cid, health[, hitEffect[, hitColor[, force]]])
  469.     return doCreatureAddHealth(self.cid, health, hitEffect, hitColor, force)
  470. end
  471.    
  472. function Creature:addMana(mana)
  473.     return doCreatureAddMana(self.cid, mana)
  474. end
  475.  
  476. -- creature, npc, player
  477. function Creature:setMaxHealth(health)
  478.     return setCreatureMaxHealth(self.cid, health)
  479. end
  480.  
  481. function Creature:setMaxMana(mana)
  482.     return setCreatureMaxMana(self.cid, mana)
  483. end
  484.    
  485. function Player:setMaxCap(cap)
  486.     return doPlayerSetMaxCapacity(self.cid, cap)
  487. end
  488.  
  489. function Player:addManaSpent(amount, useMultiplier)
  490.     -- doPlayerAddSpentMana(cid, amount[, useMultiplier])
  491.     return doPlayerAddSpentMana(self.cid, amount, useMultiplier)
  492. end
  493.    
  494. function Player:addSoul(soul)
  495.     return doPlayerAddSoul(self.cid, soul)
  496. end
  497.    
  498. function Player:addItem(itemid, count, canDropOnMap)
  499.     -- doPlayerAddItem(cid, itemid[, count/subtype[, canDropOnMap]])
  500.     -- doPlayerAddItem(cid, itemid[, count[, canDropOnMap[, subtype]]])
  501.     -- Returns uid of the created item
  502.     return doPlayerAddItem(self.cid, itemid, count, canDropOnMap)
  503. end
  504.  
  505. function Player:addItemEx(uid, canDropOnMap)
  506.     -- doPlayerAddItemEx(cid, uid[, canDropOnMap = FALSE])
  507.     return doPlayerAddItemEx(self.cid, uid, canDropOnMap)
  508. end
  509.  
  510. function Player:sendTextMessage(MessageClasses, message)
  511.     return doPlayerSendTextMessage(self.cid, MessageClasses, message)
  512. end
  513.  
  514. function Player:sendChannelMessage(channel, SpeakClasses, message, author)
  515.     return doPlayerSendChannelMessage(self.cid, author, message, SpeakClasses, channel)
  516. end
  517.  
  518. function Player:sendToChannel(targetId, SpeakClasses, message, channel, time_)
  519.     -- doPlayerSendToChannel(cid, targetId, SpeakClasses, message, channel[, time])
  520.     return doPlayerSendToChannel(self.cid, targetId, SpeakClasses, message, channel, time_)
  521. end
  522.  
  523. function Player:addMoney(money)
  524.     return doPlayerAddMoney(self.cid, money)
  525. end
  526.  
  527. function Player:removeMoney(money)
  528.     return doPlayerRemoveMoney(self.cid, money)
  529. end
  530.  
  531. function Player:transferMoneyTo(target, money)
  532.     return doPlayerTransferMoneyTo(self.cid, target, money)
  533. end
  534.  
  535. -- universal
  536. function x:showTextDialog(itemid, text)
  537.     return doShowTextDialog(self.cid, itemid, text)
  538. end
  539.  
  540.  
  541. function Item:decay()
  542.     return doDecayItem(self.cid)
  543. end
  544.  
  545. function x:
  546.     return doCreateItem(itemid[, type/count], pos)
  547.     --return Returns uid of the created item, only works on tiles.
  548. end
  549.  
  550. function x:
  551.     return doCreateItemEx(itemid[, count/subType = -1])
  552. end
  553.  
  554. function x:
  555.     return doTileAddItemEx(pos, uid)
  556. end
  557.  
  558. function x:
  559.     return doAddContainerItemEx(uid, virtuid)
  560.  
  561.  
  562.     return doRelocate(pos, posTo[, creatures = true])
  563.     --return Moves all moveable objects from pos to posTo
  564. end
  565.  
  566. function x:
  567.     return doCleanTile(pos[, forceMapLoaded = false])
  568. end
  569.  
  570. function x:
  571.     return doCreateTeleport(itemid, topos, createpos)
  572. end
  573.  
  574. function Game.createMonster(name, pos, displayError)
  575.     -- doCreateMonster(name, pos[, displayError = true])
  576.     return doCreateMonster(name, pos, displayError)
  577. end
  578.  
  579. function Game.createNpc(name, pos, displayError)
  580.     -- doCreateNpc(name, pos[, displayError = true])
  581.     return doCreateNpc(name, pos, displayError)
  582. end
  583.  
  584. function Game.createMonster(name)
  585.     return doSummonMonster(self.cid, name)
  586. end
  587.  
  588. function x:
  589.     return doConvinceCreature(self.cid, target)
  590. end
  591.  
  592. function x:
  593.     return getMonsterTargetList(self.cid)
  594. end
  595.  
  596. function x:
  597.     return getMonsterFriendList(self.cid)
  598. end
  599.  
  600. function x:
  601.     return doMonsterSetTarget(self.cid, target)
  602. end
  603.  
  604. function x:
  605.     return doMonsterChangeTarget(self.cid)
  606. end
  607.  
  608. function x:
  609.     return getMonsterInfo(name)
  610. end
  611.  
  612. function x:
  613.     return doAddCondition(self.cid, condition)
  614. end
  615.  
  616. function x:
  617.     return doRemoveCondition(self.cid, type[, subId])
  618. end
  619.  
  620. function x:
  621.     return doRemoveConditions(self.cid[, onlyPersistent])
  622. end
  623.  
  624. function Creature:
  625.     return doRemoveCreature(self.cid[, forceLogout = true])
  626. end
  627.  
  628. function Creature:
  629.     return doMoveCreature(self.cid, direction)
  630. end
  631.  
  632. function Player:
  633.     return doPlayerSetPzLocked(self.cid, locked)
  634. end
  635.  
  636. function Player:
  637.     return doPlayerSetTown(self.cid, townid)
  638. end
  639.  
  640. function Creature:
  641.     return doPlayerSetVocation(self.cid,voc)
  642. end
  643.  
  644. function Player:
  645.     return doPlayerRemoveItem(self.cid, itemid[, count[, subType]])
  646. end
  647.  
  648. function Player:
  649.     return doPlayerAddExperience(self.cid, amount)
  650. end
  651.  
  652. function Player:
  653.     return doPlayerSetGuildId(self.cid, id)
  654. end
  655.  
  656. function Player:
  657.     return doPlayerSetGuildLevel(self.cid, level[, rank])
  658. end
  659.  
  660. function Player:
  661.     return doPlayerSetGuildNick(self.cid, nick)
  662. end
  663.  
  664. function Player:
  665.     return doPlayerAddOutfit(self.cid, looktype, addon)
  666. end
  667.  
  668. function Player:
  669.     return doPlayerRemoveOutfit(self.cid, looktype[, addon = 0])
  670. end
  671.  
  672. function Player:
  673.     return doPlayerAddOutfitId(self.cid, outfitId, addon)
  674. end
  675.  
  676. function Player:
  677.     return doPlayerRemoveOutfitId(self.cid, outfitId[, addon = 0])
  678. end
  679.  
  680. function Creature:
  681.     return canPlayerWearOutfit(self.cid, looktype[, addon = 0])
  682. end
  683.  
  684. function Creature:
  685.     return canPlayerWearOutfitId(self.cid, outfitId[, addon = 0])
  686. end
  687.  
  688. function Creature:
  689.     return doSetCreatureLight(self.cid, lightLevel, lightColor, time)
  690. end
  691.  
  692. function Creature:
  693.     return getCreatureCondition(self.cid, condition[, subId])
  694. end
  695.  
  696. function Creature:
  697.     return doCreatureSetDropLoot(self.cid, doDrop)
  698. end
  699.  
  700. function Player:
  701.     return getPlayerLossPercent(self.cid, lossType)
  702. end
  703.  
  704. function Player:
  705.     return doPlayerSetLossPercent(self.cid, lossType, newPercent)
  706. end
  707.  
  708. function Player:
  709.     return doPlayerSetLossSkill(self.cid, doLose)
  710. end
  711.  
  712. function Player:
  713.     return getPlayerLossSkill(self.cid)
  714. end
  715.  
  716. function Player:
  717.     return doPlayerSwitchSaving(self.cid)
  718. end
  719.  
  720. function Player:
  721.     return doPlayerSave(self.cid[, shallow = false])
  722. end
  723.  
  724. function Player:
  725.     return isPlayerPzLocked(self.cid)
  726. end
  727.  
  728. function Player:
  729.     return isPlayerSaving(self.cid)
  730. end
  731.  
  732. function Creature:
  733.     return isCreature(self.cid)
  734. end
  735.  
  736. function Container:
  737.     return isContainer(uid)
  738. end
  739.  
  740. function Thing:
  741.     return isMovable(uid)
  742. end
  743.  
  744. function Creature:
  745.     return getCreatureByName(name)
  746. end
  747.  
  748. function Player:
  749.     return getPlayerByGUID(guid)
  750. end
  751.  
  752. function Player:
  753.     return getPlayerByNameWildcard(name~[, ret = false])
  754. end
  755.  
  756. function Player:
  757.     return getPlayerGUIDByName(name[, multiworld = false])
  758. end
  759.  
  760. function Player:
  761.     return getPlayerNameByGUID(guid[, multiworld = false[, displayError = true]])
  762. end
  763.  
  764. function Creature:
  765.     return registerCreatureEvent(uid, eventName)
  766. end
  767.  
  768. function Container:
  769.     return getContainerSize(uid)
  770. end
  771.  
  772. function Container:
  773.     return getContainerCap(uid)
  774. end
  775.  
  776. function Container:
  777.     return getContainerItem(uid, slot)
  778. end
  779.  
  780. function Container:
  781.     return doAddContainerItem(uid, itemid[, count/subType])
  782. end
  783.  
  784. function House:
  785.     return getHouseInfo(houseId)
  786. end
  787.  
  788. function House:
  789.     return getHouseAccessList(houseid, listId)
  790. end
  791.  
  792. function House:
  793.     return getHouseByPlayerGUID(playerGUID)
  794. end
  795.  
  796. function House:
  797.     return getHouseFromPos(pos)
  798. end
  799.  
  800. function House:
  801.     return setHouseAccessList(houseid, listid, listtext)
  802. end
  803.  
  804. function House:
  805.     return setHouseOwner(houseId, owner[, clean])
  806. end
  807.  
  808. function Game:
  809.     return getWorldType()
  810. end
  811.  
  812. function Game:
  813.     return setWorldType(type)
  814. end
  815.  
  816. function Game:
  817.     return getWorldTime()
  818. end
  819.  
  820. function Game:
  821.     return getWorldLight()
  822. end
  823.  
  824. function Game:getWorldCreatures(t)
  825.     --0 players, 1 monsters, 2 npcs, 3 all
  826.     return not t and getWorldCreatures(3) or getWorldCreatures(t)
  827. end
  828.  
  829. function Game:
  830.     return getWorldUpTime()
  831. end
  832.  
  833. function Guild:
  834.     return getGuildId(guildName)
  835. end
  836.  
  837. function Guild:
  838.     return getGuildMotd(guildId)
  839. end
  840.  
  841. function Player:
  842.     return getPlayerSex(self.cid[, full = false])
  843. end
  844.  
  845. function Player:
  846.     return doPlayerSetSex(self.cid, newSex)
  847. end
  848.  
  849. function Combat:
  850.     return createCombatArea({area}[, {extArea}])
  851. end
  852.  
  853. function Condition:
  854.     return createConditionObject(type[, ticks[, buff[, subId]]])
  855. end
  856.  
  857. function Combat:
  858.     return setCombatArea(combat, area)
  859. end
  860.  
  861. function Combat:
  862.     return setCombatCondition(combat, condition)
  863. end
  864.  
  865. function Combat:
  866.     return setCombatParam(combat, key, value)
  867. end
  868.  
  869. function Condition:
  870.     return setConditionParam(condition, key, value)
  871. end
  872.  
  873. function Condition:
  874.     return addDamageCondition(condition, rounds, time, value)
  875. end
  876.  
  877. function Condition:
  878.     return addOutfitCondition(condition, outfit)
  879. end
  880.  
  881. function Combat:
  882.     return setCombatCallBack(combat, key, function_name)
  883. end
  884.  
  885. function Combat:
  886.     return setCombatFormula(combat, type, mina, minb, maxa, maxb[, minl, maxl[, minm, maxm[, minc[, maxc]]]])
  887. end
  888.  
  889. function Condition:
  890.     return setConditionFormula(combat, mina, minb, maxa, maxb)
  891. end
  892.  
  893. function Combat:
  894.     return doCombat(self.cid, combat, param)
  895. end
  896.  
  897. function Combat:
  898.     return createCombatObject()
  899. end
  900.  
  901. function Combat:
  902.     return doCombatAreaHealth(self.cid, type, pos, area, min, max, effect)
  903. end
  904.  
  905. function Combat:
  906.     return doTargetCombatHealth(self.cid, target, type, min, max, effect)
  907. end
  908.  
  909. function Combat:
  910.     return doCombatAreaMana(self.cid, pos, area, min, max, effect)
  911. end
  912.  
  913. function Combat:
  914.     return doTargetCombatMana(self.cid, target, min, max, effect)
  915. end
  916.  
  917. function Combat:
  918.     return doCombatAreaCondition(self.cid, pos, area, condition, effect)
  919. end
  920.  
  921. function Combat:
  922.     return doTargetCombatCondition(self.cid, target, condition, effect)
  923. end
  924.  
  925. function Combat:
  926.     return doCombatAreaDispel(self.cid, pos, area, type, effect)
  927. end
  928.  
  929. function Combat:
  930.     return doTargetCombatDispel(self.cid, target, type, effect)
  931. end
  932.  
  933. function Creature:
  934.     return doChallengeCreature(self.cid, target)
  935. end
  936.  
  937. function Variant:
  938.     return numberToVariant(number)
  939. end
  940.  
  941. function Variant:
  942.     return stringToVariant(string)
  943. end
  944.  
  945. function Variant:
  946.     return positionToVariant(pos)
  947. end
  948.  
  949. function Variant:
  950.     return targetPositionToVariant(pos)
  951. end
  952.  
  953. function Variant:
  954.     return variantToNumber(var)
  955. end
  956.  
  957. function Variant:
  958.     return variantToString(var)
  959. end
  960.  
  961. function Variant:
  962.     return variantToPosition(var)
  963. end
  964.  
  965. function Creature:
  966.     return doChangeSpeed(self.cid, delta)
  967. end
  968.  
  969. function Creature:
  970.     return doCreatureChangeOutfit(self.cid, outfit)
  971. end
  972.  
  973. function Creature:
  974.     return doSetMonsterOutfit(self.cid, name, time)
  975. end
  976.  
  977. function Creature:
  978.     return doSetItemOutfit(self.cid, item, time)
  979. end
  980.  
  981. function Creature:
  982.     return doSetCreatureOutfit(self.cid, outfit, time)
  983. end
  984.  
  985. function Creature:
  986.     return getCreatureOutfit(self.cid)
  987. end
  988.  
  989. function Creature:
  990.     return getCreatureLastPosition(self.cid)
  991. end
  992.  
  993. function Creature:
  994.     return getCreatureName(self.cid)
  995. end
  996.  
  997. function Creature:
  998.     return getCreatureSpeed(self.cid)
  999. end
  1000.  
  1001. function Creature:
  1002.     return getCreatureBaseSpeed(self.cid)
  1003. end
  1004.  
  1005. function Creature:
  1006.     return getCreatureTarget(cid)
  1007. end
  1008.  
  1009. function Game:
  1010.     return isSightClear(fromPos, toPos, floorCheck)
  1011. end
  1012.  
  1013. function Game:
  1014.     return isInArray(array, value[, caseSensitive = false])
  1015. end
  1016.  
  1017. function Game:
  1018.     return addEvent(callback, delay, ...)
  1019. end
  1020.  
  1021. function Game:
  1022.     return stopEvent(eventid)
  1023. end
  1024.  
  1025. function Player:
  1026.     return getPlayersByAccountId(accId)
  1027. end
  1028.  
  1029. function Game:
  1030.     return getAccountIdByName(name)
  1031. end
  1032.  
  1033. function Game:
  1034.     return getAccountByName(name)
  1035. end
  1036.  
  1037. function Game:
  1038.     return getAccountIdByAccount(accName)
  1039. end
  1040.  
  1041. function Game:
  1042.     return getAccountByAccountId(accId)
  1043. end
  1044.  
  1045. function Game:
  1046.     return getIpByName(name)
  1047. end
  1048.  
  1049. function Player:
  1050.     return getPlayersByIp(ip[, mask = 0xFFFFFFFF])
  1051. end
  1052.  
  1053. function Player:
  1054.     return doPlayerPopupFYI(self.cid, message)
  1055. end
  1056.  
  1057. function Player:
  1058.     return doPlayerSendTutorial(self.cid, id)
  1059. end
  1060.  
  1061. function Player:
  1062.     return doPlayerSendMailByName(name, item[, town[, actor]])
  1063. end
  1064.  
  1065. function Player:
  1066.     return doPlayerAddMapMark(self.cid, pos, type[, description])
  1067. end
  1068.  
  1069. function Player:
  1070.     return doPlayerAddPremiumDays(self.cid, days)
  1071. end
  1072.  
  1073. function Player:
  1074.     return getPlayerPremiumDays(self.cid)
  1075. end
  1076.  
  1077. function Creature:
  1078.     return doCreatureSetLookDirection(self.cid, dir)
  1079. end
  1080.  
  1081. function Creature:
  1082.     return getCreatureSkullType(self.cid[, target])
  1083. end
  1084.  
  1085. function Creature:
  1086.     return doCreatureSetSkullType(self.cid, skull)
  1087. end
  1088.  
  1089. function Player:
  1090.     return getPlayerSkullEnd(self.cid)
  1091. end
  1092.  
  1093. function Player:
  1094.     return doPlayerSetSkullEnd(self.cid, time, type)
  1095. end
  1096.  
  1097. function Player:
  1098.     return getPlayerBalance(self.cid)
  1099. end
  1100.  
  1101. function Player:
  1102.     return getPlayerBlessing(self.cid, blessing)
  1103. end
  1104.  
  1105. function Player:
  1106.     return doPlayerAddBlessing(self.cid, blessing)
  1107. end
  1108.  
  1109. function Player:
  1110.     return getPlayerStamina(self.cid)
  1111. end
  1112.  
  1113. function Player:
  1114.     return doPlayerSetStamina(self.cid, minutes)
  1115. end
  1116.  
  1117. function Player:
  1118.     return doPlayerAddStamina(self.cid, minutes)
  1119. end
  1120.  
  1121. function Player:
  1122.     return doPlayerSetBalance(self.cid, balance)
  1123. end
  1124.  
  1125. function Creature:
  1126.     return getCreatureNoMove(self.cid)
  1127. end
  1128.  
  1129. function Creature:
  1130.     return doCreatureSetNoMove(self.cid, block)
  1131. end
  1132.  
  1133. function Creature:
  1134.     return getPlayerIdleTime(self.cid)
  1135. end
  1136.  
  1137. function Creature:
  1138.     return doPlayerSetIdleTime(self.cid, amount)
  1139. end
  1140.  
  1141. function Player:
  1142.     return getPlayerLastLoad(self.cid)
  1143. end
  1144.  
  1145. function Player:
  1146.     return getPlayerLastLogin(self.cid)
  1147. end
  1148.  
  1149. function Player:
  1150.     return getPlayerAccountManager(self.cid)
  1151. end
  1152.  
  1153. function Player:
  1154.     return getPlayerRates(self.cid)
  1155. end
  1156.  
  1157. function Player:
  1158.     return doPlayerSetRate(self.cid, type, value)
  1159. end
  1160.  
  1161. function Player:
  1162.     return getPlayerPartner(self.cid)
  1163. end
  1164.  
  1165. function Player:
  1166.     return doPlayerSetPartner(self.cid, guid)
  1167. end
  1168.  
  1169. function Player:
  1170.     return getPlayerParty(self.cid)
  1171. end
  1172.  
  1173. function Player:
  1174.     return doPlayerJoinParty(self.cid, lid)
  1175. end
  1176.  
  1177. function Creature:
  1178.     return getPartyMembers(lid)
  1179. end
  1180.  
  1181. function Creature:
  1182.     return getCreatureMaster(self.cid)
  1183. end
  1184.  
  1185. function Creature:
  1186.     return getCreatureSummons(cid)
  1187. end
  1188.  
  1189. function Town:
  1190.     return getTownId(townName)
  1191. end
  1192.  
  1193. function Town:
  1194.     return getTownName(townId)
  1195. end
  1196.  
  1197. function Town:
  1198.     return getTownTemplePosition(townId[, displayError])
  1199. end
  1200.  
  1201. function Town:
  1202.     return getTownHouses(townId)
  1203. end
  1204.  
  1205. function Game:
  1206.     return getSpectators(centerPos, rangex, rangey[, multifloor = false])
  1207. end
  1208.  
  1209. function Game:
  1210.     return getVocationInfo(id)
  1211. end
  1212.  
  1213. function Group:
  1214.     return getGroupInfo(id)
  1215. end
  1216.  
  1217. function Game:
  1218.     return getWaypointList()
  1219. end
  1220.  
  1221. function Game:
  1222.     return getTalkActionList()
  1223. end
  1224.  
  1225. function Game:
  1226.     return getExperienceStageList()
  1227. end
  1228.  
  1229. function Item:
  1230.     return getItemIdByName(name[, displayError = true])
  1231. end
  1232.  
  1233. function Item:
  1234.     return getItemInfo(itemid)
  1235. end
  1236.  
  1237. function Item:
  1238.     return getItemAttribute(uid, key)
  1239. end
  1240.  
  1241. function Item:
  1242.     return doItemSetAttribute(uid, key, value)
  1243. end
  1244.  
  1245. function Item:
  1246.     return doItemEraseAttribute(uid, key)
  1247. end
  1248.  
  1249. function Item:
  1250.     return getItemWeight(uid[, precise = true])
  1251. end
  1252.  
  1253. function Item:
  1254.     return hasItemProperty(uid)
  1255. end
  1256.  
  1257.  
  1258. function Player:   
  1259.     hasPlayerClient(self.cid)
  1260. end
  1261.  
  1262. function Game:
  1263.     return isIpBanished(ip[, mask])
  1264. end
  1265.  
  1266. function Player:
  1267.     return isPlayerBanished(name/guid, type)
  1268. end
  1269.  
  1270. function Game:
  1271.     return isAccountBanished(accountId[, playerId])
  1272. end
  1273.  
  1274. function Game:
  1275.     return doAddIpBanishment(...)
  1276. end
  1277.  
  1278. function Game:
  1279.     return doAddPlayerBanishment(...)
  1280. end
  1281.  
  1282. function Game:
  1283.     return doAddAccountBanishment(...)
  1284. end
  1285.  
  1286. function Game:
  1287.     return doAddNotation(...)
  1288. end
  1289.  
  1290. function Game:
  1291.     return doAddStatement(...)
  1292. end
  1293.  
  1294. function Game:
  1295.     return doRemoveIpBanishment(ip[, mask])
  1296. end
  1297.  
  1298. function Game:
  1299.     return doRemovePlayerBanishment(name/guid, type)
  1300. end
  1301.  
  1302. function Game:
  1303.     return doRemoveAccountBanishment(accountId[, playerId])
  1304. end
  1305.  
  1306. function Game:
  1307.     return doRemoveNotations(accountId[, playerId])
  1308. end
  1309.  
  1310. function Game:
  1311.     return doRemoveStatements(name/guid[, channelId])
  1312. end
  1313.  
  1314. function Game:
  1315.     return getNotationsCount(accountId[, playerId])
  1316. end
  1317.  
  1318. function Game:
  1319.     return getStatementsCount(name/guid[, channelId])
  1320. end
  1321.  
  1322. function Game:
  1323.     return getBanData(value[, type[, param]])
  1324. end
  1325.  
  1326. function Game:
  1327.     return getBanReason(id)
  1328. end
  1329.  
  1330. function Game:
  1331.     return getBanAction(id)
  1332. end
  1333.  
  1334. function Game:
  1335.     return getBanList(type[, value[, param]])
  1336. end
  1337.  
  1338. function Game:
  1339.     return getExperienceStage(level)
  1340. end
  1341.  
  1342. function Game:
  1343.     return getDataDir()
  1344. end
  1345.  
  1346. function Game:
  1347.     return getLogsDir()
  1348. end
  1349.  
  1350. function Game:
  1351.     return getConfigFile()
  1352. end
  1353.  
  1354. function Game:
  1355.     return getConfigValue(key)
  1356. end
  1357.  
  1358. function Game:
  1359.     return getModList()
  1360. end
  1361.  
  1362. function Game:
  1363.     return getHighscoreString(skillId)
  1364. end
  1365.  
  1366. function Game:
  1367.     return getWaypointPosition(name)
  1368. end
  1369.  
  1370. function Game:
  1371.     return doWaypointAddTemporial(name, pos)
  1372. end
  1373.  
  1374. function Game:
  1375.     return getGameState()
  1376. end
  1377.  
  1378. function Game:
  1379.     return doSetGameState(id)
  1380. end
  1381.  
  1382. function Game:
  1383.     return doExecuteRaid(name)
  1384. end
  1385.  
  1386. function Creature:
  1387.     return doCreatureExecuteTalkAction(self.cid, text[, ignoreAccess[, channelId]])
  1388. end
  1389.  
  1390. function Game:
  1391.     return doReloadInfo(id[, self.cid])
  1392. end
  1393.  
  1394. function Game:
  1395.     return doSaveServer()
  1396. end
  1397.  
  1398. function House:
  1399.     return doCleanHouse(houseId)
  1400. end
  1401.  
  1402. function Game:
  1403.     return doCleanMap()
  1404. end
  1405.  
  1406. function Game:
  1407.     return doRefreshMap()
  1408. end
  1409.  
  1410. function Game:
  1411.     return doUpdateHouseAuctions()
  1412. end
  1413.  
  1414. function Game:
  1415.     return loadmodlib(lib)
  1416. end
  1417.  
  1418. function Game:
  1419.     return domodlib(lib)
  1420. end
  1421.  
  1422. function Game:
  1423.     return dodirectory(dir)
  1424. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement