{"action":"created","comment":{"url":"https://api.github.com/repos/themanaworld/tmwa/pulls/comments/28817790","id":28817790,"diff_hunk":"@@ -496,6 +496,67 @@ void builtin_if (ScriptState *st)\n     run_func(st);\n }\n \n+static\n+void builtin_getq(ScriptState *st)\n+{\n+    int i;\n+    int val;\n+    QuestId questid;\n+    dumb_ptr<map_session_data> sd = nullptr;\n+    if (auto *data = AARG(1).get_if<ScriptDataStr>())\n+    {\n+        sd = script_rid2sd(st);\n+        assert (sd->status.global_reg_num < GLOBAL_REG_NUM);\n+        Option<P<struct quest_data>> quest_data_ = questdb_searchname(ZString(conv_str(st, &AARG(1))));\n+        OMATCH_BEGIN_SOME(quest_data, quest_data_)\n+        {\n+            VarName reg = quest_data->quest_vr;\n+            int quest_shift = quest_data->quest_shift;\n+            int quest_mask = quest_data->quest_mask;\n+            for (i = 0; i < sd->status.global_reg_num; i++)\n+            {\n+                if (sd->status.global_reg[i].str == reg)\n+                {\n+                    val = ((sd->status.global_reg[i].value & quest_mask) >> quest_shift);\n+                    break;\n+                }\n+            }\n+        }\n+        OMATCH_END ();\n+    }\n+    if (auto *u = AARG(0).get_if<ScriptDataParam>())\n+    {\n+        SIR reg = u->reg;\n+        sd = script_rid2sd(st);\n+\n+        set_reg(sd, VariableCode::PARAM, reg, val);\n+        return;\n+    }\n+\n+    SIR reg = AARG(0).get_if<ScriptDataVariable>()->reg;\n+\n+    ZString name = variable_names.outtern(reg.base());\n+    char prefix = name.front();\n+    char postfix = name.back();\n+\n+    if (prefix != '$')\n+        sd = script_rid2sd(st);\n+\n+    if (postfix == '$')\n+    {\n+        // 文字列","path":"src/map/script-fun.cpp","position":52,"original_position":52,"commit_id":"73d499adb546efbd0054120504d580f85e91a4c2","original_commit_id":"73d499adb546efbd0054120504d580f85e91a4c2","user":{"login":"wushin","id":3985142,"avatar_url":"https://avatars.githubusercontent.com/u/3985142?v=3","gravatar_id":"","url":"https://api.github.com/users/wushin","html_url":"https://github.com/wushin","followers_url":"https://api.github.com/users/wushin/followers","following_url":"https://api.github.com/users/wushin/following{/other_user}","gists_url":"https://api.github.com/users/wushin/gists{/gist_id}","starred_url":"https://api.github.com/users/wushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wushin/subscriptions","organizations_url":"https://api.github.com/users/wushin/orgs","repos_url":"https://api.github.com/users/wushin/repos","events_url":"https://api.github.com/users/wushin/events{/privacy}","received_events_url":"https://api.github.com/users/wushin/received_events","type":"User","site_admin":false},"body":"I said it still needed polishing but the damn thing works.","created_at":"2015-04-21T20:19:13Z","updated_at":"2015-04-21T20:19:13Z","html_url":"https://github.com/themanaworld/tmwa/pull/65#discussion_r28817790","pull_request_url":"https://api.github.com/repos/themanaworld/tmwa/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/themanaworld/tmwa/pulls/comments/28817790"},"html":{"href":"https://github.com/themanaworld/tmwa/pull/65#discussion_r28817790"},"pull_request":{"href":"https://api.github.com/repos/themanaworld/tmwa/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/themanaworld/tmwa/pulls/65","id":33790652,"html_url":"https://github.com/themanaworld/tmwa/pull/65","diff_url":"https://github.com/themanaworld/tmwa/pull/65.diff","patch_url":"https://github.com/themanaworld/tmwa/pull/65.patch","issue_url":"https://api.github.com/repos/themanaworld/tmwa/issues/65","number":65,"state":"open","locked":false,"title":"Quest log","user":{"login":"wushin","id":3985142,"avatar_url":"https://avatars.githubusercontent.com/u/3985142?v=3","gravatar_id":"","url":"https://api.github.com/users/wushin","html_url":"https://github.com/wushin","followers_url":"https://api.github.com/users/wushin/followers","following_url":"https://api.github.com/users/wushin/following{/other_user}","gists_url":"https://api.github.com/users/wushin/gists{/gist_id}","starred_url":"https://api.github.com/users/wushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wushin/subscriptions","organizations_url":"https://api.github.com/users/wushin/orgs","repos_url":"https://api.github.com/users/wushin/repos","events_url":"https://api.github.com/users/wushin/events{/privacy}","received_events_url":"https://api.github.com/users/wushin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-21T18:40:45Z","updated_at":"2015-04-21T20:19:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e163247374cca8d5ee0da8b640490cb3791ae658","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/themanaworld/tmwa/pulls/65/commits","review_comments_url":"https://api.github.com/repos/themanaworld/tmwa/pulls/65/comments","review_comment_url":"https://api.github.com/repos/themanaworld/tmwa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/themanaworld/tmwa/issues/65/comments","statuses_url":"https://api.github.com/repos/themanaworld/tmwa/statuses/73d499adb546efbd0054120504d580f85e91a4c2","head":{"label":"wushin:quest-log","ref":"quest-log","sha":"73d499adb546efbd0054120504d580f85e91a4c2","user":{"login":"wushin","id":3985142,"avatar_url":"https://avatars.githubusercontent.com/u/3985142?v=3","gravatar_id":"","url":"https://api.github.com/users/wushin","html_url":"https://github.com/wushin","followers_url":"https://api.github.com/users/wushin/followers","following_url":"https://api.github.com/users/wushin/following{/other_user}","gists_url":"https://api.github.com/users/wushin/gists{/gist_id}","starred_url":"https://api.github.com/users/wushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wushin/subscriptions","organizations_url":"https://api.github.com/users/wushin/orgs","repos_url":"https://api.github.com/users/wushin/repos","events_url":"https://api.github.com/users/wushin/events{/privacy}","received_events_url":"https://api.github.com/users/wushin/received_events","type":"User","site_admin":false},"repo":{"id":13866704,"name":"tmwa","full_name":"wushin/tmwa","owner":{"login":"wushin","id":3985142,"avatar_url":"https://avatars.githubusercontent.com/u/3985142?v=3","gravatar_id":"","url":"https://api.github.com/users/wushin","html_url":"https://github.com/wushin","followers_url":"https://api.github.com/users/wushin/followers","following_url":"https://api.github.com/users/wushin/following{/other_user}","gists_url":"https://api.github.com/users/wushin/gists{/gist_id}","starred_url":"https://api.github.com/users/wushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wushin/subscriptions","organizations_url":"https://api.github.com/users/wushin/orgs","repos_url":"https://api.github.com/users/wushin/repos","events_url":"https://api.github.com/users/wushin/events{/privacy}","received_events_url":"https://api.github.com/users/wushin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wushin/tmwa","description":"The tmwAthena server itself, much modified from an ancient version of eAthena","fork":true,"url":"https://api.github.com/repos/wushin/tmwa","forks_url":"https://api.github.com/repos/wushin/tmwa/forks","keys_url":"https://api.github.com/repos/wushin/tmwa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wushin/tmwa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wushin/tmwa/teams","hooks_url":"https://api.github.com/repos/wushin/tmwa/hooks","issue_events_url":"https://api.github.com/repos/wushin/tmwa/issues/events{/number}","events_url":"https://api.github.com/repos/wushin/tmwa/events","assignees_url":"https://api.github.com/repos/wushin/tmwa/assignees{/user}","branches_url":"https://api.github.com/repos/wushin/tmwa/branches{/branch}","tags_url":"https://api.github.com/repos/wushin/tmwa/tags","blobs_url":"https://api.github.com/repos/wushin/tmwa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wushin/tmwa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wushin/tmwa/git/refs{/sha}","trees_url":"https://api.github.com/repos/wushin/tmwa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wushin/tmwa/statuses/{sha}","languages_url":"https://api.github.com/repos/wushin/tmwa/languages","stargazers_url":"https://api.github.com/repos/wushin/tmwa/stargazers","contributors_url":"https://api.github.com/repos/wushin/tmwa/contributors","subscribers_url":"https://api.github.com/repos/wushin/tmwa/subscribers","subscription_url":"https://api.github.com/repos/wushin/tmwa/subscription","commits_url":"https://api.github.com/repos/wushin/tmwa/commits{/sha}","git_commits_url":"https://api.github.com/repos/wushin/tmwa/git/commits{/sha}","comments_url":"https://api.github.com/repos/wushin/tmwa/comments{/number}","issue_comment_url":"https://api.github.com/repos/wushin/tmwa/issues/comments{/number}","contents_url":"https://api.github.com/repos/wushin/tmwa/contents/{+path}","compare_url":"https://api.github.com/repos/wushin/tmwa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wushin/tmwa/merges","archive_url":"https://api.github.com/repos/wushin/tmwa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wushin/tmwa/downloads","issues_url":"https://api.github.com/repos/wushin/tmwa/issues{/number}","pulls_url":"https://api.github.com/repos/wushin/tmwa/pulls{/number}","milestones_url":"https://api.github.com/repos/wushin/tmwa/milestones{/number}","notifications_url":"https://api.github.com/repos/wushin/tmwa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wushin/tmwa/labels{/name}","releases_url":"https://api.github.com/repos/wushin/tmwa/releases{/id}","created_at":"2013-10-25T17:01:24Z","updated_at":"2015-04-21T01:06:22Z","pushed_at":"2015-04-21T18:39:21Z","git_url":"git://github.com/wushin/tmwa.git","ssh_url":"git@github.com:wushin/tmwa.git","clone_url":"https://github.com/wushin/tmwa.git","svn_url":"https://github.com/wushin/tmwa","homepage":null,"size":15342,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"themanaworld:master","ref":"master","sha":"e6ee7b3f99935a594e6462472fdc9d075408da0f","user":{"login":"themanaworld","id":1402939,"avatar_url":"https://avatars.githubusercontent.com/u/1402939?v=3","gravatar_id":"","url":"https://api.github.com/users/themanaworld","html_url":"https://github.com/themanaworld","followers_url":"https://api.github.com/users/themanaworld/followers","following_url":"https://api.github.com/users/themanaworld/following{/other_user}","gists_url":"https://api.github.com/users/themanaworld/gists{/gist_id}","starred_url":"https://api.github.com/users/themanaworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themanaworld/subscriptions","organizations_url":"https://api.github.com/users/themanaworld/orgs","repos_url":"https://api.github.com/users/themanaworld/repos","events_url":"https://api.github.com/users/themanaworld/events{/privacy}","received_events_url":"https://api.github.com/users/themanaworld/received_events","type":"Organization","site_admin":false},"repo":{"id":6301427,"name":"tmwa","full_name":"themanaworld/tmwa","owner":{"login":"themanaworld","id":1402939,"avatar_url":"https://avatars.githubusercontent.com/u/1402939?v=3","gravatar_id":"","url":"https://api.github.com/users/themanaworld","html_url":"https://github.com/themanaworld","followers_url":"https://api.github.com/users/themanaworld/followers","following_url":"https://api.github.com/users/themanaworld/following{/other_user}","gists_url":"https://api.github.com/users/themanaworld/gists{/gist_id}","starred_url":"https://api.github.com/users/themanaworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/themanaworld/subscriptions","organizations_url":"https://api.github.com/users/themanaworld/orgs","repos_url":"https://api.github.com/users/themanaworld/repos","events_url":"https://api.github.com/users/themanaworld/events{/privacy}","received_events_url":"https://api.github.com/users/themanaworld/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/themanaworld/tmwa","description":"The tmwAthena server itself, much modified from an ancient version of eAthena","fork":false,"url":"https://api.github.com/repos/themanaworld/tmwa","forks_url":"https://api.github.com/repos/themanaworld/tmwa/forks","keys_url":"https://api.github.com/repos/themanaworld/tmwa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/themanaworld/tmwa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/themanaworld/tmwa/teams","hooks_url":"https://api.github.com/repos/themanaworld/tmwa/hooks","issue_events_url":"https://api.github.com/repos/themanaworld/tmwa/issues/events{/number}","events_url":"https://api.github.com/repos/themanaworld/tmwa/events","assignees_url":"https://api.github.com/repos/themanaworld/tmwa/assignees{/user}","branches_url":"https://api.github.com/repos/themanaworld/tmwa/branches{/branch}","tags_url":"https://api.github.com/repos/themanaworld/tmwa/tags","blobs_url":"https://api.github.com/repos/themanaworld/tmwa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/themanaworld/tmwa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/themanaworld/tmwa/git/refs{/sha}","trees_url":"https://api.github.com/repos/themanaworld/tmwa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/themanaworld/tmwa/statuses/{sha}","languages_url":"https://api.github.com/repos/themanaworld/tmwa/languages","stargazers_url":"https://api.github.com/repos/themanaworld/tmwa/stargazers","contributors_url":"https://api.github.com/repos/themanaworld/tmwa/contributors","subscribers_url":"https://api.github.com/repos/themanaworld/tmwa/subscribers","subscription_url":"https://api.github.com/repos/themanaworld/tmwa/subscription","commits_url":"https://api.github.com/repos/themanaworld/tmwa/commits{/sha}","git_commits_url":"https://api.github.com/repos/themanaworld/tmwa/git/commits{/sha}","comments_url":"https://api.github.com/repos/themanaworld/tmwa/comments{/number}","issue_comment_url":"https://api.github.com/repos/themanaworld/tmwa/issues/comments{/number}","contents_url":"https://api.github.com/repos/themanaworld/tmwa/contents/{+path}","compare_url":"https://api.github.com/repos/themanaworld/tmwa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/themanaworld/tmwa/merges","archive_url":"https://api.github.com/repos/themanaworld/tmwa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/themanaworld/tmwa/downloads","issues_url":"https://api.github.com/repos/themanaworld/tmwa/issues{/number}","pulls_url":"https://api.github.com/repos/themanaworld/tmwa/pulls{/number}","milestones_url":"https://api.github.com/repos/themanaworld/tmwa/milestones{/number}","notifications_url":"https://api.github.com/repos/themanaworld/tmwa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/themanaworld/tmwa/labels{/name}","releases_url":"https://api.github.com/repos/themanaworld/tmwa/releases{/id}","created_at":"2012-10-19T20:48:36Z","updated_at":"2015-04-21T01:00:17Z","pushed_at":"2015-04-21T18:40:46Z","git_url":"git://github.com/themanaworld/tmwa.git","ssh_url":"git@github.com:themanaworld/tmwa.git","clone_url":"https://github.com/themanaworld/tmwa.git","svn_url":"https://github.com/themanaworld/tmwa","homepage":null,"size":40097,"stargazers_count":28,"watchers_count":28,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":31,"forks":42,"open_issues":31,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/themanaworld/tmwa/pulls/65"},"html":{"href":"https://github.com/themanaworld/tmwa/pull/65"},"issue":{"href":"https://api.github.com/repos/themanaworld/tmwa/issues/65"},"comments":{"href":"https://api.github.com/repos/themanaworld/tmwa/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/themanaworld/tmwa/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/themanaworld/tmwa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/themanaworld/tmwa/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/themanaworld/tmwa/statuses/73d499adb546efbd0054120504d580f85e91a4c2"}}}}