wowarmory.com API 帮助

发布于 2024-07-27 15:35:35 字数 689 浏览 6 评论 0 原文

我正在开发一个简单的应用程序,它从 wowarmory.com 获取一些数据。 我需要做的是获取角色的声望。 我知道 api 位于哪里:

http://www.wowarmory.com/character-reputation.xml?r=Realm&cn=CharacterName

我可以获取 XML 并将其加载到 SimpleXML 对象中,但我无法弄清楚如何从 XML 中获取每个派系的当前和最大声誉。 下面是一个 XML 示例:

<faction id="69" key="darnassus" name="Darnassus" reputation="35023"/>
<faction id="930" key="exodar" name="Exodar" reputation="26805"/>
<faction id="54" key="gnomereganexiles" name="Gnomeregan Exiles" reputation="23433"/>
<faction id="47" key="ironforge" name="Ironforge" reputation="29410"/>

每个派系只有“声誉”属性。 我如何计算它的最大和当前声誉? 好像缺少属性。

有人能指出我正确的方向吗?

I'm developing a simple application that fetches some data from wowarmory.com. What I need to do is fetch reputations for a character. I know where's the api located:

http://www.wowarmory.com/character-reputation.xml?r=Realm&cn=CharacterName

I can fetch the XML and load it into the SimpleXML object but I'm having trouble figuring out how to get the current and maximum reputation for each faction from the XML. Here's an example of XML:

<faction id="69" key="darnassus" name="Darnassus" reputation="35023"/>
<faction id="930" key="exodar" name="Exodar" reputation="26805"/>
<faction id="54" key="gnomereganexiles" name="Gnomeregan Exiles" reputation="23433"/>
<faction id="47" key="ironforge" name="Ironforge" reputation="29410"/>

There's only the attribute 'reputation' there for each faction. How do I calculate the maximum and current reputation from it though? Seems like there are missing attributes.

Can somebody point me to the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荒芜了季节 2024-08-03 15:35:35

我想我可以回答这个问题,因为我自己也是一名魔兽世界玩家。

Wow的代表系统只是-42,000到42,000范围内的点值。

这个范围被分为对游戏有实际意义的级别。

Rep Name    Range            Range Value
----------------------------------------
Hated      -42,000 - -6,001       36,000
Hostile     -6,000 - -3,001        3,000
Unfriendly  -3,000 -     -1        3,000
Neutral          0 -  2,999        3,000
Friendly     3,000 -  8,999        6,000
Honored      9,000 - 20,999       12,000
Revered     21,000 - 41,999       21,000
Exalted     42,000+                    ~

这意味着某个派系拥有 35,023 名声望的人处于崇敬地位 - 具体来说是 14,024/21,000。

他们的 API 中可能有一个方法可以为您执行此转换,但如果没有该方法,这应该会为您提供所需的数据。

I think I can answer this since I'm a WoW player myself.

Wow's rep system is just a point values in the inclusive range of -42,000 to 42,000.

This range is divided up into levels which have tangible meaning to the game.

Rep Name    Range            Range Value
----------------------------------------
Hated      -42,000 - -6,001       36,000
Hostile     -6,000 - -3,001        3,000
Unfriendly  -3,000 -     -1        3,000
Neutral          0 -  2,999        3,000
Friendly     3,000 -  8,999        6,000
Honored      9,000 - 20,999       12,000
Revered     21,000 - 41,999       21,000
Exalted     42,000+                    ~

That means someone with 35,023 rep for a faction is at Revered - specifically 14,024/21,000.

There may be a method in their API that does this conversion for you, but without that, this should give you the data you need.

待天淡蓝洁白时 2024-08-03 15:35:35

值 42999 表示该派系的最高声望。
-42000 的值表示该派系的最大仇恨声誉。

<faction id="730" key="stormpikeguard" name="Stormpike Guard" reputation="42999"/>
<faction id="21" key="bootybay" name="Booty Bay" reputation="-42000"/>

他们使用该派系的声誉总量,并在显示代码中将其分为不同的级别。 请参阅http://www.wowwiki.com/Reputation 了解每个声望级别开始位置的详细信息。

A value of 42999 indicates maximum exalted reputation with that faction.
A value of -42000 indicates maximum hated reputation with that faction.

<faction id="730" key="stormpikeguard" name="Stormpike Guard" reputation="42999"/>
<faction id="21" key="bootybay" name="Booty Bay" reputation="-42000"/>

They use the total amount of reputation with that faction and divide it down into different levels in the display code. Refer to the reputation levels chart at http://www.wowwiki.com/Reputation for details on where each reputation level begins.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文