Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e313d9ea85 | ||
|
|
f09ffd8a35 | ||
|
|
6199b2cbff | ||
|
|
fb066e7046 | ||
|
|
c30258ef5e | ||
|
|
14c4491469 | ||
|
|
5ad07886ea | ||
|
|
89261fdf8a | ||
|
|
38b62cfdbd | ||
|
|
cd395c73b7 |
@@ -0,0 +1,38 @@
|
||||
# AVA2 drop tables
|
||||
|
||||
203 drops what AVA2 drops. Tables: `tools/ava2-drops/make_drops.py`. Code: `ITEM_MANAGER::ReadCommonDropNewItemFile` (item_manager_read_tables.cpp), the common-drop block and `GetDropPct` in item_manager.cpp, the load in input_db.cpp. The items AVA2 drops that 40250 lacks come from metin2-client `tools/server/ava2-items` and must be installed in the same deploy (the readers fail on an unknown item vnum and the core stops).
|
||||
|
||||
## Tables
|
||||
|
||||
Built by `make_drops.py <AVA2 locale dir> <203 locale dir> <out dir> <item_proto.txt>...`, the protos being every row the db will load (live item_proto.txt + ava2-items' items-server.tsv).
|
||||
|
||||
| File | Content |
|
||||
|---|---|
|
||||
| mob_drop_item.txt | AVA2's 247 `drop` groups. Entries with an unknown item are removed and the rest renumbered: the reader stops at the first missing index. |
|
||||
| common_drop_new.txt | AVA2's 26 level-range common groups (new file, see below). |
|
||||
| special_item_group.txt | 203's groups; AVA2's groups replace those of the same box vnum (50011, 50082, 50186, 50255) and AVA2-only boxes are added. 50035 keeps 203's group: it is the children's day box on 203 but a GM box on AVA2. |
|
||||
| common_drop_item.txt, etc_drop_item.txt | empty, as on AVA2. |
|
||||
|
||||
`report.json` lists group counts, removed items and replaced boxes.
|
||||
|
||||
## common_drop_new.txt
|
||||
|
||||
```
|
||||
Group <name>
|
||||
{
|
||||
map_index 0 # 0 = every map, otherwise the maps listed
|
||||
level_range <min> <max> # killer level
|
||||
<n> <item vnum> <count> <pct> # pct as a float, chance = pct / 100
|
||||
}
|
||||
```
|
||||
|
||||
A group drops when the monster level is within 20 of the killer, the killer level is in `level_range` and the map matches. Each entry is rolled against `GetDropPct`'s range (base 4,000,000) with probability `pct × 40000`. A missing file is logged and skipped; a parse error or unknown item fails the boot like the other drop files.
|
||||
|
||||
## Changes to the drop code (from AVA2)
|
||||
|
||||
- `GetDropPct`: premium item or glove doubles the drop rate, otherwise +50%; the permanent glove adds 100 (50 with premium) to the denominator bonus. `iRandRange = 4000000 * 100 / (100 + priv + bonus)`; 203 had an operator-precedence bug that fixed the divisor at 100.
|
||||
- PC-bang bonus removed. The event-manager bonus is not ported (203 has no ENABLE_EVENT_MANAGER).
|
||||
- A mob with two `drop` groups no longer reads an uninitialised group pointer.
|
||||
- special_item_group.txt groups may have up to 1023 entries (AVA2's cofreskindop boxes have 267).
|
||||
|
||||
The wiki (`/mt_features ... mob`) lists common_drop_new rows as rule 0 (FEATURE-QUERY-PROTOCOL.md). Not ported: AVA2's `/reload y`; quest-script and hardcoded drops are not compared.
|
||||
@@ -0,0 +1,140 @@
|
||||
# AVA2 items: unlocking the locked systems
|
||||
|
||||
The 478 AVA2 drop items come from metin2-client `tools/server/ava2-items` (see FEATURE-AVA2-DROPS.md). Items of systems 40250 lacks were imported as ITEM_NONE. This branch turns them back into usable items one system at a time. Each phase keeps the AVA2 row (type, subtype, values, applies) once the server and client understand it.
|
||||
|
||||
| Phase | Items | State |
|
||||
|---|---|---|
|
||||
| P1 boxes and keys | 77918–77920 boxes, 77921–77923 keys (`ITEM_TREASURE_BOX` / `ITEM_TREASURE_KEY`, value0 3–5) | done |
|
||||
| P2 stones | 28444 破碑之石+4 (`APPLY_ATTBONUS_STONE`), 28445 Boss stone (`APPLY_ATTBONUS_BOSS`) | done |
|
||||
| P3 dragon armor | 21210–21219 暗龙 (warrior), 21230– 风龙 (assassin), 21250– 魔龙 (sura), 21270– 神龙 (shaman), +0..+9 | done (client) |
|
||||
| P4 sash | 85004 领主 / 85008 大师 / 85014 王朝 / 85018 皇家 披风 (`COSTUME_SASH`, grade 4) | done, not deployed |
|
||||
| P5 mounts | 71502 / 71505 / 71508 / 71511 坐骑时装 (`COSTUME_MOUNT`), 71234 / 71254 坐骑外观 (`COSTUME_MOUNT_SKIN`) + mobs 32012 / 32028 | done, not deployed |
|
||||
| P6 costume enchants | 54001–54078 时装 / 发型强化石, 54124–54174 坐骑外观强化石 (`USE_CHANGE_ATTRIBUTE`); weapon / sash-skin / effect ranges and 53996 stay locked | done, not deployed |
|
||||
| P7 talismans | 护符 chains 9600–10950 (`ARMOR_PENDANT`, +0..+200 per element), 71301 / 71302 / 53996 / 53997 talisman attribute items | done, not deployed |
|
||||
| P8 new rings | 戒指 chains 19500 红宝石 / 19520 石榴石 / 19540 祖母绿 / 19560 蓝宝石 (`ITEM_NEW_RINGS`, +0..+9) | done, not deployed |
|
||||
|
||||
## P1: boxes and keys
|
||||
|
||||
40250 already has both types. A key opens a box when their value0 match (char_item.cpp, `ITEM_TREASURE_KEY`); the box then hands out its special_item_group group (live since the drops deploy). 203's own boxes use value0 0–2, so AVA2's 3–5 don't clash.
|
||||
|
||||
## P2: stone and Boss bonus
|
||||
|
||||
The points exist from the biolog port (POINT_ATTBONUS_STONE 240, POINT_ATTBONUS_BOSS 241, damage in battle.cpp); the apply types did not.
|
||||
|
||||
- `APPLY_ATTBONUS_STONE = 139`, `APPLY_ATTBONUS_BOSS = 140` (common/length.h), the same numbers as AVA2 and the client (`ItemData.h`). 92–138 are reserved for AVA2 applies not ported yet: `aApplyInfo` maps them to POINT_NONE and ProtoReader's `arApplyType` names them `APPLY_RESERVED_<n>`, so array index = apply number.
|
||||
- `CHARACTER::ApplyPoint` handles both like the other additive applies.
|
||||
- ProtoReader is in the db, so **the db binary must be redeployed with the game**; an old db rejects the items' `APPLY_ATTBONUS_*` columns.
|
||||
- The two stones share AVA2's stone family 31 (value5), so a weapon holds only one of them. The 7 guardian weapons keep their AVA2 `APPLY_ATTBONUS_BOSS 5`.
|
||||
|
||||
Test: `tests/features/test_applies.py` (numbering in length.h, constants.cpp, ProtoReader and the client header).
|
||||
|
||||
## P3: dragon armor
|
||||
|
||||
Ordinary `ARMOR_BODY` items; the server needed nothing. All ten refine steps are imported so the refine chain (refine sets 81–89, 203's own costs) works; +9 ends the chain.
|
||||
|
||||
The look is armor shape 32 (value3). The 40250 race msm stop at shape 30, and they cannot be patched from a pack (a bare file name always comes from the root pack). The client therefore registers the shape after each race msm load: script `mt_shapes` (metin2-client `src/platform/ScriptLib/ArmorShapesScript.inc`). The models `<race>_7_1.gr2` (+ LODs, skin) ship in the ava2items pack.
|
||||
|
||||
**Open:** AVA2 requires level 115–120. 203 caps at MAX_LEVEL 105, so nobody can wear the armor, nor the guardian weapons (level 120) already live.
|
||||
|
||||
## P4: sash
|
||||
|
||||
AVA2's sash (acce) system, ported from `Srcs/Server` (`#ifdef __SASH_SYSTEM__`) into `game/src/port_sash.cpp`.
|
||||
|
||||
- Item: `ITEM_COSTUME` / `COSTUME_SASH = 3` (ProtoReader `arSub28`, so **the db binary changes too**). value0 = grade (the four imported sashes are grade 4); socket0 = absorption %, socket1 = vnum of the absorbed weapon/armor. An unrolled grade-4 sash gets 11–25 % on first equip/creation (`SASH_GRADE_4_ABS_*`), combining caps at 19 %.
|
||||
- Slot `WEAR_COSTUME_SASH = 24`; `PART_SASH` follows `PART_HAIR`. The part is not stored in the player table: `SetPlayerProto` clears it and the equipped sash sets it to vnum − 85000, +1000 once absorption reaches 19 % (the client shows the glow above 86000).
|
||||
- **Protocol:** `CHR_EQUIPPART_SASH` is a fifth `awPart` WORD in GC_CHARACTER_ADD / ADD2 / UPDATE, `HEADER_CG_SASH = 211`, `HEADER_GC_SASH = 215`. Old clients break; the server and the client deploy together.
|
||||
- Absorbed bonuses: the sash adds the absorbed item's applies, attributes and (weapons) attack values scaled by absorption, `int(v*abs/100 + .5)` (+1 when positive), in `CItem::ModifyPoints` and battle.cpp. `MTSASH <code>` chat commands report window errors and results to the client (`mt_sash`).
|
||||
- Combine: two sashes of the same grade, price 100k/200k/300k/500k by grade, success 80/70/50/30 %. Absorb: sash + weapon/armor, the material is destroyed.
|
||||
- Window: quest `sash` on 王铁匠 20016 (203 has no NPC 60003), `pc.open_sash(true)` combine / `(false)` absorb: metin2-client `tools/server/sash` (installs `pc.open_sash` into quest_functions).
|
||||
- Client: `src/platform/ScriptLib/SashScript.inc` (`mt_sash`: windows, costume slot, tooltips), models + `item_scale.txt` + effects in the ava2items pack.
|
||||
|
||||
Test: `tests/features/test_sash.py` (numbering, packet layout shared with the client header, quest hook).
|
||||
|
||||
## P5: mount costume and mount skin
|
||||
|
||||
AVA2's `ENABLE_MOUNT_COSTUME_SYSTEM` + `ENABLE_MOUNT_SKIN`, ported 1:1 into `game/src/port_mount.cpp`. They ride on the 40250 horse: the worn costume only changes the horse race.
|
||||
|
||||
- Items: `ITEM_COSTUME` / `COSTUME_MOUNT = 2` and `COSTUME_MOUNT_SKIN = 4` (AVA2 numbers the skin 7; ProtoReader `arSub28` gains `COSTUME_MOUNT_SKIN`, so **the db binary changes again**). value0 = horse race.
|
||||
- 71502 狮子 20113 (怪物强悍 +30 %), 71505 野猪 20110 (破碑 +30 %), 71508 狼 20111 (Boss +30 %), 71511 20112 (双倍经验 30 %).
|
||||
- The applies count while the costume is worn.
|
||||
- Skins 71234 蓝色巴里 → 32012, 71254 白色冬日羊驼 → 32028.
|
||||
- Both subtypes return no attribute set (`GetAttributeSetIndex` −1, the sash too), so they cannot be rerolled.
|
||||
- Slots `WEAR_COSTUME_MOUNT = 25` and `WEAR_COSTUME_MOUNT_SKIN = 26`.
|
||||
- `GetMyHorseVnum`: the worn skin's value0, else the worn mount's value0, else the horse-level race.
|
||||
- Summoning and riding still need horse level ≥ 1, as on AVA2; equipping without a horse says `MTMOUNT need_horse`.
|
||||
- Riding uses horse stamina.
|
||||
- Hooks follow AVA2:
|
||||
- Equipping re-summons.
|
||||
- Taking the mount off sends the horse away; taking the skin off re-summons.
|
||||
- A skin needs a worn mount (`need_mount`). Neither piece changes while riding (`riding`). The mount stays while a skin is worn (`has_skin`).
|
||||
- A worn mount is summoned on login.
|
||||
- `/user_horse_back` also takes the mount off.
|
||||
- Mobs 32012 / 32028 come from the AVA2 mob_proto rows (`mobs-server.tsv`, installed by `install_items.py … <mobs-server.tsv>`).
|
||||
- Client:
|
||||
- RaceManager `__IsNewMountRace` (32000–32100 → `npc_mount`).
|
||||
- `mt_mount` (`MountScript.inc`) registers the npclist rows, adds the costume window slots and renders the `MTMOUNT` messages.
|
||||
- The models ship in the ava2items pack (`MOUNT_MOBS`).
|
||||
|
||||
Test: `tests/features/test_mount.py`.
|
||||
|
||||
## P6: costume enchants
|
||||
|
||||
AVA2's `ENABLE_SPECIAL_COSTUME_ATTR`, in `game/src/port_costume_attr.cpp`. The items are `ITEM_USE` / `USE_CHANGE_ATTRIBUTE`. value0 is the apply type and value1 the value; AVA2 apply numbers equal 203's (P2 aligned 139/140). value2 is the target mask `1 << bonus flag`.
|
||||
|
||||
- Unlocked ranges (make_items `ENCHANT_KEEP`):
|
||||
- 54001–54027 时装 (mask 2, body);
|
||||
- 54028–54078 发型 (4, hair);
|
||||
- 54124–54174 坐骑外观 (16, mount skin).
|
||||
- Still locked, since the target systems don't exist here: 54079– weapon costume (8), 54175– sash skin (32), 54220– effect (64). 53996 became a talisman item in P7.
|
||||
- `CItem::IsCostumeEnchant` (vnum 54001–54267 with a nonzero value2) is checked first in the change/add-attribute case of `UseItemEx`, before the 40250 costume refusal. So an enchant never reaches the reroll code, and dragged onto gear it is refused (`MTCATTR target`).
|
||||
- `CostumeEnchantUse` follows AVA2's checks:
|
||||
- target kind and mask (`target`);
|
||||
- apply none (`none`);
|
||||
- not while worn (`equipped`, the 40250 switcher rule);
|
||||
- at most 3 attributes (`full`);
|
||||
- no duplicate apply (`has`).
|
||||
- Then `AddAttribute`, consume one, `ItemLog COSTUME_ENCHANT`, `done`.
|
||||
- The switchbot does not accept enchants as scrolls, on either the server (`PortSwitchScroll`) or the client.
|
||||
- Client `mt_costume_attr` (`CostumeAttrScript.inc`):
|
||||
- marks matching costumes as usable drop targets (the 40250 inventory already sends every `USE_CHANGE_ATTRIBUTE` drop);
|
||||
- adds the attribute and targets to the enchant tooltip;
|
||||
- renders `MTCATTR`.
|
||||
|
||||
Test: `tests/features/test_costume_attr.py`.
|
||||
|
||||
## P7: talismans
|
||||
|
||||
AVA2's `ITEM_TALISMAN_EQUIPMENT` + `ELEMENT_NEW_BONUSES`, in `game/src/port_pendant.cpp`.
|
||||
|
||||
- Item: `ITEM_ARMOR` / `ARMOR_PENDANT = 7` (ProtoReader `arSub2`, so **the db binary changes again**), worn in `WEAR_PENDANT = 27`. The AVA2 wear flag `WEAR_PENDANT` does not exist here: `FindEquipCell` sends every talisman to the slot before the wear-flag check.
|
||||
- Six chains of 201 items (+0..+200), fire 9600, ice 9830, earth 10060, dark 10290, wind 10520, elect 10750. Each carries `APPLY_ENCHANT_<element>` = its step; the level limit rises from 20 to 60 along the chain.
|
||||
- Refine sets 440–499 (fragment 96001–96006 + 30031 + 33031 ×10, 50000 yang, 100 %) are SQL rows: metin2-client `tools/server/pendant` (`install.sh`, then restart the db).
|
||||
- Applies `APPLY_ENCHANT_ELEC..DARK = 123..128` (AVA2 numbers; the db names are AVA2's, `APPLY_ENCHANT_ELECT` first) → `POINT_ENCHANT_* = 242..247`.
|
||||
- Damage (battle.cpp `CalcAttBonus`): against a monster with `RACE_FLAG_ATT_<element>`, attack +point %, so a +200 talisman triples the attack on those monsters (×(1+200/100)), which is AVA2's own balance. Each flag is its own `if`, as on AVA2. AVA2 leaves out ICE; we include it, since 203 has 83 ice monsters and an ice talisman chain.
|
||||
- Attributes:
|
||||
- The pool is AVA2's item_attr pendant column (20 rows, levels 1–5), kept in a table in `port_pendant.cpp` instead of a new item_attr column (that would change the db boot packet).
|
||||
- `GetAttributeSetIndex` stays −1. So talismans drop without attributes, and the 40250 switchers, the switchbot and the attribute lock refuse them.
|
||||
- 71302 rerolls all attributes (needs at least one; levels 0/10/40/35/15 %). 71301 adds one up to 5, always succeeding (levels 40/50/10 %). No duplicates.
|
||||
- **Deviation:** AVA2's 53996 / 53997 are generic switcher / adder items, a free 40250 gear reroll. Here they work like 71302 / 71301, as their zh names (护符附魔道具 / 护符加持道具) say.
|
||||
- Not while worn (`equipped`), like the 40250 switcher. Any other attribute item dropped on a talisman, or a talisman item dropped on anything else, gets `target`.
|
||||
- Messages: `MTPENDANT target|equipped|empty|changed|full|added` (client `mt_pendant`). `ItemLog PENDANT_CHANGE` / `PENDANT_ADD`.
|
||||
- Not ported: AVA2's element target packet (`ELEMENT_TARGET`, the element icon over the target HP bar).
|
||||
- Client: `ItemData.h` / `PythonItemModule` constants, `c_Equipment_Pendant`, apply texts, and `mt_pendant` (`PendantScript.inc`: the equipment slot under the earring, item drop targets, messages).
|
||||
|
||||
Test: `tests/features/test_pendant.py`; `test_applies.py` covers the 123–128 numbering.
|
||||
|
||||
## P8: new rings
|
||||
|
||||
AVA2's `ENABLE_NEW_RINGS`, in `game/src/port_rings.cpp`.
|
||||
|
||||
- Item: `ITEM_NEW_RINGS = 36` (`ITEM_SHINING = 35` is reserved for the AVA2 numbering and not ported). It is a new ProtoReader type, so **the db binary changes again**. Worn in `WEAR_RINGS_1 = 28` / `WEAR_RINGS_2 = 29`: `FindEquipCell` takes ring slot 1 when free, else slot 2. Rings have no wear flag.
|
||||
- Four chains of 10 (+0..+9). Each step carries a stat (INT / DEX / STR / CON) and a resist against one class. Level limit 90 (203's MAX_LEVEL is 105). They reuse 203's refine sets 46–54, which already have AVA2's materials, so no refine SQL is needed.
|
||||
- Sockets: rings are socket accessories (`IsAccessoryForSocket`). Drills add sockets (up to 3). As with every socket or attribute item in 40250, the ring must not be worn. Each family takes its AVA2 jewel (`CanPutInto`): 19500 → 50635, 19520 → 50636, 19540 → 50637, 19560 → 50638 (19220 → 50634 is in the table, but that family is not imported).
|
||||
- Attributes:
|
||||
- The pool is AVA2's `item_attr_rings` (20 rows, levels 1–5), kept as a table in `port_rings.cpp`. `GetAttributeSetIndex` stays −1, and `PutAttributeWithLevel` branches to the ring pool.
|
||||
- The 40250 switchers and adders (`USE_CHANGE_ATTRIBUTE`, `USE_ADD_ATTRIBUTE`, `USE_ADD_ATTRIBUTE2`) accept rings, with the usual not-while-worn rule. 71151 / 71152 (weapon / armor only) refuse them, by design.
|
||||
- The switchbot and the rare (6th / 7th) attributes skip rings. AVA2's `item_attr_rare_rings` is not ported.
|
||||
- Rings drop without attributes: `AlterToMagicItem` only handles weapons and armor.
|
||||
- Client: `ITEM_TYPE_RINGS`, `c_Equipment_Rings1/2` (253 / 254), and `mt_rings` (`RingsScript.inc`). That module adds the two slots beside the shoes, the accessory tooltip (applies, attributes, jewel sockets) and the drop targets for drills, jewels, switchers and adders.
|
||||
|
||||
Test: `tests/features/test_rings.py`.
|
||||
@@ -47,7 +47,7 @@ final VNUM COUNT [VNUM COUNT]x0..5
|
||||
|
||||
A kill counts for the player that `CHARACTER::Reward` gives the quest kill event to, which is the `DistributeExp` attacker. As in AVA2, it counts only when the monster is within 20 levels of the player. A party member who is not that attacker gets nothing. Type 9 needs a vnum because selling any item could be farmed with cheap shop items.
|
||||
|
||||
The shipped file has seasons 202610–202612, starting at local midnight on the first of each month (Europe/Berlin, the server's zone). Each has:
|
||||
The shipped file has seasons 202610–202712 (through 2028-01-01), starting at local midnight on the first of each month (Europe/Berlin, the server's zone). Each has:
|
||||
- eight missions, rewards taken from 40250 items;
|
||||
- a final reward of the three pearls and 70024.
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ Rules:
|
||||
|
||||
| RULE | Meaning of MIN/MAX and weights |
|
||||
|---|---|
|
||||
| 0 | rank common drop; MIN/MAX = eligible player levels |
|
||||
| 0 | rank common drop (common_drop_item.txt) or level-range common drop (common_drop_new.txt, MIN/MAX clipped to monster level ±20); MIN/MAX = eligible player levels |
|
||||
| 1 | independent monster drop group; weight is original configured threshold, not final probability |
|
||||
| 2 | weighted kill group; MIN = original kill-per-drop parameter; weight/group total describe the conditional selection |
|
||||
| 3 | level group; MIN = player minimum level; original denominator 1,000,000 |
|
||||
|
||||
@@ -76,6 +76,8 @@ enum EItemTypes
|
||||
ITEM_SECONDARY_COIN, //32 ?? 명도전??
|
||||
ITEM_RING, //33 반지
|
||||
ITEM_BELT, //34 벨트
|
||||
ITEM_SHINING, //35 AVA2 shining (not ported, keeps the AVA2 numbering)
|
||||
ITEM_NEW_RINGS, //36 AVA2 new rings (port_rings.cpp), worn in WEAR_RINGS_1/2
|
||||
};
|
||||
|
||||
enum EMetinSubTypes
|
||||
@@ -106,6 +108,7 @@ enum EArmorSubTypes
|
||||
ARMOR_FOOTS,
|
||||
ARMOR_NECK,
|
||||
ARMOR_EAR,
|
||||
ARMOR_PENDANT, // 7 AVA2 talisman (ITEM_TALISMAN_EQUIPMENT), worn in WEAR_PENDANT
|
||||
ARMOR_NUM_TYPES
|
||||
};
|
||||
|
||||
@@ -113,6 +116,9 @@ enum ECostumeSubTypes
|
||||
{
|
||||
COSTUME_BODY = ARMOR_BODY, // [중요!!] ECostumeSubTypes enum value는 종류별로 EArmorSubTypes의 그것과 같아야 함.
|
||||
COSTUME_HAIR = ARMOR_HEAD, // 이는 코스츔 아이템에 추가 속성을 붙이겠다는 사업부의 요청에 따라서 기존 로직을 활용하기 위함임.
|
||||
COSTUME_MOUNT = 2, // AVA2 mount costume (value0 = horse race)
|
||||
COSTUME_SASH = 3, // AVA2 sash (85001..85024)
|
||||
COSTUME_MOUNT_SKIN = 4, // AVA2 mount skin (value0 = horse race, needs COSTUME_MOUNT)
|
||||
COSTUME_NUM_TYPES,
|
||||
};
|
||||
|
||||
@@ -368,4 +374,30 @@ enum ERefineType
|
||||
REFINE_TYPE_BDRAGON,
|
||||
};
|
||||
|
||||
// AVA2 sash: combine two sashes of one grade into the next grade / absorb a weapon or body armor.
|
||||
enum ESashInfo
|
||||
{
|
||||
SASH_GRADE_VALUE_FIELD = 0, // item value0 = grade 1..4
|
||||
SASH_ABSORPTION_SOCKET = 0, // socket0 = absorption %
|
||||
SASH_ABSORBED_SOCKET = 1, // socket1 = vnum of the absorbed item
|
||||
SASH_GRADE_1_ABS = 1,
|
||||
SASH_GRADE_2_ABS = 5,
|
||||
SASH_GRADE_3_ABS = 10,
|
||||
SASH_GRADE_4_ABS_MIN = 11,
|
||||
SASH_GRADE_4_ABS_MAX = 25,
|
||||
SASH_GRADE_4_ABS_MAX_COMB = 19,
|
||||
SASH_GRADE_4_ABS_RANGE = 5,
|
||||
SASH_EFFECT_FROM_ABS = 19,
|
||||
SASH_CLEAN_ATTR_VALUE0 = 7,
|
||||
SASH_WINDOW_MAX_MATERIALS = 2,
|
||||
SASH_GRADE_1_PRICE = 100000,
|
||||
SASH_GRADE_2_PRICE = 200000,
|
||||
SASH_GRADE_3_PRICE = 300000,
|
||||
SASH_GRADE_4_PRICE = 500000,
|
||||
SASH_COMBINE_GRADE_1 = 80,
|
||||
SASH_COMBINE_GRADE_2 = 70,
|
||||
SASH_COMBINE_GRADE_3 = 50,
|
||||
SASH_COMBINE_GRADE_4 = 30,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -137,6 +137,12 @@ enum EWearPositions
|
||||
WEAR_RING2, // 22 : 신규 반지슬롯2 (오른쪽)
|
||||
|
||||
WEAR_BELT, // 23 : 신규 벨트슬롯
|
||||
WEAR_COSTUME_SASH, // 24 : AVA2 sash
|
||||
WEAR_COSTUME_MOUNT, // 25 : AVA2 mount costume
|
||||
WEAR_COSTUME_MOUNT_SKIN, // 26 : AVA2 mount skin
|
||||
WEAR_PENDANT, // 27 : AVA2 talisman (ARMOR_PENDANT)
|
||||
WEAR_RINGS_1, // 28 : AVA2 new ring (ITEM_NEW_RINGS)
|
||||
WEAR_RINGS_2, // 29 : AVA2 new ring
|
||||
|
||||
WEAR_MAX = 32 //
|
||||
};
|
||||
@@ -247,6 +253,7 @@ enum EParts
|
||||
PART_WEAPON,
|
||||
PART_HEAD,
|
||||
PART_HAIR,
|
||||
PART_SASH,
|
||||
|
||||
PART_MAX_NUM,
|
||||
PART_WEAPON_SUB,
|
||||
@@ -437,6 +444,18 @@ enum EApplyTypes
|
||||
APPLY_ANTI_PENETRATE_PCT, //91 관통타격 저항
|
||||
|
||||
|
||||
// PORT AVA2 bonus numbering (AVA2 common/length.h): 92-138 are AVA2 applies not ported yet,
|
||||
// kept free so later ports and the client item_proto keep AVA2's numbers.
|
||||
// AVA2 ELEMENT_NEW_BONUSES: attack bonus % against monsters of the element (RACE_FLAG_ATT_*), on the talismans.
|
||||
APPLY_ENCHANT_ELEC = 123,
|
||||
APPLY_ENCHANT_FIRE = 124,
|
||||
APPLY_ENCHANT_ICE = 125,
|
||||
APPLY_ENCHANT_WIND = 126,
|
||||
APPLY_ENCHANT_EARTH = 127,
|
||||
APPLY_ENCHANT_DARK = 128,
|
||||
APPLY_ATTBONUS_STONE = 139,
|
||||
APPLY_ATTBONUS_BOSS = 140,
|
||||
|
||||
MAX_APPLY_NUM, //
|
||||
};
|
||||
|
||||
@@ -670,6 +689,8 @@ enum SPECIAL_EFFECT
|
||||
SE_EQUIP_HALLOWEEN_CANDY, // 할로윈 사탕을 착용(-_-;)한 순간에 발동하는 이펙트
|
||||
SE_EQUIP_HAPPINESS_RING, // 크리스마스 행복의 반지(71143) 착용할 때 이펙트 (발동이펙트임, 지속이펙트 아님)
|
||||
SE_EQUIP_LOVE_PENDANT, // 발렌타인 사랑의 팬던트(71145) 착용할 때 이펙트 (발동이펙트임, 지속이펙트 아님)
|
||||
SE_EFFECT_SASH_SUCCEDED, // AVA2 sash combine success
|
||||
SE_EFFECT_SASH_EQUIP,
|
||||
} ;
|
||||
|
||||
enum ETeenFlags
|
||||
|
||||
@@ -79,6 +79,7 @@ int get_Item_Type_Value(string inputString)
|
||||
|
||||
"ITEM_RING",
|
||||
"ITEM_BELT", //35개 (EItemTypes 값으로 치면 34)
|
||||
"ITEM_SHINING", "ITEM_NEW_RINGS", // AVA2 35 (not ported), 36 new rings
|
||||
};
|
||||
|
||||
|
||||
@@ -103,7 +104,7 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
||||
static string arSub1[] = { "WEAPON_SWORD", "WEAPON_DAGGER", "WEAPON_BOW", "WEAPON_TWO_HANDED",
|
||||
"WEAPON_BELL", "WEAPON_FAN", "WEAPON_ARROW", "WEAPON_MOUNT_SPEAR"};
|
||||
static string arSub2[] = { "ARMOR_BODY", "ARMOR_HEAD", "ARMOR_SHIELD", "ARMOR_WRIST", "ARMOR_FOOTS",
|
||||
"ARMOR_NECK", "ARMOR_EAR", "ARMOR_NUM_TYPES"};
|
||||
"ARMOR_NECK", "ARMOR_EAR", "ARMOR_PENDANT", "ARMOR_NUM_TYPES"};
|
||||
static string arSub3[] = { "USE_POTION", "USE_TALISMAN", "USE_TUNING", "USE_MOVE", "USE_TREASURE_BOX", "USE_MONEYBAG", "USE_BAIT",
|
||||
"USE_ABILITY_UP", "USE_AFFECT", "USE_CREATE_STONE", "USE_SPECIAL", "USE_POTION_NODELAY", "USE_CLEAR",
|
||||
"USE_INVISIBILITY", "USE_DETACHMENT", "USE_BUCKET", "USE_POTION_CONTINUE", "USE_CLEAN_SOCKET",
|
||||
@@ -122,7 +123,7 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
||||
"RESOURCE_STONE", "RESOURCE_METIN", "RESOURCE_ORE" };
|
||||
static string arSub16[] = { "UNIQUE_NONE", "UNIQUE_BOOK", "UNIQUE_SPECIAL_RIDE", "UNIQUE_3", "UNIQUE_4", "UNIQUE_5",
|
||||
"UNIQUE_6", "UNIQUE_7", "UNIQUE_8", "UNIQUE_9", "USE_SPECIAL"};
|
||||
static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR" };
|
||||
static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR", "COSTUME_MOUNT", "COSTUME_SASH", "COSTUME_MOUNT_SKIN" };
|
||||
static string arSub29[] = { "DS_SLOT1", "DS_SLOT2", "DS_SLOT3", "DS_SLOT4", "DS_SLOT5", "DS_SLOT6" };
|
||||
static string arSub31[] = { "EXTRACT_DRAGON_SOUL", "EXTRACT_DRAGON_HEART" };
|
||||
|
||||
@@ -161,6 +162,8 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
||||
0, //32
|
||||
0, //33 반지
|
||||
0, //34 벨트
|
||||
0, //35 ITEM_SHINING
|
||||
0, //36 ITEM_NEW_RINGS
|
||||
};
|
||||
static int arNumberOfSubtype[_countof(arSubType)] = {
|
||||
0,
|
||||
@@ -198,6 +201,8 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
||||
0, // 32
|
||||
0, // 33 반지
|
||||
0, // 34 벨트
|
||||
0, // 35
|
||||
0, // 36
|
||||
};
|
||||
|
||||
|
||||
@@ -393,6 +398,14 @@ int get_Item_ApplyType_Value(string inputString)
|
||||
"APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN",
|
||||
"APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER",
|
||||
"APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT",
|
||||
// PORT AVA2 numbering: 92-138 not ported yet (common/length.h)
|
||||
"APPLY_RESERVED_92", "APPLY_RESERVED_93", "APPLY_RESERVED_94", "APPLY_RESERVED_95", "APPLY_RESERVED_96", "APPLY_RESERVED_97", "APPLY_RESERVED_98", "APPLY_RESERVED_99",
|
||||
"APPLY_RESERVED_100", "APPLY_RESERVED_101", "APPLY_RESERVED_102", "APPLY_RESERVED_103", "APPLY_RESERVED_104", "APPLY_RESERVED_105", "APPLY_RESERVED_106", "APPLY_RESERVED_107",
|
||||
"APPLY_RESERVED_108", "APPLY_RESERVED_109", "APPLY_RESERVED_110", "APPLY_RESERVED_111", "APPLY_RESERVED_112", "APPLY_RESERVED_113", "APPLY_RESERVED_114", "APPLY_RESERVED_115",
|
||||
"APPLY_RESERVED_116", "APPLY_RESERVED_117", "APPLY_RESERVED_118", "APPLY_RESERVED_119", "APPLY_RESERVED_120", "APPLY_RESERVED_121", "APPLY_RESERVED_122", "APPLY_ENCHANT_ELECT",
|
||||
"APPLY_ENCHANT_FIRE", "APPLY_ENCHANT_ICE", "APPLY_ENCHANT_WIND", "APPLY_ENCHANT_EARTH", "APPLY_ENCHANT_DARK", "APPLY_RESERVED_129", "APPLY_RESERVED_130", "APPLY_RESERVED_131",
|
||||
"APPLY_RESERVED_132", "APPLY_RESERVED_133", "APPLY_RESERVED_134", "APPLY_RESERVED_135", "APPLY_RESERVED_136", "APPLY_RESERVED_137", "APPLY_RESERVED_138",
|
||||
"APPLY_ATTBONUS_STONE", "APPLY_ATTBONUS_BOSS",
|
||||
};
|
||||
|
||||
int retInt = -1;
|
||||
|
||||
@@ -61,7 +61,7 @@ CPPFILE = BattleArena.cpp FSM.cpp MarkConvert.cpp MarkImage.cpp MarkManager.cpp
|
||||
desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\
|
||||
entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\
|
||||
guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\
|
||||
input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp port_attr_lock.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
|
||||
input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp port_rings.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
|
||||
item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\
|
||||
locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp matrix_card.cpp\
|
||||
messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\
|
||||
|
||||
@@ -287,6 +287,20 @@ int CalcAttBonus(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, int iAtk)
|
||||
else if (pkVictim->IsRaceFlag(RACE_FLAG_TREE))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_TREE)) / 100;
|
||||
|
||||
// PORT AVA2 ELEMENT_NEW_BONUSES (talisman enchant), each flag on its own like AVA2; AVA2 forgot ICE.
|
||||
if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_ELEC))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ENCHANT_ELEC)) / 100;
|
||||
if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_FIRE))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ENCHANT_FIRE)) / 100;
|
||||
if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_ICE))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ENCHANT_ICE)) / 100;
|
||||
if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_WIND))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ENCHANT_WIND)) / 100;
|
||||
if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_EARTH))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ENCHANT_EARTH)) / 100;
|
||||
if (pkVictim->IsRaceFlag(RACE_FLAG_ATT_DARK))
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ENCHANT_DARK)) / 100;
|
||||
|
||||
if (pkVictim->GetMobRank() >= MOB_RANK_BOSS && !pkVictim->IsStone())
|
||||
iAtk += (iAtk * pkAttacker->GetPoint(POINT_ATTBONUS_BOSS)) / 100;
|
||||
int monsterBonus = pkAttacker->GetPoint(POINT_ATTBONUS_MONSTER);
|
||||
@@ -389,6 +403,13 @@ void Item_GetDamage(LPITEM pkItem, int* pdamMin, int* pdamMax)
|
||||
|
||||
*pdamMin = pkItem->GetValue(3);
|
||||
*pdamMax = pkItem->GetValue(4);
|
||||
|
||||
int iMin, iMax, iMagMin, iMagMax;
|
||||
if (Sash_GetAbsorbedWeaponBonus(pkItem->GetOwner(), &iMin, &iMax, &iMagMin, &iMagMax))
|
||||
{
|
||||
*pdamMin += iMin;
|
||||
*pdamMax += iMax;
|
||||
}
|
||||
}
|
||||
|
||||
int CalcMeleeDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreDefense, bool bIgnoreTargetRating)
|
||||
|
||||
@@ -21,6 +21,7 @@ extern float CalcAttackRating(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool
|
||||
extern bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim);
|
||||
extern int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim);
|
||||
extern void battle_end(LPCHARACTER ch);
|
||||
extern bool Sash_GetAbsorbedWeaponBonus(LPCHARACTER ch, int * piMin, int * piMax, int * piMagMin, int * piMagMax);
|
||||
|
||||
extern bool battle_distance_valid_by_xy(long x, long y, long tx, long ty);
|
||||
extern bool battle_distance_valid(LPCHARACTER ch, LPCHARACTER victim);
|
||||
|
||||
@@ -383,6 +383,9 @@ void CHARACTER::Initialize()
|
||||
|
||||
memset(&m_tvLastSyncTime, 0, sizeof(m_tvLastSyncTime));
|
||||
m_iSyncHackCount = 0;
|
||||
|
||||
m_bSashCombination = false;
|
||||
m_bSashAbsorption = false;
|
||||
}
|
||||
|
||||
void CHARACTER::Create(const char * c_pszName, DWORD vid, bool isPC)
|
||||
@@ -903,6 +906,7 @@ void CHARACTER::EncodeInsertPacket(LPENTITY entity)
|
||||
addPacket.awPart[CHR_EQUIPPART_WEAPON] = GetPart(PART_WEAPON);
|
||||
addPacket.awPart[CHR_EQUIPPART_HEAD] = GetPart(PART_HEAD);
|
||||
addPacket.awPart[CHR_EQUIPPART_HAIR] = GetPart(PART_HAIR);
|
||||
addPacket.awPart[CHR_EQUIPPART_SASH] = GetPart(PART_SASH);
|
||||
|
||||
addPacket.bPKMode = m_bPKMode;
|
||||
addPacket.dwMountVnum = GetMountVnum();
|
||||
@@ -1032,6 +1036,7 @@ void CHARACTER::UpdatePacket()
|
||||
pack.awPart[CHR_EQUIPPART_WEAPON] = GetPart(PART_WEAPON);
|
||||
pack.awPart[CHR_EQUIPPART_HEAD] = GetPart(PART_HEAD);
|
||||
pack.awPart[CHR_EQUIPPART_HAIR] = GetPart(PART_HAIR);
|
||||
pack.awPart[CHR_EQUIPPART_SASH] = GetPart(PART_SASH);
|
||||
|
||||
pack.bMovingSpeed = GetLimitPoint(POINT_MOV_SPEED);
|
||||
pack.bAttackSpeed = GetLimitPoint(POINT_ATT_SPEED);
|
||||
@@ -1773,6 +1778,7 @@ void CHARACTER::SetPlayerProto(const TPlayerTable * t)
|
||||
|
||||
m_pointsInstant.bBasePart = t->part_base;
|
||||
SetPart(PART_HAIR, t->parts[PART_HAIR]);
|
||||
SetPart(PART_SASH, 0); // not stored in the player table; the equipped sash sets it when the items load
|
||||
|
||||
m_points.iRandomHP = t->sRandomHP;
|
||||
m_points.iRandomSP = t->sRandomSP;
|
||||
@@ -2277,6 +2283,7 @@ void CHARACTER::ComputePoints()
|
||||
SetPart(PART_WEAPON, GetOriginalPart(PART_WEAPON));
|
||||
SetPart(PART_HEAD, GetOriginalPart(PART_HEAD));
|
||||
SetPart(PART_HAIR, GetOriginalPart(PART_HAIR));
|
||||
SetPart(PART_SASH, GetOriginalPart(PART_SASH));
|
||||
|
||||
SetPoint(POINT_PARTY_ATTACKER_BONUS, lAttackerBonus);
|
||||
SetPoint(POINT_PARTY_TANKER_BONUS, lTankerBonus);
|
||||
@@ -3442,6 +3449,12 @@ void CHARACTER::PointChange(BYTE type, int amount, bool bAmount, bool bBroadcast
|
||||
// PORT AVA2 biology points
|
||||
case POINT_ATTBONUS_STONE:
|
||||
case POINT_ATTBONUS_BOSS:
|
||||
case POINT_ENCHANT_ELEC:
|
||||
case POINT_ENCHANT_FIRE:
|
||||
case POINT_ENCHANT_ICE:
|
||||
case POINT_ENCHANT_WIND:
|
||||
case POINT_ENCHANT_EARTH:
|
||||
case POINT_ENCHANT_DARK:
|
||||
case POINT_RESIST_HUMAN:
|
||||
case POINT_ATTBONUS_MONSTER:
|
||||
case POINT_ATTBONUS_SURA:
|
||||
@@ -3827,6 +3840,14 @@ void CHARACTER::ApplyPoint(BYTE bApplyType, int iVal)
|
||||
case APPLY_DEF_GRADE: // 83 방어력. DEF_GRADE_BONUS는 클라에서 두배로 보여지는 의도된 버그(...)가 있다.
|
||||
case APPLY_COSTUME_ATTR_BONUS: // 84 코스튬 아이템에 붙은 속성치 보너스
|
||||
case APPLY_MAGIC_ATTBONUS_PER: // 85 마법 공격력 +x%
|
||||
case APPLY_ATTBONUS_STONE:
|
||||
case APPLY_ATTBONUS_BOSS:
|
||||
case APPLY_ENCHANT_ELEC:
|
||||
case APPLY_ENCHANT_FIRE:
|
||||
case APPLY_ENCHANT_ICE:
|
||||
case APPLY_ENCHANT_WIND:
|
||||
case APPLY_ENCHANT_EARTH:
|
||||
case APPLY_ENCHANT_DARK:
|
||||
case APPLY_MELEE_MAGIC_ATTBONUS_PER: // 86 마법 + 밀리 공격력 +x%
|
||||
PointChange(aApplyInfo[bApplyType].bPointType, iVal);
|
||||
break;
|
||||
@@ -4176,6 +4197,9 @@ WORD CHARACTER::GetOriginalPart(BYTE bPartPos) const
|
||||
case PART_HAIR:
|
||||
return GetPart(PART_HAIR);
|
||||
|
||||
case PART_SASH:
|
||||
return GetPart(PART_SASH);
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -279,6 +279,13 @@ enum EPointTypes
|
||||
// PORT AVA2 biology points, within the existing 255-point packet.
|
||||
POINT_ATTBONUS_STONE = 240,
|
||||
POINT_ATTBONUS_BOSS = 241,
|
||||
// PORT AVA2 element enchant (talismans, APPLY_ENCHANT_*).
|
||||
POINT_ENCHANT_ELEC = 242,
|
||||
POINT_ENCHANT_FIRE = 243,
|
||||
POINT_ENCHANT_ICE = 244,
|
||||
POINT_ENCHANT_WIND = 245,
|
||||
POINT_ENCHANT_EARTH = 246,
|
||||
POINT_ENCHANT_DARK = 247,
|
||||
POINT_RESIST_HUMAN = 220,
|
||||
|
||||
// 추가 속성 저항
|
||||
@@ -408,6 +415,7 @@ typedef struct character_point_instant
|
||||
// by mhh
|
||||
LPITEM pCubeItems[CUBE_MAX_NUM];
|
||||
LPCHARACTER pCubeNpc;
|
||||
LPITEM pSashMaterials[SASH_WINDOW_MAX_MATERIALS]; // AVA2 sash window
|
||||
|
||||
LPCHARACTER battle_victim;
|
||||
|
||||
@@ -2070,6 +2078,36 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider
|
||||
protected:
|
||||
int m_iLastPMPulse;
|
||||
int m_iPMCounter;
|
||||
|
||||
// AVA2 sash: combine (bCombination) / absorb window opened by pc.open_sash
|
||||
protected:
|
||||
bool m_bSashCombination, m_bSashAbsorption;
|
||||
|
||||
public:
|
||||
bool isSashOpened(bool bCombination) { return bCombination ? m_bSashCombination : m_bSashAbsorption; }
|
||||
bool IsSashWindowOpen() const { return m_bSashCombination || m_bSashAbsorption; }
|
||||
void OpenSash(bool bCombination);
|
||||
void CloseSash();
|
||||
void ClearSashMaterials();
|
||||
LPITEM* GetSashMaterials() { return m_pointsInstant.pSashMaterials; }
|
||||
bool SashIsSameGrade(long lGrade);
|
||||
DWORD GetSashCombinePrice(long lGrade);
|
||||
void GetSashCombineResult(DWORD & dwItemVnum, DWORD & dwMinAbs, DWORD & dwMaxAbs);
|
||||
BYTE CheckEmptyMaterialSlot();
|
||||
void AddSashMaterial(TItemPos tPos, BYTE bPos);
|
||||
void RemoveSashMaterial(BYTE bPos);
|
||||
BYTE CanRefineSashMaterials();
|
||||
void RefineSashMaterials();
|
||||
|
||||
// AVA2 mount costume / skin (port_mount.cpp)
|
||||
public:
|
||||
bool MountCostumeCanEquip(LPITEM item);
|
||||
bool MountCostumeCanUnequip(LPITEM item);
|
||||
void MountCostumeEquipped(LPITEM item);
|
||||
void MountCostumeUnequipped(LPITEM item, bool bAlwaysSummon);
|
||||
void MountCostumeOnLogin();
|
||||
bool CostumeEnchantUse(LPITEM item, LPITEM item2);
|
||||
bool PendantScrollUse(LPITEM item, LPITEM item2);
|
||||
};
|
||||
|
||||
ESex GET_SEX(LPCHARACTER ch);
|
||||
|
||||
@@ -283,6 +283,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
|
||||
sys_log(1, "DEATH_PERNALY_CHECK(%s) town(%d)", GetName(), bTown);
|
||||
|
||||
Cube_close(this);
|
||||
CloseSash();
|
||||
|
||||
if (CBattleArena::instance().IsBattleArenaMap(GetMapIndex()) == true)
|
||||
{
|
||||
@@ -1525,6 +1526,9 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
|
||||
{
|
||||
Cube_close(this);
|
||||
}
|
||||
|
||||
if (IsPC())
|
||||
CloseSash();
|
||||
|
||||
CShopManager::instance().StopShopping(this);
|
||||
CloseMyShop();
|
||||
|
||||
@@ -265,6 +265,15 @@ DWORD CHARACTER::GetMyHorseVnum() const
|
||||
++delta;
|
||||
}
|
||||
|
||||
// AVA2 ENABLE_MOUNT_SKIN / ENABLE_MOUNT_COSTUME_SYSTEM: the worn skin, else the worn mount, is the horse
|
||||
LPITEM pkCostumeMountSkin = GetWear(WEAR_COSTUME_MOUNT_SKIN);
|
||||
if (pkCostumeMountSkin)
|
||||
return pkCostumeMountSkin->GetValue(0);
|
||||
|
||||
LPITEM pkCostumeMount = GetWear(WEAR_COSTUME_MOUNT);
|
||||
if (pkCostumeMount)
|
||||
return pkCostumeMount->GetValue(0);
|
||||
|
||||
return c_aHorseStat[GetHorseLevel()].iNPCRace + delta;
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +229,9 @@ bool CHARACTER::CanHandleItem(bool bSkipCheckRefine, bool bSkipObserver)
|
||||
if (IsWarping())
|
||||
return false;
|
||||
|
||||
if (IsSashWindowOpen())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1898,6 +1901,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
case ITEM_ROD:
|
||||
case ITEM_RING: // 신규 반지 아이템
|
||||
case ITEM_BELT: // 신규 벨트 아이템
|
||||
case ITEM_NEW_RINGS: // AVA2 new rings
|
||||
// MINING
|
||||
case ITEM_PICK:
|
||||
// END_OF_MINING
|
||||
@@ -4492,6 +4496,12 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
|
||||
return false;
|
||||
|
||||
if (item->IsCostumeEnchant())
|
||||
return CostumeEnchantUse(item, item2);
|
||||
|
||||
if (item->GetPendantScrollKind() || item2->IsTalisman())
|
||||
return PendantScrollUse(item, item2);
|
||||
|
||||
if (item2->IsEquipped())
|
||||
{
|
||||
BuffOnAttr_RemoveBuffsFromItem(item2);
|
||||
@@ -4555,7 +4565,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
break;
|
||||
|
||||
case USE_CHANGE_ATTRIBUTE :
|
||||
if (item2->GetAttributeSetIndex() == -1)
|
||||
if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다."));
|
||||
return false;
|
||||
@@ -4660,7 +4670,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
break;
|
||||
|
||||
case USE_ADD_ATTRIBUTE :
|
||||
if (item2->GetAttributeSetIndex() == -1)
|
||||
if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다."));
|
||||
return false;
|
||||
@@ -4732,7 +4742,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
case USE_ADD_ATTRIBUTE2 :
|
||||
// 축복의 구슬
|
||||
// 재가비서를 통해 속성을 4개 추가 시킨 아이템에 대해서 하나의 속성을 더 붙여준다.
|
||||
if (item2->GetAttributeSetIndex() == -1)
|
||||
if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다."));
|
||||
return false;
|
||||
@@ -5694,6 +5704,9 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
|
||||
snprintf(szBuf, sizeof(szBuf), "%u %u %u %u ", item2->GetID(), item2->GetCount(), item->GetCount(), item->GetCount() + item2->GetCount());
|
||||
LogManager::instance().ItemLog(this, item, "ITEM_SPLIT", szBuf);
|
||||
}
|
||||
|
||||
if (Cell.IsEquipPosition()) // AVA2 mount costume / skin taken off by drag
|
||||
MountCostumeUnequipped(item, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -6097,6 +6110,8 @@ bool CHARACTER::UnequipItem(LPITEM item)
|
||||
else
|
||||
item->AddToCharacter(this, TItemPos(INVENTORY, pos));
|
||||
|
||||
MountCostumeUnequipped(item, true); // AVA2 mount costume / skin
|
||||
|
||||
CheckMaximumPoints();
|
||||
|
||||
return true;
|
||||
@@ -6245,6 +6260,10 @@ bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell)
|
||||
{
|
||||
this->EffectPacket(SE_EQUIP_LOVE_PENDANT);
|
||||
}
|
||||
else if (ITEM_COSTUME == item->GetType() && COSTUME_SASH == item->GetSubType())
|
||||
{
|
||||
this->EffectPacket(SE_EFFECT_SASH_EQUIP);
|
||||
}
|
||||
// ITEM_UNIQUE의 경우, SpecialItemGroup에 정의되어 있고, (item->GetSIGVnum() != NULL)
|
||||
//
|
||||
else if (ITEM_UNIQUE == item->GetType() && 0 != item->GetSIGVnum())
|
||||
@@ -6265,6 +6284,8 @@ bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell)
|
||||
{
|
||||
quest::CQuestManager::instance().UseItem(GetPlayerID(), item, false);
|
||||
}
|
||||
|
||||
MountCostumeEquipped(item); // AVA2 mount costume / skin
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -7561,6 +7582,9 @@ bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TI
|
||||
|
||||
}
|
||||
|
||||
if (!MountCostumeCanEquip(item)) // AVA2 mount skin
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7575,6 +7599,9 @@ bool CHARACTER::CanUnequipNow(const LPITEM item, const TItemPos& srcCell, const
|
||||
if (IS_SET(item->GetFlag(), ITEM_FLAG_IRREMOVABLE))
|
||||
return false;
|
||||
|
||||
if (!MountCostumeCanUnequip(item)) // AVA2 mount costume / skin
|
||||
return false;
|
||||
|
||||
// 아이템 unequip시 인벤토리로 옮길 때 빈 자리가 있는 지 확인
|
||||
{
|
||||
int pos = -1;
|
||||
|
||||
@@ -1043,6 +1043,13 @@ void SetPolyVarForAttack(LPCHARACTER ch, CSkillProto * pkSk, LPITEM pkWeapon)
|
||||
int iMtk = number(pkWeapon->GetValue(1), pkWeapon->GetValue(2));
|
||||
iMtk += pkWeapon->GetValue(5);
|
||||
|
||||
int iMin, iMax, iMagMin, iMagMax;
|
||||
if (Sash_GetAbsorbedWeaponBonus(ch, &iMin, &iMax, &iMagMin, &iMagMax))
|
||||
{
|
||||
iWep += number(iMin, iMax);
|
||||
iMtk += number(iMagMin, iMagMax);
|
||||
}
|
||||
|
||||
pkSk->SetPointVar("wep", iWep);
|
||||
pkSk->SetPointVar("mtk", iMtk);
|
||||
pkSk->SetPointVar("mwep", iMtk);
|
||||
|
||||
@@ -104,6 +104,10 @@ ACMD(do_user_horse_back)
|
||||
if (ch->GetHorse() != NULL)
|
||||
{
|
||||
ch->HorseSummon(false);
|
||||
// AVA2 mount costume: sending the horse back also takes the costume off
|
||||
LPITEM pkCostumeMount = ch->GetWear(WEAR_COSTUME_MOUNT);
|
||||
if (pkCostumeMount)
|
||||
ch->UnequipItem(pkCostumeMount);
|
||||
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("말을 돌려보냈습니다."));
|
||||
}
|
||||
else if (ch->IsHorseRiding() == true)
|
||||
|
||||
@@ -914,6 +914,56 @@ const TApplyInfo aApplyInfo[MAX_APPLY_NUM] =
|
||||
{ POINT_RESIST_DARK, }, // APPLY_RESIST_DARK, 89
|
||||
{ POINT_RESIST_CRITICAL, }, // APPLY_ANTI_CRITICAL_PCT, 90
|
||||
{ POINT_RESIST_PENETRATE, }, // APPLY_ANTI_PENETRATE_PCT, 91
|
||||
// PORT AVA2 applies 92-138, not ported yet
|
||||
{ POINT_NONE }, // 92
|
||||
{ POINT_NONE }, // 93
|
||||
{ POINT_NONE }, // 94
|
||||
{ POINT_NONE }, // 95
|
||||
{ POINT_NONE }, // 96
|
||||
{ POINT_NONE }, // 97
|
||||
{ POINT_NONE }, // 98
|
||||
{ POINT_NONE }, // 99
|
||||
{ POINT_NONE }, // 100
|
||||
{ POINT_NONE }, // 101
|
||||
{ POINT_NONE }, // 102
|
||||
{ POINT_NONE }, // 103
|
||||
{ POINT_NONE }, // 104
|
||||
{ POINT_NONE }, // 105
|
||||
{ POINT_NONE }, // 106
|
||||
{ POINT_NONE }, // 107
|
||||
{ POINT_NONE }, // 108
|
||||
{ POINT_NONE }, // 109
|
||||
{ POINT_NONE }, // 110
|
||||
{ POINT_NONE }, // 111
|
||||
{ POINT_NONE }, // 112
|
||||
{ POINT_NONE }, // 113
|
||||
{ POINT_NONE }, // 114
|
||||
{ POINT_NONE }, // 115
|
||||
{ POINT_NONE }, // 116
|
||||
{ POINT_NONE }, // 117
|
||||
{ POINT_NONE }, // 118
|
||||
{ POINT_NONE }, // 119
|
||||
{ POINT_NONE }, // 120
|
||||
{ POINT_NONE }, // 121
|
||||
{ POINT_NONE }, // 122
|
||||
{ POINT_ENCHANT_ELEC }, // APPLY_ENCHANT_ELEC 123
|
||||
{ POINT_ENCHANT_FIRE }, // APPLY_ENCHANT_FIRE 124
|
||||
{ POINT_ENCHANT_ICE }, // APPLY_ENCHANT_ICE 125
|
||||
{ POINT_ENCHANT_WIND }, // APPLY_ENCHANT_WIND 126
|
||||
{ POINT_ENCHANT_EARTH }, // APPLY_ENCHANT_EARTH 127
|
||||
{ POINT_ENCHANT_DARK }, // APPLY_ENCHANT_DARK 128
|
||||
{ POINT_NONE }, // 129
|
||||
{ POINT_NONE }, // 130
|
||||
{ POINT_NONE }, // 131
|
||||
{ POINT_NONE }, // 132
|
||||
{ POINT_NONE }, // 133
|
||||
{ POINT_NONE }, // 134
|
||||
{ POINT_NONE }, // 135
|
||||
{ POINT_NONE }, // 136
|
||||
{ POINT_NONE }, // 137
|
||||
{ POINT_NONE }, // 138
|
||||
{ POINT_ATTBONUS_STONE }, // APPLY_ATTBONUS_STONE 139
|
||||
{ POINT_ATTBONUS_BOSS }, // APPLY_ATTBONUS_BOSS 140
|
||||
};
|
||||
|
||||
const int aiItemMagicAttributePercentHigh[ITEM_ATTRIBUTE_MAX_LEVEL] =
|
||||
@@ -1281,6 +1331,14 @@ TValueName c_aApplyTypeNames[] =
|
||||
{ "MAGIC_ATTBONUS_PER", APPLY_MAGIC_ATTBONUS_PER },
|
||||
{ "MELEE_MAGIC_ATTBONUS_PER", APPLY_MELEE_MAGIC_ATTBONUS_PER },
|
||||
|
||||
{ "ATTBONUS_STONE", APPLY_ATTBONUS_STONE },
|
||||
{ "ATTBONUS_BOSS", APPLY_ATTBONUS_BOSS },
|
||||
{ "ENCHANT_ELEC", APPLY_ENCHANT_ELEC },
|
||||
{ "ENCHANT_FIRE", APPLY_ENCHANT_FIRE },
|
||||
{ "ENCHANT_ICE", APPLY_ENCHANT_ICE },
|
||||
{ "ENCHANT_WIND", APPLY_ENCHANT_WIND },
|
||||
{ "ENCHANT_EARTH", APPLY_ENCHANT_EARTH },
|
||||
{ "ENCHANT_DARK", APPLY_ENCHANT_DARK },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
// from import_item_proto.c
|
||||
|
||||
@@ -156,6 +156,7 @@ class CInputMain : public CInputProcessor
|
||||
int MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes);
|
||||
|
||||
void Refine(LPCHARACTER ch, const char* c_pData);
|
||||
void Sash(LPCHARACTER ch, const char* c_pData);
|
||||
|
||||
void Roulette(LPCHARACTER ch, const char* c_pData);
|
||||
};
|
||||
|
||||
@@ -963,6 +963,22 @@ void CInputDB::Boot(const char* data)
|
||||
return;
|
||||
}
|
||||
|
||||
// AVA2 NEW_COMMON_DROP; optional so the binary still runs on a locale without the file
|
||||
char szCommonDropNewFileName[FILE_NAME_LEN];
|
||||
snprintf(szCommonDropNewFileName, sizeof(szCommonDropNewFileName), "%s/common_drop_new.txt", LocaleService_GetBasePath().c_str());
|
||||
if (access(szCommonDropNewFileName, R_OK) != 0)
|
||||
sys_log(0, "LoadLocaleFile: CommonDropNew: %s absent", szCommonDropNewFileName);
|
||||
else
|
||||
{
|
||||
sys_log(0, "LoadLocaleFile: CommonDropNew: %s", szCommonDropNewFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadCommonDropNewItemFile(szCommonDropNewFileName))
|
||||
{
|
||||
sys_err("cannot load CommonDropNew: %s", szCommonDropNewFileName);
|
||||
thecore_shutdown();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sys_log(0, "LoadLocaleFile: ETCDropItem: %s", szETCDropItemFileName);
|
||||
if (!ITEM_MANAGER::instance().ReadEtcDropItemFile(szETCDropItemFileName))
|
||||
{
|
||||
|
||||
@@ -634,6 +634,8 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
||||
ch->SendGreetMessage();
|
||||
|
||||
_send_bonus_info(ch);
|
||||
|
||||
ch->MountCostumeOnLogin(); // AVA2 mount costume
|
||||
|
||||
for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
|
||||
{
|
||||
|
||||
@@ -3043,6 +3043,30 @@ void CInputMain::Refine(LPCHARACTER ch, const char* c_pData)
|
||||
ch->ClearRefineMode();
|
||||
}
|
||||
|
||||
void CInputMain::Sash(LPCHARACTER ch, const char* c_pData)
|
||||
{
|
||||
quest::PC * pPC = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID());
|
||||
if (pPC && pPC->IsRunning())
|
||||
return;
|
||||
|
||||
const TPacketSash * p = reinterpret_cast<const TPacketSash *>(c_pData);
|
||||
switch (p->subheader)
|
||||
{
|
||||
case SASH_SUBHEADER_CG_CLOSE:
|
||||
ch->CloseSash();
|
||||
break;
|
||||
case SASH_SUBHEADER_CG_ADD:
|
||||
ch->AddSashMaterial(p->tPos, p->bPos);
|
||||
break;
|
||||
case SASH_SUBHEADER_CG_REMOVE:
|
||||
ch->RemoveSashMaterial(p->bPos);
|
||||
break;
|
||||
case SASH_SUBHEADER_CG_REFINE:
|
||||
ch->RefineSashMaterials();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
||||
{
|
||||
LPCHARACTER ch;
|
||||
@@ -3324,6 +3348,10 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
||||
// }
|
||||
// break;
|
||||
|
||||
case HEADER_CG_SASH:
|
||||
Sash(ch, c_pData);
|
||||
break;
|
||||
|
||||
case HEADER_CG_DRAGON_SOUL_REFINE:
|
||||
{
|
||||
TPacketCGDragonSoulRefine* p = reinterpret_cast <TPacketCGDragonSoulRefine*>((void*)c_pData);
|
||||
|
||||
+101
-10
@@ -366,6 +366,20 @@ bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
|
||||
if (ch->GetDesc())
|
||||
m_dwLastOwnerPID = ch->GetPlayerID();
|
||||
|
||||
// AVA2 sash: a fresh sash gets the starting absorption of its grade
|
||||
if (GetType() == ITEM_COSTUME && GetSubType() == COSTUME_SASH && GetSocket(SASH_ABSORPTION_SOCKET) == 0)
|
||||
{
|
||||
long lVal;
|
||||
switch (GetValue(SASH_GRADE_VALUE_FIELD))
|
||||
{
|
||||
case 2: lVal = SASH_GRADE_2_ABS; break;
|
||||
case 3: lVal = SASH_GRADE_3_ABS; break;
|
||||
case 4: lVal = number(SASH_GRADE_4_ABS_MIN, SASH_GRADE_4_ABS_MAX_COMB); break;
|
||||
default: lVal = SASH_GRADE_1_ABS; break;
|
||||
}
|
||||
SetSocket(SASH_ABSORPTION_SOCKET, lVal);
|
||||
}
|
||||
|
||||
event_cancel(&m_pkDestroyEvent);
|
||||
|
||||
ch->SetItem(TItemPos(window_type, pos), this);
|
||||
@@ -473,9 +487,12 @@ bool CItem::CanUsedBy(LPCHARACTER ch)
|
||||
|
||||
int CItem::FindEquipCell(LPCHARACTER ch, int iCandidateCell)
|
||||
{
|
||||
if (IsTalisman())
|
||||
return WEAR_PENDANT;
|
||||
|
||||
// 코스츔 아이템(ITEM_COSTUME)은 WearFlag 없어도 됨. (sub type으로 착용위치 구분. 귀찮게 또 wear flag 줄 필요가 있나..)
|
||||
// 용혼석(ITEM_DS, ITEM_SPECIAL_DS)도 SUB_TYPE으로 구분. 신규 반지, 벨트는 ITEM_TYPE으로 구분 -_-
|
||||
if ((0 == GetWearFlag() || ITEM_TOTEM == GetType()) && ITEM_COSTUME != GetType() && ITEM_DS != GetType() && ITEM_SPECIAL_DS != GetType() && ITEM_RING != GetType() && ITEM_BELT != GetType())
|
||||
if ((0 == GetWearFlag() || ITEM_TOTEM == GetType()) && ITEM_COSTUME != GetType() && ITEM_DS != GetType() && ITEM_SPECIAL_DS != GetType() && ITEM_RING != GetType() && ITEM_BELT != GetType() && ITEM_NEW_RINGS != GetType())
|
||||
return -1;
|
||||
|
||||
// 용혼석 슬롯을 WEAR로 처리할 수가 없어서(WEAR는 최대 32개까지 가능한데 용혼석을 추가하면 32가 넘는다.)
|
||||
@@ -507,6 +524,12 @@ int CItem::FindEquipCell(LPCHARACTER ch, int iCandidateCell)
|
||||
return WEAR_COSTUME_BODY;
|
||||
else if (GetSubType() == COSTUME_HAIR)
|
||||
return WEAR_COSTUME_HAIR;
|
||||
else if (GetSubType() == COSTUME_SASH)
|
||||
return WEAR_COSTUME_SASH;
|
||||
else if (GetSubType() == COSTUME_MOUNT)
|
||||
return WEAR_COSTUME_MOUNT;
|
||||
else if (GetSubType() == COSTUME_MOUNT_SKIN)
|
||||
return WEAR_COSTUME_MOUNT_SKIN;
|
||||
}
|
||||
else if (GetType() == ITEM_RING)
|
||||
{
|
||||
@@ -517,6 +540,13 @@ int CItem::FindEquipCell(LPCHARACTER ch, int iCandidateCell)
|
||||
}
|
||||
else if (GetType() == ITEM_BELT)
|
||||
return WEAR_BELT;
|
||||
else if (GetType() == ITEM_NEW_RINGS) // AVA2 new rings
|
||||
{
|
||||
if (ch->GetWear(WEAR_RINGS_1))
|
||||
return WEAR_RINGS_2;
|
||||
else
|
||||
return WEAR_RINGS_1;
|
||||
}
|
||||
else if (GetWearFlag() & WEARABLE_BODY)
|
||||
return WEAR_BODY;
|
||||
else if (GetWearFlag() & WEARABLE_HEAD)
|
||||
@@ -635,23 +665,54 @@ void CItem::ModifyPoints(bool bAdd)
|
||||
accessoryGrade = MIN(GetAccessorySocketGrade(), ITEM_ACCESSORY_SOCKET_MAX_NUM);
|
||||
}
|
||||
|
||||
// AVA2 sash: the absorbed item's applies (and a body armor's defense) at the absorption %, instead of
|
||||
// the sash's own applies; its attributes count at the absorption % below
|
||||
const bool bSash = GetType() == ITEM_COSTUME && GetSubType() == COSTUME_SASH;
|
||||
const TItemTable * pkAbsorbed = bSash && GetSocket(SASH_ABSORBED_SOCKET) ? ITEM_MANAGER::instance().GetTable(GetSocket(SASH_ABSORBED_SOCKET)) : NULL;
|
||||
const long lAbsorption = bSash ? GetSocket(SASH_ABSORPTION_SOCKET) : 100;
|
||||
|
||||
if (pkAbsorbed && pkAbsorbed->bType == ITEM_ARMOR && pkAbsorbed->bSubType == ARMOR_BODY)
|
||||
{
|
||||
long lDefGrade = (long) ((pkAbsorbed->alValues[1] + pkAbsorbed->alValues[5] * 2) * lAbsorption / 100.0 + .5);
|
||||
if (pkAbsorbed->alValues[1] > 0 || pkAbsorbed->alValues[5] > 0)
|
||||
lDefGrade += 1;
|
||||
m_pOwner->ApplyPoint(APPLY_DEF_GRADE_BONUS, bAdd ? lDefGrade : -lDefGrade);
|
||||
|
||||
long lDefMagicBonus = (long) (pkAbsorbed->alValues[0] * lAbsorption / 100.0 + .5);
|
||||
if (pkAbsorbed->alValues[0] > 0)
|
||||
lDefMagicBonus += 1;
|
||||
m_pOwner->ApplyPoint(APPLY_MAGIC_DEF_GRADE, bAdd ? lDefMagicBonus : -lDefMagicBonus);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ITEM_APPLY_MAX_NUM; ++i)
|
||||
{
|
||||
if (m_pProto->aApplies[i].bType == APPLY_NONE)
|
||||
continue;
|
||||
|
||||
BYTE bType = m_pProto->aApplies[i].bType;
|
||||
long value = m_pProto->aApplies[i].lValue;
|
||||
|
||||
if (m_pProto->aApplies[i].bType == APPLY_SKILL)
|
||||
if (bSash)
|
||||
{
|
||||
m_pOwner->ApplyPoint(m_pProto->aApplies[i].bType, bAdd ? value : value ^ 0x00800000);
|
||||
if (!pkAbsorbed || pkAbsorbed->aApplies[i].bType == APPLY_NONE || pkAbsorbed->aApplies[i].lValue < 0)
|
||||
continue;
|
||||
|
||||
bType = pkAbsorbed->aApplies[i].bType;
|
||||
value = (long) (pkAbsorbed->aApplies[i].lValue * lAbsorption / 100.0 + .5);
|
||||
if (pkAbsorbed->aApplies[i].lValue > 0 && value <= 0)
|
||||
value += 1;
|
||||
}
|
||||
|
||||
if (bType == APPLY_NONE)
|
||||
continue;
|
||||
|
||||
if (bType == APPLY_SKILL)
|
||||
{
|
||||
m_pOwner->ApplyPoint(bType, bAdd ? value : value ^ 0x00800000);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 != accessoryGrade)
|
||||
value += MAX(accessoryGrade, value * aiAccessorySocketEffectivePct[accessoryGrade] / 100);
|
||||
|
||||
m_pOwner->ApplyPoint(m_pProto->aApplies[i].bType, bAdd ? value : -value);
|
||||
m_pOwner->ApplyPoint(bType, bAdd ? value : -value);
|
||||
}
|
||||
}
|
||||
// 초승달의 반지, 할로윈 사탕, 행복의 반지, 영원한 사랑의 펜던트의 경우
|
||||
@@ -672,11 +733,19 @@ void CItem::ModifyPoints(bool bAdd)
|
||||
if (GetAttributeType(i))
|
||||
{
|
||||
const TPlayerItemAttribute& ia = GetAttribute(i);
|
||||
long sValue = ia.sValue;
|
||||
|
||||
if (bSash)
|
||||
{
|
||||
sValue = (long) (ia.sValue * lAbsorption / 100.0 + .5);
|
||||
if (ia.sValue > 0 && sValue <= 0)
|
||||
sValue += 1;
|
||||
}
|
||||
|
||||
if (ia.bType == APPLY_SKILL)
|
||||
m_pOwner->ApplyPoint(ia.bType, bAdd ? ia.sValue : ia.sValue ^ 0x00800000);
|
||||
m_pOwner->ApplyPoint(ia.bType, bAdd ? sValue : sValue ^ 0x00800000);
|
||||
else
|
||||
m_pOwner->ApplyPoint(ia.bType, bAdd ? ia.sValue : -ia.sValue);
|
||||
m_pOwner->ApplyPoint(ia.bType, bAdd ? sValue : -sValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -766,6 +835,13 @@ void CItem::ModifyPoints(bool bAdd)
|
||||
toSetValue = (true == bAdd) ? this->GetValue(3) : 0;
|
||||
}
|
||||
|
||||
// AVA2 sash: the client draws item (part + 85000)
|
||||
else if (GetSubType() == COSTUME_SASH)
|
||||
{
|
||||
toSetPart = PART_SASH;
|
||||
toSetValue = (true == bAdd) ? this->GetVnum() - 85000 : 0;
|
||||
}
|
||||
|
||||
if (PART_MAX_NUM != toSetPart)
|
||||
{
|
||||
m_pOwner->SetPart((BYTE)toSetPart, toSetValue);
|
||||
@@ -808,6 +884,7 @@ bool CItem::IsEquipable() const
|
||||
case ITEM_SPECIAL_DS:
|
||||
case ITEM_RING:
|
||||
case ITEM_BELT:
|
||||
case ITEM_NEW_RINGS:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1581,7 +1658,7 @@ int CItem::GetSpecialGroup() const
|
||||
bool CItem::IsAccessoryForSocket()
|
||||
{
|
||||
return (m_pProto->bType == ITEM_ARMOR && (m_pProto->bSubType == ARMOR_WRIST || m_pProto->bSubType == ARMOR_NECK || m_pProto->bSubType == ARMOR_EAR)) ||
|
||||
(m_pProto->bType == ITEM_BELT); // 2013년 2월 새로 추가된 '벨트' 아이템의 경우 기획팀에서 악세서리 소켓 시스템을 그대로 이용하자고 함.
|
||||
(m_pProto->bType == ITEM_BELT) || (m_pProto->bType == ITEM_NEW_RINGS); // 2013년 2월 새로 추가된 '벨트' 아이템의 경우 기획팀에서 악세서리 소켓 시스템을 그대로 이용하자고 함.
|
||||
}
|
||||
|
||||
void CItem::SetAccessorySocketGrade(int iGrade)
|
||||
@@ -1703,6 +1780,16 @@ bool CItem::IsRideItem()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CItem::IsCostumeMount()
|
||||
{
|
||||
return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT;
|
||||
}
|
||||
|
||||
bool CItem::IsCostumeMountSkin()
|
||||
{
|
||||
return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT_SKIN;
|
||||
}
|
||||
|
||||
bool CItem::IsRamadanRing()
|
||||
{
|
||||
if (GetVnum() == UNIQUE_ITEM_RAMADAN_RING)
|
||||
@@ -1788,6 +1875,10 @@ bool CItem::CanPutInto(LPITEM item)
|
||||
else if(item->GetType() == ITEM_RING)
|
||||
return CanPutIntoRing(item, this);
|
||||
|
||||
// AVA2 new rings take the jewel of the matching AVA2 accessory family (port_rings.cpp).
|
||||
else if (item->GetType() == ITEM_NEW_RINGS)
|
||||
return GetVnum() == GetNewRingJewelVnum(item->GetVnum());
|
||||
|
||||
else if (item->GetType() != ITEM_ARMOR)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -234,6 +234,13 @@ class CItem : public CEntity
|
||||
|
||||
public:
|
||||
bool IsRideItem();
|
||||
bool IsCostumeMount(); // AVA2 mount costume
|
||||
bool IsCostumeMountSkin();
|
||||
bool IsCostumeEnchant(); // AVA2 costume enchant (port_costume_attr.cpp)
|
||||
bool IsTalisman(); // AVA2 talisman (port_pendant.cpp)
|
||||
int GetPendantScrollKind();
|
||||
bool IsNewRing(); // AVA2 new rings (port_rings.cpp)
|
||||
void PutNewRingAttributeWithLevel(BYTE bLevel);
|
||||
bool IsRamadanRing();
|
||||
|
||||
void ClearMountAttributeAndAffect();
|
||||
@@ -331,4 +338,6 @@ EVENTINFO(item_vid_event_info)
|
||||
}
|
||||
};
|
||||
|
||||
DWORD GetNewRingJewelVnum(DWORD dwRingVnum); // port_rings.cpp, 0 = none
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,10 @@ int CItem::GetAttributeSetIndex()
|
||||
return ATTRIBUTE_SET_WEAPON;
|
||||
}
|
||||
|
||||
// AVA2 costume sub types reuse ARMOR_SHIELD/WRIST/FOOTS numbers but take no random attributes
|
||||
if (GetType() == ITEM_COSTUME && (GetSubType() == COSTUME_MOUNT || GetSubType() == COSTUME_SASH || GetSubType() == COSTUME_MOUNT_SKIN))
|
||||
return -1;
|
||||
|
||||
if (GetType() == ITEM_ARMOR || GetType() == ITEM_COSTUME)
|
||||
{
|
||||
switch (GetSubType())
|
||||
@@ -114,6 +118,12 @@ void CItem::AddAttr(BYTE bApply, BYTE bLevel)
|
||||
|
||||
void CItem::PutAttributeWithLevel(BYTE bLevel)
|
||||
{
|
||||
if (IsNewRing())
|
||||
{
|
||||
PutNewRingAttributeWithLevel(bLevel);
|
||||
return;
|
||||
}
|
||||
|
||||
int iAttributeSet = GetAttributeSetIndex();
|
||||
|
||||
if (iAttributeSet < 0)
|
||||
|
||||
@@ -817,25 +817,26 @@ bool ITEM_MANAGER::GetDropPct(LPCHARACTER pkChr, LPCHARACTER pkKiller, OUT int&
|
||||
|
||||
//if (pkKiller->GetPoint(POINT_MALL_ITEMBONUS) > 0)
|
||||
//iDeltaPercent += iDeltaPercent * pkKiller->GetPoint(POINT_MALL_ITEMBONUS) / 100;
|
||||
// ADD_PREMIUM
|
||||
// ADD_PREMIUM (AVA2 rates: premium or a thief glove doubles, everyone else gets +50%)
|
||||
if (pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0 ||
|
||||
pkKiller->IsEquipUniqueGroup(UNIQUE_GROUP_DOUBLE_ITEM))
|
||||
iDeltaPercent += iDeltaPercent;
|
||||
else
|
||||
iDeltaPercent += iDeltaPercent / 2;
|
||||
// END_OF_ADD_PREMIUM
|
||||
|
||||
// PC_BANG_ITEM_ADD
|
||||
if (pkKiller->GetPoint(POINT_PC_BANG_DROP_BONUS) > 0)
|
||||
{
|
||||
if (pkKiller->IsPCBang() == true)
|
||||
iDeltaPercent += iDeltaPercent * pkKiller->GetPoint(POINT_PC_BANG_DROP_BONUS)/100;
|
||||
}
|
||||
// END_PC_BANG_ITEM_ADD
|
||||
// AVA2: the permanent glove adds 100 with premium and 50 alone (or a removable glove with premium). This also
|
||||
// fixes the original ternary without parentheses, which always made the divisor 100 and ignored PRIV_ITEM_DROP.
|
||||
int bonus = 0;
|
||||
if (pkKiller->IsEquipUniqueItem(UNIQUE_ITEM_DOUBLE_ITEM) && pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0)
|
||||
bonus = 100;
|
||||
else if (pkKiller->IsEquipUniqueItem(UNIQUE_ITEM_DOUBLE_ITEM) ||
|
||||
(pkKiller->IsEquipUniqueGroup(UNIQUE_GROUP_DOUBLE_ITEM) && pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0))
|
||||
bonus = 50;
|
||||
|
||||
iRandRange = 4000000;
|
||||
iRandRange = iRandRange * 100 /
|
||||
(100 +
|
||||
CPrivManager::instance().GetPriv(pkKiller, PRIV_ITEM_DROP) +
|
||||
pkKiller->IsEquipUniqueItem(UNIQUE_ITEM_DOUBLE_ITEM)?100:0);
|
||||
iRandRange = iRandRange * 100 /
|
||||
(100 + CPrivManager::instance().GetPriv(pkKiller, PRIV_ITEM_DROP) + bonus);
|
||||
|
||||
if (distribution_test_server) iRandRange /= 3;
|
||||
|
||||
@@ -926,6 +927,26 @@ bool ITEM_MANAGER::CreateDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::
|
||||
}
|
||||
}
|
||||
|
||||
// AVA2 NEW_COMMON_DROP: killer level within a group's range and within 20 levels of the victim
|
||||
if (abs(pkChr->GetLevel() - iLevel) <= 20)
|
||||
{
|
||||
for (size_t g = 0; g < m_vec_pkCommonNewItemGroup.size(); ++g)
|
||||
{
|
||||
const CCommonDropNew* commonNew = m_vec_pkCommonNewItemGroup[g];
|
||||
if (iLevel < commonNew->minLevel || iLevel > commonNew->maxLevel || !commonNew->CanDropThisMap(pkKiller->GetMapIndex()))
|
||||
continue;
|
||||
for (size_t i = 0; i < commonNew->m_vecProbs.size(); ++i)
|
||||
{
|
||||
int iPercent = (commonNew->m_vecProbs[i] * iDeltaPercent) / 100;
|
||||
if (iPercent >= number(1, iRandRange))
|
||||
{
|
||||
item = CreateItem(commonNew->m_vecItems[i].first, commonNew->m_vecItems[i].second, 0, true);
|
||||
if (item) vec_item.push_back(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MobDropItem Group
|
||||
{
|
||||
itertype(m_map_pkMobItemGroup) it;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef __INC_ITEM_MANAGER__
|
||||
#define __INC_ITEM_MANAGER__
|
||||
#include "port_feature_types.h"
|
||||
#include <climits>
|
||||
|
||||
#ifdef M2_USE_POOL
|
||||
#include "pool.h"
|
||||
@@ -273,6 +274,31 @@ class CDropItemGroup
|
||||
std::vector<SDropItemGroupInfo> m_vec_items;
|
||||
};
|
||||
|
||||
// AVA2 NEW_COMMON_DROP (common_drop_new.txt): level-ranged, optionally map-restricted groups replacing the
|
||||
// rank-based common_drop_item.txt. Probabilities are stored on the 40000-per-percent scale of the other drop tables.
|
||||
class CCommonDropNew
|
||||
{
|
||||
public:
|
||||
CCommonDropNew() : minLevel(0), maxLevel(INT_MAX) {}
|
||||
|
||||
bool CanDropThisMap(DWORD mapIndex) const
|
||||
{
|
||||
return m_vecMapIndex.empty() || std::find(m_vecMapIndex.begin(), m_vecMapIndex.end(), mapIndex) != m_vecMapIndex.end();
|
||||
}
|
||||
|
||||
void AddItem(DWORD dwItemVnum, DWORD iCount, DWORD iPartPct)
|
||||
{
|
||||
m_vecProbs.push_back(iPartPct);
|
||||
m_vecItems.push_back(std::make_pair(dwItemVnum, iCount));
|
||||
}
|
||||
|
||||
int minLevel;
|
||||
int maxLevel;
|
||||
std::vector<DWORD> m_vecMapIndex;
|
||||
std::vector<DWORD> m_vecProbs;
|
||||
std::vector<std::pair<DWORD, DWORD> > m_vecItems;
|
||||
};
|
||||
|
||||
class CLevelItemGroup
|
||||
{
|
||||
struct SLevelItemGroupInfo
|
||||
@@ -393,6 +419,7 @@ class ITEM_MANAGER : public singleton<ITEM_MANAGER>
|
||||
bool CreateDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item);
|
||||
|
||||
bool ReadCommonDropItemFile(const char * c_pszFileName);
|
||||
bool ReadCommonDropNewItemFile(const char * c_pszFileName);
|
||||
bool ReadEtcDropItemFile(const char * c_pszFileName);
|
||||
bool ReadDropItemGroup(const char * c_pszFileName);
|
||||
bool ReadMonsterDropItemGroup(const char * c_pszFileName);
|
||||
@@ -444,6 +471,7 @@ class ITEM_MANAGER : public singleton<ITEM_MANAGER>
|
||||
std::map<DWORD, CMobItemGroup*> m_map_pkMobItemGroup;
|
||||
std::map<DWORD, CLevelItemGroup*> m_map_pkLevelItemGroup;
|
||||
std::map<DWORD, CBuyerThiefGlovesItemGroup*> m_map_pkGloveItemGroup;
|
||||
std::vector<CCommonDropNew*> m_vec_pkCommonNewItemGroup;
|
||||
|
||||
// CHECK_UNIQUE_GROUP
|
||||
std::map<DWORD, int> m_ItemToSpecialGroup;
|
||||
|
||||
@@ -169,9 +169,9 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
|
||||
if ("attr" == stType)
|
||||
{
|
||||
CSpecialAttrGroup * pkGroup = M2_NEW CSpecialAttrGroup(iVnum);
|
||||
for (int k = 1; k < 256; ++k)
|
||||
for (int k = 1; k < 1024; ++k) // AVA2 @fixme148: groups up to 1023 entries
|
||||
{
|
||||
char buf[4];
|
||||
char buf[8];
|
||||
snprintf(buf, sizeof(buf), "%d", k);
|
||||
|
||||
if (loader.GetTokenVector(buf, &pTok))
|
||||
@@ -212,9 +212,9 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
|
||||
else
|
||||
{
|
||||
CSpecialItemGroup * pkGroup = M2_NEW CSpecialItemGroup(iVnum, type);
|
||||
for (int k = 1; k < 256; ++k)
|
||||
for (int k = 1; k < 1024; ++k) // AVA2 @fixme148: groups up to 1023 entries
|
||||
{
|
||||
char buf[4];
|
||||
char buf[8];
|
||||
snprintf(buf, sizeof(buf), "%d", k);
|
||||
|
||||
if (loader.GetTokenVector(buf, &pTok))
|
||||
@@ -427,6 +427,96 @@ bool ITEM_MANAGER::ConvSpecialDropItemFile()
|
||||
return true;
|
||||
}
|
||||
|
||||
// AVA2 NEW_COMMON_DROP. Each group: optional "map_index" list (0 = every map), optional "level_range MIN MAX" of the
|
||||
// killer, entries "N vnum count percent". A malformed group fails the whole file like the other drop tables.
|
||||
bool ITEM_MANAGER::ReadCommonDropNewItemFile(const char * c_pszFileName)
|
||||
{
|
||||
CTextFileLoader loader;
|
||||
if (!loader.Load(c_pszFileName))
|
||||
return false;
|
||||
|
||||
std::vector<CCommonDropNew*> groups;
|
||||
std::string stName;
|
||||
bool ok = true;
|
||||
|
||||
for (DWORD i = 0; i < loader.GetChildNodeCount() && ok; ++i)
|
||||
{
|
||||
CCommonDropNew* dropPtr = M2_NEW CCommonDropNew;
|
||||
TTokenVector* pTok = NULL;
|
||||
loader.SetChildNode(i);
|
||||
loader.GetCurrentNodeName(&stName);
|
||||
|
||||
if (loader.GetTokenVector("map_index", &pTok))
|
||||
{
|
||||
if (pTok->empty())
|
||||
ok = false;
|
||||
for (DWORD j = 0; ok && j < pTok->size(); ++j)
|
||||
{
|
||||
DWORD mapIndex = 0;
|
||||
str_to_number(mapIndex, pTok->at(j).c_str());
|
||||
if (mapIndex)
|
||||
dropPtr->m_vecMapIndex.push_back(mapIndex);
|
||||
}
|
||||
}
|
||||
if (ok && loader.GetTokenVector("level_range", &pTok))
|
||||
{
|
||||
if (pTok->size() != 2)
|
||||
ok = false;
|
||||
else
|
||||
{
|
||||
str_to_number(dropPtr->minLevel, pTok->at(0).c_str());
|
||||
str_to_number(dropPtr->maxLevel, pTok->at(1).c_str());
|
||||
}
|
||||
}
|
||||
for (int k = 1; ok && k < 256; ++k)
|
||||
{
|
||||
char buf[4];
|
||||
snprintf(buf, sizeof(buf), "%d", k);
|
||||
if (!loader.GetTokenVector(buf, &pTok))
|
||||
continue;
|
||||
DWORD itemVnum = 0, itemCount = 0;
|
||||
float itemPct = 0.0f;
|
||||
if (pTok->size() != 3)
|
||||
{
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
str_to_number(itemVnum, pTok->at(0).c_str());
|
||||
str_to_number(itemCount, pTok->at(1).c_str());
|
||||
str_to_number(itemPct, pTok->at(2).c_str());
|
||||
if (!GetTable(itemVnum) || !itemCount)
|
||||
{
|
||||
sys_err("ReadCommonDropNewItemFile : no item %u (count %u) : node %s", itemVnum, itemCount, stName.c_str());
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
dropPtr->AddItem(itemVnum, itemCount, (DWORD)(40000.0f * itemPct));
|
||||
}
|
||||
loader.SetParentNode();
|
||||
|
||||
if (!ok)
|
||||
sys_err("ReadCommonDropNewItemFile : Syntax error %s : node %s", c_pszFileName, stName.c_str());
|
||||
if (!ok || dropPtr->m_vecItems.empty())
|
||||
{
|
||||
M2_DELETE(dropPtr);
|
||||
continue;
|
||||
}
|
||||
groups.push_back(dropPtr);
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
for (size_t i = 0; i < groups.size(); ++i)
|
||||
M2_DELETE(groups[i]);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_vec_pkCommonNewItemGroup.size(); ++i)
|
||||
M2_DELETE(m_vec_pkCommonNewItemGroup[i]);
|
||||
m_vec_pkCommonNewItemGroup.swap(groups);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ITEM_MANAGER::ReadEtcDropItemFile(const char * c_pszFileName)
|
||||
{
|
||||
FILE * fp = fopen(c_pszFileName, "r");
|
||||
@@ -634,7 +724,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
|
||||
else
|
||||
{
|
||||
bNew = false;
|
||||
CDropItemGroup* pkGroup = it->second;
|
||||
pkGroup = it->second;
|
||||
}
|
||||
|
||||
for (int k = 1; k < 256; ++k)
|
||||
|
||||
@@ -109,6 +109,7 @@ enum
|
||||
|
||||
HEADER_CG_DRAGON_SOUL_REFINE = 205,
|
||||
HEADER_CG_STATE_CHECKER = 206,
|
||||
HEADER_CG_SASH = 211, // AVA2 sash
|
||||
|
||||
HEADER_CG_CLIENT_VERSION = 0xfd,
|
||||
HEADER_CG_CLIENT_VERSION2 = 0xf1,
|
||||
@@ -295,6 +296,7 @@ enum
|
||||
|
||||
HEADER_GC_DRAGON_SOUL_REFINE = 209,
|
||||
HEADER_GC_RESPOND_CHANNELSTATUS = 210,
|
||||
HEADER_GC_SASH = 215, // AVA2 sash
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -942,6 +944,7 @@ enum ECharacterEquipmentPart
|
||||
CHR_EQUIPPART_WEAPON,
|
||||
CHR_EQUIPPART_HEAD,
|
||||
CHR_EQUIPPART_HAIR,
|
||||
CHR_EQUIPPART_SASH,
|
||||
CHR_EQUIPPART_NUM,
|
||||
};
|
||||
|
||||
@@ -1144,6 +1147,33 @@ typedef struct packet_item_set
|
||||
TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
|
||||
} TPacketGCItemSet;
|
||||
|
||||
// AVA2 sash window (HEADER_CG_SASH / HEADER_GC_SASH share the layout)
|
||||
enum
|
||||
{
|
||||
SASH_SUBHEADER_GC_OPEN = 0,
|
||||
SASH_SUBHEADER_GC_CLOSE,
|
||||
SASH_SUBHEADER_GC_ADDED,
|
||||
SASH_SUBHEADER_GC_REMOVED,
|
||||
SASH_SUBHEADER_CG_REFINED,
|
||||
SASH_SUBHEADER_CG_CLOSE = 0,
|
||||
SASH_SUBHEADER_CG_ADD,
|
||||
SASH_SUBHEADER_CG_REMOVE,
|
||||
SASH_SUBHEADER_CG_REFINE,
|
||||
};
|
||||
|
||||
typedef struct SPacketSash
|
||||
{
|
||||
BYTE header;
|
||||
BYTE subheader;
|
||||
bool bWindow; // true = combine, false = absorb
|
||||
DWORD dwPrice;
|
||||
BYTE bPos;
|
||||
TItemPos tPos;
|
||||
DWORD dwItemVnum;
|
||||
DWORD dwMinAbs;
|
||||
DWORD dwMaxAbs;
|
||||
} TPacketSash;
|
||||
|
||||
typedef struct packet_item_del
|
||||
{
|
||||
BYTE header;
|
||||
|
||||
@@ -228,6 +228,7 @@ CPacketInfoCG::CPacketInfoCG()
|
||||
// Set(HEADER_CG_XTRAP_ACK, sizeof(TPacketXTrapCSVerify), "XTrapResponse", false);
|
||||
Set(HEADER_CG_DRAGON_SOUL_REFINE, sizeof(TPacketCGDragonSoulRefine), "DragonSoulRefine", false);
|
||||
Set(HEADER_CG_STATE_CHECKER, sizeof(BYTE), "ServerStateCheck", false);
|
||||
Set(HEADER_CG_SASH, sizeof(TPacketSash), "Sash", true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
// AVA2 costume enchant items (ENABLE_SPECIAL_COSTUME_ATTR, char_item.cpp USE_CHANGE_ATTRIBUTE case):
|
||||
// ITEM_USE / USE_CHANGE_ATTRIBUTE rows whose value0 = apply type, value1 = apply value and
|
||||
// value2 = target mask (1 << bonus flag). Dragged onto a costume they add that one fixed attribute,
|
||||
// at most three per costume; they never reroll anything, and gear is refused (they would otherwise be
|
||||
// free 40250 switchers, so the switchbot skips them too).
|
||||
// Only the costume kinds 40250 has are mapped: body (flag 1), hair (2) and mount skin (4). AVA2's
|
||||
// weapon costume (3), sash skin (5) and shining (6) items stay locked in tools/server/ava2-items.
|
||||
// Messages go to the client as "MTCATTR <code>" commands (rendered by the client's mt_costume_attr
|
||||
// script) instead of AVA2's locale strings 1056 / 1057 / 1061 / 1062 / 1063.
|
||||
#include "stdafx.h"
|
||||
#include "char.h"
|
||||
#include "item.h"
|
||||
#include "log.h"
|
||||
|
||||
enum
|
||||
{
|
||||
COSTUME_ENCHANT_VNUM_MIN = 54001,
|
||||
COSTUME_ENCHANT_VNUM_MAX = 54267,
|
||||
COSTUME_ENCHANT_MAX_ATTR = 3, // AVA2 GetBonusMaxAttr: every limit is 3
|
||||
};
|
||||
|
||||
bool CItem::IsCostumeEnchant()
|
||||
{
|
||||
return GetType() == ITEM_USE && GetSubType() == USE_CHANGE_ATTRIBUTE && GetValue(2) != 0 &&
|
||||
GetVnum() >= COSTUME_ENCHANT_VNUM_MIN && GetVnum() <= COSTUME_ENCHANT_VNUM_MAX;
|
||||
}
|
||||
|
||||
// AVA2 CItem::GetBonusFlag for the costume kinds that exist here; 0 = cannot be enchanted.
|
||||
static int CostumeEnchantFlag(LPITEM item)
|
||||
{
|
||||
if (item->GetType() != ITEM_COSTUME)
|
||||
return 0;
|
||||
|
||||
switch (item->GetSubType())
|
||||
{
|
||||
case COSTUME_BODY:
|
||||
return 1;
|
||||
case COSTUME_HAIR:
|
||||
return 2;
|
||||
case COSTUME_MOUNT_SKIN:
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CHARACTER::CostumeEnchantUse(LPITEM item, LPITEM item2)
|
||||
{
|
||||
if (item2->IsExchanging())
|
||||
return false;
|
||||
|
||||
const int flag = CostumeEnchantFlag(item2);
|
||||
const BYTE applyType = static_cast<BYTE>(item->GetValue(0));
|
||||
const short applyValue = static_cast<short>(item->GetValue(1));
|
||||
|
||||
if (!flag || !(item->GetValue(2) & (1 << flag)))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTCATTR target");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (applyType == APPLY_NONE || applyValue == 0)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTCATTR none");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 40250 equipped items are never touched by attribute items (the "Fix" in the switcher path):
|
||||
// the new attribute would not be applied to the character until the next re-equip.
|
||||
if (item2->IsEquipped())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTCATTR equipped");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item2->GetAttributeCount() >= COSTUME_ENCHANT_MAX_ATTR)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTCATTR full");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item2->HasAttr(applyType))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTCATTR has");
|
||||
return false;
|
||||
}
|
||||
|
||||
item2->AddAttribute(applyType, applyValue);
|
||||
|
||||
{
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), "%u %u %d", item2->GetID(), applyType, applyValue);
|
||||
LogManager::instance().ItemLog(this, item, "COSTUME_ENCHANT", buf);
|
||||
}
|
||||
|
||||
item->SetCount(item->GetCount() - 1);
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTCATTR done");
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// AVA2 mount costume + mount skin (ENABLE_MOUNT_COSTUME_SYSTEM / ENABLE_MOUNT_SKIN), ported onto the
|
||||
// 40250 horse: the worn costume (or its skin) only replaces the horse race in GetMyHorseVnum, so
|
||||
// riding still needs horse level >= 1 and uses horse stamina, exactly as on AVA2.
|
||||
// Messages go to the client as "MTMOUNT <code>" commands (rendered by the client's mt_mount script)
|
||||
// instead of AVA2's numeric locale strings 334 / 1097 / 1098.
|
||||
#include "stdafx.h"
|
||||
#include "char.h"
|
||||
#include "item.h"
|
||||
|
||||
// AVA2 CanEquipNow: a skin needs a worn mount and cannot be put on while riding.
|
||||
bool CHARACTER::MountCostumeCanEquip(LPITEM item)
|
||||
{
|
||||
if (!item->IsCostumeMountSkin())
|
||||
return true;
|
||||
|
||||
if (IsRiding())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT riding");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetWear(WEAR_COSTUME_MOUNT))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT need_mount");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// AVA2 CanUnequipNow: neither piece comes off while riding; the mount stays while a skin is worn.
|
||||
bool CHARACTER::MountCostumeCanUnequip(LPITEM item)
|
||||
{
|
||||
if (!item->IsCostumeMount() && !item->IsCostumeMountSkin())
|
||||
return true;
|
||||
|
||||
if (IsRiding())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT riding");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item->IsCostumeMount() && GetWear(WEAR_COSTUME_MOUNT_SKIN))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT has_skin");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// AVA2 EquipItem tail: re-summon so the horse takes the new race.
|
||||
void CHARACTER::MountCostumeEquipped(LPITEM item)
|
||||
{
|
||||
if (!item->IsCostumeMount() && !item->IsCostumeMountSkin())
|
||||
return;
|
||||
|
||||
if (GetHorseLevel() <= 0)
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT need_horse");
|
||||
|
||||
if (GetHorse())
|
||||
HorseSummon(false);
|
||||
HorseSummon(true);
|
||||
}
|
||||
|
||||
// AVA2 UnequipItem / MoveItem: taking the mount off sends the horse away, taking the skin off
|
||||
// re-summons it with the mount's race (bAlwaysSummon: UnequipItem summons even without a horse out).
|
||||
void CHARACTER::MountCostumeUnequipped(LPITEM item, bool bAlwaysSummon)
|
||||
{
|
||||
if (item->IsCostumeMount())
|
||||
{
|
||||
if (GetHorse())
|
||||
HorseSummon(false);
|
||||
}
|
||||
else if (item->IsCostumeMountSkin())
|
||||
{
|
||||
if (GetHorse())
|
||||
{
|
||||
HorseSummon(false);
|
||||
HorseSummon(true);
|
||||
}
|
||||
else if (bAlwaysSummon)
|
||||
HorseSummon(true);
|
||||
}
|
||||
}
|
||||
|
||||
// AVA2 input_login: a worn mount comes out on login.
|
||||
void CHARACTER::MountCostumeOnLogin()
|
||||
{
|
||||
if (!GetWear(WEAR_COSTUME_MOUNT))
|
||||
return;
|
||||
|
||||
if (!IsRiding() && !GetHorse())
|
||||
HorseSummon(true);
|
||||
else
|
||||
StopRiding();
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
// AVA2 talisman (ITEM_TALISMAN_EQUIPMENT + ELEMENT_NEW_BONUSES): ITEM_ARMOR / ARMOR_PENDANT, worn in WEAR_PENDANT.
|
||||
// A talisman's APPLY_ENCHANT_<element> (= its refine level, +0..+200) adds that % to attacks on monsters with the
|
||||
// matching RACE_FLAG_ATT_* (battle.cpp).
|
||||
// Its random attributes come from AVA2's item_attr "pendant" column. That column is not added to 203's item_attr
|
||||
// table and ATTRIBUTE_SET_*, which would change the db -> game boot packet. Instead the pool lives here and
|
||||
// GetAttributeSetIndex() stays -1, so the 40250 switchers, the switchbot and the attribute lock never touch a
|
||||
// talisman, and drops carry no magic attributes.
|
||||
// Only the talisman items change its attributes; AVA2 uses 71302 (reroll) and 71301 (add, up to 5). The
|
||||
// imported 53996 / 53997 (AVA2 generic switcher / adder, which would be free 40250 gear rerolls) act as the same
|
||||
// talisman reroll / add here, as their zh names say. Messages go to the client as "MTPENDANT <code>"
|
||||
// (rendered by the client's mt_pendant script) instead of AVA2's locale strings 1056 / 1057 / 1067.
|
||||
#include "stdafx.h"
|
||||
#include "constants.h"
|
||||
#include "char.h"
|
||||
#include "item.h"
|
||||
#include "log.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
struct PendantAttr
|
||||
{
|
||||
BYTE bApply;
|
||||
DWORD dwProb;
|
||||
short asValues[ITEM_ATTRIBUTE_MAX_LEVEL];
|
||||
};
|
||||
|
||||
// AVA2 player.item_attr rows whose pendant column is set (all with max level 5).
|
||||
const PendantAttr s_aPendantAttr[] =
|
||||
{
|
||||
{ APPLY_MAX_HP, 35, { 1500, 1500, 1500, 2000, 2000 } },
|
||||
{ APPLY_MAX_SP, 35, { 50, 50, 50, 80, 80 } },
|
||||
{ APPLY_CON, 11, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_INT, 11, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_STR, 11, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_DEX, 11, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_HP_REGEN, 60, { 20, 20, 20, 30, 30 } },
|
||||
{ APPLY_SP_REGEN, 60, { 20, 20, 20, 30, 30 } },
|
||||
{ APPLY_STEAL_HP, 50, { 5, 5, 5, 10, 10 } },
|
||||
{ APPLY_STEAL_SP, 50, { 5, 5, 5, 10, 10 } },
|
||||
{ APPLY_MANA_BURN_PCT, 18, { 5, 5, 5, 10, 10 } },
|
||||
{ APPLY_DODGE, 15, { 8, 8, 8, 10, 10 } },
|
||||
{ APPLY_POISON_REDUCE, 15, { 5, 5, 5, 8, 8 } },
|
||||
{ APPLY_KILL_SP_RECOVER, 10, { 5, 5, 5, 10, 10 } },
|
||||
{ APPLY_EXP_DOUBLE_BONUS, 10, { 10, 10, 10, 20, 20 } },
|
||||
{ APPLY_GOLD_DOUBLE_BONUS, 10, { 10, 10, 10, 20, 20 } },
|
||||
{ APPLY_ITEM_DROP_BONUS, 10, { 10, 10, 10, 20, 20 } },
|
||||
{ APPLY_KILL_HP_RECOVER, 10, { 5, 5, 5, 10, 10 } },
|
||||
{ APPLY_ANTI_CRITICAL_PCT, 10, { 4, 4, 4, 10, 10 } },
|
||||
{ APPLY_ANTI_PENETRATE_PCT, 10, { 4, 4, 4, 10, 10 } },
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PENDANT_MAX_ATTR = 5, // AVA2: 71301 adds while GetAttributeCount() < 5
|
||||
};
|
||||
|
||||
// 203 CItem::ChangeAttribute / AddAttribute level tables (AVA2 has the same).
|
||||
const int s_aiChangeLevel[ITEM_ATTRIBUTE_MAX_LEVEL] = { 0, 10, 40, 35, 15 };
|
||||
const int s_aiAddLevel[ITEM_ATTRIBUTE_MAX_LEVEL] = { 40, 50, 10, 0, 0 };
|
||||
|
||||
int PendantLevel(const int * aiPercent)
|
||||
{
|
||||
int iPercent = number(1, 100);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ITEM_ATTRIBUTE_MAX_LEVEL - 1; ++i)
|
||||
{
|
||||
if (iPercent <= aiPercent[i])
|
||||
break;
|
||||
|
||||
iPercent -= aiPercent[i];
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
// CItem::PutAttributeWithLevel over the talisman pool.
|
||||
void PendantPutAttribute(LPITEM item, const int * aiPercent)
|
||||
{
|
||||
DWORD dwTotal = 0;
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aPendantAttr) / sizeof(s_aPendantAttr[0]); ++i)
|
||||
if (!item->HasAttr(s_aPendantAttr[i].bApply))
|
||||
dwTotal += s_aPendantAttr[i].dwProb;
|
||||
|
||||
if (!dwTotal)
|
||||
return;
|
||||
|
||||
DWORD dwProb = number(1, dwTotal);
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aPendantAttr) / sizeof(s_aPendantAttr[0]); ++i)
|
||||
{
|
||||
const PendantAttr & r = s_aPendantAttr[i];
|
||||
|
||||
if (item->HasAttr(r.bApply))
|
||||
continue;
|
||||
|
||||
if (dwProb <= r.dwProb)
|
||||
{
|
||||
item->AddAttribute(r.bApply, r.asValues[PendantLevel(aiPercent)]);
|
||||
return;
|
||||
}
|
||||
|
||||
dwProb -= r.dwProb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CItem::IsTalisman()
|
||||
{
|
||||
return GetType() == ITEM_ARMOR && GetSubType() == ARMOR_PENDANT;
|
||||
}
|
||||
|
||||
// 1 = reroll, 2 = add, 0 = not a talisman attribute item.
|
||||
int CItem::GetPendantScrollKind()
|
||||
{
|
||||
if (GetType() != ITEM_USE)
|
||||
return 0;
|
||||
|
||||
switch (GetVnum())
|
||||
{
|
||||
case 71302:
|
||||
case 53996:
|
||||
return GetSubType() == USE_CHANGE_ATTRIBUTE ? 1 : 0;
|
||||
|
||||
case 71301:
|
||||
case 53997:
|
||||
return GetSubType() == USE_ADD_ATTRIBUTE ? 2 : 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CHARACTER::PendantScrollUse(LPITEM item, LPITEM item2)
|
||||
{
|
||||
if (item2->IsExchanging())
|
||||
return false;
|
||||
|
||||
const int kind = item->GetPendantScrollKind();
|
||||
|
||||
if (!kind || !item2->IsTalisman())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTPENDANT target");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 40250 never changes the attributes of a worn item (the "Fix" in the switcher path).
|
||||
if (item2->IsEquipped())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTPENDANT equipped");
|
||||
return false;
|
||||
}
|
||||
|
||||
char buf[21];
|
||||
snprintf(buf, sizeof(buf), "%u", item2->GetID());
|
||||
|
||||
if (kind == 1)
|
||||
{
|
||||
const int iCount = item2->GetAttributeCount();
|
||||
|
||||
if (!iCount)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTPENDANT empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
item2->ClearAttribute();
|
||||
|
||||
for (int i = 0; i < iCount; ++i)
|
||||
PendantPutAttribute(item2, s_aiChangeLevel);
|
||||
|
||||
LogManager::instance().ItemLog(this, item, "PENDANT_CHANGE", buf);
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTPENDANT changed");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item2->GetAttributeCount() >= PENDANT_MAX_ATTR)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTPENDANT full");
|
||||
return false;
|
||||
}
|
||||
|
||||
PendantPutAttribute(item2, s_aiAddLevel);
|
||||
LogManager::instance().ItemLog(this, item, "PENDANT_ADD", buf);
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTPENDANT added");
|
||||
}
|
||||
|
||||
item->SetCount(item->GetCount() - 1);
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
// AVA2 new rings (ENABLE_NEW_RINGS): ITEM_NEW_RINGS (36), worn in WEAR_RINGS_1 / WEAR_RINGS_2 (item.cpp
|
||||
// FindEquipCell). They are socket accessories like the 40250 bracelets / necklaces / earrings (IsAccessoryForSocket):
|
||||
// drills add sockets, and each ring family takes the jewel of the matching AVA2 accessory family (CanPutInto).
|
||||
// Their random attributes come from AVA2's item_attr_rings table. As with the talismans (port_pendant.cpp), that
|
||||
// table is not added to 203's item_attr / ATTRIBUTE_SET_*, which would change the db -> game boot packet: the pool
|
||||
// lives here, GetAttributeSetIndex() stays -1 and PutAttributeWithLevel() branches to it, and the 40250 switchers /
|
||||
// adders accept rings (char_item.cpp). The switchbot and the rare (6th / 7th) attributes skip rings; AVA2's
|
||||
// item_attr_rare_rings is not ported. Rings drop without attributes (AlterToMagicItem only handles weapons / armor).
|
||||
#include "stdafx.h"
|
||||
#include "constants.h"
|
||||
#include "item.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
struct RingAttr
|
||||
{
|
||||
BYTE bApply;
|
||||
DWORD dwProb;
|
||||
short asValues[ITEM_ATTRIBUTE_MAX_LEVEL];
|
||||
};
|
||||
|
||||
// AVA2 player.item_attr_rings (all with max level 5).
|
||||
const RingAttr s_aRingAttr[] =
|
||||
{
|
||||
{ APPLY_MAX_HP, 35, { 200, 300, 300, 500, 500 } },
|
||||
{ APPLY_MAX_SP, 35, { 200, 200, 200, 350, 350 } },
|
||||
{ APPLY_PENETRATE_PCT, 20, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_REFLECT_MELEE, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_STEAL_SP, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_STEAL_HP, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_GOLD_DOUBLE_BONUS, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_POISON_REDUCE, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_RESIST_MAGIC, 15, { 2, 3, 3, 5, 5 } },
|
||||
{ APPLY_ATTBONUS_DEVIL, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_UNDEAD, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_MILGYO, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_ORC, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_ANIMAL, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_HUMAN, 15, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_CRITICAL_PCT, 20, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_HP_REGEN, 20, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_SP_REGEN, 20, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_POISON_PCT, 15, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_SLOW_PCT, 15, { 3, 3, 3, 5, 5 } },
|
||||
};
|
||||
|
||||
// AVA2 CItem::CanPutInto / GetAccessorySocketVnumRings: ring family (vnum / 10 * 10) -> jewel.
|
||||
const struct { DWORD dwRing, dwJewel; } s_aRingJewel[] =
|
||||
{
|
||||
{ 19220, 50634 },
|
||||
{ 19500, 50635 },
|
||||
{ 19520, 50636 },
|
||||
{ 19540, 50637 },
|
||||
{ 19560, 50638 },
|
||||
};
|
||||
}
|
||||
|
||||
bool CItem::IsNewRing()
|
||||
{
|
||||
return GetType() == ITEM_NEW_RINGS;
|
||||
}
|
||||
|
||||
DWORD GetNewRingJewelVnum(DWORD dwRingVnum)
|
||||
{
|
||||
const DWORD dwFamily = dwRingVnum / 10 * 10;
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aRingJewel) / sizeof(s_aRingJewel[0]); ++i)
|
||||
if (s_aRingJewel[i].dwRing == dwFamily)
|
||||
return s_aRingJewel[i].dwJewel;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CItem::PutAttributeWithLevel over the ring pool (bLevel 1..5).
|
||||
void CItem::PutNewRingAttributeWithLevel(BYTE bLevel)
|
||||
{
|
||||
if (bLevel < 1 || bLevel > ITEM_ATTRIBUTE_MAX_LEVEL)
|
||||
return;
|
||||
|
||||
DWORD dwTotal = 0;
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aRingAttr) / sizeof(s_aRingAttr[0]); ++i)
|
||||
if (!HasAttr(s_aRingAttr[i].bApply))
|
||||
dwTotal += s_aRingAttr[i].dwProb;
|
||||
|
||||
if (!dwTotal)
|
||||
return;
|
||||
|
||||
DWORD dwProb = number(1, dwTotal);
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aRingAttr) / sizeof(s_aRingAttr[0]); ++i)
|
||||
{
|
||||
const RingAttr & r = s_aRingAttr[i];
|
||||
|
||||
if (HasAttr(r.bApply))
|
||||
continue;
|
||||
|
||||
if (dwProb <= r.dwProb)
|
||||
{
|
||||
AddAttribute(r.bApply, r.asValues[bLevel - 1]);
|
||||
return;
|
||||
}
|
||||
|
||||
dwProb -= r.dwProb;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,440 @@
|
||||
// AVA2 sash window (combine / absorb), ported from the AVA2 __SASH_SYSTEM__ char.cpp block.
|
||||
// Messages go to the client as "MTSASH <code> [arg]" commands (rendered by the client's mt_sash
|
||||
// script) instead of AVA2's numeric locale strings; AVA2's sash log table is replaced by ItemLog.
|
||||
#include "stdafx.h"
|
||||
#include "utils.h"
|
||||
#include "char.h"
|
||||
#include "desc.h"
|
||||
#include "db.h"
|
||||
#include "item.h"
|
||||
#include "item_manager.h"
|
||||
#include "log.h"
|
||||
#include "packet.h"
|
||||
|
||||
static void SendSashPacket(LPCHARACTER ch, BYTE bSubHeader, bool bWindow, DWORD dwPrice, BYTE bPos, TItemPos tPos,
|
||||
DWORD dwItemVnum, DWORD dwMinAbs, DWORD dwMaxAbs)
|
||||
{
|
||||
if (!ch->GetDesc())
|
||||
return;
|
||||
|
||||
TPacketSash sPacket;
|
||||
sPacket.header = HEADER_GC_SASH;
|
||||
sPacket.subheader = bSubHeader;
|
||||
sPacket.bWindow = bWindow;
|
||||
sPacket.dwPrice = dwPrice;
|
||||
sPacket.bPos = bPos;
|
||||
sPacket.tPos = tPos;
|
||||
sPacket.dwItemVnum = dwItemVnum;
|
||||
sPacket.dwMinAbs = dwMinAbs;
|
||||
sPacket.dwMaxAbs = dwMaxAbs;
|
||||
ch->GetDesc()->Packet(&sPacket, sizeof(TPacketSash));
|
||||
}
|
||||
|
||||
static TItemPos SashNoPos()
|
||||
{
|
||||
return TItemPos(INVENTORY, 0);
|
||||
}
|
||||
|
||||
void CHARACTER::OpenSash(bool bCombination)
|
||||
{
|
||||
if (isSashOpened(bCombination))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH already_open");
|
||||
return;
|
||||
}
|
||||
|
||||
if (bCombination)
|
||||
{
|
||||
if (m_bSashAbsorption)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH absorb_open");
|
||||
return;
|
||||
}
|
||||
|
||||
m_bSashCombination = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_bSashCombination)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH combine_open");
|
||||
return;
|
||||
}
|
||||
|
||||
m_bSashAbsorption = true;
|
||||
}
|
||||
|
||||
SendSashPacket(this, SASH_SUBHEADER_GC_OPEN, bCombination, 0, 0, SashNoPos(), 0, 0, 0);
|
||||
ClearSashMaterials();
|
||||
}
|
||||
|
||||
void CHARACTER::CloseSash()
|
||||
{
|
||||
if (!m_bSashCombination && !m_bSashAbsorption)
|
||||
return;
|
||||
|
||||
bool bWindow = m_bSashCombination;
|
||||
SendSashPacket(this, SASH_SUBHEADER_GC_CLOSE, bWindow, 0, 0, SashNoPos(), 0, 0, 0);
|
||||
|
||||
if (bWindow)
|
||||
m_bSashCombination = false;
|
||||
else
|
||||
m_bSashAbsorption = false;
|
||||
|
||||
ClearSashMaterials();
|
||||
}
|
||||
|
||||
void CHARACTER::ClearSashMaterials()
|
||||
{
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
for (int i = 0; i < SASH_WINDOW_MAX_MATERIALS; ++i)
|
||||
{
|
||||
if (!pkItemMaterial[i])
|
||||
continue;
|
||||
|
||||
pkItemMaterial[i]->Lock(false);
|
||||
pkItemMaterial[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool CHARACTER::SashIsSameGrade(long lGrade)
|
||||
{
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
if (!pkItemMaterial[0])
|
||||
return false;
|
||||
|
||||
return pkItemMaterial[0]->GetValue(SASH_GRADE_VALUE_FIELD) == lGrade;
|
||||
}
|
||||
|
||||
DWORD CHARACTER::GetSashCombinePrice(long lGrade)
|
||||
{
|
||||
switch (lGrade)
|
||||
{
|
||||
case 2: return SASH_GRADE_2_PRICE;
|
||||
case 3: return SASH_GRADE_3_PRICE;
|
||||
case 4: return SASH_GRADE_4_PRICE;
|
||||
default: return SASH_GRADE_1_PRICE;
|
||||
}
|
||||
}
|
||||
|
||||
BYTE CHARACTER::CheckEmptyMaterialSlot()
|
||||
{
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
for (int i = 0; i < SASH_WINDOW_MAX_MATERIALS; ++i)
|
||||
{
|
||||
if (!pkItemMaterial[i])
|
||||
return i;
|
||||
}
|
||||
|
||||
return 255;
|
||||
}
|
||||
|
||||
void CHARACTER::GetSashCombineResult(DWORD & dwItemVnum, DWORD & dwMinAbs, DWORD & dwMaxAbs)
|
||||
{
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
dwItemVnum = 0;
|
||||
dwMinAbs = 0;
|
||||
dwMaxAbs = 0;
|
||||
|
||||
if (!pkItemMaterial[0] || !pkItemMaterial[1])
|
||||
return;
|
||||
|
||||
if (m_bSashCombination)
|
||||
{
|
||||
long lVal = pkItemMaterial[0]->GetValue(SASH_GRADE_VALUE_FIELD);
|
||||
if (lVal == 4)
|
||||
{
|
||||
dwItemVnum = pkItemMaterial[0]->GetOriginalVnum();
|
||||
dwMinAbs = pkItemMaterial[0]->GetSocket(SASH_ABSORPTION_SOCKET);
|
||||
dwMaxAbs = MIN(dwMinAbs + SASH_GRADE_4_ABS_RANGE, (DWORD) SASH_GRADE_4_ABS_MAX);
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD dwMaskVnum = pkItemMaterial[0]->GetOriginalVnum();
|
||||
if (ITEM_MANAGER::instance().GetTable(dwMaskVnum + 1))
|
||||
dwMaskVnum += 1;
|
||||
|
||||
dwItemVnum = dwMaskVnum;
|
||||
switch (lVal)
|
||||
{
|
||||
case 2:
|
||||
dwMinAbs = dwMaxAbs = SASH_GRADE_3_ABS;
|
||||
break;
|
||||
case 3:
|
||||
dwMinAbs = SASH_GRADE_4_ABS_MIN;
|
||||
dwMaxAbs = SASH_GRADE_4_ABS_MAX_COMB;
|
||||
break;
|
||||
default:
|
||||
dwMinAbs = dwMaxAbs = SASH_GRADE_2_ABS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dwItemVnum = pkItemMaterial[0]->GetOriginalVnum();
|
||||
dwMinAbs = dwMaxAbs = pkItemMaterial[0]->GetSocket(SASH_ABSORPTION_SOCKET);
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsSash(LPITEM pkItem)
|
||||
{
|
||||
return pkItem->GetType() == ITEM_COSTUME && pkItem->GetSubType() == COSTUME_SASH;
|
||||
}
|
||||
|
||||
static bool IsSashAbsorbable(LPITEM pkItem)
|
||||
{
|
||||
return pkItem->GetType() == ITEM_WEAPON || (pkItem->GetType() == ITEM_ARMOR && pkItem->GetSubType() == ARMOR_BODY);
|
||||
}
|
||||
|
||||
void CHARACTER::AddSashMaterial(TItemPos tPos, BYTE bPos)
|
||||
{
|
||||
if (!m_bSashCombination && !m_bSashAbsorption)
|
||||
return;
|
||||
|
||||
if (bPos >= SASH_WINDOW_MAX_MATERIALS)
|
||||
{
|
||||
if (bPos != 255)
|
||||
return;
|
||||
|
||||
bPos = CheckEmptyMaterialSlot();
|
||||
if (bPos >= SASH_WINDOW_MAX_MATERIALS)
|
||||
return;
|
||||
}
|
||||
|
||||
if (tPos.window_type != INVENTORY)
|
||||
return;
|
||||
|
||||
LPITEM pkItem = GetItem(tPos);
|
||||
if (!pkItem)
|
||||
return;
|
||||
if (pkItem->GetCell() >= INVENTORY_MAX_NUM || pkItem->IsEquipped() || tPos.IsBeltInventoryPosition() || pkItem->IsDragonSoul() || pkItem->IsExchanging())
|
||||
return;
|
||||
|
||||
// the sash slot (0) and both combine slots take sashes only
|
||||
if ((m_bSashCombination || bPos == 0) && !IsSash(pkItem))
|
||||
return;
|
||||
|
||||
if (pkItem->isLocked())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH locked");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_bSashCombination)
|
||||
{
|
||||
if (bPos == 1 && !SashIsSameGrade(pkItem->GetValue(SASH_GRADE_VALUE_FIELD)))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH grade");
|
||||
return;
|
||||
}
|
||||
if (pkItem->GetSocket(SASH_ABSORPTION_SOCKET) >= SASH_GRADE_4_ABS_MAX)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH max_abs");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (bPos == 1)
|
||||
{
|
||||
if (!IsSashAbsorbable(pkItem))
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH absorb_type");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (pkItem->GetSocket(SASH_ABSORBED_SOCKET) > 0)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH absorbed");
|
||||
return;
|
||||
}
|
||||
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
if (bPos == 1 && !pkItemMaterial[0])
|
||||
return;
|
||||
|
||||
if (pkItemMaterial[bPos])
|
||||
return;
|
||||
|
||||
pkItemMaterial[bPos] = pkItem;
|
||||
pkItem->Lock(true);
|
||||
|
||||
DWORD dwItemVnum, dwMinAbs, dwMaxAbs;
|
||||
GetSashCombineResult(dwItemVnum, dwMinAbs, dwMaxAbs);
|
||||
SendSashPacket(this, SASH_SUBHEADER_GC_ADDED, m_bSashCombination, GetSashCombinePrice(pkItem->GetValue(SASH_GRADE_VALUE_FIELD)),
|
||||
bPos, tPos, dwItemVnum, dwMinAbs, dwMaxAbs);
|
||||
}
|
||||
|
||||
void CHARACTER::RemoveSashMaterial(BYTE bPos)
|
||||
{
|
||||
if (bPos >= SASH_WINDOW_MAX_MATERIALS)
|
||||
return;
|
||||
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
DWORD dwPrice = 0;
|
||||
|
||||
if (bPos == 1)
|
||||
{
|
||||
if (pkItemMaterial[bPos])
|
||||
{
|
||||
pkItemMaterial[bPos]->Lock(false);
|
||||
pkItemMaterial[bPos] = NULL;
|
||||
}
|
||||
|
||||
if (pkItemMaterial[0])
|
||||
dwPrice = GetSashCombinePrice(pkItemMaterial[0]->GetValue(SASH_GRADE_VALUE_FIELD));
|
||||
}
|
||||
else
|
||||
ClearSashMaterials();
|
||||
|
||||
SendSashPacket(this, SASH_SUBHEADER_GC_REMOVED, m_bSashCombination, dwPrice, bPos, SashNoPos(), 0, 0, 0);
|
||||
}
|
||||
|
||||
BYTE CHARACTER::CanRefineSashMaterials()
|
||||
{
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
if (!pkItemMaterial[0] || !pkItemMaterial[1])
|
||||
return 0;
|
||||
|
||||
if (m_bSashCombination)
|
||||
return (IsSash(pkItemMaterial[0]) && IsSash(pkItemMaterial[1])) ? 1 : 0;
|
||||
|
||||
if (m_bSashAbsorption)
|
||||
{
|
||||
// AVA2 overwrote the sash check with the target check; both must hold
|
||||
if (!IsSash(pkItemMaterial[0]) || !IsSashAbsorbable(pkItemMaterial[1]))
|
||||
return 0;
|
||||
if (pkItemMaterial[0]->GetSocket(SASH_ABSORBED_SOCKET) > 0)
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CHARACTER::RefineSashMaterials()
|
||||
{
|
||||
BYTE bCan = CanRefineSashMaterials();
|
||||
if (bCan == 0)
|
||||
return;
|
||||
|
||||
LPITEM * pkItemMaterial = GetSashMaterials();
|
||||
|
||||
DWORD dwItemVnum, dwMinAbs, dwMaxAbs;
|
||||
GetSashCombineResult(dwItemVnum, dwMinAbs, dwMaxAbs);
|
||||
long long llPrice = GetSashCombinePrice(pkItemMaterial[0]->GetValue(SASH_GRADE_VALUE_FIELD));
|
||||
|
||||
if (bCan == 1)
|
||||
{
|
||||
int iSuccessChance;
|
||||
long lVal = pkItemMaterial[0]->GetValue(SASH_GRADE_VALUE_FIELD);
|
||||
switch (lVal)
|
||||
{
|
||||
case 2: iSuccessChance = SASH_COMBINE_GRADE_2; break;
|
||||
case 3: iSuccessChance = SASH_COMBINE_GRADE_3; break;
|
||||
case 4: iSuccessChance = SASH_COMBINE_GRADE_4; break;
|
||||
default: iSuccessChance = SASH_COMBINE_GRADE_1; break;
|
||||
}
|
||||
|
||||
if (GetGold() < llPrice)
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH gold");
|
||||
return;
|
||||
}
|
||||
|
||||
bool bSuccess = number(1, 100) <= iSuccessChance;
|
||||
if (bSuccess)
|
||||
{
|
||||
LPITEM pkItem = ITEM_MANAGER::instance().CreateItem(dwItemVnum, 1, 0, false);
|
||||
if (!pkItem)
|
||||
{
|
||||
sys_err("sash combine: %u can't be created.", dwItemVnum);
|
||||
return;
|
||||
}
|
||||
|
||||
ITEM_MANAGER::CopyAllAttrTo(pkItemMaterial[0], pkItem);
|
||||
DWORD dwAbs = (dwMinAbs == dwMaxAbs ? dwMinAbs : number(dwMinAbs + 1, dwMaxAbs));
|
||||
pkItem->SetSocket(SASH_ABSORPTION_SOCKET, dwAbs);
|
||||
pkItem->SetSocket(SASH_ABSORBED_SOCKET, pkItemMaterial[0]->GetSocket(SASH_ABSORBED_SOCKET));
|
||||
|
||||
PointChange(POINT_GOLD, -llPrice);
|
||||
DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, pkItemMaterial[0]->GetVnum(), -llPrice);
|
||||
|
||||
WORD wCell = pkItemMaterial[0]->GetCell();
|
||||
ITEM_MANAGER::instance().RemoveItem(pkItemMaterial[0], "SASH COMBINE (REFINE SUCCESS)");
|
||||
ITEM_MANAGER::instance().RemoveItem(pkItemMaterial[1], "SASH COMBINE (REFINE SUCCESS)");
|
||||
pkItemMaterial[0] = pkItemMaterial[1] = NULL;
|
||||
|
||||
pkItem->AddToCharacter(this, TItemPos(INVENTORY, wCell));
|
||||
ITEM_MANAGER::instance().FlushDelayedSave(pkItem);
|
||||
pkItem->AttrLog();
|
||||
LogManager::instance().ItemLog(this, pkItem, "SASH COMBINE SUCCESS", pkItem->GetName());
|
||||
|
||||
if (lVal == 4)
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH abs %u", dwAbs);
|
||||
else
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH success");
|
||||
|
||||
EffectPacket(SE_EFFECT_SASH_SUCCEDED);
|
||||
}
|
||||
else
|
||||
{
|
||||
PointChange(POINT_GOLD, -llPrice);
|
||||
DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, pkItemMaterial[0]->GetVnum(), -llPrice);
|
||||
|
||||
LogManager::instance().ItemLog(this, pkItemMaterial[1], "SASH COMBINE FAIL", pkItemMaterial[1]->GetName());
|
||||
ITEM_MANAGER::instance().RemoveItem(pkItemMaterial[1], "SASH COMBINE (REFINE FAIL)");
|
||||
pkItemMaterial[1] = NULL;
|
||||
|
||||
if (lVal == 4)
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH abs %ld", pkItemMaterial[0]->GetSocket(SASH_ABSORPTION_SOCKET));
|
||||
else
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH fail");
|
||||
}
|
||||
|
||||
SendSashPacket(this, SASH_SUBHEADER_CG_REFINED, m_bSashCombination, (DWORD) llPrice, 0, SashNoPos(), 0, 0, bSuccess ? 100 : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
LPITEM pkSash = pkItemMaterial[0];
|
||||
LPITEM pkTarget = pkItemMaterial[1];
|
||||
|
||||
pkTarget->CopyAttributeTo(pkSash);
|
||||
pkSash->SetSocket(SASH_ABSORBED_SOCKET, pkTarget->GetOriginalVnum());
|
||||
for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i)
|
||||
{
|
||||
if (pkSash->GetAttributeValue(i) < 0)
|
||||
pkSash->SetForceAttribute(i, pkSash->GetAttributeType(i), 0);
|
||||
}
|
||||
|
||||
LogManager::instance().ItemLog(this, pkSash, "SASH ABSORB", pkTarget->GetName());
|
||||
ITEM_MANAGER::instance().RemoveItem(pkTarget, "SASH ABSORBED (REFINE SUCCESS)");
|
||||
pkItemMaterial[1] = NULL;
|
||||
|
||||
ITEM_MANAGER::instance().FlushDelayedSave(pkSash);
|
||||
pkSash->AttrLog();
|
||||
|
||||
ChatPacket(CHAT_TYPE_COMMAND, "MTSASH success");
|
||||
ClearSashMaterials();
|
||||
|
||||
SendSashPacket(this, SASH_SUBHEADER_CG_REFINED, m_bSashCombination, (DWORD) llPrice, 255, SashNoPos(), 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// An absorbed weapon adds its attack (values 3/4 + 5) and magic attack (1/2 + 5) at the absorption %.
|
||||
bool Sash_GetAbsorbedWeaponBonus(LPCHARACTER ch, int * piMin, int * piMax, int * piMagMin, int * piMagMax)
|
||||
{
|
||||
LPITEM pkSash = ch ? ch->GetWear(WEAR_COSTUME_SASH) : NULL;
|
||||
if (!pkSash)
|
||||
return false;
|
||||
|
||||
const TItemTable * pkAbsorbed = ITEM_MANAGER::instance().GetTable(pkSash->GetSocket(SASH_ABSORBED_SOCKET));
|
||||
if (!pkAbsorbed || pkAbsorbed->bType != ITEM_WEAPON)
|
||||
return false;
|
||||
|
||||
const double dPct = pkSash->GetSocket(SASH_ABSORPTION_SOCKET) / 100.0;
|
||||
*piMin = (int) ((pkAbsorbed->alValues[3] + pkAbsorbed->alValues[5]) * dPct + .5);
|
||||
*piMax = (int) ((pkAbsorbed->alValues[4] + pkAbsorbed->alValues[5]) * dPct + .5);
|
||||
*piMagMin = (int) ((pkAbsorbed->alValues[1] + pkAbsorbed->alValues[5]) * dPct + .5);
|
||||
*piMagMax = (int) ((pkAbsorbed->alValues[2] + pkAbsorbed->alValues[5]) * dPct + .5);
|
||||
return true;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ static LPITEM PortSwitchItem(LPCHARACTER ch,const PortSwitchbot& bot) {
|
||||
}
|
||||
|
||||
static bool PortSwitchScroll(LPITEM scroll) {
|
||||
return scroll && scroll->GetType()==ITEM_USE && scroll->GetSubType()==USE_CHANGE_ATTRIBUTE;
|
||||
return scroll && scroll->GetType()==ITEM_USE && scroll->GetSubType()==USE_CHANGE_ATTRIBUTE && !scroll->IsCostumeEnchant() && !scroll->GetPendantScrollKind();
|
||||
}
|
||||
|
||||
static void PortSwitchState(LPCHARACTER ch,const PortSwitchbot* bot,bool active,const char* reason) {
|
||||
|
||||
@@ -13,6 +13,13 @@ std::vector<PortWikiRow> ITEM_MANAGER::PortWikiDrops(DWORD race) {
|
||||
if (mob->m_table.bRank<MOB_RANK_MAX_NUM)
|
||||
for (const auto& row:g_vec_pkCommonDropItem[mob->m_table.bRank])
|
||||
add(row.m_dwVnum,1,WIKI_COMMON,row.m_iLevelStart,row.m_iLevelEnd,row.m_iPercent,0);
|
||||
// common_drop_new.txt: the player range narrowed to the killers within 20 levels of this mob; map lists are not shown
|
||||
for (const CCommonDropNew* group:m_vec_pkCommonNewItemGroup) {
|
||||
int low=std::max(group->minLevel,int(mob->m_table.bLevel)-20),high=std::min(group->maxLevel,int(mob->m_table.bLevel)+20);
|
||||
if (low>high) continue;
|
||||
for (size_t i=0;i<group->m_vecItems.size() && i<group->m_vecProbs.size();++i)
|
||||
add(group->m_vecItems[i].first,group->m_vecItems[i].second,WIKI_COMMON,unsigned(std::max(low,0)),unsigned(high),group->m_vecProbs[i],0);
|
||||
}
|
||||
auto drop=m_map_pkDropItemGroup.find(race);
|
||||
if (drop!=m_map_pkDropItemGroup.end() && drop->second)
|
||||
for (const auto& row:drop->second->GetVector()) add(row.dwVnum,row.iCount,WIKI_DROP,0,0,row.dwPct,0);
|
||||
|
||||
@@ -1158,6 +1158,21 @@ namespace quest
|
||||
return 0;
|
||||
}
|
||||
|
||||
// AVA2 sash: pc.open_sash(true) = combine window, pc.open_sash(false) = absorb window
|
||||
int pc_open_sash(lua_State* L)
|
||||
{
|
||||
if (!lua_isboolean(L, 1))
|
||||
{
|
||||
sys_err("pc.open_sash: arg1 must be boolean");
|
||||
return 0;
|
||||
}
|
||||
|
||||
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
|
||||
if (ch)
|
||||
ch->OpenSash(lua_toboolean(L, 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pc_get_empire(lua_State* L)
|
||||
{
|
||||
lua_pushnumber(L, CQuestManager::instance().GetCurrentCharacterPtr()->GetEmpire());
|
||||
@@ -2885,6 +2900,7 @@ teleport_area:
|
||||
{ "in_dungeon", pc_in_dungeon },
|
||||
{ "getempire", pc_get_empire },
|
||||
{ "get_empire", pc_get_empire },
|
||||
{ "open_sash", pc_open_sash },
|
||||
{ "get_skill_group", pc_get_skillgroup },
|
||||
{ "set_skill_group", pc_set_skillgroup },
|
||||
{ "warp", pc_warp },
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 bonus numbering: the stone/boss applies the AVA2 stones and guardian weapons carry (docs/FEATURE-AVA2-UNLOCK.md)."""
|
||||
from pathlib import Path
|
||||
import re
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server'
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
|
||||
length=source('common/length.h')
|
||||
enum=length[length.index('enum EApplyTypes'):] if 'enum EApplyTypes' in length else length[length.index('APPLY_NONE'):]
|
||||
enum=enum[:enum.index('MAX_APPLY_NUM')]
|
||||
assert 'APPLY_ATTBONUS_STONE = 139,' in enum and 'APPLY_ATTBONUS_BOSS = 140,' in enum and enum.rstrip().endswith('= 140,')
|
||||
|
||||
# the db reads apply names by position, so the array index is the apply number
|
||||
reader=source('db/src/ProtoReader.cpp')
|
||||
names=re.findall(r'"([^"]+)"',re.search(r'arApplyType\[\]\s*=\s*\{(.*?)\};',reader,re.S).group(1))
|
||||
assert len(names)==141 and names[91]=='APPLY_ANTI_PENETRATE_PCT' and names[139:]==['APPLY_ATTBONUS_STONE','APPLY_ATTBONUS_BOSS'],names[88:]
|
||||
|
||||
# aApplyInfo is indexed by apply number: 141 rows, the two new ones mapped to the biolog points
|
||||
constants=source('game/src/constants.cpp')
|
||||
table=constants[constants.index('aApplyInfo[MAX_APPLY_NUM]'):]
|
||||
table=table[table.index('{')+1:table.index('};')]
|
||||
rows=re.findall(r'\{\s*(POINT_[A-Z_]+)',table)
|
||||
assert len(rows)==141 and rows[139:]==['POINT_ATTBONUS_STONE','POINT_ATTBONUS_BOSS'] and set(rows[92:123]+rows[129:139])=={'POINT_NONE'},len(rows)
|
||||
ELEM=('ELEC','FIRE','ICE','WIND','EARTH','DARK')
|
||||
# P7 talisman: APPLY_ENCHANT_* 123-128 (AVA2 names, ELECT for the db) -> POINT_ENCHANT_* 242-247
|
||||
assert rows[123:129]==['POINT_ENCHANT_'+e for e in ELEM],rows[123:129]
|
||||
assert names[123:129]==['APPLY_ENCHANT_'+('ELECT' if e=='ELEC' else e) for e in ELEM],names[123:129]
|
||||
assert '"ATTBONUS_STONE",\tAPPLY_ATTBONUS_STONE' in constants and '"ATTBONUS_BOSS",\tAPPLY_ATTBONUS_BOSS' in constants
|
||||
|
||||
char=source('game/src/char.cpp')
|
||||
apply=char[char.index('void CHARACTER::ApplyPoint('):char.index('void CHARACTER::MotionPacketEncode(')]
|
||||
assert all('case APPLY_ENCHANT_%s:'%e in apply for e in ELEM)
|
||||
assert 'case APPLY_ATTBONUS_STONE:' in apply and 'case APPLY_ATTBONUS_BOSS:' in apply
|
||||
points=source('game/src/char.h')
|
||||
assert all('POINT_ENCHANT_%s = %d,'%(e,242+i) in points for i,e in enumerate(ELEM)),'enchant points'
|
||||
assert 'POINT_ATTBONUS_STONE = 240,' in points and 'POINT_ATTBONUS_BOSS = 241,' in points
|
||||
battle=source('game/src/battle.cpp')
|
||||
assert all('GetPoint(POINT_ENCHANT_%s)'%e in battle for e in ELEM) and 'RACE_FLAG_ATT_ICE' in battle
|
||||
assert 'GetPoint(POINT_ATTBONUS_STONE)' in battle and 'GetPoint(POINT_ATTBONUS_BOSS)' in battle
|
||||
print('PASS: stone/boss applies 139/140 in the db reader, aApplyInfo, apply names and ApplyPoint')
|
||||
@@ -155,7 +155,7 @@ static bool Parses(const std::string& text){PortBpConfig c;std::istringstream in
|
||||
int main(int argc,char** argv){
|
||||
basePath=argv[1];
|
||||
// --- the shipped config
|
||||
{PortBpConfig c;std::ifstream in(argv[2]);assert(c.Parse(in));assert(c.seasons.size()==3 && c.seasons[0].id==202610);
|
||||
{PortBpConfig c;std::ifstream in(argv[2]);assert(c.Parse(in));assert(c.seasons.size()==15 && c.seasons[0].id==202610 && c.seasons.back().id==202712);
|
||||
for(auto& s:c.seasons){assert(s.missions.size()==8 && s.final.size()==4);for(auto& m:s.missions)for(auto& r:m.rewards)assert(tables.count(r.vnum));
|
||||
for(auto& r:s.final)assert(tables.count(r.vnum));}
|
||||
assert(c.seasons[0].end==c.seasons[1].start && c.Active(1790805600)==&c.seasons[0] && !c.Active(1790805599));}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 costume enchants (docs/FEATURE-AVA2-UNLOCK.md P6): 54001-54267 add one fixed attribute to a
|
||||
body/hair/mount-skin costume, are routed before the 40250 switcher path and are no switchbot scroll."""
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server/game/src'
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
|
||||
items=source('char_item.cpp')
|
||||
case=items[items.index('case USE_CHANGE_ATTRIBUTE2 :'):]
|
||||
hook=case.index('if (item->IsCostumeEnchant())\n\t\t\t\t\t\t\t\treturn CostumeEnchantUse(item, item2);')
|
||||
assert hook<case.index('BuffOnAttr_RemoveBuffsFromItem(item2)')<case.index('ITEM_COSTUME == item2->GetType()'),'hook must run before the costume refusal'
|
||||
assert '!scroll->IsCostumeEnchant()' in source('port_switchbot.h')
|
||||
assert 'port_costume_attr.cpp' in source('Makefile')
|
||||
port=source('port_costume_attr.cpp')
|
||||
for text in ('COSTUME_ENCHANT_VNUM_MIN = 54001','COSTUME_ENCHANT_VNUM_MAX = 54267','COSTUME_ENCHANT_MAX_ATTR = 3',
|
||||
'case COSTUME_BODY:\n\t\t\treturn 1;','case COSTUME_HAIR:\n\t\t\treturn 2;','case COSTUME_MOUNT_SKIN:\n\t\t\treturn 4;',
|
||||
'GetValue(2) & (1 << flag)','item->SetCount(item->GetCount() - 1);'):
|
||||
assert text in port,text
|
||||
codes=('target','none','equipped','full','has','done')
|
||||
for code in codes:assert '"MTCATTR %s"'%code in port,code
|
||||
# the add must come after every refusal
|
||||
assert all(port.index('"MTCATTR %s"'%c)<port.index('item2->AddAttribute') for c in codes[:-1])
|
||||
script=ROOT.parent/'metin2-client/src/platform/ScriptLib/CostumeAttrScript.inc'
|
||||
if script.is_file():
|
||||
s=script.read_text()
|
||||
for code in codes:assert "'%s':"%code in s,code
|
||||
print('PASS: costume enchant hook before switcher path, body/hair/mount-skin masks, max 3, switchbot excluded, MTCATTR codes')
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 drop tables: the table builder on fixtures, then the wiring of the ported drop code."""
|
||||
from pathlib import Path
|
||||
import importlib.util
|
||||
import json
|
||||
import tempfile
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server/game/src'
|
||||
spec=importlib.util.spec_from_file_location('make_drops',ROOT/'tools/ava2-drops/make_drops.py')
|
||||
make_drops=importlib.util.module_from_spec(spec);spec.loader.exec_module(make_drops)
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix='mt-drops-') as folder:
|
||||
base=Path(folder);ava=base/'ava';live=base/'live';out=base/'out';ava.mkdir();live.mkdir()
|
||||
(ava/'mob_drop_item.txt').write_bytes(b'Group\tA\n{\n\tMob\t101\n\tType\tdrop\n\t1\t19\t1\t100\n\t2\t99999\t1\t100\n\t3\t110005\t1\t50\n}\n'
|
||||
b'Group\tB\n{\n\tMob\t102\n\tType\tdrop\n\t1\t99999\t1\t100\n}\n')
|
||||
(ava/'common_drop_new.txt').write_bytes(b'Group\tW\n{\n\tmap_index\t0\n\tlevel_range\t1\t12\n\t1\t19\t1\t0.03\n}\n')
|
||||
(ava/'special_item_group.txt').write_bytes(b'Group\tX\r\n{\r\n\tVnum\t50011\r\n\t1\t19\t5\t2\r\n}\r\n'
|
||||
b'Group\tGM\n{\n\tVnum\t50035\n\tType\tPct\n\t1\t19\t2000\t100\n}\n'
|
||||
b'Group\tNew\n{\n\tVnum\t77900\n\t1\t99999\t1\t30\n\t2\t19\t1\t30\n}\n')
|
||||
(live/'special_item_group.txt').write_bytes(b'Group\t\xc0\xcc\n{\n\tVnum\t50011\n\t1\t\xb0\xe6 \xc7\xe8\t1\t1\n}\n'
|
||||
b'Group\tKid\n{\n\tVnum\t50035\n\t1\t19\t1\t1\n}\n'
|
||||
b'Group\tOld\n{\n\tVnum\t10000\n\t1\t19\t1\t1\n}\n')
|
||||
(base/'proto.txt').write_bytes(b'VNUM\tNAME\n19\tsword\n110000~110099\tds\n')
|
||||
report=make_drops.build(ava,live,out,[base/'proto.txt'])
|
||||
mob=(out/'mob_drop_item.txt').read_bytes()
|
||||
# unknown items removed, entries renumbered (the reader stops at the first gap), empty groups skipped, ranges known
|
||||
assert mob==b'Group\tA\n{\n\tMob\t101\n\tType\tdrop\n\t1\t19\t1\t100\n\t2\t110005\t1\t50\n}\n',mob
|
||||
assert report['mob_dropped']=={'99999':2}
|
||||
assert b'level_range\t1\t12' in (out/'common_drop_new.txt').read_bytes()
|
||||
special=(out/'special_item_group.txt').read_bytes()
|
||||
assert b'Vnum\t50011\n\t1\t19\t5\t2' in special and b'\xb0\xe6' not in special # AVA2 replaces the same vnum
|
||||
assert b'Kid' in special and b'2000' not in special # 50035 is a different box on 203
|
||||
assert b'Old' in special and b'Vnum\t77900\n\t1\t19\t1\t30' in special
|
||||
assert (out/'common_drop_item.txt').read_bytes()==b''==(out/'etc_drop_item.txt').read_bytes()
|
||||
assert json.loads((out/'report.json').read_text())['special_replaced']==[50011]
|
||||
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
manager=source('item_manager.cpp')
|
||||
pct=manager[manager.index('bool ITEM_MANAGER::GetDropPct('):manager.index('bool ITEM_MANAGER::CreateDropItem(')]
|
||||
assert '?100:0' not in pct.replace(' ','') # the precedence bug that pinned the denominator to 100
|
||||
assert 'else\n\t\tiDeltaPercent += iDeltaPercent / 2;' in pct
|
||||
assert '(100 + CPrivManager::instance().GetPriv(pkKiller, PRIV_ITEM_DROP) + bonus)' in pct
|
||||
drop=manager[manager.index('bool ITEM_MANAGER::CreateDropItem('):]
|
||||
assert drop.index('// Drop Item Group')<drop.index('m_vec_pkCommonNewItemGroup')<drop.index('// MobDropItem Group')
|
||||
assert 'abs(pkChr->GetLevel() - iLevel) <= 20' in drop
|
||||
tables=source('item_manager_read_tables.cpp')
|
||||
assert 'CDropItemGroup* pkGroup = it->second;' not in tables # second group of a mob used an uninitialised pointer
|
||||
special=tables[tables.index('bool ITEM_MANAGER::ReadSpecialDropItemFile('):tables.index('bool ITEM_MANAGER::ReadCommonDropNewItemFile(')]
|
||||
assert special.count('k < 1024')==2 and 'char buf[4]' not in special.split('ConvSpecialDropItemFile')[0]
|
||||
db=source('input_db.cpp')
|
||||
assert db.index('ReadCommonDropItemFile(')<db.index('ReadCommonDropNewItemFile(')<db.index('ReadEtcDropItemFile(')
|
||||
print('PASS: drop table builder (filter, renumber, ranges, merge, kept 203 box) and AVA2 drop code wiring')
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 mount costume + skin (docs/FEATURE-AVA2-UNLOCK.md P5): subtype/wear numbering shared with the client,
|
||||
the horse race override and the equip/unequip/login hooks."""
|
||||
from pathlib import Path
|
||||
import re
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server'
|
||||
CLIENT=ROOT.parent/'metin2-client/src/port'
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
def enum_after(text,start,end):
|
||||
body=text[text.index(start):];body=body[:body.index(end)]
|
||||
return re.findall(r'^\s*([A-Z_0-9]+)\s*[,=]',body,re.M)
|
||||
|
||||
item=source('common/item_length.h')
|
||||
assert 'COSTUME_MOUNT = 2,' in item and 'COSTUME_MOUNT_SKIN = 4,' in item
|
||||
reader=source('db/src/ProtoReader.cpp')
|
||||
assert '"COSTUME_MOUNT", "COSTUME_SASH", "COSTUME_MOUNT_SKIN" };' in reader
|
||||
wear=enum_after(source('common/length.h'),'WEAR_BODY','WEAR_MAX_NUM')
|
||||
assert wear.index('WEAR_COSTUME_MOUNT')==25 and wear.index('WEAR_COSTUME_MOUNT_SKIN')==26,wear
|
||||
if CLIENT.is_dir():
|
||||
gametype=(CLIENT/'UserInterface/GameType.h').read_text()
|
||||
assert 'c_Costume_Slot_Mount = c_Equipment_Start + 25;' in gametype and 'c_Costume_Slot_MountSkin = c_Equipment_Start + 26;' in gametype
|
||||
itemdata=(CLIENT/'GameLib/ItemData.h').read_text()
|
||||
assert 'COSTUME_MOUNT = 2,' in itemdata and 'COSTUME_MOUNT_SKIN = 4,' in itemdata
|
||||
|
||||
horse=source('game/src/char_horse.cpp')
|
||||
body=horse[horse.index('DWORD CHARACTER::GetMyHorseVnum'):];body=body[:body.index('\n}\n')]
|
||||
assert body.index('WEAR_COSTUME_MOUNT_SKIN')<body.index('GetWear(WEAR_COSTUME_MOUNT)')<body.index('c_aHorseStat'),body
|
||||
assert 'return WEAR_COSTUME_MOUNT;' in source('game/src/item.cpp') and 'return WEAR_COSTUME_MOUNT_SKIN;' in source('game/src/item.cpp')
|
||||
attr=source('game/src/item_attribute.cpp')
|
||||
assert 'GetSubType() == COSTUME_MOUNT || GetSubType() == COSTUME_SASH || GetSubType() == COSTUME_MOUNT_SKIN))\n\t\treturn -1;' in attr
|
||||
|
||||
items=source('game/src/char_item.cpp')
|
||||
for hook in ('MountCostumeCanEquip(item)','MountCostumeCanUnequip(item)','MountCostumeEquipped(item);',
|
||||
'MountCostumeUnequipped(item, true);','MountCostumeUnequipped(item, false);'):
|
||||
assert items.count(hook)==1,hook
|
||||
assert 'ch->MountCostumeOnLogin();' in source('game/src/input_login.cpp')
|
||||
assert 'ch->UnequipItem(pkCostumeMount);' in source('game/src/cmd_general.cpp')
|
||||
assert 'port_mount.cpp' in source('game/src/Makefile')
|
||||
mount=source('game/src/port_mount.cpp')
|
||||
for code in ('riding','need_mount','has_skin','need_horse'):assert '"MTMOUNT %s"'%code in mount,code
|
||||
script=ROOT.parent/'metin2-client/src/platform/ScriptLib/MountScript.inc'
|
||||
if script.is_file():
|
||||
s=script.read_text()
|
||||
for code in ('riding','need_mount','has_skin','need_horse'):assert "'%s':"%code in s,code
|
||||
print('PASS: mount subtypes 2/4, WEAR 25/26, horse race = skin > mount > horse level, hooks, MTMOUNT codes')
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 talisman (docs/FEATURE-AVA2-UNLOCK.md P7): ARMOR_PENDANT worn in WEAR_PENDANT, element enchant applies,
|
||||
its own attribute pool changed only by 71301/71302/53996/53997, which are no switchbot scrolls."""
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server'
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
|
||||
il=source('common/item_length.h');assert il.index('ARMOR_EAR,')<il.index('ARMOR_PENDANT,')<il.index('ARMOR_NUM_TYPES')
|
||||
length=source('common/length.h')
|
||||
assert length.index('WEAR_COSTUME_MOUNT_SKIN,\t// 26')<length.index('WEAR_PENDANT,\t\t// 27')
|
||||
reader=source('db/src/ProtoReader.cpp')
|
||||
assert '"ARMOR_NECK", "ARMOR_EAR", "ARMOR_PENDANT", "ARMOR_NUM_TYPES"' in reader
|
||||
item=source('game/src/item.cpp')
|
||||
fec=item[item.index('int CItem::FindEquipCell('):]
|
||||
assert fec.index('if (IsTalisman())\n\t\treturn WEAR_PENDANT;')<fec.index('0 == GetWearFlag()'),'talisman has no wear flag'
|
||||
items=source('game/src/char_item.cpp')
|
||||
case=items[items.index('case USE_CHANGE_ATTRIBUTE2 :'):]
|
||||
assert case.index('return CostumeEnchantUse(item, item2);')<case.index('if (item->GetPendantScrollKind() || item2->IsTalisman())\n\t\t\t\t\t\t\t\treturn PendantScrollUse(item, item2);')<case.index('BuffOnAttr_RemoveBuffsFromItem(item2)')
|
||||
assert '!scroll->GetPendantScrollKind()' in source('game/src/port_switchbot.h')
|
||||
assert 'port_pendant.cpp' in source('game/src/Makefile')
|
||||
port=source('game/src/port_pendant.cpp')
|
||||
pool=port[port.index('s_aPendantAttr[] ='):];pool=pool[:pool.index('};')]
|
||||
assert pool.count('{ APPLY_')==20 and 'APPLY_ATTBONUS' not in pool and 'APPLY_ENCHANT' not in pool
|
||||
for text in ('PENDANT_MAX_ATTR = 5','{ 0, 10, 40, 35, 15 }','{ 40, 50, 10, 0, 0 }','case 71302:\n\t\tcase 53996:','case 71301:\n\t\tcase 53997:',
|
||||
'if (item->HasAttr(r.bApply))','item->SetCount(item->GetCount() - 1);'):
|
||||
assert text in port,text
|
||||
codes=('target','equipped','empty','changed','full','added')
|
||||
for code in codes:assert '"MTPENDANT %s"'%code in port,code
|
||||
assert port.index('"MTPENDANT equipped"')<port.index('item2->ClearAttribute()')
|
||||
assert port.index('"MTPENDANT full"')<port.index('PendantPutAttribute(item2, s_aiAddLevel)')
|
||||
script=ROOT.parent/'metin2-client/src/platform/ScriptLib/PendantScript.inc'
|
||||
if script.is_file():
|
||||
s=script.read_text()
|
||||
for code in codes:assert "'%s':"%code in s,code
|
||||
print('PASS: talisman slot/equip, enchant switch routing before the switcher path, 20-row pool, max 5, switchbot excluded, MTPENDANT codes')
|
||||
@@ -12,6 +12,7 @@ points=sorted(set(re.findall(r'\bPOINT_[A-Z_]+', (SRC/'port_features.h').read_te
|
||||
code=r'''
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <climits>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <map>
|
||||
@@ -28,7 +29,7 @@ GROUPS
|
||||
#include "item_manager_private_types.h"
|
||||
std::vector<CItemDropInfo> g_vec_pkCommonDropItem[MOB_RANK_MAX_NUM];
|
||||
struct TItemTable{unsigned dwVnum;unsigned bType=0;};
|
||||
struct MobTable{unsigned bType=0,bRank=0,dwPolymorphItemVnum=0,dwDropItemVnum=0;};
|
||||
struct MobTable{unsigned bType=0,bRank=0,dwPolymorphItemVnum=0,dwDropItemVnum=0;unsigned char bLevel=0;};
|
||||
struct CMob{MobTable m_table;};
|
||||
class CMobManager {
|
||||
public:std::map<DWORD,CMob*> mobs;
|
||||
@@ -44,6 +45,7 @@ class ITEM_MANAGER {
|
||||
std::map<DWORD,CLevelItemGroup*> m_map_pkLevelItemGroup;
|
||||
std::map<DWORD,CBuyerThiefGlovesItemGroup*> m_map_pkGloveItemGroup;
|
||||
std::map<DWORD,DWORD> m_map_dwEtcItemDropProb;
|
||||
std::vector<CCommonDropNew*> m_vec_pkCommonNewItemGroup;
|
||||
std::map<DWORD,CSpecialItemGroup*> special;
|
||||
static ITEM_MANAGER& instance(){static ITEM_MANAGER m;return m;}
|
||||
TItemTable* GetTable(unsigned id){for(auto& t:tables)if(t.dwVnum==id)return &t;return nullptr;}
|
||||
@@ -100,6 +102,13 @@ int main(){
|
||||
assert(items.PortWikiDrops(9001).empty() && items.PortWikiDrops(99999).empty());
|
||||
drop.AddItem(30220,25,1);assert(items.PortWikiDrops(101).size()==8);
|
||||
drop.AddItem(70104,1,1);assert(items.PortWikiDrops(101).size()==9); // Non-common groups retain configured polymorph candidates. // Sees active changes, not exported text.
|
||||
// common_drop_new: player range clipped to the mob level +-20; groups out of reach are left out
|
||||
mob.m_table.bLevel=10;CCommonDropNew low,high;low.minLevel=1;low.maxLevel=40;low.AddItem(30006,3,1200);high.minLevel=31;high.maxLevel=60;high.AddItem(19,1,1200);
|
||||
items.m_vec_pkCommonNewItemGroup={&low,&high};rows=items.PortWikiDrops(101);assert(rows.size()==10);
|
||||
assert(rows[1].item==30006 && rows[1].count==3 && rows[1].rule==WIKI_COMMON && rows[1].minimum==1 && rows[1].maximum==30 && rows[1].weight==1200);
|
||||
high.minLevel=30;assert(items.PortWikiDrops(101).size()==11 && items.PortWikiDrops(101)[2].minimum==30);
|
||||
assert(low.CanDropThisMap(41));low.m_vecMapIndex={1};assert(low.CanDropThisMap(1) && !low.CanDropThisMap(41));
|
||||
items.m_vec_pkCommonNewItemGroup.clear();mob.m_table.bLevel=0;
|
||||
CSpecialItemGroup chest(50011);chest.AddItem(19,1,80,0);chest.AddItem(1,500,20,0);items.special[50011]=&chest;
|
||||
CSpecialItemGroup multi(50012,CSpecialItemGroup::PCT);multi.AddItem(19,2,20,0);multi.AddItem(3,101,150,0);items.special[50012]=&multi;
|
||||
CSpecialItemGroup attr(50013,CSpecialItemGroup::SPECIAL);attr.AddItem(19,1,100,0);items.special[50013]=&attr;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 new rings (docs/FEATURE-AVA2-UNLOCK.md P8): ITEM_NEW_RINGS (36) worn in WEAR_RINGS_1/2, socket accessories
|
||||
with AVA2's jewels, their own 20-row attribute pool reached through the 40250 switchers / adders."""
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server'
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
|
||||
il=source('common/item_length.h')
|
||||
assert il.index('ITEM_BELT,')<il.index('ITEM_SHINING,')<il.index('ITEM_NEW_RINGS,')<il.index('enum EMetinSubTypes'),'AVA2 numbering 35/36'
|
||||
length=source('common/length.h')
|
||||
assert length.index('WEAR_PENDANT,\t\t// 27')<length.index('WEAR_RINGS_1,\t\t// 28')<length.index('WEAR_RINGS_2,\t\t// 29')<length.index('WEAR_MAX = 32')
|
||||
reader=source('db/src/ProtoReader.cpp')
|
||||
types=reader[reader.index('string arType[]'):];types=types[:types.index('};')]
|
||||
assert types.index('"ITEM_BELT"')<types.index('"ITEM_SHINING", "ITEM_NEW_RINGS"')
|
||||
for name,rows in (('arSubType[] =',36),('arNumberOfSubtype[_countof(arSubType)] =',37)): # item types 0..36
|
||||
arr=reader[reader.index(name):];arr=arr[:arr.index('};')]
|
||||
assert arr.count('\n\t\t')==rows,(name,arr.count('\n\t\t'))
|
||||
item=source('game/src/item.cpp')
|
||||
fec=item[item.index('int CItem::FindEquipCell('):item.index('void CItem::ModifyPoints(')]
|
||||
assert 'ITEM_BELT != GetType() && ITEM_NEW_RINGS != GetType())' in fec
|
||||
assert 'if (ch->GetWear(WEAR_RINGS_1))\n\t\t\treturn WEAR_RINGS_2;\n\t\telse\n\t\t\treturn WEAR_RINGS_1;' in fec
|
||||
assert '\tcase ITEM_BELT:\n\tcase ITEM_NEW_RINGS:\n\t\treturn true;' in item
|
||||
assert '(m_pProto->bType == ITEM_BELT) || (m_pProto->bType == ITEM_NEW_RINGS);' in item
|
||||
assert 'return GetVnum() == GetNewRingJewelVnum(item->GetVnum());' in item
|
||||
items=source('game/src/char_item.cpp')
|
||||
assert '\t\tcase ITEM_NEW_RINGS:\t// AVA2 new rings\n' in items
|
||||
assert items.count('if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())')==3
|
||||
assert items.count('if (item2->GetAttributeSetIndex() == -1)\n')==2 # 71051 / 71052 rare attributes stay closed
|
||||
attr=source('game/src/item_attribute.cpp')
|
||||
put=attr[attr.index('void CItem::PutAttributeWithLevel('):]
|
||||
assert put.index('PutNewRingAttributeWithLevel(bLevel);')<put.index('GetAttributeSetIndex()')
|
||||
assert 'port_rings.cpp' in source('game/src/Makefile')
|
||||
port=source('game/src/port_rings.cpp')
|
||||
pool=port[port.index('s_aRingAttr[] ='):];pool=pool[:pool.index('};')]
|
||||
assert pool.count('{ APPLY_')==20 and '{ APPLY_MAX_HP,\t\t\t35,\t{ 200, 300, 300, 500, 500 } }' in pool
|
||||
for ring,jewel in ((19500,50635),(19520,50636),(19540,50637),(19560,50638)):assert '{ %d, %d }'%(ring,jewel) in port
|
||||
assert 'dwRingVnum / 10 * 10' in port and 'AddAttribute(r.bApply, r.asValues[bLevel - 1]);' in port
|
||||
print('PASS: ring type 36 + WEAR_RINGS_1/2, accessory sockets + jewels, switchers/adders via the 20-row ring pool, rare attrs closed')
|
||||
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python3
|
||||
"""AVA2 sash (docs/FEATURE-AVA2-UNLOCK.md P4): item/wear/part numbering, packet headers shared with the client,
|
||||
and the quest hook."""
|
||||
from pathlib import Path
|
||||
import re
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
SRC=ROOT/'src/server'
|
||||
CLIENT=ROOT.parent/'metin2-client/src/port/UserInterface/Packet.h'
|
||||
def source(name):return (SRC/name).read_bytes().decode('latin1')
|
||||
def enum_after(text,start,end):
|
||||
body=text[text.index(start):];body=body[:body.index(end)]
|
||||
return re.findall(r'^\s*([A-Z_0-9]+)\s*[,=]',body,re.M)
|
||||
|
||||
item=source('common/item_length.h')
|
||||
assert 'COSTUME_SASH = 3,' in item
|
||||
for k,v in (('SASH_ABSORPTION_SOCKET',0),('SASH_ABSORBED_SOCKET',1),('SASH_GRADE_4_ABS_MIN',11),('SASH_GRADE_4_ABS_MAX',25),
|
||||
('SASH_GRADE_4_ABS_MAX_COMB',19),('SASH_EFFECT_FROM_ABS',19),('SASH_GRADE_4_PRICE',500000),('SASH_COMBINE_GRADE_4',30)):
|
||||
assert re.search(r'\b%s = %d,'%(k,v),item),k
|
||||
reader=source('db/src/ProtoReader.cpp')
|
||||
assert 'arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR", "COSTUME_MOUNT", "COSTUME_SASH", "COSTUME_MOUNT_SKIN" };' in reader
|
||||
|
||||
length=source('common/length.h')
|
||||
wear=enum_after(length,'WEAR_BODY','WEAR_MAX_NUM')
|
||||
assert wear.index('WEAR_COSTUME_SASH')==24,wear
|
||||
parts=enum_after(length,'PART_MAIN','PART_MAX_NUM')
|
||||
assert parts[parts.index('PART_HAIR')+1]=='PART_SASH',parts
|
||||
se=enum_after(length,'SE_EQUIP_LOVE_PENDANT','} ;')
|
||||
assert se[se.index('SE_EQUIP_LOVE_PENDANT')+1:se.index('SE_EQUIP_LOVE_PENDANT')+3]==['SE_EFFECT_SASH_SUCCEDED','SE_EFFECT_SASH_EQUIP'],se
|
||||
|
||||
packet=source('game/src/packet.h')
|
||||
assert re.search(r'HEADER_CG_SASH\s*= 211,',packet) and re.search(r'HEADER_GC_SASH\s*= 215,',packet)
|
||||
equip=enum_after(packet,'CHR_EQUIPPART_ARMOR','CHR_EQUIPPART_NUM')
|
||||
assert equip==['CHR_EQUIPPART_ARMOR','CHR_EQUIPPART_WEAPON','CHR_EQUIPPART_HEAD','CHR_EQUIPPART_HAIR','CHR_EQUIPPART_SASH'],equip
|
||||
if CLIENT.is_file(): # the character packets grow by one WORD: both sides must agree
|
||||
client=CLIENT.read_bytes().decode('latin1')
|
||||
assert re.search(r'HEADER_CG_SASH\s*= 211,',client) and re.search(r'HEADER_GC_SASH\s*= 215,',client)
|
||||
cequip=re.findall(r'(CHR_EQUIPPART_[A-Z]+)',client[client.index('CHR_EQUIPPART_ARMOR'):client.index('CHR_EQUIPPART_NUM')])
|
||||
assert cequip==equip,cequip
|
||||
|
||||
char=source('game/src/char.cpp')
|
||||
assert 'SetPart(PART_SASH, 0);' in char # not stored in the player table
|
||||
assert char.count('awPart[CHR_EQUIPPART_SASH] = GetPart(PART_SASH);')==2
|
||||
assert 'port_sash.cpp' in source('game/src/Makefile')
|
||||
assert '{ "open_sash",\t\tpc_open_sash\t\t},' in source('game/src/questlua_pc.cpp')
|
||||
sash=source('game/src/port_sash.cpp')
|
||||
assert '* dPct + .5);' in sash and 'MTSASH abs %u' in sash
|
||||
|
||||
quest=ROOT.parent/'metin2-client/tools/server/sash/sash.quest'
|
||||
if quest.is_file():
|
||||
q=quest.read_text()
|
||||
assert q.count('when 20016.chat.')==3 and 'pc.open_sash(true)' in q and 'pc.open_sash(false)' in q
|
||||
print('PASS: sash subtype 3, WEAR 24, PART_SASH, CG 211 / GC 215, 5 equip parts on both sides, pc.open_sash')
|
||||
@@ -45,6 +45,7 @@ class CHARACTER;
|
||||
class CItem {public:
|
||||
DWORD id,vnum;BYTE type,subtype;int set=0;unsigned cell;BYTE window=INVENTORY;bool equipped=false,exchanging=false;int count=1;
|
||||
CHARACTER* owner=nullptr;TItemTable proto{};TPlayerItemAttribute attrs[7];
|
||||
long value2=0;bool IsCostumeEnchant(){return vnum>=54001 && vnum<=54267 && value2;}int GetPendantScrollKind(){return vnum==71302||vnum==53996;}
|
||||
DWORD GetID(){return id;}DWORD GetVnum(){return vnum;}BYTE GetType(){return type;}BYTE GetSubType(){return subtype;}
|
||||
int GetAttributeSetIndex(){return set;}const TItemTable* GetProto(){return &proto;}
|
||||
const TPlayerItemAttribute& GetAttribute(int i){return attrs[i];}BYTE GetAttributeType(int i){return attrs[i].bType;}
|
||||
@@ -131,6 +132,9 @@ int main(){
|
||||
cmd("1 start 10 71084 5 2 3 1 3 2");assert(last()=="MTSB1 error start target"); // duplicate
|
||||
cmd("1 start 10 71085 5 1 3 4");assert(last()=="MTSB1 error start scroll");
|
||||
cmd("1 start 10 50001 5 1 3 4");assert(last()=="MTSB1 error start scroll");
|
||||
// AVA2 costume enchants share USE_CHANGE_ATTRIBUTE but are no switchers (port_costume_attr.cpp).
|
||||
CItem enchant{2004,54001,ITEM_USE,USE_CHANGE_ATTRIBUTE,-1,23};enchant.owner=&ch;enchant.value2=2;ch.inventory.push_back(&enchant);
|
||||
cmd("1 start 10 54001 5 1 3 4");assert(last()=="MTSB1 error start scroll");
|
||||
cmd("1 start 30 71084 5 1 3 4");assert(last()=="MTSB1 error start no_attr");
|
||||
armor.equipped=true;cmd("1 start 10 71084 5 1 3 4");assert(last()=="MTSB1 error start equipped");armor.equipped=false;
|
||||
cmd("1 start 10 71084 5 1 3 2");assert(last()=="MTSB1 state 0 10 11209 0 5 71084 3 matched" && events.empty()); // already satisfied
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Build the 203 drop tables from AVA2's (docs/FEATURE-AVA2-DROPS.md).
|
||||
|
||||
mob_drop_item.txt AVA2's, entries whose item 203 lacks are dropped and the rest renumbered
|
||||
(the reader stops at the first missing index and fails on an unknown item)
|
||||
common_drop_new.txt AVA2's NEW_COMMON_DROP groups, filtered the same way
|
||||
special_item_group.txt 203's groups with AVA2's groups replacing those of the same vnum; AVA2-only groups added
|
||||
common_drop_item.txt empty, like AVA2 (common drops come from common_drop_new.txt)
|
||||
etc_drop_item.txt empty, like AVA2
|
||||
|
||||
Usage: make_drops.py <AVA2 locale dir> <203 locale dir> <output dir> <item_proto.txt>...
|
||||
The item_proto files are every row the servers will load (the live one plus ava2-items' items-server.tsv).
|
||||
"""
|
||||
import json,re,sys
|
||||
from pathlib import Path
|
||||
|
||||
# AVA2 reused these vnums for a different box: 50035 is 203's children's day gift box but AVA2's GM-only
|
||||
# 'Pct' box handing out thousands of items, so 203's group stays.
|
||||
KEEP_203={50035}
|
||||
|
||||
def vnums(paths):
|
||||
result=set()
|
||||
for p in paths:
|
||||
for line in Path(p).read_bytes().splitlines():
|
||||
head=line.split(b'\t',1)[0].strip()
|
||||
if head.isdigit():result.add(int(head))
|
||||
elif re.fullmatch(rb'\d+~\d+',head): # dragon soul rows cover a vnum range
|
||||
lo,hi=map(int,head.split(b'~'));result.update(range(lo,hi+1))
|
||||
return result
|
||||
|
||||
def groups(data):
|
||||
"""[(name bytes, [body line bytes])] of a CTextFileLoader file ('Group <name>' then a braced body)."""
|
||||
lines=data.replace(b'\r\n',b'\n').split(b'\n');result=[];i=0
|
||||
while i<len(lines):
|
||||
m=re.match(rb'\s*group\s+(.*?)\s*$',lines[i],re.I)
|
||||
if not m:
|
||||
if lines[i].strip() and not lines[i].strip().startswith((b'#',b'//')):raise SystemExit('unexpected line %r'%lines[i])
|
||||
i+=1;continue
|
||||
assert lines[i+1].strip()==b'{',lines[i:i+2]
|
||||
j=i+2;body=[]
|
||||
while lines[j].strip()!=b'}':body.append(lines[j]);j+=1
|
||||
result.append((m.group(1),body));i=j+1
|
||||
return result
|
||||
|
||||
def key(body,name):
|
||||
for line in body:
|
||||
t=line.split()
|
||||
if t and t[0].lower()==name.encode():return t[1:]
|
||||
return None
|
||||
|
||||
def entries(body):
|
||||
return [line.split() for line in body if line.split() and line.split()[0].isdigit()]
|
||||
|
||||
def render(name,head,items):
|
||||
out=[b'Group\t'+name,b'{']+[b'\t'+b'\t'.join(t) for t in head]
|
||||
out+=[b'\t'+b'\t'.join([str(k).encode()]+t[1:]) for k,t in enumerate(items,1)]
|
||||
return out+[b'}']
|
||||
|
||||
def filtered(gs,known,item_column,dropped):
|
||||
"""Groups with unknown items removed and indexes renumbered; groups left empty are skipped."""
|
||||
out=[]
|
||||
for name,body in gs:
|
||||
head=[line.split() for line in body if line.split() and not line.split()[0].isdigit()]
|
||||
items=[]
|
||||
for t in entries(body):
|
||||
token=t[item_column]
|
||||
if token.isdigit() and int(token) not in known:dropped.setdefault(int(token),0);dropped[int(token)]+=1;continue
|
||||
items.append(t)
|
||||
if items:out+=render(name,head,items)
|
||||
return out
|
||||
|
||||
def build(ava,live,output,protos):
|
||||
known=vnums(protos);report={}
|
||||
output.mkdir(parents=True,exist_ok=True)
|
||||
mob=groups((ava/'mob_drop_item.txt').read_bytes())
|
||||
assert all(key(b,'type')[0].lower()==b'drop' for _,b in mob) # every AVA2 group is a 'drop' group
|
||||
assert max(len(entries(b)) for _,b in mob)<256
|
||||
dropped={};text=filtered(mob,known,1,dropped)
|
||||
(output/'mob_drop_item.txt').write_bytes(b'\n'.join(text)+b'\n')
|
||||
report['mob_groups']=sum(1 for l in text if l==b'{');report['mob_dropped']=dropped
|
||||
common=groups((ava/'common_drop_new.txt').read_bytes())
|
||||
dropped={};text=filtered(common,known,1,dropped)
|
||||
(output/'common_drop_new.txt').write_bytes(b'\n'.join(text)+b'\n')
|
||||
report['common_new_groups']=sum(1 for l in text if l==b'{');report['common_new_dropped']=dropped
|
||||
theirs=groups((ava/'special_item_group.txt').read_bytes());ours=groups((live/'special_item_group.txt').read_bytes())
|
||||
assert all((key(b,'type') or [b'x'])[0].lower()!=b'attr' for _,b in theirs)
|
||||
theirs=[(n,b) for n,b in theirs if int(key(b,'vnum')[0]) not in KEEP_203]
|
||||
replaced={int(key(b,'vnum')[0]) for _,b in theirs}
|
||||
dropped={};text=[]
|
||||
for name,body in ours:
|
||||
if int(key(body,'vnum')[0]) in replaced:continue
|
||||
text+=[b'Group\t'+name,b'{']+body+[b'}']
|
||||
text+=filtered(theirs,known,1,dropped)
|
||||
(output/'special_item_group.txt').write_bytes(b'\n'.join(text)+b'\n')
|
||||
kept=[int(key(b,'vnum')[0]) for _,b in ours if int(key(b,'vnum')[0]) not in replaced]
|
||||
report.update(special_kept_203=len(kept),special_from_ava2=len(replaced),
|
||||
special_replaced=sorted(replaced&{int(key(b,'vnum')[0]) for _,b in ours}),special_dropped=dropped)
|
||||
for name in ('common_drop_item.txt','etc_drop_item.txt'):(output/name).write_bytes(b'')
|
||||
for k in [k for k in report if k.endswith('_dropped')]:report[k]={str(v):n for v,n in sorted(report[k].items())}
|
||||
(output/'report.json').write_text(json.dumps(report,indent=1)+'\n')
|
||||
return report
|
||||
|
||||
if __name__=='__main__':
|
||||
if len(sys.argv)<5:sys.exit(__doc__)
|
||||
r=build(Path(sys.argv[1]),Path(sys.argv[2]),Path(sys.argv[3]),sys.argv[4:])
|
||||
print(json.dumps({k:(len(v) if isinstance(v,(list,dict)) else v) for k,v in r.items()}))
|
||||
@@ -48,3 +48,147 @@ mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-01 (Europe/Berlin)
|
||||
season 202701 1798758000 1801436400
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-02 (Europe/Berlin)
|
||||
season 202702 1801436400 1803855600
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-03 (Europe/Berlin)
|
||||
season 202703 1803855600 1806530400
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-04 (Europe/Berlin)
|
||||
season 202704 1806530400 1809122400
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-05 (Europe/Berlin)
|
||||
season 202705 1809122400 1811800800
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-06 (Europe/Berlin)
|
||||
season 202706 1811800800 1814392800
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-07 (Europe/Berlin)
|
||||
season 202707 1814392800 1817071200
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-08 (Europe/Berlin)
|
||||
season 202708 1817071200 1819749600
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-09 (Europe/Berlin)
|
||||
season 202709 1819749600 1822341600
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-10 (Europe/Berlin)
|
||||
season 202710 1822341600 1825023600
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-11 (Europe/Berlin)
|
||||
season 202711 1825023600 1827615600
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
# 2027-12 (Europe/Berlin)
|
||||
season 202712 1827615600 1830294000
|
||||
mission 1 1 0 20000 70043 1 71153 5
|
||||
mission 2 2 0 30 25041 2 71032 1
|
||||
mission 3 3 0 300 50513 3
|
||||
mission 4 4 0 172800 71094 2
|
||||
mission 5 5 0 100 27987 5
|
||||
mission 6 6 0 50 25040 2
|
||||
mission 7 7 0 5 71153 5
|
||||
mission 8 8 0 50000000 71084 20
|
||||
final 27992 2 27993 1 27994 1 70024 1
|
||||
|
||||
|
Reference in New Issue
Block a user