feat: add point currency and stage extended shop items
Rename shop currency and vouchers to points, synchronize the wiki catalogue, and display point rewards. Add wear40 item metadata transport and pet identity accessors; stage sixteen timed mounts and appearance items with AVA2 model registration. Include build and sbtest acceptance evidence. Remaining shop systems are unfinished and are not enabled or deployed. Wear40 requires the matching server migration and mt20261022 client.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"build": "isolated wear40 and extended-item ABI; not deployed",
|
||||
"candidate": {
|
||||
"game": "3ebf3a7bf4e7e92224fc17ee31cf189e286fb57e3c5baeb5c86fd5a6ac83cf13",
|
||||
"db": "0ad7bcd16a2ef95c8990d65e6242f61ca2ea7c113fb1ef6dd7624fb1b778ed03"
|
||||
},
|
||||
"production": {
|
||||
"game": "56975b48aa2fd40389c57eab84d017b0a2518cf6e1b573d967bf239f4ae04aba",
|
||||
"db": "dc940401fe6ccc3410c8d90ce98d2a5bad2e2c023279665bcd664c008d011699"
|
||||
},
|
||||
"productionDbPid": "53754"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"schema": "port_shop_migration_test",
|
||||
"before": "1\t32\n2\t43\n3\t287\n4\t302\n5\t286\n6\t32\n",
|
||||
"after": "1\t40\n2\t51\n3\t295\n4\t310\n5\t286\n6\t32\n",
|
||||
"quickslots": "active/deleted player both shifted",
|
||||
"replay": "unchanged",
|
||||
"fixture": "deleted after test"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"note": "sbtest only; synthetic 491-point row seeds earned=498 for boundary test; monster chance temporarily 100% for deterministic integration",
|
||||
"sql": "0006864747df5e500000000000000001\t14\t16\t8055\t6\t6\t2026-10-20\n0006864747df5e500000000000000002\t14\t16\t3705\t1\t1\t2026-10-20\n0006864747df5e500000000000000003\t14\t16\t8055\t5\t2\t2026-10-20\n0006864747df5e500000000000000004\t14\t16\t8055\t7\t0\t2026-10-20\nffffffffffffffffffffffffffffff01\t14\t16\t8055\t491\t491\t2026-10-20\n500\n",
|
||||
"proxy": "{\"event\": \"request\", \"token\": \"0006864747df5e500000000000000001\", \"vnum\": 8055, \"at\": 1792458562.2058332}\n{\"event\": \"request\", \"token\": \"0006864747df5e500000000000000002\", \"vnum\": 3705, \"at\": 1792458562.2082963}\n{\"event\": \"reply\", \"token\": \"0006864747df5e500000000000000001\", \"amount\": 6, \"at\": 1792458562.389858}\n{\"event\": \"drop-first-success-reply\", \"token\": \"0006864747df5e500000000000000001\", \"at\": 1792458562.3900392}\n{\"event\": \"reply\", \"token\": \"0006864747df5e500000000000000002\", \"amount\": 1, \"at\": 1792458562.390154}\n{\"event\": \"request\", \"token\": \"0006864747df5e500000000000000001\", \"vnum\": 8055, \"at\": 1792458572.1319}\n{\"event\": \"reply\", \"token\": \"0006864747df5e500000000000000001\", \"amount\": 6, \"at\": 1792458572.2864504}\n{\"event\": \"request\", \"token\": \"0006864747df5e500000000000000003\", \"vnum\": 8055, \"at\": 1792458842.0943224}\n{\"event\": \"reply\", \"token\": \"0006864747df5e500000000000000003\", \"amount\": 2, \"at\": 1792458842.28736}\n{\"event\": \"request\", \"token\": \"0006864747df5e500000000000000004\", \"vnum\": 8055, \"at\": 1792458864.3035688}\n{\"event\": \"reply\", \"token\": \"0006864747df5e500000000000000004\", \"amount\": 0, \"at\": 1792458864.487179}\n",
|
||||
"afterRestartSQL": "0006864747df5e500000000000000001\t8055\t6\t6\t2026-10-20\n0006864747df5e500000000000000002\t3705\t1\t1\t2026-10-20\n0006864747df5e500000000000000003\t8055\t5\t2\t2026-10-20\n0006864747df5e500000000000000004\t8055\t7\t0\t2026-10-20\n000686c9636c6e210000000000000001\t8055\t8\t0\t2026-10-20\nffffffffffffffffffffffffffffff01\t8055\t491\t491\t2026-10-20\n500\n"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
MTWIKI 1 638070c02e0ce213ff2616a733d241b3c7b32c9a483eaab4bdcde633fbaecc20
|
||||
MTWIKI 1 27b35188d2f5c96dd51f62c5f11689b15dfc1a6efcd96c03e26bd1b39c2b0d71
|
||||
I 2 2 YMIR ITEM_NONE 0 0 1 0 0
|
||||
I 10 10 短刀+0 ITEM_WEAPON WEAPON_SWORD 0 2 11 1
|
||||
I 11 11 短刀+1 ITEM_WEAPON WEAPON_SWORD 0 2 12 2
|
||||
@@ -5552,9 +5552,9 @@ I 80006 80006 金砖(100万两) ITEM_SPECIAL SPECIAL_MAP 0 1 0 0
|
||||
I 80007 80007 金砖(200万两) ITEM_SPECIAL SPECIAL_MAP 0 1 0 0
|
||||
I 80008 80008 黄金锭 ITEM_SPECIAL SPECIAL_MAP 0 1 0 0
|
||||
I 80014 80014 超级宝石合成秘籍 ITEM_QUEST 0 0 1 0 0
|
||||
I 80015 80015 龙币兑换券(500) ITEM_QUEST 0 0 1 0 0
|
||||
I 80016 80016 龙币兑换券(1000) ITEM_QUEST 0 0 1 0 0
|
||||
I 80017 80017 龙币兑换券(50) ITEM_QUEST 0 0 1 0 0
|
||||
I 80015 80015 点券兑换券(500) ITEM_QUEST 0 0 1 0 0
|
||||
I 80016 80016 点券兑换券(1000) ITEM_QUEST 0 0 1 0 0
|
||||
I 80017 80017 点券兑换券(50) ITEM_QUEST 0 0 1 0 0
|
||||
I 90001 90001 1000点卡 ITEM_USE USE_BUCKET 0 1 0 0
|
||||
I 90002 90002 水桶 ITEM_RESOURCE RESOURCE_BUCKET 0 1 0 0
|
||||
I 90003 90003 水晶 ITEM_RESOURCE RESOURCE_CRYSTAL 0 1 0 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"catalogue_sha256": "638070c02e0ce213ff2616a733d241b3c7b32c9a483eaab4bdcde633fbaecc20",
|
||||
"catalogue_sha256": "27b35188d2f5c96dd51f62c5f11689b15dfc1a6efcd96c03e26bd1b39c2b0d71",
|
||||
"source_sha256": {
|
||||
"item_proto.txt": "7d4f5c54983d5ccb5b1db59a734e0c60d7ab6480e807c48c881be39d5769cbd1",
|
||||
"item_names.txt": "7a616550ec56206dcdc540f20f30ed3725fb6c9d6475dbd1a3b6eaddaa29a4d5",
|
||||
@@ -15,7 +15,7 @@
|
||||
"generator_sha256": "9c4e1b6069179c36c080a1136d65cbe52a8e44b3577fb8391e8404f5162ef40b",
|
||||
"localization_sha256": {
|
||||
"item_names_zh.txt": "5604985d7f11039f3d3e38d4e2c07995e80ca3e4f6deb01fe57cd772e9cd0f70",
|
||||
"item_names_zh_overlay.txt": "dcaee419bcc23e72e6dcce1c521a48501b3bbd6b1fd26fa925a213d53515df7e",
|
||||
"item_names_zh_overlay.txt": "a4660f7b20e15beaa05220bf23f4df5a4ef64f474bc03a754e2338ce144c0e36",
|
||||
"mob_names_zh.txt": "fdbfe4b3f3367d5842c0e9bbe0b5e5ea2dbe99fb6e566ef5789f65d3794eab5c",
|
||||
"mob_names_zh_overlay.txt": "7c44a5f6cff5c3c27c13cc4c7be91d619c20c67a8e091222e13ed392ea18d00b"
|
||||
},
|
||||
|
||||
@@ -1430,9 +1430,9 @@ VNUM LOCALE_NAME
|
||||
76022 红龙的祝福(中)
|
||||
76023 初级物品属性转换秘笈
|
||||
76024 初级追加物品属性秘笈
|
||||
80015 龙币兑换券(500)
|
||||
80016 龙币兑换券(1000)
|
||||
80017 龙币兑换券(50)
|
||||
80015 点券兑换券(500)
|
||||
80016 点券兑换券(1000)
|
||||
80017 点券兑换券(50)
|
||||
100000 时间灵药(小)
|
||||
100001 时间灵药(中)
|
||||
100002 时间灵药(大)
|
||||
|
||||
@@ -1774,10 +1774,10 @@ Automatically refills your HP. Contains 3,000,000 HP. Not tradeable. 自动补
|
||||
A dark and already worn out pouch sewed from leather. 一个用皮革缝制、颜色暗沉且已破旧的小袋。
|
||||
An unused parchment of good quality. 一张未使用的优质羊皮纸。
|
||||
A lump of gold that has never been crafted. It is being sold in a shop for a high price. 一块未经加工的金块,在商店能卖出高价。
|
||||
Voucher to the value of 100 Dragon Coins. Item is tradeable. 面值100龙币的兑换券。此物品可交易。
|
||||
Voucher to the value of 500 Dragon Coins. Item is tradeable. 面值500龙币的兑换券。此物品可交易。
|
||||
Voucher to the value of 1000 Dragon Coins. Item is tradeable. 面值1000龙币的兑换券。此物品可交易。
|
||||
Voucher to the value of 50 Dragon Coins. Item is tradeable. 面值50龙币的兑换券。此物品可交易。
|
||||
Voucher to the value of 100 Dragon Coins. Item is tradeable. 面值100点券的兑换券。此物品可交易。
|
||||
Voucher to the value of 500 Dragon Coins. Item is tradeable. 面值500点券的兑换券。此物品可交易。
|
||||
Voucher to the value of 1000 Dragon Coins. Item is tradeable. 面值1000点券的兑换券。此物品可交易。
|
||||
Voucher to the value of 50 Dragon Coins. Item is tradeable. 面值50点券的兑换券。此物品可交易。
|
||||
A stable travel case to transport water - sadly it is empty right now. 一个坚固的旅行水囊,可惜现在是空的。
|
||||
A stable travel case to transport water. 一个坚固的旅行水囊。
|
||||
An especially nice and clear gemstone which shines fascinatingly in the sunlight. 一颗格外美丽剔透的宝石,在阳光下闪耀迷人。
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 38 and column 21.
|
@@ -88,7 +88,7 @@ change_guild_master._60_say 完成了!
|
||||
change_guild_master._70_say 你不在帮会里。
|
||||
change_guild_master._80_say 你已经是帮主了。
|
||||
change_guild_master._90_say 未来的帮主必须在线才能接任!
|
||||
charge_cash_by_voucher._010_syschat %s个龙币已充入你的账户。
|
||||
charge_cash_by_voucher._010_syschat %s个点券已充入你的账户。
|
||||
check_collect_reward._010_npcChat 生物学者无效的秘方
|
||||
check_collect_reward._020_say_title 医生:
|
||||
check_collect_reward._030_say 你好!有什么我能帮你的吗?
|
||||
@@ -5445,7 +5445,7 @@ new_quest_premium_lv4._140_notice 齐了!现在赶快回武器商人那里。
|
||||
new_quest_premium_lv4._150_notice 可惜这枝石菖蒲已经枯萎了。
|
||||
new_quest_premium_lv4._160_say 你需要的石菖蒲数量:[ENTER]%s
|
||||
new_quest_premium_lv4._170_say 这不够。这点石菖蒲只够做几滴!
|
||||
new_quest_premium_lv4._180_say 啊,石菖蒲!现在我只需要一些特别的麝香油了。它只能在一家非常特别的商店订购。旋转的金币会给你指路。你需要一些龙币,不过我相信你肯定存了一些,对吧?我会永远感激你的!之后你可以去仓库保管员那里取货。那样我的材料就终于齐了!
|
||||
new_quest_premium_lv4._180_say 啊,石菖蒲!现在我只需要一些特别的麝香油了。它只能在一家非常特别的商店订购。旋转的金币会给你指路。你需要一些点券,不过我相信你肯定存了一些,对吧?我会永远感激你的!之后你可以去仓库保管员那里取货。那样我的材料就终于齐了!
|
||||
new_quest_premium_lv4._190_say 请快点把麝香油带给我。你会因此得到奖励的!
|
||||
new_quest_premium_lv4._200_say_reward 继续打猎,直到你能带回%s枝石菖蒲!
|
||||
new_quest_premium_lv4._20_sayTitle 我的心上人
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -0,0 +1,46 @@
|
||||
# 商城剩余商品与点券掉落(实施中)
|
||||
|
||||
用户要求补齐剩余168件商品的实际用途及资源,商城货币中文改为点券,并增加击杀怪物、石头奖励。
|
||||
|
||||
已确认参数:怪物5%获得1点,石头100%获得3~8点;同账号所有角色和频道每日合计500点,目标最多低15级。每日按数据库服务器自然日重置;Boss使用怪物规则,组队沿用最高伤害归属,不重复发放,自动狩猎有效。
|
||||
|
||||
当前工作:
|
||||
|
||||
- 中文名称已修改商城和道具/描述/任务翻译源文件,尚未发布。
|
||||
- 点券接入内部GD76 operation3,使用商城相同的InnoDB账号锁、独立幂等奖励流水和每日上限;客户端标识mt20261021。
|
||||
- 击杀入口仅在Reward(true)且同一实体首次处理时执行;内部重试保留同一token。
|
||||
- 正式服仍只有49件商品启用,运行版本保持基线。
|
||||
- 剩余168件逐项清单:服务端`data/ava2-itemshop/completion-168.json`。其中16件限时坐骑/服装/发型已补入数据与资源,待联机验收;其余依赖继续实现。
|
||||
- AVA2原服务端参考:本机`build/shop-completion-reference`(来自FILES+SRC.tgz)。
|
||||
- FreeBSD隔离构建:`/root/deploy-features/20261020-shop-completion`。源码、obj-game和bin均独立,禁止使用默认正式GAMEDIR。
|
||||
- 正式基线备份:`/root/backup-itemshop/20261020-014955`;game为56975b48…,db为dc940401…。
|
||||
|
||||
隔离点券版game/db已编译完成。db首次构建误用了Makefile的默认DBDIR,短暂覆盖正式db磁盘文件;已立即从已验收商城候选恢复dc940401…,生产db PID53754及所有核心未重启。事件记录在服务器`db-build-output-correction.json`。后续使用服务端`tools/ava2-itemshop/build_isolated.py`,同时覆写GAMEDIR/DBDIR/BINDIR/OBJDIR,拒绝生产目录。
|
||||
|
||||
当前正在补充装备40栏位、道具额外状态(保留经典3socket/7属性客户端封包,以GC93独立扩展同步)和内部game/db物品持久化。此部分尚未构建/部署。扩展存储及位置迁移必须先备份、停止服务,并使用保存的精确行迁移计划;不能用未完成的工作区构建覆盖现有发布包。
|
||||
|
||||
剩余依赖包括限时坐骑和缺失模型、普通/养成宠物及消耗品、时装/发型/武器/披风外观及强化、发光特效、稀有度、炼金附魔/补时/材料、离线商店钥匙和扩充、Gaya市场恢复、月份战令/外观兑换券,以及宝箱的完整产物链。逐项验收后更新verified-products和上架清单。
|
||||
|
||||
## 2026-10-20 测试服点券验收
|
||||
|
||||
证据:`audit/evidence/itemshop/point-drops-sbtest-20261020.json`。
|
||||
|
||||
- 120级角色击杀105级8055石头,随机获得6点;3705怪物获得1点。
|
||||
- 低等级8001石头未发奖;资格边界105/104由真实共用规则的C++测试验证。
|
||||
- 代理故意丢弃第一次成功回复;10秒后同token重试,流水及余额均未重复增加。
|
||||
- 用明确标记的491点测试流水将当日累计从7补到498。下一块石头抽中5点、实际只发2点,累计500;之后两次石头分别请求7点/8点,均发0点并留有流水。
|
||||
- 第二次0点发生在测试服game/db重启及角色重新登录后,上限没有重置。
|
||||
- 怪物概率在确定性验收中临时改为100%;正式配置仍为500基点(5%),未改正式服。
|
||||
- 验收后恢复sbtest的测试前数据、余额0、奖励流水0、原始点券开关、GM名单、game/db、CONFIG;停止丢包代理,原sbtest重新启动。正式服db仍为dc940401…、PID53754。
|
||||
|
||||
## 扩展物品与外观验证
|
||||
|
||||
- 额外5个socket、8个属性、自定义名称共69字节,已验证数值边界、完整往返、空旧数据和损坏输入。
|
||||
- 独立MySQL临时库验证了龙魂/腰带位置、在用和已删除角色快捷栏迁移,重复执行不再移动;临时库已删除,正式及sbtest均未执行wear40迁移。
|
||||
- 新增16件:71500/1、71503/4、71506/7、71509/10、41119~41122、45005/6、45057/8。
|
||||
- 原AVA2八个职业性别定义与运行时注册的服装/发型路径逐项一致;104个服装/发型依赖文件全部存在,资源包构建成功。
|
||||
- 道具导入22项测试、客户端全部160项wiki/系统测试(含商城12项)通过;百科兑换券名称也同步改成点券。外观仍需联机目视验收,不能据此上架。
|
||||
- macOS原生客户端构建、FreeBSD隔离wear40 game/db构建成功,见`audit/evidence/itemshop/extended-item-build-20261020.json`;未部署到sbtest或正式服。
|
||||
- wear40构建只在独立目录中验证;原生产客户端发布包没有替换。新服务端要求mt20261022及以上客户端进入游戏,避免旧龙魂/腰带位置误用。
|
||||
|
||||
扩展版本回滚不能直接还原旧game/db:旧DB的REPLACE会丢弃新增属性,新装备栏也不能由旧客户端表示。上线前必须准备保留点券和购买记录的兼容回退;存在新栏位道具或额外状态时,应保留兼容二进制并关闭新增商品,禁止恢复旧全库备份覆盖玩家购买。
|
||||
@@ -5,7 +5,8 @@
|
||||
static const char c_szArmorShapesScript[] = R"PY(# -*- coding: utf-8 -*-
|
||||
import chrmgr
|
||||
|
||||
SHAPES = {32: "%s_7_1"}
|
||||
SHAPES = {32: "%s_7_1", 40062: "%s_salsa1", 40063: "%s_springwear1"}
|
||||
HAIRS = {161: "hair/hair_16_1", 191: "hair/hair_19_1"}
|
||||
# ShapeData PathName of each race msm (male, female).
|
||||
PATHS = {"warrior": ("pc", "pc2"), "assassin": ("pc2", "pc"), "sura": ("pc", "pc2"), "shaman": ("pc2", "pc")}
|
||||
|
||||
@@ -22,6 +23,9 @@ def Register(name):
|
||||
model = path + model % race
|
||||
chrmgr.SetShapeModel(shape, model + ".gr2")
|
||||
chrmgr.AppendShapeSkin(shape, 0, model + ".dds", model + ".dds")
|
||||
for hair, model in HAIRS.items():
|
||||
model = path + model
|
||||
chrmgr.SetHairSkin(hair, 0, model + ".gr2", model + ".dds", model + ".dds")
|
||||
|
||||
|
||||
def LoadLocalRaceData(name):
|
||||
|
||||
@@ -8,7 +8,7 @@ import ui
|
||||
ui.Window.SetMouseWheelScrollEvent=lambda self,event:setattr(self,'onMouseWheelScrollEvent',event)
|
||||
from mt_biolog import L
|
||||
LOCALE={'CATEGORY_0_NAME': 'Offers', 'CATEGORY_0_SUB_0_NAME': 'Battle pass', 'CATEGORY_0_SUB_1_NAME': 'Special packs', 'CATEGORY_0_SUB_2_NAME': 'Special Offers', 'CATEGORY_1_NAME': 'Special Objects', 'CATEGORY_2_NAME': 'Cosmetics', 'CATEGORY_2_SUB_0_NAME': 'Weapons Skins', 'CATEGORY_2_SUB_1_NAME': 'Body Costume', 'CATEGORY_2_SUB_2_NAME': 'Hairstyles', 'CATEGORY_2_SUB_3_NAME': 'Sash Skin', 'CATEGORY_2_SUB_4_NAME': 'Mount Skin', 'CATEGORY_3_NAME': 'Pets and mounts', 'CATEGORY_3_SUB_0_NAME': 'Mounts', 'CATEGORY_3_SUB_1_NAME': 'Leveable pets', 'CATEGORY_3_SUB_2_NAME': 'Normal pets', 'CATEGORY_4_NAME': 'Dungeons', 'CATEGORY_5_NAME': 'Reinforce Costume', 'CATEGORY_5_SUB_0_NAME': 'Weapon Skin', 'CATEGORY_5_SUB_1_NAME': 'Body Costume', 'CATEGORY_5_SUB_2_NAME': 'Hairstyles', 'CATEGORY_5_SUB_3_NAME': 'Mount Skin', 'CATEGORY_5_SUB_4_NAME': 'Sash Skin', 'CATEGORY_5_SUB_5_NAME': 'Effects', 'CATEGORY_6_NAME': 'Alchemy', 'CATEGORY_7_NAME': 'Equipment', 'ITEMSHOP_BUY': 'Comprar', 'ITEMSHOP_BUY_COIN': 'Home', 'ITEMSHOP_BUY_TEXT': 'Wanna buy |cffF7BD48%s|r ?', 'ITEMSHOP_BUY_TEXT_COUNT': 'Wanna buy |cffF7BD48%sx%d|r ?', 'ITEMSHOP_DRAGONCOINT': 'Dragon Coins', 'ITEMSHOP_HOTITEMS': '|Eishop/hot|ePOPULAR', 'ITEMSHOP_ITEMSEARCH_DEFAULT_TEXT': 'Search the itemshop ...', 'ITEMSHOP_LAST_COUNT': 'Remaining amount: %d', 'ITEMSHOP_OFFERS': '|Eishop/offer|e OFFERS', 'ITEMSHOP_PRICE_NEW': '|Eishop/mini_coin|e %s Coins', 'ITEMSHOP_PRICE_ONLY_TEXT': '%s Coins', 'ITEMSHOP_PRICE_WITH_DISCOUNT': '|Eishop/mini_coin|e |cffFF7B7B%s Coins (%d%%)', 'ITEMSHOP_PURCHASES': 'SHOPPING', 'ITEMSHOP_WHEEL': '|Eishop/wheel_icon|e Roulette', 'ITEMSHOP_WHEEL_BACK_ISHOP': 'Itemhop go back', 'ITEMSHOP_WHEEL_COIN_TEXT': ' |Eishop/coin|e Price: 10 Coins', 'ITEMSHOP_WHEEL_COIN_TEXT_INFO': 'You will use |cffF7BD48Coins|r to spin.', 'ITEMSHOP_WHEEL_PURCHASE': '|Eishop/wheel_icon|e |cffF7BD48Fortune roulette|r', 'ITEMSHOP_WHEEL_SKIP_ANIMATION': 'Skip animation', 'ITEMSHOP_WHEEL_TICKET_TEXT': '|Eishop/wheel_ticket|e x1 ticket', 'ITEMSHOP_WHEEL_TICKET_TEXT_INFO': 'Your are using |cffF7BD48Roulette ticket|r to spin.', 'PURCHASES_ACCOUNTID': 'ID account', 'PURCHASES_DATE': 'Date', 'PURCHASES_IP': 'IP', 'PURCHASES_ITEMBOUGHT': 'Purchased object', 'PURCHASES_PRICE': 'Price', 'PURCHASES_PRICE_TEXT': '|Eishop/mini_coin|e |cfff7bd48%s dragon coins', 'UI_CANCEL': 'Cancel', 'UI_OK': 'OK', 'WHEEL_REWARD_TEXT': 'You have received', 'WHEEL_REWARD_TEXT_1': 'In your inventory', 'WHEEL_REWARD_TITLE': 'Roulette reward', 'YES': 'Buy'}
|
||||
ZH={'YES':'确认','ITEMSHOP_BUY_COIN': '充值', 'ITEMSHOP_WHEEL': '幸运转盘', 'ITEMSHOP_PURCHASES': '购买记录', 'ITEMSHOP_HOTITEMS': '热销商品', 'ITEMSHOP_OFFERS': '限时优惠', 'ITEMSHOP_ITEMSEARCH_DEFAULT_TEXT': '搜索道具名称', 'ITEMSHOP_DRAGONCOINT': '龙币', 'ITEMSHOP_BUY': '购买', 'ITEMSHOP_BUY_TEXT': '购买 %s?', 'ITEMSHOP_BUY_TEXT_COUNT': '购买 %s × %d?', 'ITEMSHOP_PRICE_NEW': '价格:%s 龙币', 'ITEMSHOP_PRICE_ONLY_TEXT': '%s 龙币', 'ITEMSHOP_PRICE_WITH_DISCOUNT': '原价 %s(优惠 %d%%)', 'ITEMSHOP_LAST_COUNT': '剩余:%d', 'PURCHASES_PRICE_TEXT': '支付:%s 龙币', 'PURCHASES_DATE': '购买时间', 'PURCHASES_ACCOUNTID': '角色', 'PURCHASES_IP': '登录地址', 'PURCHASES_ITEMBOUGHT': '购买道具', 'PURCHASES_PRICE': '支付金额', 'ITEMSHOP_WHEEL_BACK_ISHOP': '返回商城'}
|
||||
ZH={'YES':'确认','ITEMSHOP_BUY_COIN': '充值', 'ITEMSHOP_WHEEL': '幸运转盘', 'ITEMSHOP_PURCHASES': '购买记录', 'ITEMSHOP_HOTITEMS': '热销商品', 'ITEMSHOP_OFFERS': '限时优惠', 'ITEMSHOP_ITEMSEARCH_DEFAULT_TEXT': '搜索道具名称', 'ITEMSHOP_DRAGONCOINT': '点券', 'ITEMSHOP_BUY': '购买', 'ITEMSHOP_BUY_TEXT': '购买 %s?', 'ITEMSHOP_BUY_TEXT_COUNT': '购买 %s × %d?', 'ITEMSHOP_PRICE_NEW': '价格:%s 点券', 'ITEMSHOP_PRICE_ONLY_TEXT': '%s 点券', 'ITEMSHOP_PRICE_WITH_DISCOUNT': '原价 %s(优惠 %d%%)', 'ITEMSHOP_LAST_COUNT': '剩余:%d', 'PURCHASES_PRICE_TEXT': '支付:%s 点券', 'PURCHASES_DATE': '购买时间', 'PURCHASES_ACCOUNTID': '角色', 'PURCHASES_IP': '登录地址', 'PURCHASES_ITEMBOUGHT': '购买道具', 'PURCHASES_PRICE': '支付金额', 'ITEMSHOP_WHEEL_BACK_ISHOP': '返回商城'}
|
||||
ZH.update({'CATEGORY_0_NAME': '精选优惠', 'CATEGORY_0_SUB_0_NAME': '战令', 'CATEGORY_0_SUB_1_NAME': '超值礼包', 'CATEGORY_0_SUB_2_NAME': '特别优惠', 'CATEGORY_1_NAME': '特殊道具', 'CATEGORY_2_NAME': '外观', 'CATEGORY_2_SUB_0_NAME': '武器外观', 'CATEGORY_2_SUB_1_NAME': '服装', 'CATEGORY_2_SUB_2_NAME': '发型', 'CATEGORY_2_SUB_3_NAME': '披风外观', 'CATEGORY_2_SUB_4_NAME': '坐骑外观', 'CATEGORY_3_NAME': '宠物与坐骑', 'CATEGORY_3_SUB_0_NAME': '坐骑', 'CATEGORY_3_SUB_1_NAME': '成长宠物', 'CATEGORY_3_SUB_2_NAME': '普通宠物', 'CATEGORY_4_NAME': '副本', 'CATEGORY_5_NAME': '外观强化', 'CATEGORY_5_SUB_0_NAME': '武器外观', 'CATEGORY_5_SUB_1_NAME': '服装', 'CATEGORY_5_SUB_2_NAME': '发型', 'CATEGORY_5_SUB_3_NAME': '坐骑外观', 'CATEGORY_5_SUB_4_NAME': '披风外观', 'CATEGORY_5_SUB_5_NAME': '特效', 'CATEGORY_6_NAME': '龙魂炼金', 'CATEGORY_7_NAME': '装备'})
|
||||
for key,value in LOCALE.items():
|
||||
if not hasattr(localeInfo,key):setattr(localeInfo,key,L(value))
|
||||
@@ -25,7 +25,7 @@ def calculateRect(curValue,maxValue):
|
||||
ui.calculateRect=calculateRect
|
||||
window=None;pending=None;_serial=0;_next=0;_waiting=False;_requested=0;_queued=False;_logAt=0
|
||||
_product=struct.Struct('<IIqiBiiqiii');_log=struct.Struct('<I25s21si16sIIiq')
|
||||
ERRORS={1:'龙币不足。',2:'超过本周限购数量。',3:'超过本月限购数量。',4:'商品库存不足。',5:'商品优惠已过期。',6:'商城暂不可用,请稍后重试。',7:'订单编号冲突,请重新登录。',9:'商品或价格已变化,请确认最新信息后重试。'}
|
||||
ERRORS={1:'点券不足。',2:'超过本周限购数量。',3:'超过本月限购数量。',4:'商品库存不足。',5:'商品优惠已过期。',6:'商城暂不可用,请稍后重试。',7:'订单编号冲突,请重新登录。',9:'商品或价格已变化,请确认最新信息后重试。'}
|
||||
# AVA2 image callbacks include an event tag; classic image callbacks omit it.
|
||||
# Adapt only this module's handlers; preserve the original UI class hierarchy.
|
||||
_MISSING=object()
|
||||
@@ -245,4 +245,19 @@ def Close(self):Clear();return _close(self)
|
||||
def Update(self):_update(self);Tick()
|
||||
game.GameWindow.Open=Open;game.GameWindow.Close=Close;game.GameWindow.OnUpdate=Update
|
||||
game.GameWindow.BINARY_Ava2ItemShop=Receive
|
||||
|
||||
_command=game.GameWindow.BINARY_ServerCommand_Run
|
||||
def Command(self,line):
|
||||
if line.startswith('MTPOINTS '):
|
||||
try:
|
||||
words=line.split()
|
||||
if len(words)!=3:return 1
|
||||
amount,balance=int(words[1]),long(words[2])
|
||||
if not 0<amount<=1000000 or not 0<=balance<=9223372036854775807:return 1
|
||||
except (ValueError,OverflowError):return 1
|
||||
if window:window.SetDragonCoin(balance)
|
||||
chat.AppendChat(chat.CHAT_TYPE_INFO,L('获得 %d 点券,当前余额 %d。')%(amount,balance))
|
||||
return 1
|
||||
return _command(self,line)
|
||||
game.GameWindow.BINARY_ServerCommand_Run=Command
|
||||
)PY";
|
||||
|
||||
@@ -59,6 +59,8 @@ class CItemData
|
||||
ITEM_TYPE_SHINING, //35 PORT: AVA2 shining (not ported, keeps the AVA2 numbering)
|
||||
ITEM_TYPE_RINGS, //36 PORT: AVA2 new rings, worn in c_Equipment_Rings1/2
|
||||
|
||||
ITEM_TYPE_PET, // PORT: AVA2 pet type 37.
|
||||
|
||||
ITEM_TYPE_MAX_NUM,
|
||||
};
|
||||
|
||||
@@ -108,6 +110,9 @@ class CItemData
|
||||
COSTUME_MOUNT = 2, // PORT: AVA2 mount costume (value0 = horse race)
|
||||
COSTUME_SASH = 3, // PORT: AVA2 sash
|
||||
COSTUME_MOUNT_SKIN = 4, // PORT: AVA2 mount skin (needs a worn COSTUME_MOUNT)
|
||||
COSTUME_WEAPON = 5, // PORT: local subtype mapping.
|
||||
COSTUME_NEW_SASH = 6,
|
||||
COSTUME_PET = 7,
|
||||
COSTUME_NUM_TYPES,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "../GameLib/ItemData.h"
|
||||
#include "../common/PortItemExtra.h"
|
||||
|
||||
struct SAffects
|
||||
{
|
||||
@@ -111,12 +112,19 @@ enum EDragonSoulStepTypes
|
||||
const DWORD c_Equipment_Pendant = c_Equipment_Start + 27; // PORT: AVA2 talisman, server WEAR_PENDANT
|
||||
const DWORD c_Equipment_Rings1 = c_Equipment_Start + 28; // PORT: AVA2 new rings, server WEAR_RINGS_1/2
|
||||
const DWORD c_Equipment_Rings2 = c_Equipment_Start + 29;
|
||||
const DWORD c_Costume_Slot_Weapon = c_Equipment_Start + 30;
|
||||
const DWORD c_Costume_Slot_Pet = c_Equipment_Start + 31;
|
||||
const DWORD c_Pet_Slot = c_Equipment_Start + 32;
|
||||
const DWORD c_Costume_Slot_NewSash = c_Equipment_Start + 33;
|
||||
const DWORD c_Shining_Slot_Weapon = c_Equipment_Start + 34;
|
||||
const DWORD c_Shining_Slot_Armor = c_Equipment_Start + 35;
|
||||
const DWORD c_Shining_Slot_Special = c_Equipment_Start + 36;
|
||||
|
||||
|
||||
// [주의] 숫자(32) 하드코딩 주의. 현재 서버에서 용혼석 슬롯은 32부터임.
|
||||
// 서버 common/length.h 파일의 EWearPositions 열거형이 32까지 확장될 것을 염두하고(32 이상은 확장 하기 힘들게 되어있음.),
|
||||
// 그 이후부터를 용혼석 장착 슬롯으로 사용.
|
||||
const DWORD c_Wear_Max = 32;
|
||||
const DWORD c_Wear_Max = 40; // PORT: shop costume, pet and shining equipment.
|
||||
const DWORD c_DragonSoul_Equip_Start = c_ItemSlot_Count + c_Wear_Max;
|
||||
const DWORD c_DragonSoul_Equip_Slot_Max = 6;
|
||||
const DWORD c_DragonSoul_Equip_End = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM;
|
||||
@@ -361,6 +369,8 @@ typedef struct packet_item
|
||||
DWORD anti_flags;
|
||||
LONG alSockets[ITEM_SOCKET_SLOT_MAX_NUM]; // PORT: LONG, the 32-bit Win32 long
|
||||
TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
|
||||
DWORD portId = 0; // PORT: owning item identity for pet operations.
|
||||
PortItemExtra extra{};
|
||||
} TItemData;
|
||||
|
||||
typedef struct packet_shop_item
|
||||
|
||||
@@ -494,6 +494,19 @@ PyObject * chrmgrSetShapeModel(PyObject* poSelf, PyObject* poArgs)
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
// PORT: register AVA2 hair definitions after the classic race file is loaded.
|
||||
PyObject* chrmgrSetHairSkin(PyObject*,PyObject* args)
|
||||
{
|
||||
int hair,part;char *model,*source,*target;
|
||||
if(!PyTuple_GetInteger(args,0,&hair) || !PyTuple_GetInteger(args,1,&part) ||
|
||||
!PyTuple_GetString(args,2,&model) || !PyTuple_GetString(args,3,&source) ||
|
||||
!PyTuple_GetString(args,4,&target))return Py_BadArgument();
|
||||
auto race=CRaceManager::Instance().GetSelectedRaceDataPointer();
|
||||
if(!race)return Py_BuildException("RaceData has not selected!");
|
||||
race->SetHairSkin(hair,part,model,source,target);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * chrmgrAppendShapeSkin(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
int eShape;
|
||||
@@ -722,6 +735,7 @@ void initchrmgr()
|
||||
{ "GetVIDInfo", chrmgrGetVIDInfo, METH_VARARGS },
|
||||
{ "GetPickedVID", chrmgrGetPickedVID, METH_VARARGS },
|
||||
{ "SetShapeModel", chrmgrSetShapeModel, METH_VARARGS },
|
||||
{ "SetHairSkin", chrmgrSetHairSkin, METH_VARARGS },
|
||||
{ "AppendShapeSkin", chrmgrAppendShapeSkin, METH_VARARGS },
|
||||
{ "SetPathName", chrmgrSetPathName, METH_VARARGS },
|
||||
{ "LoadRaceData", chrmgrLoadRaceData, METH_VARARGS },
|
||||
|
||||
@@ -4220,8 +4220,8 @@ bool CPythonNetworkStream::SendClientVersionPacket()
|
||||
TPacketCGClientVersion2 kVersionPacket;
|
||||
kVersionPacket.header = HEADER_CG_CLIENT_VERSION2;
|
||||
strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1);
|
||||
// PORT: revision mt20261020 adds native itemshop; preserve the numeric prefix for atoi version checks.
|
||||
strncpy(kVersionPacket.timestamp, "1215955205 mt20261020", sizeof(kVersionPacket.timestamp)-1); // # python time.time 앞자리
|
||||
// PORT: revision mt20261022 adds native itemshop; preserve the numeric prefix for atoi version checks.
|
||||
strncpy(kVersionPacket.timestamp, "1215955205 mt20261022", sizeof(kVersionPacket.timestamp)-1); // # python time.time 앞자리
|
||||
//strncpy(kVersionPacket.timestamp, __TIMESTAMP__, sizeof(kVersionPacket.timestamp)-1); // old_string_ver
|
||||
//strncpy(kVersionPacket.timestamp, "1218055205", sizeof(kVersionPacket.timestamp)-1); // new_future
|
||||
//strncpy(kVersionPacket.timestamp, "1214055205", sizeof(kVersionPacket.timestamp)-1); // old_past
|
||||
@@ -4234,8 +4234,8 @@ bool CPythonNetworkStream::SendClientVersionPacket()
|
||||
TPacketCGClientVersion kVersionPacket;
|
||||
kVersionPacket.header = HEADER_CG_CLIENT_VERSION;
|
||||
strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1);
|
||||
// PORT: native itemshop requires mt20261020; older AVA2 services retain their own revision gates.
|
||||
strncpy(kVersionPacket.timestamp, "mt20261020", sizeof(kVersionPacket.timestamp)-1);
|
||||
// PORT: native itemshop requires mt20261022; older AVA2 services retain their own revision gates.
|
||||
strncpy(kVersionPacket.timestamp, "mt20261022", sizeof(kVersionPacket.timestamp)-1);
|
||||
|
||||
if (!Send(sizeof(kVersionPacket), &kVersionPacket))
|
||||
Tracef("SendClientReportPacket Error");
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "PythonNetworkStream.h"
|
||||
#include "Ava2QueryPackets.h"
|
||||
#include <vector>
|
||||
#include "PythonPlayer.h"
|
||||
#include "PythonSafeBox.h"
|
||||
|
||||
bool CPythonNetworkStream::SendAva2DropQuery(BYTE subheader,LONG vnum) {
|
||||
if (!PORT_IsGamePhase() || (subheader!=0 && subheader!=1 && subheader!=6 && subheader!=7 && subheader!=8 && subheader!=9 && subheader!=10) || vnum<0)return false;
|
||||
@@ -30,6 +32,24 @@ bool CPythonNetworkStream::RecvAva2ItemShop() {
|
||||
if (!Recv(sizeof(p),&p) || p.size<sizeof(p)+1 || p.size>32768)return false;
|
||||
std::vector<char> data(p.size-sizeof(p));
|
||||
if (!Recv(data.size(),data.data()))return false;
|
||||
if(uint8_t(data[0])==10) {
|
||||
#pragma pack(push,1)
|
||||
struct Extra {uint8_t op,window;uint16_t cell;uint32_t vnum,id;PortItemExtra extra;};
|
||||
#pragma pack(pop)
|
||||
if(data.size()!=sizeof(Extra))return false;
|
||||
Extra extra;memcpy(&extra,data.data(),sizeof(extra));extra.extra.name[24]=0;
|
||||
TItemData* target=nullptr;
|
||||
if(extra.window==SAFEBOX){if(!CPythonSafeBox::Instance().GetItemDataPtr(extra.cell,&target))return false;}
|
||||
else if(extra.window==MALL){if(!CPythonSafeBox::Instance().GetMallItemDataPtr(extra.cell,&target))return false;}
|
||||
else {
|
||||
TItemPos pos(extra.window,extra.cell);
|
||||
if(!pos.IsValidCell())return false;
|
||||
target=const_cast<TItemData*>(CPythonPlayer::Instance().GetItemData(pos));
|
||||
}
|
||||
if(!target || target->vnum!=extra.vnum)return true;
|
||||
target->portId=extra.id;target->extra=extra.extra;
|
||||
return true;
|
||||
}
|
||||
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME],"BINARY_Ava2ItemShop",Py_BuildValue("(s#)",data.data(),int(data.size())));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -668,13 +668,25 @@ DWORD CPythonPlayer::GetItemCountByVnum(DWORD dwVnum)
|
||||
return dwCount;
|
||||
}
|
||||
|
||||
DWORD CPythonPlayer::GetItemID(TItemPos Cell)
|
||||
{
|
||||
const auto item=Cell.IsValidCell() ? GetItemData(Cell) : nullptr;
|
||||
return item ? item->portId : 0;
|
||||
}
|
||||
|
||||
const char* CPythonPlayer::GetItemNewName(TItemPos Cell)
|
||||
{
|
||||
const auto item=Cell.IsValidCell() ? GetItemData(Cell) : nullptr;
|
||||
return item ? item->extra.name : "";
|
||||
}
|
||||
|
||||
DWORD CPythonPlayer::GetItemMetinSocket(TItemPos Cell, DWORD dwMetinSocketIndex)
|
||||
{
|
||||
if (!Cell.IsValidCell())
|
||||
return 0;
|
||||
|
||||
if (dwMetinSocketIndex >= ITEM_SOCKET_SLOT_MAX_NUM)
|
||||
return 0;
|
||||
return dwMetinSocketIndex<8 ? GetItemData(Cell)->extra.sockets[dwMetinSocketIndex-3] : 0;
|
||||
|
||||
return GetItemData(Cell)->alSockets[dwMetinSocketIndex];
|
||||
}
|
||||
@@ -688,7 +700,10 @@ void CPythonPlayer::GetItemAttribute(TItemPos Cell, DWORD dwAttrSlotIndex, BYTE
|
||||
return;
|
||||
|
||||
if (dwAttrSlotIndex >= ITEM_ATTRIBUTE_SLOT_MAX_NUM)
|
||||
{
|
||||
if(dwAttrSlotIndex<15){*pbyType=GetItemData(Cell)->extra.types[dwAttrSlotIndex-7];*psValue=GetItemData(Cell)->extra.values[dwAttrSlotIndex-7];}
|
||||
return;
|
||||
}
|
||||
|
||||
*pbyType = GetItemData(Cell)->aAttr[dwAttrSlotIndex].bType;
|
||||
*psValue = GetItemData(Cell)->aAttr[dwAttrSlotIndex].sValue;
|
||||
|
||||
@@ -292,6 +292,8 @@ class CPythonPlayer : public CSingleton<CPythonPlayer>, public IAbstractPlayer
|
||||
DWORD GetItemCount(TItemPos Cell);
|
||||
DWORD GetItemCountByVnum(DWORD dwVnum);
|
||||
DWORD GetItemMetinSocket(TItemPos Cell, DWORD dwMetinSocketIndex);
|
||||
DWORD GetItemID(TItemPos Cell);
|
||||
const char* GetItemNewName(TItemPos Cell);
|
||||
void GetItemAttribute(TItemPos Cell, DWORD dwAttrSlotIndex, BYTE * pbyType, short * psValue);
|
||||
void SendClickItemPacket(DWORD dwIID);
|
||||
|
||||
|
||||
@@ -943,6 +943,24 @@ PyObject * playerGetItemCountByVnum(PyObject* poSelf, PyObject* poArgs)
|
||||
return Py_BuildValue("i", ItemNum);
|
||||
}
|
||||
|
||||
// PORT: AVA2 pet dialogs identify the saved item and display its custom name.
|
||||
static bool PortItemPosition(PyObject* args,TItemPos& cell)
|
||||
{
|
||||
if(PyTuple_Size(args)==1)return PyTuple_GetInteger(args,0,&cell.cell);
|
||||
if(PyTuple_Size(args)==2)return PyTuple_GetByte(args,0,&cell.window_type) && PyTuple_GetInteger(args,1,&cell.cell);
|
||||
return false;
|
||||
}
|
||||
PyObject* playerGetItemID(PyObject*,PyObject* args)
|
||||
{
|
||||
TItemPos cell;if(!PortItemPosition(args,cell))return Py_BuildException();
|
||||
return Py_BuildValue("I",CPythonPlayer::Instance().GetItemID(cell));
|
||||
}
|
||||
PyObject* playerGetItemNewName(PyObject*,PyObject* args)
|
||||
{
|
||||
TItemPos cell;if(!PortItemPosition(args,cell))return Py_BuildException();
|
||||
return Py_BuildValue("s",CPythonPlayer::Instance().GetItemNewName(cell));
|
||||
}
|
||||
|
||||
PyObject * playerGetItemMetinSocket(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
TItemPos Cell;
|
||||
@@ -2364,6 +2382,8 @@ void initPlayer()
|
||||
{ "GetItemCount", playerGetItemCount, METH_VARARGS },
|
||||
{ "GetItemCountByVnum", playerGetItemCountByVnum, METH_VARARGS },
|
||||
{ "GetItemMetinSocket", playerGetItemMetinSocket, METH_VARARGS },
|
||||
{ "GetItemID", playerGetItemID, METH_VARARGS },
|
||||
{ "GetItemNewName", playerGetItemNewName, METH_VARARGS },
|
||||
{ "GetItemAttribute", playerGetItemAttribute, METH_VARARGS },
|
||||
#if defined(GAIDEN)
|
||||
{ "GetItemUnbindTime", playerGetItemUnbindTime, METH_VARARGS },
|
||||
|
||||
@@ -206,14 +206,14 @@ PyObject * safeboxGetItemMetinSocket(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iSocketIndex))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (iSocketIndex >= ITEM_SOCKET_SLOT_MAX_NUM)
|
||||
if (iSocketIndex < 0 || iSocketIndex >= 8)
|
||||
return Py_BuildException();
|
||||
|
||||
TItemData * pItemData;
|
||||
if (!CPythonSafeBox::Instance().GetItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildException();
|
||||
|
||||
return Py_BuildValue("i", pItemData->alSockets[iSocketIndex]);
|
||||
return Py_BuildValue("i", iSocketIndex<3?pItemData->alSockets[iSocketIndex]:pItemData->extra.sockets[iSocketIndex-3]);
|
||||
}
|
||||
|
||||
PyObject * safeboxGetItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
@@ -225,11 +225,11 @@ PyObject * safeboxGetItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iAttrSlotIndex))
|
||||
return Py_BuildException();
|
||||
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < ITEM_ATTRIBUTE_SLOT_MAX_NUM)
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < 15)
|
||||
{
|
||||
TItemData * pItemData;
|
||||
if (CPythonSafeBox::Instance().GetItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildValue("ii", pItemData->aAttr[iAttrSlotIndex].bType, pItemData->aAttr[iAttrSlotIndex].sValue);
|
||||
return Py_BuildValue("ii", iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].bType:pItemData->extra.types[iAttrSlotIndex-7], iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].sValue:pItemData->extra.values[iAttrSlotIndex-7]);
|
||||
}
|
||||
|
||||
return Py_BuildValue("ii", 0, 0);
|
||||
@@ -275,14 +275,14 @@ PyObject * safeboxGetMallItemMetinSocket(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iSocketIndex))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (iSocketIndex >= ITEM_SOCKET_SLOT_MAX_NUM)
|
||||
if (iSocketIndex < 0 || iSocketIndex >= 8)
|
||||
return Py_BuildException();
|
||||
|
||||
TItemData * pItemData;
|
||||
if (!CPythonSafeBox::Instance().GetMallItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildException();
|
||||
|
||||
return Py_BuildValue("i", pItemData->alSockets[iSocketIndex]);
|
||||
return Py_BuildValue("i", iSocketIndex<3?pItemData->alSockets[iSocketIndex]:pItemData->extra.sockets[iSocketIndex-3]);
|
||||
}
|
||||
|
||||
PyObject * safeboxGetMallItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
@@ -294,11 +294,11 @@ PyObject * safeboxGetMallItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iAttrSlotIndex))
|
||||
return Py_BuildException();
|
||||
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < ITEM_ATTRIBUTE_SLOT_MAX_NUM)
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < 15)
|
||||
{
|
||||
TItemData * pItemData;
|
||||
if (CPythonSafeBox::Instance().GetMallItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildValue("ii", pItemData->aAttr[iAttrSlotIndex].bType, pItemData->aAttr[iAttrSlotIndex].sValue);
|
||||
return Py_BuildValue("ii", iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].bType:pItemData->extra.types[iAttrSlotIndex-7], iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].sValue:pItemData->extra.values[iAttrSlotIndex-7]);
|
||||
}
|
||||
|
||||
return Py_BuildValue("ii", 0, 0);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
// PORT: supplementary AVA2 pet/rarity state. Classic item packets retain 3 sockets / 7 attributes.
|
||||
#pragma pack(push,1)
|
||||
struct PortItemExtra {
|
||||
int32_t sockets[5];
|
||||
uint8_t types[8];
|
||||
int16_t values[8];
|
||||
char name[25];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
static_assert(sizeof(PortItemExtra)==69,"extended item state");
|
||||
|
||||
inline std::string PortItemExtraHex(const PortItemExtra& extra) {
|
||||
static const char digits[]="0123456789abcdef";
|
||||
const auto p=reinterpret_cast<const unsigned char*>(&extra);
|
||||
std::string result(sizeof(extra)*2,'0');
|
||||
for(unsigned i=0;i<sizeof(extra);++i){result[2*i]=digits[p[i]>>4];result[2*i+1]=digits[p[i]&15];}
|
||||
return result;
|
||||
}
|
||||
inline bool PortItemExtraRead(const char* hex,PortItemExtra& extra) {
|
||||
std::memset(&extra,0,sizeof(extra));
|
||||
if(!hex || !*hex)return true;
|
||||
if(std::strlen(hex)!=sizeof(extra)*2)return false;
|
||||
auto nibble=[](char c){return c>='0' && c<='9'?c-'0':c>='A' && c<='F'?c-'A'+10:c>='a' && c<='f'?c-'a'+10:-1;};
|
||||
auto p=reinterpret_cast<unsigned char*>(&extra);
|
||||
for(unsigned i=0;i<sizeof(extra);++i){int a=nibble(hex[2*i]),b=nibble(hex[2*i+1]);if(a<0 || b<0){std::memset(&extra,0,sizeof(extra));return false;}p[i]=(a<<4)|b;}
|
||||
extra.name[24]=0;return true;
|
||||
}
|
||||
@@ -57,6 +57,18 @@ class PurchaseFlow(unittest.TestCase):
|
||||
for now in [5,10,15,20,25]:self.now=now;self.ns['Tick']()
|
||||
self.assertEqual(self.sent,['/ishop buy 1 2 '+'a'*32+' 148 71084']*3)
|
||||
self.assertEqual(self.ns['pending'][4],4)
|
||||
def test_point_reward_updates_balance_and_rejects_malformed_notifications(self):
|
||||
messages=[];balances=[]
|
||||
self.ns.update(long=int,_command=lambda self,line:42,
|
||||
window=types.SimpleNamespace(SetDragonCoin=balances.append),
|
||||
chat=types.SimpleNamespace(CHAT_TYPE_INFO=1,AppendChat=lambda kind,text:messages.append(text)))
|
||||
self.functions('Command')
|
||||
for line in ('MTPOINTS -1 100','MTPOINTS 1 -1','MTPOINTS bad 100','MTPOINTS 1 2 3'):
|
||||
self.assertEqual(self.ns['Command'](None,line),1)
|
||||
self.assertEqual(messages,[]);self.assertEqual(balances,[])
|
||||
self.assertEqual(self.ns['Command'](None,'MTPOINTS 3 103'),1)
|
||||
self.assertEqual(balances,[103]);self.assertEqual(messages,['获得 3 点券,当前余额 103。'])
|
||||
self.assertEqual(self.ns['Command'](None,'other-command'),42)
|
||||
def test_catalogue_refresh_is_queued_past_command_throttle(self):
|
||||
self.functions('Request','Tick');self.ns['Request']();self.now=.5;self.ns['Request']()
|
||||
self.assertEqual(len(self.sent),1);self.assertTrue(self.ns['_queued'])
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
"""Verify runtime race registration against the AVA2 definitions, for every sex/job."""
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sys
|
||||
import types
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
REFERENCE = ROOT.parent/'AVA2/1. Client DEV/pack_maker/root'
|
||||
|
||||
|
||||
@unittest.skipUnless(REFERENCE.is_dir(), 'requires original AVA2 race definitions')
|
||||
class ShopAppearance(unittest.TestCase):
|
||||
def test_models_and_skins_match_original_race_definitions(self):
|
||||
calls = []
|
||||
module = types.ModuleType('chrmgr')
|
||||
module.LoadLocalRaceData = lambda name: calls.append(('load', name)) or True
|
||||
for name in ('SetShapeModel', 'AppendShapeSkin', 'SetHairSkin'):
|
||||
setattr(module, name, lambda *args, method=name: calls.append((method,)+args))
|
||||
text = (ROOT/'src/platform/ScriptLib/ArmorShapesScript.inc').read_text()
|
||||
script = text.split('R"PY(', 1)[1].split(')PY"', 1)[0]
|
||||
with patch.dict(sys.modules, chrmgr=module):
|
||||
exec(compile(script, '<appearance>', 'exec'), {})
|
||||
for race in ('warrior', 'assassin', 'sura', 'shaman'):
|
||||
for sex in ('m', 'w'):
|
||||
with self.subTest(race=race, sex=sex):
|
||||
calls.clear()
|
||||
filename = race+'_'+sex+'.msm'
|
||||
self.assertTrue(module.LoadLocalRaceData(filename))
|
||||
self.assertEqual(calls[0], ('load', filename))
|
||||
source = (REFERENCE/filename).read_text(errors='replace')
|
||||
hair_data = source[source.index('Group HairData'):]
|
||||
base = re.search(r'PathName\s+"([^"]+)"', hair_data).group(1).lower()
|
||||
groups = re.findall(r'\{([^{}]+)\}', source)
|
||||
for index, kind in ((40062, 'Shape'), (40063, 'Shape'), (161, 'Hair'), (191, 'Hair')):
|
||||
group = next(g for g in groups if re.search(kind+r'Index\s+'+str(index)+r'\b', g))
|
||||
model = re.search(r'Model\s+"([^"]+)"', group).group(1).lower()
|
||||
skin = re.search(r'TargetSkin\s+"([^"]+)"', group).group(1).lower()
|
||||
if kind == 'Shape':
|
||||
self.assertIn(('SetShapeModel', index, base+model), calls)
|
||||
self.assertIn(('AppendShapeSkin', index, 0, base+skin, base+skin), calls)
|
||||
else:
|
||||
self.assertIn(('SetHairSkin', index, 0, base+model, base+skin, base+skin), calls)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -45,6 +45,8 @@ def stone_lock_reason(cols, E):
|
||||
# Models of the armor shapes the 40250 race msm lack (registered by the client's mt_shapes script): shape ->
|
||||
# model stem ('%s' = race); RACE_PATHS = the ShapeData PathName of each race msm.
|
||||
ARMOR_SHAPES={32:'%s_7_1'}
|
||||
SHOP_ARMOR_SHAPES={40062:'%s_salsa1',40063:'%s_springwear1'}
|
||||
SHOP_HAIRS={161:'hair/hair_16_1',191:'hair/hair_19_1'}
|
||||
RACE_PATHS={'warrior':('pc','pc2'),'assassin':('pc2','pc'),'sura':('pc','pc2'),'shaman':('pc2','pc')} # (male, female)
|
||||
# Kept with their 40250 meaning; everything else becomes ITEM_NONE (see module doc).
|
||||
KEEP_TYPES={'ITEM_MATERIAL','ITEM_QUEST','ITEM_GIFTBOX','ITEM_NONE','ITEM_TREASURE_BOX','ITEM_TREASURE_KEY','ITEM_NEW_RINGS'}
|
||||
@@ -65,6 +67,8 @@ SASH_LOCALE={'locale/en/ui/acce/acce_combine.tga':'locale/zh/ui/acce/acce_combin
|
||||
# target; AVA2 apply numbers in value0 equal 203's (P2 aligned 139/140). The rest stay locked.
|
||||
ENCHANT_KEEP=((54001,54078),(54124,54174))
|
||||
DESC_SUB={('ITEM_USE','USE_CHANGE_ATTRIBUTE'):'拖到未穿戴的对应时装上,附加一条固定属性(每件时装最多 3 条,不能重复)。',
|
||||
('ITEM_COSTUME','COSTUME_BODY'):'时装。装备后改变角色服装外观,附加属性在装备期间生效。',
|
||||
('ITEM_COSTUME','COSTUME_HAIR'):'发型时装。装备后改变角色发型或头饰,附加属性在装备期间生效。',
|
||||
('ITEM_COSTUME','COSTUME_MOUNT'):'坐骑时装。装备后召唤该坐骑(需要已拥有马匹),装备期间属性生效。',
|
||||
('ITEM_COSTUME','COSTUME_MOUNT_SKIN'):'坐骑外观。需先装备坐骑时装,装备后改变坐骑外观。',
|
||||
('ITEM_ARMOR','ARMOR_PENDANT'):'护符。装备在护符栏,对相应属性的怪物伤害提高(强化等级 +1 = +1%)。可用护符强化道具重洗属性,用护符加持道具追加属性(最多 5 条)。'}
|
||||
@@ -110,6 +114,12 @@ def names():
|
||||
for base,label in ((85001,'领主'),(85005,'大师'),(85011,'王朝'),(85015,'皇家')):
|
||||
for grade,suffix in enumerate(('普通','精致','高级','个人')):
|
||||
result[base+grade]=label+'披风('+suffix+')'
|
||||
result.update({41119:'萨尔萨礼服(男)',41120:'萨尔萨舞裙(女)',
|
||||
41121:'绅士礼服(男)',41122:'鸡尾酒礼裙(女)',
|
||||
45005:'莫西干发型(男)',45006:'刘海发型(女)',
|
||||
45057:'博加特礼帽(男)',45058:'花饰发型(女)'})
|
||||
for base,label in ((71500,'狮子'),(71503,'野猪'),(71506,'狼'),(71509,'老虎')):
|
||||
result[base]=label+'封印(7天)';result[base+1]=label+'封印(30天)'
|
||||
for v in sorted(STONE_IDS):result[v]=stone_name(v)
|
||||
result.update({50348:'属性锁定符',50349:'属性解锁符',70002:'第三只手'})
|
||||
for month in range(1,13):result[25149+month]='%d月战令票'%month
|
||||
@@ -124,6 +134,7 @@ def convert(cols,E,imported):
|
||||
(t,st) in (('ITEM_USE','USE_CHANGE_ATTRIBUTE'),('ITEM_USE','USE_ADD_ATTRIBUTE')) and int(c[0]) in PENDANT_SCROLLS) or (
|
||||
int(c[0]) in (50348,50349) and (t,st)==('ITEM_USE','USE_CHANGE_ATTRIBUTE')) or (
|
||||
int(c[0])==70002 and (t,st)==('ITEM_USE','USE_SPECIAL'))
|
||||
if t=='ITEM_COSTUME' and st in ('COSTUME_BODY','COSTUME_HAIR') and int(c[0]) in (41119,41120,41121,41122,45005,45006,45057,45058):kept=True
|
||||
if stone_lock_reason(c,E):kept=False
|
||||
anti=tokens(c[5]);flags=tokens(c[6])
|
||||
if 'ITEM_STACKABLE' in anti:anti.remove('ITEM_STACKABLE');flags.append('ITEM_STACKABLE')
|
||||
@@ -160,6 +171,10 @@ def shape_models():
|
||||
for d in dict.fromkeys(dirs):
|
||||
for stem in ARMOR_SHAPES.values():
|
||||
out+=['d:/ymir work/%s/%s/%s%s'%(d,race,stem%race,e) for e in ('.gr2','.dds','_lod_01.gr2','_lod_02.gr2','_lod_03.gr2')]
|
||||
for stem in SHOP_ARMOR_SHAPES.values():
|
||||
out+=['d:/ymir work/%s/%s/%s%s'%(d,race,stem%race,e) for e in ('.gr2','.dds')]
|
||||
for stem in SHOP_HAIRS.values():
|
||||
out+=['d:/ymir work/%s/%s/%s%s'%(d,race,stem,e) for e in ('.gr2','.dds')]
|
||||
return out
|
||||
|
||||
def effect_files(files):
|
||||
|
||||
@@ -35,11 +35,25 @@ class UIAssetTests(unittest.TestCase):
|
||||
def test_missing_atlas_rejects_pack(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root=Path(tmp);(root/'a.sub').write_bytes(b'version 1.0\nimage "missing.dds"\n')
|
||||
with self.assertRaisesRegex(ValueError,'missing UI subimage atlas'):m.pack_ui_subimages(root,{})
|
||||
with self.assertRaisesRegex(ValueError,'missing or ambiguous UI subimage atlas'):m.pack_ui_subimages(root,{})
|
||||
|
||||
@unittest.skipUnless(READER.is_file(),'needs ../metin2-server')
|
||||
class ConvertTests(unittest.TestCase):
|
||||
E=m.enums(READER) if READER.is_file() else None
|
||||
def test_shop_costume_gender_shape_and_first_use_duration(self):
|
||||
for vnum,subtype,shape in ((41119,'COSTUME_BODY',40062),(41121,'COSTUME_BODY',40063),
|
||||
(45005,'COSTUME_HAIR',161),(45057,'COSTUME_HAIR',191)):
|
||||
server,client,kept=m.convert(row(vnum,'ITEM_COSTUME',subtype,anti='ANTI_FEMALE',values=('0','0','0',str(shape),'0','0')),self.E,{vnum})
|
||||
self.assertTrue(kept)
|
||||
self.assertEqual(server[5],'ANTI_FEMALE')
|
||||
self.assertEqual(server[27],str(shape))
|
||||
for vnum,seconds in ((71500,604800),(71501,2592000)):
|
||||
data=row(vnum,'ITEM_COSTUME','COSTUME_MOUNT',values=('20113','0','0','0','0','0'))
|
||||
data[14:16]=['REAL_TIME_FIRST_USE',str(seconds)]
|
||||
server,client,kept=m.convert(data,self.E,{vnum})
|
||||
self.assertTrue(kept)
|
||||
self.assertEqual(server[14:16],['REAL_TIME_FIRST_USE',str(seconds)])
|
||||
self.assertEqual(server[24],'20113')
|
||||
def test_weapon_kept_without_unknown_flags(self):
|
||||
s,c,kept=m.convert(row(320,'ITEM_WEAPON','WEAPON_SWORD','ANTI_MUDANG | ANTI_WOLFMAN','ITEM_TUNABLE','WEAR_WEAPON',
|
||||
('APPLY_ATT_SPEED','18','APPLY_ATTBONUS_BOSS','5','APPLY_NONE','0'),refine=('321','81')),self.E,{320})
|
||||
@@ -90,8 +104,10 @@ class ConvertTests(unittest.TestCase):
|
||||
('APPLY_MOV_SPEED','5','APPLY_RESIST_MAGIC','25','APPLY_MAX_HP_PCT','20'),('0','210','0','32','0','0'),('21211','81')),self.E,{21210,21211})
|
||||
self.assertTrue(kept);self.assertEqual(s[3],'ARMOR_BODY');self.assertEqual(s[7],'WEAR_BODY');self.assertEqual(s[11:13],['21211','81'])
|
||||
self.assertEqual(s[5],'ANTI_ASSASSIN | ANTI_SURA | ANTI_MUDANG');self.assertEqual(s[27],'32') # value3 = armor shape
|
||||
models=m.shape_models();self.assertEqual(len(models),40)
|
||||
models=m.shape_models()
|
||||
self.assertIn('d:/ymir work/pc2/warrior/warrior_7_1_lod_03.gr2',models)
|
||||
self.assertIn('d:/ymir work/pc2/warrior/warrior_salsa1.gr2',models)
|
||||
self.assertIn('d:/ymir work/pc/sura/hair/hair_19_1.dds',models)
|
||||
def test_sash_kept(self):
|
||||
s,c,kept=m.convert(row(85004,'ITEM_COSTUME','COSTUME_SASH',wear='WEAR_COSTUME_BODY',
|
||||
values=('4','0','0','0','0','0')),self.E,{85004})
|
||||
@@ -178,7 +194,8 @@ class ConvertTests(unittest.TestCase):
|
||||
self.assertEqual(m.names()[70002],'第三只手')
|
||||
|
||||
def test_names_cover_ranges(self):
|
||||
n=m.names();self.assertEqual(len(n),518+6*200+4*9+14+12+136+1);self.assertEqual(n[54100],'武器外观强化石')
|
||||
n=m.names();self.assertEqual(n[54100],'武器外观强化石')
|
||||
self.assertTrue({41119,41120,41121,41122,45005,45006,45057,45058,71500,71501,71503,71504,71506,71507,71509,71510}.issubset(n))
|
||||
self.assertEqual([n[v] for v in (21210,21219,21279)],['暗龙铠甲+0','暗龙铠甲+9','神龙铠甲+9'])
|
||||
self.assertTrue(all(len(v.encode('gbk'))<=24 for v in n.values()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user