Lib: g_game - levantocode/otcv8reference-materials GitHub Wiki

Lib g_game Functions

Summary

  1. Player
  2. Walking
  3. Attacking
  4. Battle Options
  5. Right Click Functions
  6. Containers
  7. Party
  8. Communication
  9. NPCs
  10. VIPs
  11. Outfits
  12. Imbuements
  13. Trading with Players
  14. Prey
  15. Quest
  16. Client Text
  17. Connection
  18. Login / Logout
  19. Premium Store
  20. Extras

Player

g_game.getLocalPlayer()

g_game.getLocalPlayer():getInventoryItem()

g_game.getCharacterName()

g_game.isDead()

g_game.getUnjustifiedPoints().killsWeekRemaining


Walking

g_game.walk()

g_game.autoWalk()

g_game.setMaxPreWalkingSteps(value)

g_game.getLastWalkDir()

g_game.turn()


Attacking

g_game.attack() g_game.cancelAttack()

g_game.getAttackingCreature() g_game.getFollowingCreature()

g_game.isFollowing() g_game.cancelFollow()

g_game.cancelAttackAndFollow()


Battle Options

g_game.getChaseMode() g_game.setChaseMode()

g_game.getFightMode() g_game.setFightMode()

g_game.getPVPMode() g_game.setPVPMode()

g_game.isSafeFight() g_game.setSafeFight()

g_game.mount()

g_game.stop()

g_game.getOpenPvpSituations()


Right Click Functions

g_game.look()

g_game.use()

g_game.useWith()

g_game.browseField()

g_game.moveToParentContainer()

g_game.rotate()


Containers

g_game.open(container) g_game.open(slot) g_game.open(item, container)

g_game.openParent()

g_game.close(container)

g_game.getContainers() g_game.getContainer(index)

g_game.refreshContainer()

g_game.findPlayerItem() g_game.findItemInContainers() g_game.seekInContainer()

g_game.move() g_game.moveRaw()

g_game.useInventoryItemWith()

g_game.requestItemInfo()

g_game.equipItem() g_game.equipItemId()


Party

g_game.partyInvite() g_game.partyRevokeInvitation()

g_game.partyJoin() g_game.partyLeave()

g_game.partyPassLeadership()

g_game.partyShareExperience()


Communication

g_game.talk()

g_game.talkPrivate()

g_game.talkChannel()

g_game.requestChannels()

g_game.joinChannel() g_game.leaveChannel()

g_game.openPrivateChannel()

g_game.closeNpcChannel()

g_game.openOwnChannel() g_game.inviteToOwnChannel() g_game.excludeFromOwnChannel()


NPCs

g_game.sellItem(item, count, ignoreEquipped)

g_game.buyItem(item, count, ignoreCapacity, withBackpack)

g_game.inspectNpcTrade()

g_game.closeNpcTrade()


VIPs

g_game.getVips()

g_game.addVip()

g_game.editVip()

g_game.removeVip()


Outfit

g_game.requestOutfit()

g_game.changeOutfit(outfit)

g_game.setOutfitExtensions()


Imbuements

g_game.clearImbuement()

g_game.applyImbuement()

g_game.closeImbuingWindow()


Trading With Players

g_game.requestTrade()

g_game.acceptTrade()

g_game.rejectTrade()

g_game.inspectTrade()


Prey

g_game.preyAction()

g_game.preyRequest() (Tibia 12) update preys


Quest

g_game.requestQuestLog()

g_game.requestQuestLine()


Client Text

g_game.answerModalDialog()

g_game.editText()

g_game.editList()


Connection

g_game.isConnectionOk() g_game.connectionOk()

g_game.getPing()

g_game.getWorldName()

g_game.getServerBeat()


Login / Logout

g_game.isOnline()

g_game.isLogging()

g_game.safeLogout() g_game.forceLogout()

g_game.loginWorld() g_game.cancelLogin()


Premium Store

g_game.openStore()

g_game.transferCoins()

g_game.openTransactionHistory()

g_game.requestStoreOffers()

g_game.buyStoreOffer()

g_game.getTibiaCoins() g_game.setTibiaCoins()

g_game.getTransferableTibiaCoins()

g_game.requestTransactionHistory()


Extras

g_game.getFeature() g_game.enableFeature(feature_id) g_game.disableFeature(feature_id) g_game.resetFeatures()

g_game.getProtocolGame() g_game.getProtocolVersion() -- otserv_protocol g_game.setProtocolVersion() g_game.setCustomProtocolVersion()

g_game.getSupportedClients() g_game.getClientVersion() -- otserv_client g_game.setClientVersion()

g_game.isOfficialTibia()

g_game.showRealDirection() g_game.ignoreServerDirection()

g_game.getRsa() g_game.setRsa() g_game.chooseRsa()

g_game.getOs() g_game.setCustomOs()

g_game.getRecivedPacketsCount() g_game.getRecivedPacketsSize() g_game.setPingDelay()

g_game.isTileThingLuaCallbackEnabled() g_game.enableTileThingLuaCallback()

g_game.getGMActions() g_game.isGM()

g_game.reportBug() g_game.reportRuleViolation() g_game.cancelRuleViolation() g_game.openRuleViolation() g_game.closeRuleViolation()

g_game.wrap() g_game.changeMapAwareRange()