Advertisement
Guest User

config.py

a guest
Oct 24th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.00 KB | None | 0 0
  1. from math import log, floor
  2.  
  3. # Network:
  4. loginInterface = '' # Leave blank to accept connections on any hostname
  5. loginPort = 7171
  6. gameInterface = '' # Leave blank to accept connections on any hostname
  7. gamePort = 7172
  8. webInterface = '' # Leave blank to accept connections on any hostname
  9. webPort = 8080
  10.  
  11. enableExtensionProtocol = True # Only works if loginserver and gameserver run on the same IP.
  12. enableWebProtocol = False
  13.  
  14. # Server ips, for the loginserver
  15. servers = {0 : ('localhost', "PyOT dev server")} # WORLD_ID -> (ip, name). If ip is 'auto', we'll automatically find the IP to the LOGINSERVER machine. This require internet access!
  16.  
  17. # IPs allowed to use the execute protocol (usually things like web servers). ONLY trusted hosts, they can remove system files from this!
  18. executeProtocolIps = ('127.0.0.1',)
  19. executeProtocolAuthKeys = ("Test",) # Add keys here if you will demand authorization
  20. loginMaxConnections = 20
  21. gameMaxConnections = 100
  22.  
  23. # SQL:
  24. sqlModule = "mysql" # # Can be "mysql" or "tornado-mysql".
  25. sqlUsername = "root"
  26. sqlPassword = "grilo13"
  27. sqlDatabase = "pyot" # Either a DB name, or file for sqlite3
  28. sqlHost = "localhost"
  29.  
  30. # Use socket from libmysqlclient, works ONLY if sqlHost == localhost
  31. sqlSocket = None
  32.  
  33. # Alternative:
  34. # Fedora/CentOS/RHEL
  35. #sqlSocket = "/var/lib/mysql/mysql.sock"
  36. # Ubuntu/Kubuntu/Debian
  37. # sqlSocket = "/var/run/mysql/mysql.sock"
  38. # Others:
  39. #sqlSocket = "/var/run/mysqld/mysqld.sock"
  40.  
  41. # LoginServer, seperate or integrated? This allows you to let the game server handle the loginserver. Doesn't stack very well when using multi server.
  42. # This option also enables otserv compatible status protocol.
  43. letGameServerRunTheLoginServer = True
  44.  
  45. # This servers worldId
  46. worldId = 0
  47.  
  48. # Versions:
  49. versionMin = 854
  50. versionMax = 981
  51. versionError = "You must use a client between 8.6 and 9.81"
  52. supportProtocols = (854,860, 861, 862, 870, 910, 920, 931, 940, 941, 942, 943, 944, 945, 946, 951, 952, 953, 954, 960, 962, 963, 970, 971, 980) # We support these main branches + compatible protocols to them
  53.  
  54. # MOTD
  55. motd = "PyOT, it's alive!"
  56.  
  57. # Status info
  58. ownerName = "Server owner"
  59. ownerEmail = "owner@vapus.net"
  60. location = "Europe"
  61. url = "http://vapus.net"
  62.  
  63. # Walking
  64. diagonalWalkCost = 3
  65. stairHopDelay = 2 # In seconds.
  66.  
  67. # Object using.
  68. useDelay = 0.5 # How often objects can be used. 0 to disable. Introduced in 8.72.
  69.  
  70. # Soulgain timer
  71. soulGain = 240 # 4 minutes
  72.  
  73. # Stamina
  74. maxStamina = 42 * 60 # 42 hours, higher won't be displayed in client do to debug, but it will exist virtually
  75. noStaminaNoExp = True
  76.  
  77. # Melee
  78. meleeAttackSpeed = 2 # 2 seconds, this affect both monsters and players. TODO: Configurable per vocation
  79. monsterMeleeFactor = 1 # 1x damage
  80.  
  81. # Spell and rune
  82. runeCastDelay = 1 # Set to 0 to disable the delay.
  83.  
  84. # Monster behavior
  85. monsterWalkBack = False # Walk or Teleport back to spawn point
  86. monsterWalkPer = 2 # Amount of seconds between walks without target.
  87. monsterNeverSkipWalks = False # This makes monsters always calculate a new rute if it runs into solid tiles etc. Walking will be smooth
  88. monsterStairHops = False # Allow monsters to walk up and down stairs
  89. monsterAoEAffectMonsters = False # Does monsters AoE spells affect other monsters?
  90.  
  91. # Outfits
  92. playerCanChangeOutfit = True
  93. playerCanChangeColor = True
  94. playerCanWearAllOutfits = False
  95. playerCanUseAllMounts = False
  96.  
  97. # PvP
  98. trackHits = 40 # How many hits are we suppose to track? This is important for both assists and experience splitting.
  99. globalProtectionZone = False # True = optional PvP. Scripts might change a players attackability. This set a global protection zone and override protectedZones = False.
  100. skullSystem = True # False means skulls and skull effects are disabled. Like in Optional PvP, or Hardcore PvP. Scripts can still raise skulls tho.
  101. protectedZones = True # False will disable protected zones like in Harcore PvP. Scripts can force set protected zones.
  102. protectionLevel = 200 #0 noone is protected, X > 0 protection until that level
  103.  
  104. loginBlock = 60 # In seconds, 0 to disable.
  105. resetSkulls = True # If a player takes new offence in a skull periode will it reset the timer?
  106. pvpDamageFactor = 0.5 # 50%
  107.  
  108. deathListCutoff = 45 # In days. This is the maximum amount of time we care to load in death entries from.
  109.  
  110. whiteSkull = 15 * 60 # In seconds, 0 to disable
  111.  
  112. redSkull = 60 * 60 * 24 * 30 # Red skull, in seconds. 0 to disable
  113. redSkullUnmarked = {24:3, 7*24:5, 30*24:10} # {periode in hours: KILLS}
  114. redSkullLoseRate = 100 # Aga, lose everything, 0 to disable and fall back to default rates. This also count for blackSkull.
  115.  
  116. blackSkull = 60 * 60 * 24 * 45 # Black skull, in seconds. 0 to disable
  117. blackSkullUnmarked = {24:6, 7*24:10, 30*24:20} # {periode in hours: KILLS}
  118. blackSkullDisableAreaSpells = True
  119. blackSkullDisableAreaRunes = True
  120. blackSkullDisableSummons = True
  121. blackSkullFullDamage = True # Receive 100% instead of pvpDamageFactor.
  122. blackSkullRecoverHealth = 40 # How much health to get when you respawn, -1 for full.
  123. blackSkullRecoverMana = 0 # How much mana to get when you respawn. -1 for full.
  124. yellowSkull = True # Enable/Disable this. Disaled = all kills and unjust
  125. orangeSkull = True
  126. orangeSkullLength = 3600 * 7 * 24 # In seconds.
  127.  
  128. # War system.
  129. # See data/scripts/other/war_system.py
  130. enableWarSystem = True
  131. warFee = 1000 # in gold.
  132. minWarDuratiom = 7 * 3600 * 24 # In seconds
  133. maxWarDuration = 180 * 3600 * 24 # In seconds
  134. maxWarLosePenalty = 20000000000 # 2 billion, in gold.
  135. minWarLosePenalty = 1000 # in gold.
  136. maxWarFrags = 1000 # In kills.
  137. minWarFrags = 10
  138. greenSkull = True
  139.  
  140. # Lose rate
  141. loseCutoff = 25 # Set to 0 to disable loose entierly.
  142. loseConstant = 10 # For players with level < loseCutoff. Otherwise we use loseFormula divided by experience.
  143.  
  144. # Loot / Drop
  145. lootDropRate = 1
  146. lootMaxRate = 1
  147. lootInAlphabeticalOrder = True # Order loot in alphabetical order just like real tibia
  148. stockLootInBagsIfNeeded = True # If amount of items > corpseSize, then append a bag, note: bags does stack as the first items, not alphabetically.
  149. stockLootBagId = 1987 # Id of the bags to append
  150. privateLootFor = 10 # How long only you and your party can access the loot.
  151. moveCorpseAfter = 15 # How long is a corpse unmovable?
  152.  
  153. # Experince
  154. experienceRate = 1
  155. experienceMessageColor = 215 # Between 1 or 255, else debug
  156. partyExperienceFactor = 1.05 # 5% extra.
  157. partyExperienceDistance = 30 # In fields.
  158. partyExperienceLevelFactor = 2/3.0
  159. partyExperienceContributeTime = 120
  160.  
  161. # Map cleaning & unloading
  162. # Note: All dropped items on the map will be removed, all creatures will (hopefully) despawn etc
  163. performSectorUnload = True
  164. performSectorUnloadEvery = 900 # 15 minutes is good
  165.  
  166. # Save system
  167. doSaveAll = True # Issue saves
  168. saveEvery = 300 # in seconds. Even down to a few seconds won't really make server lag since it's async, but you will definitly risk binding up sql connections if your below 1second, this in turn can cause lag
  169. saveOnShutdown = True # Issue saves on shutdowns
  170.  
  171. # Tibia day
  172. tibiaTimeOffset = 1200 # This is used as a base time for when the server started. If day is 3600, this means the clock will be 8 when the server starts
  173. tibiaDayLength = 3600 # One hour
  174. tibiaDayFullLightStart = 14
  175. tibiaDayFullLightEnds = 20
  176. tibiaFullDayLight = 215 # Highest light level
  177. tibiaNightLight = 40 # Lowest light level
  178.  
  179. # Mounts
  180. allowMounts = True
  181. applyMountSpeedChange = True
  182. mountInPz = False
  183.  
  184. # Player walking speed.
  185. # 9.8 rules.
  186. playerBaseSpeed = 220.0 # Should have a .0 behind it! Or rather, should be a float number.
  187. playerSpeedLowIncrease = 2 # Increase per level up to playerSpeedLowCut
  188. playerSpeedLowCut = 175 # Level in witch HighIncrease will have an effect.
  189. playerSpeedHighIncrease = 1 # Player speed after
  190.  
  191. # Game modes
  192. playerWalkthrough = False # can also be modified in scripts
  193. creatureWalkthrough = False # can also be modified in scripts
  194. playerIsPushable = True
  195.  
  196. # Instant regeneration.
  197. regenerationTresshold = 150 # 0 to disable.
  198. regenerationDelay = 10
  199.  
  200. # Spawn
  201. tryToSpawnCreaturesNextToEachother = True # Try the sides of a spawn field if there is a creature on top of them
  202. tryToSpawnCreatureRegardlessOfCreatures = False # Try to spawn creatures on top of eachother, this and previous option doesn't stack.
  203.  
  204. # Mailboxes
  205. maxMails = 20
  206. maxMailsWithin = 600 # 10min, default on tibia as of 9.aug
  207.  
  208. # Questlog
  209. sendTutorialSignalUponQuestLogUpdate = True # This is a non-cipsoft feature originally thought up by Big Vamp.
  210.  
  211. # Potions
  212. usableOnTarget = True
  213. splashable = True
  214. realAnimation = False
  215. healthMultiplier = 1
  216. manaMultiplier = 1
  217. exhaust = 2
  218.  
  219. # Auto Cython
  220. # Cython makes c code and compile it out of the python code which still keeping most of the python code compatible. DO NOT STACK WELL WITH tryPsyco!
  221. tryCython = False
  222.  
  223. # Item cache
  224. # This reduce the time it takes to start the server (by about 0.1s), but in turn, it won't use items from the DB whenever a cache file exists.
  225. # This also make item reloading impossible (will require restart and removal of the cache file)
  226. itemCache = False
  227.  
  228. # Houses
  229. chargeRentEvery = 30 * 86400 # Every 30 days
  230.  
  231. # Critical hits:
  232. criticalHitRate = 5 # In %
  233. criticalHitMultiplier = 2 # Multiplier for the damage
  234.  
  235. # Useful options for war system.
  236. anyAccountWillDo = False
  237. anyAccountPlayerMap = ("Random Test Character", 0), # (name, world_id)...
  238.  
  239. # Hotkeys
  240. enableHotkey = True
  241.  
  242. # Marketplace
  243. enableMarket = True # It works for 9.44+ only. Lower versions might not access it.
  244. marketOfferExpire = 7 * 3600 * 24 # How long shall a offer be listed?
  245.  
  246. # Pathfinder
  247. # MIGHT BE BUGGY, NOT WELL TESTED!
  248. findDiagonalPaths = True # Disable this will make the pathfinder somewhat 10-15%
  249.  
  250. # Skills
  251. defaultSkillLevel = 10 # Must be between 10 and 0xFFFF
  252.  
  253. # Vocation stuff (often occure on custom vocations, or pre-level 8 promoted characters.).
  254. minHealth = 150
  255. minMana = 0
  256.  
  257. # Language
  258. # Default (fallback) language.
  259. enableTranslations = True
  260. defaultLanguage = "en_EN" # ISO-4 code
  261.  
  262. # Send premium on 9.5+?
  263. sendPremium = True
  264.  
  265. # Inventory
  266. ammoSlotOnlyForAmmo = True # Post 9.1 behaviour.
  267.  
  268. # Bans
  269. refreshBans = 900 # In seconds, how often to clean up old bans, and load new from the database. Useful for multiplayer servers. Note, having a high value gives a window where a banned account or ip can use a different server before the bans are reloaded. This can ofcourse be dealt with by sending reload orders.
  270. banTimeFormat = "%Y-%m-%d %H:%M:%S" # Expire messages.
  271.  
  272. # Data directories.
  273. dataDirectory = "data" # Should point to a folder at the top level. Cannot be a subfolder!
  274. itemFile = "data/items.json" # Should point to a file under the top directory.
  275. mapDirectory = "map" # Should point to a folder under the data directory. Cannot be a subfolder!
  276.  
  277. # (WINDOWS ONLY)
  278. # Adjust size and/or color of the windows
  279. # Set to None to disable.
  280. consoleColumns = 110
  281. consoleColor = "5f"
  282.  
  283. ########## Advance settings #########
  284. sqlConnections = 10
  285.  
  286. RSAKeys = {"n":"109120132967399429278860960508995541528237502902798129123468757937266291492576446330739696001110603907230888610072655818825358503429057592827629436413108566029093628212635953836686562675849720620786279431090218017681061521755056710823876476444260558147179707119674283982419152118103759076030616683978566631413",
  287. "e":"65537",
  288. "d":"46730330223584118622160180015036832148732986808519344675210555262940258739805766860224610646919605860206328024326703361630109888417839241959507572247284807035235569619173792292786907845791904955103601652822519121908367187885509270025388641700821735345222087940578381210879116823013776808975766851829020659073",
  289. "p":"14299623962416399520070177382898895550795403345466153217470516082934737582776038882967213386204600674145392845853859217990626450972452084065728686565928113",
  290. "q":"7630979195970404721891201847792002125535401292779123937207447574596692788513647179235335529307251350570728407373705564708871762033017096809910315212884101"}
  291.  
  292. maxLengthOfSay = 255 # maximum length of what the client might say
  293. debugItems = True # Print extra data about items
  294.  
  295. checkAdler32 = False # Disable this might speed things up a bit
  296. loadEntierMap = False # Load all the sectors, useful for debug and benchmarking
  297.  
  298. # Disabled for now, breaks house support
  299. stackTiles = False # Sacrefice loading time for the sake of memory usage
  300. stackItems = True
  301.  
  302. whisperRange = (1, 1)
  303. whisperNoise = "pspspsps"
  304. sayRange = (9, 7)
  305. yellRange = (18, 14)
  306.  
  307. # Formulas
  308. levelFormula = lambda x: 50*(x**2)-150*x+200
  309. totalExpFormula = lambda x: (50.0/3)*x*((x-3)*x+8)
  310. loseFormula = lambda x: (x+50)*(50*((x**2) - (5*x) + 8)) # x = level
  311.  
  312. # PvP formulas
  313. pvpExpFormula = lambda killerLevel, victimLevel, victimExperience: max(0, floor((floor(victimLevel * 1.1) - killerLevel)/victimLevel) * floor(victimExperience * 0.05))
  314.  
  315. # pathfinder cache?
  316. pathfinderCache = True
  317.  
  318. # This formula is too complex to put into a lambda
  319. def levelFromExpFormula(y): # y = experience
  320. l1 = ((3 ** 0.5)*(((243*(y**2))-(48600*y)+3680000) ** 0.5)+(27*y)-2700) ** (1.0/3)
  321. l2 = 30**(2.0/3)
  322. l3 = 5 * 10**(2.0/3)
  323. l4 = (3 ** (1.0/3)) * l1
  324. return int(round((l1/l2)-(l3/l4)+2, 10)) # Use int to get the level, and not the progress (eg 10.7 instead of 10), we only want 10 in that case.
  325.  
  326. magicLevelFormula = lambda a,b: 1600*(b**a)
  327. totalMagicLevelFormula = lambda a,b:(1600*((b**a)-1))/(b-1) # a = level, b = vocation constant
  328. magicLevelFromManaFormula = lambda n,b: int(round((log((1.0+n+(1600.0/b)) / 1600.0) + log(b)) / (log(b)), 8)) # n = mana, b = vocation constant
  329.  
  330. # Skills
  331. skillFormula = lambda a,b: 50*(b**(a-10))
  332. totalSkillFormula = lambda a,b: 500*(b**(a-10))-500 # a = current level, b = skill constant
  333. skillTriesToLevel = lambda b, tries: (log((tries/500)+1)/log(b))+10 # b = skill constant, tries = skill tries.
  334. magicPower = lambda lvl,mlvl: max(1,(lvl + 4 * mlvl) / 100)
  335. fishingFormula = lambda x: 20*(1.1)**(x-10)
  336.  
  337. meleeDamage = lambda attack,skill,level,factor: (0.085*factor*attack*skill)+(level/5)
  338.  
  339. minDistanceDamage = lambda level: level // 5
  340. distanceDamage = lambda attack,skill,factor: (0.09*factor*attack*skill)
  341. hitChance = lambda skill, hitchance: hitchance*skill
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement