{"action":"created","comment":{"url":"https://api.github.com/repos/otland/forgottenserver/pulls/comments/63339491","id":63339491,"diff_hunk":"@@ -1,158 +1,221 @@\n-local ultimateHealthPot = 8473\n-local greatHealthPot = 7591\n-local greatManaPot = 7590\n-local greatSpiritPot = 8472\n-local strongHealthPot = 7588\n-local strongManaPot = 7589\n-local healthPot = 7618\n-local manaPot = 7620\n-local smallHealthPot = 8704\n-local antidotePot = 8474\n-local greatEmptyPot = 7635\n-local strongEmptyPot = 7634\n-local emptyPot = 7636\n-\n+--[[\n+\t-- Don't forget to put new potions in actions.xml before adding here!\n+\tValues of potions are copied from tibia wiki!\n+\t-- Explanations!\n+\tremovePotions : removing the potion after use. Default : true (optional)\n+\taddEmptyFlasks : add the empty flask after using! ( only works if removePotions ) Default : true (optional)\n+\twords : to say after using! Default : \"Aaaah...\" (optional)\n+\thealthRate : affects the formula of health/mana added (min * healthRate), (max * healthRate) - Default: 1 (required)\n+\tmanaRate : same as healthRate but, for mana - Default: 1 (required)\n+\t-- For every potion!\n+\t[potionId] = {\n+\t\tvocations : the vocations that are able to use the potion! (optional)\n+\t\tminLevel : minimum level to use the potion (optional)\n+\t\thealth/mana : (required)\n+\t\t\tmin, max : the Formula of adding health (i.e , the potion addes from 150 ~ 200 health) (required)\n+\t\temptyFlask : the empty flask to add to player (optional)\n+\t}\n+]]\n+potions = {\n+\t-- The values used in every config is copied from tibia wiki!\n+\tremovePotions = true,\n+\taddEmptyFlasks = true,\n+\twords = \"Aaaah...\",\n+\thealthRate = 1,\n+\tmanaRate = 1,\n+\t-- string to say if player can't use the potion!\n+\t-- First skip is for vocations(string), second skip is for level(int)!\n+\tstringOfVocation = \"This potion can only be consumed by %s of level %d or higher\", -- (Required*)\n+\t-- Health & Spirit Potions\n+\t[8473] = { -- ultimate health potion\n+\t\tvocations = {4, 8},\n+\t\tminLevel = 130,\n+\t\thealthToAdd = { min = 650, max = 850 },\n+\t\temptyFlask = 7635\n+\t},\n+\t[7591] = { -- great health potion\n+\t\tvocations = {4, 8},\n+\t\tminLevel = 80,\n+\t\thealthToAdd = { min = 425, max = 575},\n+\t\temptyFlask = 7635\n+\t},\n+\t[8472] = { -- great spitit potion\n+\t\tvocations = {3, 7},\n+\t\tminLevel = 80,\n+\t\thealthToAdd = { min = 250, max = 350},\n+\t\tmanaToAdd = { min = 100, max = 200},\n+\t\temptyFlask = 7635\n+\t},\n+\t[7588] = { -- strong health potion\n+\t\tvocations = {3, 4, 7, 8},\n+\t\tminLevel = 50,\n+\t\thealthToAdd = { min = 250, max = 350},\n+\t\temptyFlask = 7634\n+\t},\n+\t[7618] = { -- health potion\n+\t\thealthToAdd = { min = 125, max = 175},\n+\t\temptyFlask = 7636\n+\t},\n+\t-- Mana Potions\n+\t[7590] = { -- great mana potion\n+\t\tvocations = {1, 2, 5, 6},\n+\t\tminLevel = 80,\n+\t\tmanaToAdd = { min = 150, max = 250},\n+\t\temptyFlask = 7635\n+\t},\n+\t[7589] = { -- strong mana potion\n+\t\tvocations = {1, 2, 3, 5, 6, 7},\n+\t\tminLevel = 50,\n+\t\tmanaToAdd = { min = 115, max = 185},\n+\t\temptyFlask = 7634\n+\t},\n+\t[7620] = { -- mana potion\n+\t\tmanaToAdd = { min = 75, max = 125},\n+\t\temptyFlask = 7636\n+\t},\n+\t[8704] = { -- small health potion\n+\t\thealthToAdd = { min = 60, max = 90},\n+\t\temptyFlask = 7636\n+\t}\n+}\n+--[[ available custom methods!\n+\tcombat : MetatableCombat\n+\tcondition : MetatableCondition\n+]]\n+-- antidote\n local antidote = Combat()\n antidote:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)\n antidote:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)\n antidote:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)\n antidote:setParameter(COMBAT_PARAM_AGGRESSIVE, false)\n antidote:setParameter(COMBAT_PARAM_DISPEL, CONDITION_POISON)\n+potions[8474] = {combat = antidote, emptyFlask = 7636}\n+\n+--- FUNCTIONS ---\n \n-local exhaust = Condition(CONDITION_EXHAUST_HEAL)\n-exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))\n+potions.exhaust = Condition(CONDITION_EXHAUST_HEAL)\n+potions.exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 100))\n -- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.\n \n function onUse(player, item, fromPosition, target, toPosition, isHotkey)\n \tif target == nil or not target:isPlayer() then\n \t\treturn true","path":"data/actions/scripts/other/potions.lua","position":118,"original_position":118,"commit_id":"6ca9b6a668abe39cbfd8c85efc77332970db45cb","original_commit_id":"6ca9b6a668abe39cbfd8c85efc77332970db45cb","user":{"login":"wgrriffel","id":16732610,"avatar_url":"https://avatars.githubusercontent.com/u/16732610?v=3","gravatar_id":"","url":"https://api.github.com/users/wgrriffel","html_url":"https://github.com/wgrriffel","followers_url":"https://api.github.com/users/wgrriffel/followers","following_url":"https://api.github.com/users/wgrriffel/following{/other_user}","gists_url":"https://api.github.com/users/wgrriffel/gists{/gist_id}","starred_url":"https://api.github.com/users/wgrriffel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wgrriffel/subscriptions","organizations_url":"https://api.github.com/users/wgrriffel/orgs","repos_url":"https://api.github.com/users/wgrriffel/repos","events_url":"https://api.github.com/users/wgrriffel/events{/privacy}","received_events_url":"https://api.github.com/users/wgrriffel/received_events","type":"User","site_admin":false},"body":"should `return false`.","created_at":"2016-05-16T11:14:25Z","updated_at":"2016-05-16T11:14:25Z","html_url":"https://github.com/otland/forgottenserver/pull/1795#discussion_r63339491","pull_request_url":"https://api.github.com/repos/otland/forgottenserver/pulls/1795","_links":{"self":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/comments/63339491"},"html":{"href":"https://github.com/otland/forgottenserver/pull/1795#discussion_r63339491"},"pull_request":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1795"}}},"pull_request":{"url":"https://api.github.com/repos/otland/forgottenserver/pulls/1795","id":70174044,"html_url":"https://github.com/otland/forgottenserver/pull/1795","diff_url":"https://github.com/otland/forgottenserver/pull/1795.diff","patch_url":"https://github.com/otland/forgottenserver/pull/1795.patch","issue_url":"https://api.github.com/repos/otland/forgottenserver/issues/1795","number":1795,"state":"open","locked":false,"title":"Better modifiable potions.lua","user":{"login":"slavidodo","id":14849657,"avatar_url":"https://avatars.githubusercontent.com/u/14849657?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidodo","html_url":"https://github.com/slavidodo","followers_url":"https://api.github.com/users/slavidodo/followers","following_url":"https://api.github.com/users/slavidodo/following{/other_user}","gists_url":"https://api.github.com/users/slavidodo/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidodo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidodo/subscriptions","organizations_url":"https://api.github.com/users/slavidodo/orgs","repos_url":"https://api.github.com/users/slavidodo/repos","events_url":"https://api.github.com/users/slavidodo/events{/privacy}","received_events_url":"https://api.github.com/users/slavidodo/received_events","type":"User","site_admin":false},"body":"Explanation of all features are included.","created_at":"2016-05-16T09:55:43Z","updated_at":"2016-05-16T11:14:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"228153f58bbc8cbe0c34d1b78414d95b7de10274","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/otland/forgottenserver/pulls/1795/commits","review_comments_url":"https://api.github.com/repos/otland/forgottenserver/pulls/1795/comments","review_comment_url":"https://api.github.com/repos/otland/forgottenserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/otland/forgottenserver/issues/1795/comments","statuses_url":"https://api.github.com/repos/otland/forgottenserver/statuses/6ca9b6a668abe39cbfd8c85efc77332970db45cb","head":{"label":"slavidodo:potions_lua","ref":"potions_lua","sha":"6ca9b6a668abe39cbfd8c85efc77332970db45cb","user":{"login":"slavidodo","id":14849657,"avatar_url":"https://avatars.githubusercontent.com/u/14849657?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidodo","html_url":"https://github.com/slavidodo","followers_url":"https://api.github.com/users/slavidodo/followers","following_url":"https://api.github.com/users/slavidodo/following{/other_user}","gists_url":"https://api.github.com/users/slavidodo/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidodo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidodo/subscriptions","organizations_url":"https://api.github.com/users/slavidodo/orgs","repos_url":"https://api.github.com/users/slavidodo/repos","events_url":"https://api.github.com/users/slavidodo/events{/privacy}","received_events_url":"https://api.github.com/users/slavidodo/received_events","type":"User","site_admin":false},"repo":{"id":58772745,"name":"forgottenserver","full_name":"slavidodo/forgottenserver","owner":{"login":"slavidodo","id":14849657,"avatar_url":"https://avatars.githubusercontent.com/u/14849657?v=3","gravatar_id":"","url":"https://api.github.com/users/slavidodo","html_url":"https://github.com/slavidodo","followers_url":"https://api.github.com/users/slavidodo/followers","following_url":"https://api.github.com/users/slavidodo/following{/other_user}","gists_url":"https://api.github.com/users/slavidodo/gists{/gist_id}","starred_url":"https://api.github.com/users/slavidodo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slavidodo/subscriptions","organizations_url":"https://api.github.com/users/slavidodo/orgs","repos_url":"https://api.github.com/users/slavidodo/repos","events_url":"https://api.github.com/users/slavidodo/events{/privacy}","received_events_url":"https://api.github.com/users/slavidodo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slavidodo/forgottenserver","description":"A free and open-source MMORPG server emulator written in C++","fork":true,"url":"https://api.github.com/repos/slavidodo/forgottenserver","forks_url":"https://api.github.com/repos/slavidodo/forgottenserver/forks","keys_url":"https://api.github.com/repos/slavidodo/forgottenserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slavidodo/forgottenserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slavidodo/forgottenserver/teams","hooks_url":"https://api.github.com/repos/slavidodo/forgottenserver/hooks","issue_events_url":"https://api.github.com/repos/slavidodo/forgottenserver/issues/events{/number}","events_url":"https://api.github.com/repos/slavidodo/forgottenserver/events","assignees_url":"https://api.github.com/repos/slavidodo/forgottenserver/assignees{/user}","branches_url":"https://api.github.com/repos/slavidodo/forgottenserver/branches{/branch}","tags_url":"https://api.github.com/repos/slavidodo/forgottenserver/tags","blobs_url":"https://api.github.com/repos/slavidodo/forgottenserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slavidodo/forgottenserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slavidodo/forgottenserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/slavidodo/forgottenserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slavidodo/forgottenserver/statuses/{sha}","languages_url":"https://api.github.com/repos/slavidodo/forgottenserver/languages","stargazers_url":"https://api.github.com/repos/slavidodo/forgottenserver/stargazers","contributors_url":"https://api.github.com/repos/slavidodo/forgottenserver/contributors","subscribers_url":"https://api.github.com/repos/slavidodo/forgottenserver/subscribers","subscription_url":"https://api.github.com/repos/slavidodo/forgottenserver/subscription","commits_url":"https://api.github.com/repos/slavidodo/forgottenserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/slavidodo/forgottenserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/slavidodo/forgottenserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/slavidodo/forgottenserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/slavidodo/forgottenserver/contents/{+path}","compare_url":"https://api.github.com/repos/slavidodo/forgottenserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slavidodo/forgottenserver/merges","archive_url":"https://api.github.com/repos/slavidodo/forgottenserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slavidodo/forgottenserver/downloads","issues_url":"https://api.github.com/repos/slavidodo/forgottenserver/issues{/number}","pulls_url":"https://api.github.com/repos/slavidodo/forgottenserver/pulls{/number}","milestones_url":"https://api.github.com/repos/slavidodo/forgottenserver/milestones{/number}","notifications_url":"https://api.github.com/repos/slavidodo/forgottenserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slavidodo/forgottenserver/labels{/name}","releases_url":"https://api.github.com/repos/slavidodo/forgottenserver/releases{/id}","deployments_url":"https://api.github.com/repos/slavidodo/forgottenserver/deployments","created_at":"2016-05-13T21:15:56Z","updated_at":"2016-05-14T02:19:08Z","pushed_at":"2016-05-16T09:52:49Z","git_url":"git://github.com/slavidodo/forgottenserver.git","ssh_url":"git@github.com:slavidodo/forgottenserver.git","clone_url":"https://github.com/slavidodo/forgottenserver.git","svn_url":"https://github.com/slavidodo/forgottenserver","homepage":"","size":13265,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"otland:master","ref":"master","sha":"9af6419cf4c89a095482ae5b7313380415ca32c8","user":{"login":"otland","id":4956302,"avatar_url":"https://avatars.githubusercontent.com/u/4956302?v=3","gravatar_id":"","url":"https://api.github.com/users/otland","html_url":"https://github.com/otland","followers_url":"https://api.github.com/users/otland/followers","following_url":"https://api.github.com/users/otland/following{/other_user}","gists_url":"https://api.github.com/users/otland/gists{/gist_id}","starred_url":"https://api.github.com/users/otland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otland/subscriptions","organizations_url":"https://api.github.com/users/otland/orgs","repos_url":"https://api.github.com/users/otland/repos","events_url":"https://api.github.com/users/otland/events{/privacy}","received_events_url":"https://api.github.com/users/otland/received_events","type":"Organization","site_admin":false},"repo":{"id":11081909,"name":"forgottenserver","full_name":"otland/forgottenserver","owner":{"login":"otland","id":4956302,"avatar_url":"https://avatars.githubusercontent.com/u/4956302?v=3","gravatar_id":"","url":"https://api.github.com/users/otland","html_url":"https://github.com/otland","followers_url":"https://api.github.com/users/otland/followers","following_url":"https://api.github.com/users/otland/following{/other_user}","gists_url":"https://api.github.com/users/otland/gists{/gist_id}","starred_url":"https://api.github.com/users/otland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otland/subscriptions","organizations_url":"https://api.github.com/users/otland/orgs","repos_url":"https://api.github.com/users/otland/repos","events_url":"https://api.github.com/users/otland/events{/privacy}","received_events_url":"https://api.github.com/users/otland/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/otland/forgottenserver","description":"A free and open-source MMORPG server emulator written in C++","fork":false,"url":"https://api.github.com/repos/otland/forgottenserver","forks_url":"https://api.github.com/repos/otland/forgottenserver/forks","keys_url":"https://api.github.com/repos/otland/forgottenserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otland/forgottenserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otland/forgottenserver/teams","hooks_url":"https://api.github.com/repos/otland/forgottenserver/hooks","issue_events_url":"https://api.github.com/repos/otland/forgottenserver/issues/events{/number}","events_url":"https://api.github.com/repos/otland/forgottenserver/events","assignees_url":"https://api.github.com/repos/otland/forgottenserver/assignees{/user}","branches_url":"https://api.github.com/repos/otland/forgottenserver/branches{/branch}","tags_url":"https://api.github.com/repos/otland/forgottenserver/tags","blobs_url":"https://api.github.com/repos/otland/forgottenserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otland/forgottenserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otland/forgottenserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/otland/forgottenserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otland/forgottenserver/statuses/{sha}","languages_url":"https://api.github.com/repos/otland/forgottenserver/languages","stargazers_url":"https://api.github.com/repos/otland/forgottenserver/stargazers","contributors_url":"https://api.github.com/repos/otland/forgottenserver/contributors","subscribers_url":"https://api.github.com/repos/otland/forgottenserver/subscribers","subscription_url":"https://api.github.com/repos/otland/forgottenserver/subscription","commits_url":"https://api.github.com/repos/otland/forgottenserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/otland/forgottenserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/otland/forgottenserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/otland/forgottenserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/otland/forgottenserver/contents/{+path}","compare_url":"https://api.github.com/repos/otland/forgottenserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otland/forgottenserver/merges","archive_url":"https://api.github.com/repos/otland/forgottenserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otland/forgottenserver/downloads","issues_url":"https://api.github.com/repos/otland/forgottenserver/issues{/number}","pulls_url":"https://api.github.com/repos/otland/forgottenserver/pulls{/number}","milestones_url":"https://api.github.com/repos/otland/forgottenserver/milestones{/number}","notifications_url":"https://api.github.com/repos/otland/forgottenserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otland/forgottenserver/labels{/name}","releases_url":"https://api.github.com/repos/otland/forgottenserver/releases{/id}","deployments_url":"https://api.github.com/repos/otland/forgottenserver/deployments","created_at":"2013-07-01T01:57:06Z","updated_at":"2016-05-09T16:51:50Z","pushed_at":"2016-05-16T09:55:43Z","git_url":"git://github.com/otland/forgottenserver.git","ssh_url":"git@github.com:otland/forgottenserver.git","clone_url":"https://github.com/otland/forgottenserver.git","svn_url":"https://github.com/otland/forgottenserver","homepage":"","size":18452,"stargazers_count":327,"watchers_count":327,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":339,"mirror_url":null,"open_issues_count":137,"forks":339,"open_issues":137,"watchers":327,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1795"},"html":{"href":"https://github.com/otland/forgottenserver/pull/1795"},"issue":{"href":"https://api.github.com/repos/otland/forgottenserver/issues/1795"},"comments":{"href":"https://api.github.com/repos/otland/forgottenserver/issues/1795/comments"},"review_comments":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1795/comments"},"review_comment":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/otland/forgottenserver/pulls/1795/commits"},"statuses":{"href":"https://api.github.com/repos/otland/forgottenserver/statuses/6ca9b6a668abe39cbfd8c85efc77332970db45cb"}}}}