DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
monstorunit.cpp
1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#pragma name_counter 798
4
5#include "monstorunit.hpp"
6
7#include <cmath>
8#include <cstdio>
9#include <cstdlib>
10#include <cstring>
11
12#include "btactstatus.hpp"
13#include "collisiondata.hpp"
14#include "dataalloc.hpp"
15#include "dataread.hpp"
16#include "dngmessageman.hpp"
17#include "dngstatusdata.hpp"
18#include "dun/gameloop.hpp"
19#include "dungeonmap.hpp"
20#include "dungeonparts.hpp"
21#include "frame.hpp"
22#include "framevu1.hpp"
23#include "gameutil.hpp"
24#include "hitmark.hpp"
25#include "hitvalue.hpp"
26#include "itemdata.hpp"
27#include "mathutil.hpp"
28#include "menu_inventory.hpp"
29#include "mglib.hpp"
30#include "nowload.hpp"
31#include "randomitem.hpp"
32#include "rect.hpp"
33#include "runscript_opcodes.hpp"
34#include "savedata.hpp"
35#include "shot_effect_pack.hpp"
36#include "snd.hpp"
37#include "stealitem.hpp"
38#include "texture.hpp"
39#include "userstatus.hpp"
40#include "weaponelement.hpp"
41
42int hitCnt;
43BEE_STATE BeeTbl[800];
44CTexAnimeData MonsterTexAnim[320];
45
47int maxFloorTbl__3[7] = {15, 17, 18, 18, 15, 25, 100};
48
52static inline float CharaHeight(CUserStatus *status) {
53 float chara_height[6] = {16.0f, 14.0f, 16.0f, 16.0f, 18.0f, 15.0f};
54
55 return chara_height[status->cur_chara];
56}
57
58// clang-format off
59#include "monstorunit_effect_data.inc"
60/* Model, script and combat parameters of every kind of monster, by species number. Each entry is
61 the model and its attachments, script, max HP, family, attachment weights, collision radius,
62 defense, hardness, shot effects, experience, two unknown bytes, money, money chance, kind, two
63 unknown bytes, name, two unknown bytes, steal item, drops items, item damage rate, status
64 chance, rare item, damage taken from each attacker, two unknown bytes and knockback scale. */
65MONSTOR_MODEL MonstorTable[167] = {
66 // 0: Master Jacket
67 {{"e01a", "", "", ""}, "e01a", 75, MONSTER_FAMILY_UNDEAD, {110, 80, 100, 80, 130}, 6.0f, 3, 0, {-1, -1}, 5, {0, 0}, 7, 50, MONSTER_KIND_NORMAL, {0, 0}, 1, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 80, ITEM_STAMINA_DRINK, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
68 // 1: Skeleton Soldier
69 {{"e03a", "", "", ""}, "e03a", 23, MONSTER_FAMILY_UNDEAD, {110, 90, 100, 100, 160}, 6.0f, 0, 0, {-1, -1}, 3, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 3, {0, 0}, -1, 1, 100, 90, ITEM_BREAD, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
70 // 2: Statue
71 {{"e05a", "", "", ""}, "e05a", 38, MONSTER_FAMILY_STONE, {100, 100, 100, 100, 100}, 6.0f, 3, 20, {-1, -1}, 3, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 5, {0, 0}, ITEM_STONE, 1, 90, 50, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.699999988f},
72 // 3: Dasher
73 {{"e06a", "", "", ""}, "e06a", 23, MONSTER_FAMILY_BEAST, {100, 100, 100, 100, 100}, 6.0f, 1, 0, {-1, -1}, 3, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 6, {0, 0}, ITEM_BREAD, 1, 100, 90, ITEM_PRICKLY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
74 // 4: Werewolf
75 {{"e07a", "", "", ""}, "e07a", 180, MONSTER_FAMILY_BEAST, {100, 100, 100, 100, 150}, 7.5f, 5, 0, {-1, -1}, 12, {0, 0}, 15, 50, MONSTER_KIND_NORMAL, {0, 0}, 7, {0, 0}, ITEM_STAND_IN_POWDER, 1, 90, 70, ITEM_ATTACH_SPEED, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
76 // 5: FliFli
77 {{"e08a", "", "", ""}, "e08a", 120, MONSTER_FAMILY_PLANT, {180, 100, 100, 100, 100}, 6.5f, 0, 0, {0, -1}, 3, {0, 0}, 7, 30, MONSTER_KIND_NORMAL, {0, 0}, 8, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 100, 70, ITEM_POISONOUS_APPLE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
78 // 6: Hornet
79 {{"e09a", "", "", ""}, "e09a", 60, MONSTER_FAMILY_SKY, {100, 120, 100, 120, 100}, 6.5f, 0, 0, {-1, -1}, 3, {0, 0}, 7, 30, MONSTER_KIND_NORMAL, {0, 0}, 9, {0, 0}, ITEM_ANTIDOTE_DRINK, 0, 100, 70, ITEM_ATTACH_WIND, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
80 // 7: Halloween
81 {{"e10a", "", "", ""}, "e10a", 150, MONSTER_FAMILY_PLANT, {150, 100, 100, 100, 100}, 5.0f, 3, 10, {3, -1}, 3, {0, 0}, 7, 40, MONSTER_KIND_NORMAL, {0, 0}, 10, {0, 0}, ITEM_BOMB_NUTS, 1, 100, 70, ITEM_BREAD, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
82 // 8: Cannibal Plant
83 {{"e11a", "", "", ""}, "e11a", 60, MONSTER_FAMILY_PLANT, {180, 100, 100, 100, 100}, 6.5f, 2, 0, {2, -1}, 3, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 11, {0, 0}, ITEM_GOOEY_PEACH, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
84 // 9: Earth Digger
85 {{"e12a", "", "", ""}, "e12a", 120, MONSTER_FAMILY_BEAST, {100, 100, 80, 80, 100}, 6.5f, 2, 0, {11, -1}, 3, {0, 0}, 7, 30, MONSTER_KIND_NORMAL, {0, 0}, 12, {0, 0}, ITEM_MINON, 1, 100, 70, ITEM_MIMI, {50, 50, 120, 50, 50, 50}, {0, 0}, 1.0f},
86 // 10: Sunday
87 {{"e14a", "", "", ""}, "e14a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {-1, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 14, {0, 0}, ITEM_MELLOW_BANANA, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
88 // 11: Monday
89 {{"e15a", "", "", ""}, "e15a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {-1, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 15, {0, 0}, ITEM_TASTY_WATER, 1, 100, 70, ITEM_CHEESE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
90 // 12: Tuesday
91 {{"e16a", "", "", ""}, "e16a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {19, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 16, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
92 // 13: Wednesday
93 {{"e17a", "", "", ""}, "e17a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {-1, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 17, {0, 0}, ITEM_TASTY_WATER, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
94 // 14: Thursday
95 {{"e18a", "", "", ""}, "e18a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {4, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 18, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
96 // 15: Friday
97 {{"e19a", "", "", ""}, "e19a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {-1, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 19, {0, 0}, ITEM_BREAD, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
98 // 16: Saturday
99 {{"e20a", "", "", ""}, "e20a", 60, MONSTER_FAMILY_MAGE, {100, 100, 100, 110, 100}, 5.0f, 0, 0, {-1, -1}, 3, {0, 0}, 6, 40, MONSTER_KIND_NORMAL, {0, 0}, 20, {0, 0}, ITEM_BREAD, 1, 100, 70, ITEM_REGULAR_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
100 // 17: Witch Hellza
101 {{"e21a", "", "", ""}, "e21a", 270, MONSTER_FAMILY_MAGE, {70, 70, 70, 70, 100}, 8.0f, 0, 0, {5, -1}, 5, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 21, {0, 0}, ITEM_POISONOUS_APPLE, 0, 85, 50, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
102 // 18: Witch Illza
103 {{"e22a", "", "", ""}, "e22a", 120, MONSTER_FAMILY_MAGE, {90, 90, 90, 90, 100}, 8.0f, 0, 0, {4, -1}, 3, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 22, {0, 0}, ITEM_POISONOUS_APPLE, 0, 90, 50, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
104 // 19: Gunny
105 {{"e23a", "", "", ""}, "e23a", 250, MONSTER_FAMILY_SEA, {120, 100, 150, 120, 100}, 6.0f, 5, 20, {6, -1}, 4, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 23, {0, 0}, ITEM_SOAP, 1, 95, 70, ITEM_EVY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
106 // 20: Gyon
107 {{"e24a", "", "", ""}, "e24a", 225, MONSTER_FAMILY_SEA, {120, 100, 150, 100, 100}, 7.0f, 0, 0, {2, -1}, 4, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 24, {0, 0}, ITEM_ANTIGOO_AMULET, 1, 100, 70, ITEM_FLAPPING_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
108 // 21: Pirate's Chariot
109 {{"e25a", "", "", ""}, "e25a", 270, MONSTER_FAMILY_METAL, {120, 80, 140, 100, 100}, 8.0f, 5, 30, {15, -1}, 8, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 25, {0, 0}, ITEM_BOMB, 1, 95, 60, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.5f},
110 // 22: Auntie Medu
111 {{"e26a", "", "", ""}, "e26a", 300, MONSTER_FAMILY_DINO, {100, 140, 100, 100, 100}, 6.0f, 3, 0, {11, -1}, 10, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 26, {0, 0}, ITEM_THROBBING_CHERRY, 1, 100, 60, ITEM_ICE_BLOCK, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
112 // 23: Captain
113 {{"e27a", "", "", ""}, "e27a", 225, MONSTER_FAMILY_UNDEAD, {110, 100, 80, 80, 150}, 6.0f, 3, 0, {-1, -1}, 6, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 27, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 70, ITEM_ROTTEN_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
114 // 24: Corcea
115 {{"e28a", "", "", ""}, "e28a", 150, MONSTER_FAMILY_UNDEAD, {110, 100, 100, 140, 130}, 6.0f, 0, 0, {-1, -1}, 4, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 28, {0, 0}, ITEM_HOLY_WATER, 1, 100, 70, ITEM_ATTACH_ATTACK, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
116 // 25: Golem
117 {{"e30a", "", "", ""}, "e30a", 375, MONSTER_FAMILY_STONE, {100, 100, 110, 110, 100}, 14.0f, 8, 0, {7, -1}, 4, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 30, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 50, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.5f},
118 // 26: Mr. Blare
119 {{"e31a", "", "", ""}, "e31a", 225, MONSTER_FAMILY_MAGE, {0, 170, 100, 100, 100}, 5.0f, 0, 10, {16, 5}, 5, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 31, {0, 0}, ITEM_FIRE_GEM, 1, 100, 70, ITEM_ATTACH_FIRE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
120 // 27: Dune
121 {{"e32a", "", "", ""}, "e32a", 525, MONSTER_FAMILY_STONE, {100, 100, 80, 120, 100}, 11.0f, 0, 0, {-1, -1}, 10, {0, 0}, 18, 30, MONSTER_KIND_NORMAL, {0, 0}, 32, {0, 0}, -1, 1, 100, 70, ITEM_STONE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
122 // 28: Titan
123 {{"e33a", "", "", ""}, "e33a", 750, MONSTER_FAMILY_STONE, {100, 100, 110, 110, 100}, 14.0f, 10, 50, {7, -1}, 12, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 33, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 70, ITEM_STONE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.5f},
124 // 29: King Mimic (Divine Beast Cave)
125 {{"e34a", "", "", ""}, "e34a", 90, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 3, 10, {-1, -1}, 4, {0, 0}, 20, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 34, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
126 // 30: Mimic (Divine Beast Cave)
127 {{"e35a", "", "", ""}, "e35a", 68, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 1, 10, {-1, -1}, 3, {0, 0}, 10, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 35, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
128 // 31: King Mimic (Sun & Moon Temple)
129 {{"e36a", "", "", ""}, "e36a", 525, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 5, 20, {-1, -1}, 15, {0, 0}, 20, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 36, {0, 0}, ITEM_STAND_IN_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
130 // 32: Mimic (Sun & Moon Temple)
131 {{"e37a", "", "", ""}, "e37a", 270, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 5, 20, {-1, -1}, 6, {0, 0}, 12, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 37, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
132 // 33: King Mimic (Moon Sea)
133 {{"e38a", "", "", ""}, "e38a", 600, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 8, 30, {-1, -1}, 12, {0, 0}, 20, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 38, {0, 0}, ITEM_REVIVAL_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
134 // 34: Mimic (Moon Sea)
135 {{"e39a", "", "", ""}, "e39a", 450, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 8, 30, {-1, -1}, 6, {0, 0}, 15, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 39, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
136 // 35: Arthur
137 {{"e40a", "", "", ""}, "e40a", 600, MONSTER_FAMILY_METAL, {80, 100, 150, 80, 80}, 9.0f, 10, 60, {5, -1}, 15, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 40, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
138 // 36: Ghost
139 {{"e42a", "", "", ""}, "e42a", 15, MONSTER_FAMILY_UNDEAD, {110, 100, 100, 100, 120}, 3.5999999f, 0, 0, {9, -1}, 3, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 42, {0, 0}, ITEM_ANTIDOTE_AMULET, 0, 100, 90, ITEM_ANTICURSEAMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
140 // 37: Alexander
141 {{"e43a", "", "", ""}, "e43a", 675, MONSTER_FAMILY_METAL, {150, 130, 100, 120, 130}, 7.0f, 10, 50, {5, -1}, 15, {0, 0}, 17, 50, MONSTER_KIND_NORMAL, {0, 0}, 43, {0, 0}, ITEM_WIND_GEM, 1, 100, 70, ITEM_ATTACH_FIRE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
142 // 38: Heart
143 {{"e44a", "", "", ""}, "e44a", 525, MONSTER_FAMILY_MAGE, {50, 150, 100, 100, 100}, 5.0f, 3, 0, {10, 12}, 6, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 44, {0, 0}, ITEM_STAMINA_DRINK, 1, 80, 50, ITEM_ANTICURSEAMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
144 // 39: Club
145 {{"e45a", "", "", ""}, "e45a", 525, MONSTER_FAMILY_MAGE, {150, 100, 100, 50, 100}, 5.0f, 3, 0, {-1, -1}, 6, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 45, {0, 0}, ITEM_PREMIUM_WATER, 1, 80, 50, ITEM_ANTIGOO_AMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
146 // 40: Diamond
147 {{"e46a", "", "", ""}, "e46a", 525, MONSTER_FAMILY_MAGE, {100, 100, 50, 150, 100}, 5.0f, 3, 0, {-1, -1}, 6, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 46, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 80, 50, ITEM_ANTIDOTE_AMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
148 // 41: Spade
149 {{"e47a", "", "", ""}, "e47a", 525, MONSTER_FAMILY_MAGE, {150, 50, 100, 100, 100}, 5.0f, 3, 0, {-1, -1}, 6, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 47, {0, 0}, ITEM_HOLY_WATER, 1, 80, 50, ITEM_ANTI_FREEZE_AMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
150 // 42: Joker
151 {{"e48a", "", "", ""}, "e48a", 600, MONSTER_FAMILY_MAGE, {50, 50, 50, 50, 150}, 5.0f, 3, 0, {-1, -1}, 6, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 48, {0, 0}, ITEM_PREMIUM_CHICKEN, 1, 50, 10, ITEM_MIGHTY_HEALING, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
152 // 43: Bomber Head
153 {{"e49a", "", "", ""}, "e49a", 180, MONSTER_FAMILY_MAGE, {200, 75, 125, 100, 75}, 4.0f, 8, 20, {16, -1}, 4, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 49, {0, 0}, ITEM_BOMB, 1, 100, 70, ITEM_BOMB, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
154 // 44: Mummy
155 {{"e50a", "", "", ""}, "e50a", 150, MONSTER_FAMILY_UNDEAD, {150, 50, 100, 100, 120}, 4.0f, 0, 0, {-1, -1}, 4, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 50, {0, 0}, -1, 1, 100, 70, ITEM_ANTICURSEAMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
156 // 45: Lich
157 {{"e51a", "", "", ""}, "e51a", 300, MONSTER_FAMILY_UNDEAD, {20, 20, 20, 20, 160}, 4.0f, 5, 0, {11, -1}, 12, {0, 0}, 15, 80, MONSTER_KIND_NORMAL, {0, 0}, 51, {0, 0}, ITEM_REVIVAL_POWDER, 0, 80, 30, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
158 // 46: Curse Dancer
159 {{"e52a", "", "", ""}, "e52a", 300, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 160}, 5.0f, 0, 0, {-1, -1}, 5, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 52, {0, 0}, ITEM_THROBBING_CHERRY, 1, 100, 70, ITEM_ANTICURSEAMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
160 // 47: Living Armor
161 {{"e55a", "", "", ""}, "e55a", 450, MONSTER_FAMILY_STONE, {100, 100, 100, 80, 80}, 4.0f, 10, 50, {-1, -1}, 6, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 55, {0, 0}, -1, 1, 100, 50, ITEM_STONE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
162 // 48: White Fang
163 {{"e56a", "", "", ""}, "e56a", 525, MONSTER_FAMILY_BEAST, {100, 100, 100, 100, 150}, 7.5f, 0, 0, {-1, -1}, 10, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 56, {0, 0}, -1, 1, 100, 70, ITEM_CHEESE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
164 // 49: Moon Bug
165 {{"e57a", "", "", ""}, "e57a", 450, MONSTER_FAMILY_METAL, {50, 120, 150, 50, 100}, 4.0f, 8, 40, {15, -1}, 5, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 57, {0, 0}, ITEM_BOMB, 1, 90, 70, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
166 // 50: Phantom
167 {{"e58a", "", "", ""}, "e58a", 150, MONSTER_FAMILY_SKY, {100, 125, 100, 125, 100}, 5.0f, 0, 0, {-1, -1}, 4, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 58, {0, 0}, ITEM_ANTIDOTE_DRINK, 0, 100, 70, ITEM_ATTACH_WIND, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
168 // 51: Dragon
169 {{"e59a", "", "", ""}, "e59a", 90, MONSTER_FAMILY_DINO, {50, 120, 100, 100, 100}, 17.5f, 5, 40, {5, -1}, 5, {0, 0}, 15, 50, MONSTER_KIND_NORMAL, {0, 0}, 59, {0, 0}, ITEM_FIRE_GEM, 1, 90, 70, ITEM_ATTACH_HOLY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
170 // 52: Cave Bat
171 {{"e60a", "", "", ""}, "e60a", 12, MONSTER_FAMILY_SKY, {100, 100, 100, 150, 100}, 3.0f, 0, 0, {-1, -1}, 3, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 60, {0, 0}, ITEM_ANTIDOTE_DRINK, 0, 100, 90, ITEM_PRICKLY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
172 // 53: Evil Bat
173 {{"e61a", "", "", ""}, "e61a", 150, MONSTER_FAMILY_SKY, {100, 100, 100, 120, 100}, 3.0f, 0, 0, {-1, -1}, 4, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 61, {0, 0}, ITEM_ANTIDOTE_DRINK, 0, 100, 70, ITEM_PREMIUM_CHICKEN, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
174 // 54: Hell Pockle
175 {{"e62a", "", "", ""}, "e62a", 270, MONSTER_FAMILY_MAGE, {100, 100, 100, 120, 100}, 5.0f, 2, 0, {-1, -1}, 5, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 62, {0, 0}, -1, 1, 100, 70, ITEM_BREAD, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
176 // 55: Rash Dasher
177 {{"e63a", "", "", ""}, "e63a", 600, MONSTER_FAMILY_BEAST, {50, 150, 100, 100, 100}, 6.0f, 2, 10, {-1, -1}, 6, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 63, {0, 0}, ITEM_PREMIUM_CHICKEN, 1, 100, 70, ITEM_ATTACH_SPEED, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
178 // 56: Steel Giant
179 {{"e64a", "", "", ""}, "e64a", 750, MONSTER_FAMILY_METAL, {80, 100, 125, 80, 100}, 14.0f, 10, 50, {7, -1}, 12, {0, 0}, 15, 50, MONSTER_KIND_NORMAL, {0, 0}, 64, {0, 0}, ITEM_REPAIR_POWDER, 1, 95, 50, ITEM_MIGHTY_HEALING, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
180 // 57: Blizzard
181 {{"e65a", "", "", ""}, "e65a", 750, MONSTER_FAMILY_METAL, {100, 100, 140, 140, 100}, 14.0f, 5, 0, {7, -1}, 8, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 65, {0, 0}, ITEM_ICE_GEM, 1, 100, 50, ITEM_ATTACH_ICE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.5f},
182 // 58: Moon Digger
183 {{"e66a", "", "", ""}, "e66a", 420, MONSTER_FAMILY_BEAST, {150, 125, 80, 80, 100}, 5.0f, 2, 0, {11, -1}, 6, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 66, {0, 0}, ITEM_POTATO_CAKE, 1, 100, 70, ITEM_MIMI, {45, 45, 130, 45, 45, 45}, {0, 0}, 1.0f},
184 // 59: Dark Flower
185 {{"e67a", "", "", ""}, "e67a", 300, MONSTER_FAMILY_PLANT, {150, 100, 100, 100, 100}, 6.5f, 5, 0, {2, -1}, 5, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 67, {0, 0}, -1, 1, 100, 70, ITEM_PREMIUM_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
186 // 60: Cursed Rose
187 {{"e68a", "", "", ""}, "e68a", 225, MONSTER_FAMILY_PLANT, {150, 100, 100, 100, 130}, 6.5f, 2, 0, {2, -1}, 4, {0, 0}, 6, 30, MONSTER_KIND_NORMAL, {0, 0}, 68, {0, 0}, -1, 1, 100, 70, ITEM_TASTY_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
188 // 61: Billy
189 {{"e69a", "", "", ""}, "e69a", 300, MONSTER_FAMILY_MAGE, {100, 100, 0, 100, 100}, 5.0f, 5, 10, {18, 23}, 6, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 69, {0, 0}, ITEM_THUNDER_GEM, 1, 100, 70, ITEM_ATTACH_THUNDER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
190 // 62: Vulcan
191 {{"e70a", "", "", ""}, "e70a", 480, MONSTER_FAMILY_STONE, {-50, 180, 100, 100, 100}, 7.0f, 5, 40, {-1, -1}, 12, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 70, {0, 0}, ITEM_ATTACH_FIRE, 1, 100, 70, ITEM_STONE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
192 // 63: Crabby Hermit
193 {{"e71a", "", "", ""}, "e71a", 300, MONSTER_FAMILY_SEA, {100, 100, 125, 100, 100}, 10.0f, 5, 20, {6, -1}, 4, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 71, {0, 0}, ITEM_THROBBING_CHERRY, 1, 95, 70, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
194 // 64: Space Gyon
195 {{"e72a", "", "", ""}, "e72a", 525, MONSTER_FAMILY_SEA, {75, 100, 125, 100, 100}, 5.0f, 0, 0, {2, -1}, 5, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 72, {0, 0}, ITEM_SOAP, 1, 100, 70, ITEM_FLAPPING_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
196 // 65: Blue Dragon
197 {{"e73a", "", "", ""}, "e73a", 600, MONSTER_FAMILY_DINO, {125, 50, 100, 100, 100}, 17.5f, 5, 30, {20, -1}, 12, {0, 0}, 18, 50, MONSTER_KIND_NORMAL, {0, 0}, 73, {0, 0}, ITEM_ICE_GEM, 1, 80, 50, ITEM_ATTACH_ATTACK, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.5f},
198 // 66: Black Dragon
199 {{"e74a", "", "", ""}, "e74a", 900, MONSTER_FAMILY_DINO, {50, 50, 50, 50, 130}, 17.5f, 10, 60, {22, -1}, 20, {0, 0}, 22, 50, MONSTER_KIND_NORMAL, {0, 0}, 74, {0, 0}, ITEM_MIGHTY_HEALING, 1, 50, 40, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.5f},
200 // 67: Mask of Prajna
201 {{"e75a", "", "", ""}, "e75a", 375, MONSTER_FAMILY_UNDEAD, {100, 100, 100, 100, 145}, 7.0f, 5, 10, {1, -1}, 12, {0, 0}, 15, 50, MONSTER_KIND_NORMAL, {0, 0}, 75, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 80, 70, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
202 // 68: Crescent Baron
203 {{"e76a", "", "", ""}, "e76a", 450, MONSTER_FAMILY_SKY, {100, 100, 100, 110, 100}, 6.0f, 5, 10, {21, -1}, 12, {0, 0}, 18, 50, MONSTER_KIND_NORMAL, {0, 0}, 76, {0, 0}, -1, 1, 80, 70, ITEM_MELLOW_BANANA, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
204 // 69: Rockanoff
205 {{"e77a", "", "", ""}, "e77a", 30, MONSTER_FAMILY_STONE, {100, 100, 100, 100, 100}, 6.5f, 5, 20, {-1, -1}, 3, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 77, {0, 0}, ITEM_STONE, 1, 90, 60, ITEM_STONE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.800000012f},
206 // 70: King Mimic (Wise Owl Forest)
207 {{"e78a", "", "", ""}, "e78a", 150, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 5, 10, {-1, -1}, 10, {0, 0}, 15, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 78, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
208 // 71: Mimic (Wise Owl Forest)
209 {{"e79a", "", "", ""}, "e79a", 90, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 2, 10, {-1, -1}, 3, {0, 0}, 6, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 79, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
210 // 72: King Mimic (Shipwreck)
211 {{"e80a", "", "", ""}, "e80a", 300, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 5, 20, {-1, -1}, 15, {0, 0}, 15, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 80, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
212 // 73: Mimic (Shipwreck)
213 {{"e81a", "", "", ""}, "e81a", 150, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 5, 20, {-1, -1}, 4, {0, 0}, 6, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 81, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
214 // 74: King Mimic (Gallery of Time)
215 {{"e82a", "", "", ""}, "e82a", 675, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 5, 30, {-1, -1}, 18, {0, 0}, 25, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 82, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
216 // 75: Mimic (Gallery of Time)
217 {{"e83a", "", "", ""}, "e83a", 450, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 5, 20, {-1, -1}, 6, {0, 0}, 20, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 83, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
218 // 76: Ice Arrow
219 {{"korinoya", "", "", ""}, "c13_korinoya", 100, MONSTER_FAMILY_MAGE, {200, 0, 100, 100, 100}, 2.0f, 5, 0, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 84, {0, 0}, -1, 0, 70, 0, -1, {0, 0, 0, 100, 0, 0}, {0, 0}, 0.0f},
220 // 77: Sam
221 {{"e86a", "", "", ""}, "e86a", 180, MONSTER_FAMILY_MAGE, {200, 0, 100, 100, 100}, 5.0f, 0, 0, {20, 17}, 4, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 85, {0, 0}, ITEM_ICE_GEM, 1, 100, 70, ITEM_ATTACH_ICE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
222 // 78: Dran
223 {{"c12a", "", "", ""}, "c12a", 250, MONSTER_FAMILY_BEAST, {100, 150, 100, 100, 50}, 45.0f, 10, 20, {13, -1}, 10, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 112, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
224 // 79: Master Utan
225 {{"c14a", "c14b", "c14c", "c14d"}, "c14a", 700, MONSTER_FAMILY_BEAST, {100, 100, 100, 100, 100}, 35.0f, 12, 0, {14, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 114, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
226 // 80: Ice Queen
227 {{"c13a", "", "", ""}, "c13a", 700, MONSTER_FAMILY_MAGE, {150, -50, 80, 80, 120}, 13.0f, 10, 0, {-1, -1}, 30, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 113, {0, 0}, -1, 0, 40, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
228 // 81: King's Curse Coffin
229 {{"c15a", "", "", ""}, "c15a", 2000, MONSTER_FAMILY_UNDEAD, {110, 100, 100, 150, 125}, 6.0f, 10, 40, {-1, -1}, 40, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 115, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
230 // 82: King's Curse
231 {{"c15b", "", "", ""}, "c15b", 1000, MONSTER_FAMILY_UNDEAD, {100, 100, 100, 100, 100}, 4.0f, 10, 0, {-1, -1}, 40, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 100, {0, 0}, -1, 0, 0, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
232 // 83: Minotaur Joe
233 {{"c16a", "", "", ""}, "c16a", 2000, MONSTER_FAMILY_BEAST, {100, 100, 150, 100, 100}, 25.0f, 12, 40, {-1, -1}, 50, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 116, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
234 // 84: Dark Genie
235 {{"c17a", "", "", ""}, "c17a", 2000, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 120}, 14.0f, 25, 30, {5, -1}, 60, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 117, {0, 0}, -1, 0, 30, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
236 // 85: Dark Genie Right Hand
237 {{"c17b", "", "", ""}, "c17b", 3200, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 120}, 8.0f, 0, 20, {-1, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 118, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
238 // 86: Dark Genie Left Hand
239 {{"c17c", "", "", ""}, "c17c", 3200, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 120}, 8.0f, 0, 20, {-1, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 119, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
240 // 87: (DG effect c17_)
241 {{"c17_hikari", "", "", ""}, "c17_hikari", 90, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 20, {-1, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
242 // 88: (DG companion c17_)
243 {{"c17_kaze", "", "", ""}, "c17_kaze", 90, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 20, {-1, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
244 // 89: (DG companion c17_)
245 {{"c17_beem", "", "", ""}, "c17_beem", 90, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 20, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
246 // 90: (DG companion c17_)
247 {{"c17_beem_s", "", "", ""}, "c17_beem_s", 90, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 20, {-1, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
248 // 91: Wine Keg
249 {{"e85a", "", "", ""}, "e85a", 80, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 7.0f, 0, 0, {-1, -1}, 0, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 121, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 1.0f},
250 // 92: Ice Aura
251 {{"b3_reiki", "", "", ""}, "c13_reiki", 80, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 0, {-1, -1}, 0, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
252 // 93: (DG companion c17_)
253 {{"c17_syougeki", "", "", ""}, "c17_syougeki", 80, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 0, {-1, -1}, 0, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
254 // 94: Gol
255 {{"e90a", "", "", ""}, "e90a", 600, MONSTER_FAMILY_STONE, {120, 90, 100, 100, 100}, 14.0f, 8, 0, {7, -1}, 5, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 90, {0, 0}, ITEM_REPAIR_POWDER, 0, 100, 50, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.5f},
256 // 95: Sil
257 {{"e91a", "", "", ""}, "e91a", 500, MONSTER_FAMILY_STONE, {90, 120, 100, 100, 100}, 14.0f, 10, 0, {7, -1}, 5, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 91, {0, 0}, ITEM_REPAIR_POWDER, 0, 100, 50, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.5f},
258 // 96: Yammich
259 {{"e101a", "", "", ""}, "e101a", 13, MONSTER_FAMILY_UNDEAD, {100, 100, 100, 70, 130}, 7.0f, 0, 1, {-1, -1}, 3, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 301, {0, 0}, ITEM_STONE, 1, 90, 100, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
260 // 97: Statue Dog
261 {{"e103a", "", "", ""}, "e103a", 15, MONSTER_FAMILY_STONE, {100, 100, 100, 100, 60}, 9.0f, 3, 10, {-1, -1}, 2, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 303, {0, 0}, ITEM_STONE, 1, 90, 100, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.600000024f},
262 // 98: Opar
263 {{"e104a", "", "", ""}, "e104a", 28, MONSTER_FAMILY_SEA, {100, 60, 130, 100, 100}, 15.0f, 1, 2, {29, -1}, 3, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 304, {0, 0}, ITEM_ROTTEN_FISH, 1, 90, 100, ITEM_PETITE_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
264 // 99: Haley Holey
265 {{"e105a", "", "", ""}, "e105a", 50, MONSTER_FAMILY_PLANT, {140, 100, 100, 100, 100}, 7.0f, 3, 10, {-1, -1}, 3, {0, 0}, 7, 40, MONSTER_KIND_NORMAL, {0, 0}, 305, {0, 0}, ITEM_CARROT, 1, 100, 70, ITEM_BATTAN, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
266 // 100: King Prickly
267 {{"e106a", "", "", ""}, "e106a", 63, MONSTER_FAMILY_BEAST, {150, 100, 100, 100, 100}, 6.0f, 3, 10, {-1, -1}, 3, {0, 0}, 7, 40, MONSTER_KIND_NORMAL, {0, 0}, 306, {0, 0}, -1, 1, 100, 70, ITEM_PRICKLY, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
268 // 101: Ice Barrier
269 {{"baria", "", "", ""}, "c13_baria", 100, MONSTER_FAMILY_MAGE, {200, 0, 100, 100, 100}, 2.0f, 5, 0, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 70, 0, -1, {0, 0, 0, 100, 0, 0}, {0, 0}, 0.0f},
270 // 102: Ice Prison
271 {{"kori", "", "", ""}, "c13_kori", 100, MONSTER_FAMILY_MAGE, {200, 0, 100, 100, 100}, 2.0f, 5, 0, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 70, 0, -1, {0, 0, 0, 100, 0, 0}, {0, 0}, 0.0f},
272 // 103: Ice Meteor
273 {{"i_meteo", "", "", ""}, "c13_i_meteo", 100, MONSTER_FAMILY_MAGE, {200, 0, 100, 100, 100}, 2.0f, 5, 0, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 70, 0, -1, {0, 0, 0, 100, 0, 0}, {0, 0}, 0.0f},
274 // 104: Ice Tornado
275 {{"i_tatumaki", "", "", ""}, "c13_i_tatumaki", 100, MONSTER_FAMILY_MAGE, {200, 0, 100, 100, 100}, 2.0f, 5, 0, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 70, 0, -1, {0, 0, 0, 100, 0, 0}, {0, 0}, 0.0f},
276 // 105: Gacious
277 {{"e124a", "", "", ""}, "e124a", 1800, MONSTER_FAMILY_UNDEAD, {70, 100, 100, 100, 140}, 14.0f, 8, 0, {-1, -1}, 5, {0, 0}, 5, 30, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 317, {0, 0}, -1, 0, 100, 90, -1, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
278 // 106: Dark Genie (Final Form)
279 {{"c23a", "", "", ""}, "c23a", 5000, MONSTER_FAMILY_UNDEAD, {70, 100, 100, 100, 140}, 14.0f, 8, 0, {26, -1}, 5, {0, 0}, 5, 30, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 223, {0, 0}, -1, 0, 100, 0, -1, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
280 // 107: DG Final summon (last_mc)
281 {{"last_mc", "", "", ""}, "c23_hasira", 100, MONSTER_FAMILY_UNDEAD, {70, 100, 100, 100, 140}, 14.0f, 8, 0, {-1, -1}, 5, {0, 0}, 5, 30, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 100, 90, -1, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
282 // 108: DG Final ground wave (last_gw1)
283 {{"last_gw1", "", "", ""}, "c23_syougeki", 100, MONSTER_FAMILY_UNDEAD, {70, 100, 100, 100, 140}, 14.0f, 8, 0, {-1, -1}, 5, {0, 0}, 5, 30, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 100, 90, -1, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
284 // 109: DG Final beam
285 {{"c23_beem", "", "", ""}, "c23_beem", 90, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 20, {-1, -1}, 17, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
286 // 110: DG Final beam (small)
287 {{"c23_beem_s", "", "", ""}, "c23_beem_s", 90, MONSTER_FAMILY_MAGE, {100, 100, 100, 100, 100}, 5.0f, 0, 20, {-1, -1}, 20, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 0, {0, 0}, -1, 0, 50, 0, -1, {0, 0, 0, 0, 0, 0}, {0, 0}, 0.0f},
288 // 111: Gemron (Fire)
289 {{"e111a", "", "", ""}, "e111a", 2500, MONSTER_FAMILY_DINO, {0, 150, 30, 30, 30}, 6.5f, 10, 10, {5, -1}, 15, {0, 0}, 20, 30, MONSTER_KIND_NORMAL, {0, 0}, 311, {0, 0}, -1, 1, 70, 60, ITEM_FIRE_GEM, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
290 // 112: Nikapous
291 {{"e108a", "", "", ""}, "e108a", 2350, MONSTER_FAMILY_MAGE, {50, 100, 100, 125, 125}, 8.0f, 10, 10, {5, -1}, 15, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 308, {0, 0}, ITEM_ANTICURSEAMULET, 1, 100, 70, ITEM_ATTACH_WIND, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
292 // 113: White Fang (Enhanced)
293 {{"e125a", "", "", ""}, "e125a", 1750, MONSTER_FAMILY_BEAST, {0, 0, 0, 0, 0}, 7.5f, 10, 10, {-1, -1}, 15, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 56, {0, 0}, -1, 1, 100, 70, ITEM_CHEESE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
294 // 114: Arthur (Enhanced)
295 {{"e126a", "", "", ""}, "e126a", 2900, MONSTER_FAMILY_METAL, {50, 50, 150, 80, 80}, 9.0f, 10, 60, {5, -1}, 20, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 40, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 20}, {0, 0}, 1.0f},
296 // 115: Sil (Enhanced)
297 {{"e127a", "", "", ""}, "e127a", 1500, MONSTER_FAMILY_STONE, {100, 100, 100, 100, 100}, 14.0f, 10, 60, {7, -1}, 15, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 91, {0, 0}, ITEM_REPAIR_POWDER, 0, 100, 50, -1, {80, 80, 150, 80, 80, 20}, {0, 0}, 0.5f},
298 // 116: Halloween (Enhanced)
299 {{"e128a", "", "", ""}, "e128a", 1800, MONSTER_FAMILY_PLANT, {150, 50, 50, 50, 50}, 5.0f, 10, 10, {3, -1}, 15, {0, 0}, 7, 40, MONSTER_KIND_NORMAL, {0, 0}, 10, {0, 0}, ITEM_BOMB_NUTS, 1, 100, 70, ITEM_BREAD, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
300 // 117: Master Jacket (Enhanced)
301 {{"e129a", "", "", ""}, "e129a", 2000, MONSTER_FAMILY_UNDEAD, {110, 80, 100, 80, 130}, 6.0f, 10, 10, {-1, -1}, 15, {0, 0}, 7, 50, MONSTER_KIND_NORMAL, {0, 0}, 1, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 80, ITEM_STAMINA_DRINK, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
302 // 118: Vulcan (Enhanced)
303 {{"e130a", "", "", ""}, "e130a", 2400, MONSTER_FAMILY_STONE, {0, 180, 100, 100, 100}, 7.0f, 10, 40, {-1, -1}, 15, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 70, {0, 0}, ITEM_ATTACH_FIRE, 1, 100, 70, ITEM_STONE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
304 // 119: Mummy (Enhanced)
305 {{"e131a", "", "", ""}, "e131a", 1500, MONSTER_FAMILY_UNDEAD, {150, 50, 100, 100, 120}, 4.0f, 10, 10, {-1, -1}, 5, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 50, {0, 0}, -1, 1, 100, 70, ITEM_ANTICURSEAMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
306 // 120: Diamond (Enhanced)
307 {{"e132a", "", "", ""}, "e132a", 1750, MONSTER_FAMILY_MAGE, {100, 100, 50, 150, 100}, 5.0f, 10, 50, {-1, -1}, 10, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 46, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 80, 50, ITEM_ANTIDOTE_AMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
308 // 121: Gemron (Ice)
309 {{"e112a", "", "", ""}, "e112a", 4000, MONSTER_FAMILY_DINO, {150, 0, 30, 30, 30}, 6.5f, 15, 10, {20, -1}, 20, {0, 0}, 20, 30, MONSTER_KIND_NORMAL, {0, 0}, 312, {0, 0}, -1, 1, 70, 60, ITEM_ICE_GEM, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
310 // 122: Horn Head
311 {{"e119a", "", "", ""}, "e119a", 2500, MONSTER_FAMILY_UNDEAD, {100, 20, 20, 20, 150}, 10.0f, 15, 10, {-1, -1}, 20, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 319, {0, 0}, -1, 1, 100, 100, ITEM_CARROT, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
312 // 123: Auntie Medu (Enhanced)
313 {{"e133a", "", "", ""}, "e133a", 3750, MONSTER_FAMILY_DINO, {30, 150, 30, 30, 30}, 6.0f, 15, 10, {11, -1}, 20, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 26, {0, 0}, ITEM_THROBBING_CHERRY, 1, 100, 60, ITEM_ICE_BLOCK, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
314 // 124: Rockanoff (Enhanced)
315 {{"e134a", "", "", ""}, "e134a", 2500, MONSTER_FAMILY_STONE, {100, 100, 100, 100, 100}, 6.5f, 15, 50, {-1, -1}, 20, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 77, {0, 0}, ITEM_STONE, 1, 90, 60, ITEM_STONE, {80, 80, 150, 80, 80, 20}, {0, 0}, 0.800000012f},
316 // 125: Yammich (Enhanced)
317 {{"e135a", "", "", ""}, "e135a", 3000, MONSTER_FAMILY_UNDEAD, {20, 20, 20, 20, 130}, 7.0f, 15, 10, {-1, -1}, 20, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 301, {0, 0}, ITEM_STONE, 1, 90, 100, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
318 // 126: Witch Hellza (Enhanced)
319 {{"e136a", "", "", ""}, "e136a", 1500, MONSTER_FAMILY_MAGE, {50, 50, 50, 50, 50}, 8.0f, 15, 10, {5, -1}, 20, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 21, {0, 0}, ITEM_POISONOUS_APPLE, 0, 85, 50, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
320 // 127: Steel Giant (Enhanced)
321 {{"e137a", "", "", ""}, "e137a", 3900, MONSTER_FAMILY_METAL, {80, 80, 150, 80, 80}, 14.0f, 15, 70, {7, -1}, 25, {0, 0}, 15, 50, MONSTER_KIND_NORMAL, {0, 0}, 64, {0, 0}, ITEM_REPAIR_POWDER, 1, 95, 50, ITEM_MIGHTY_HEALING, {80, 80, 150, 80, 80, 20}, {0, 0}, 1.0f},
322 // 128: Club (Enhanced)
323 {{"e138a", "", "", ""}, "e138a", 2525, MONSTER_FAMILY_MAGE, {150, 100, 100, 50, 100}, 5.0f, 15, 10, {-1, -1}, 20, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 45, {0, 0}, ITEM_PREMIUM_WATER, 1, 80, 50, ITEM_ANTIGOO_AMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
324 // 129: Corcea (Enhanced)
325 {{"e139a", "", "", ""}, "e139a", 3250, MONSTER_FAMILY_UNDEAD, {100, 100, 100, 100, 130}, 6.0f, 15, 10, {-1, -1}, 20, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 28, {0, 0}, ITEM_HOLY_WATER, 1, 100, 70, ITEM_ATTACH_ATTACK, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
326 // 130: Mimic (Demon Shaft)
327 {{"e109a", "", "", ""}, "e109a", 3500, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 15, 10, {-1, -1}, 10, {0, 0}, 26, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 309, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
328 // 131: King Mimic (Demon Shaft)
329 {{"e110a", "", "", ""}, "e110a", 5000, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 15, 50, {-1, -1}, 20, {0, 0}, 35, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 310, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 150, 100, 100, 20}, {0, 0}, 1.0f},
330 // 132: Gemron (Thunder)
331 {{"e113a", "", "", ""}, "e113a", 5500, MONSTER_FAMILY_DINO, {30, 30, 0, 150, 30}, 6.5f, 20, 10, {23, -1}, 25, {0, 0}, 20, 30, MONSTER_KIND_NORMAL, {0, 0}, 313, {0, 0}, -1, 1, 70, 60, ITEM_THUNDER_GEM, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
332 // 133: Bishop Q
333 {{"e116a", "", "", ""}, "e116a", 6000, MONSTER_FAMILY_MAGE, {40, 40, 40, 40, 140}, 11.0f, 20, 10, {11, 5}, 25, {0, 0}, 20, 30, MONSTER_KIND_NORMAL, {0, 0}, 316, {0, 0}, -1, 1, 50, 50, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
334 // 134: Cave Bat (Enhanced)
335 {{"e140a", "", "", ""}, "e140a", 1500, MONSTER_FAMILY_SKY, {100, 100, 100, 150, 100}, 3.0f, 20, 10, {-1, -1}, 25, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 60, {0, 0}, ITEM_ANTIDOTE_DRINK, 0, 100, 90, 0, {100, 150, 100, 100, 100, 100}, {0, 0}, 1.0f},
336 // 135: Gol (Enhanced)
337 {{"e141a", "", "", ""}, "e141a", 6000, MONSTER_FAMILY_STONE, {120, 90, 100, 100, 100}, 14.0f, 30, 80, {7, -1}, 25, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 90, {0, 0}, ITEM_REPAIR_POWDER, 0, 100, 50, -1, {100, 100, 150, 100, 100, 20}, {0, 0}, 0.5f},
338 // 136: Mask of Prajna (Enhanced)
339 {{"e142a", "", "", ""}, "e142a", 5500, MONSTER_FAMILY_UNDEAD, {100, 100, 100, 100, 145}, 7.5f, 20, 10, {1, -1}, 25, {0, 0}, 15, 50, MONSTER_KIND_NORMAL, {0, 0}, 75, {0, 0}, ITEM_ANTIDOTE_DRINK, 1, 80, 70, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
340 // 137: Gyon (Enhanced)
341 {{"e143a", "", "", ""}, "e143a", 5750, MONSTER_FAMILY_SEA, {120, 100, 150, 100, 100}, 7.0f, 20, 10, {2, -1}, 25, {0, 0}, 8, 30, MONSTER_KIND_NORMAL, {0, 0}, 24, {0, 0}, ITEM_ANTIGOO_AMULET, 1, 100, 70, ITEM_FLAPPING_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
342 // 138: Spade (Enhanced)
343 {{"e144a", "", "", ""}, "e144a", 5000, MONSTER_FAMILY_MAGE, {150, 50, 100, 100, 100}, 5.0f, 20, 10, {-1, -1}, 25, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 47, {0, 0}, ITEM_HOLY_WATER, 1, 80, 50, ITEM_ANTI_FREEZE_AMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
344 // 139: Rash Dasher (Enhanced)
345 {{"e145a", "", "", ""}, "e145a", 5000, MONSTER_FAMILY_BEAST, {50, 150, 100, 100, 100}, 6.0f, 20, 10, {-1, -1}, 25, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 63, {0, 0}, ITEM_PREMIUM_CHICKEN, 1, 100, 70, ITEM_ATTACH_SPEED, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
346 // 140: Captain (Enhanced)
347 {{"e146a", "", "", ""}, "e146a", 4000, MONSTER_FAMILY_UNDEAD, {110, 100, 80, 80, 150}, 6.0f, 20, 10, {-1, -1}, 25, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 27, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 70, ITEM_ROTTEN_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
348 // 141: Mimic (Demon Shaft) (Enhanced)
349 {{"e109a", "", "", ""}, "e147a", 5000, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 20, 10, {-1, -1}, 10, {0, 0}, 26, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 309, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
350 // 142: King Mimic (Demon Shaft) (Enhanced)
351 {{"e110a", "", "", ""}, "e148a", 7500, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 20, 50, {-1, -1}, 20, {0, 0}, 35, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 310, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 150, 100, 100, 20}, {0, 0}, 1.0f},
352 // 143: Gemron (Wind)
353 {{"e114a", "", "", ""}, "e114a", 8000, MONSTER_FAMILY_DINO, {100, 100, 140, 0, 100}, 6.5f, 23, 10, {24, -1}, 30, {0, 0}, 20, 30, MONSTER_KIND_NORMAL, {0, 0}, 314, {0, 0}, -1, 1, 70, 60, ITEM_WIND_GEM, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
354 // 144: Silver Gear
355 {{"e118a", "", "", ""}, "e118a", 2500, MONSTER_FAMILY_UNDEAD, {30, 30, 30, 30, 150}, 10.0f, 23, 10, {28, -1}, 30, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 318, {0, 0}, -1, 1, 100, 100, ITEM_PETITE_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
356 // 145: Alexander (Enhanced)
357 {{"e149a", "", "", ""}, "e149a", 7500, MONSTER_FAMILY_METAL, {100, 100, 120, 100, 100}, 7.0f, 23, 50, {5, -1}, 30, {0, 0}, 17, 50, MONSTER_KIND_NORMAL, {0, 0}, 43, {0, 0}, ITEM_WIND_GEM, 1, 100, 70, ITEM_ATTACH_FIRE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
358 // 146: Heart (Enhanced)
359 {{"e150a", "", "", ""}, "e150a", 5000, MONSTER_FAMILY_MAGE, {0, 0, 0, 0, 0}, 5.0f, 23, 10, {10, 12}, 30, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 44, {0, 0}, ITEM_STAMINA_DRINK, 1, 80, 50, ITEM_ANTICURSEAMULET, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
360 // 147: Bomber Head (Enhanced)
361 {{"e151a", "", "", ""}, "e151a", 6000, MONSTER_FAMILY_MAGE, {200, 20, 20, 20, 20}, 4.0f, 23, 20, {16, -1}, 30, {0, 0}, 10, 30, MONSTER_KIND_NORMAL, {0, 0}, 49, {0, 0}, ITEM_BOMB, 1, 100, 70, ITEM_BOMB, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
362 // 148: Crabby Hermit (Enhanced)
363 {{"e152a", "", "", ""}, "e152a", 6500, MONSTER_FAMILY_SEA, {100, 100, 125, 100, 100}, 10.0f, 23, 20, {6, -1}, 30, {0, 0}, 12, 30, MONSTER_KIND_NORMAL, {0, 0}, 71, {0, 0}, ITEM_THROBBING_CHERRY, 1, 95, 70, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
364 // 149: Cursed Rose (Enhanced)
365 {{"e153a", "", "", ""}, "e153a", 5000, MONSTER_FAMILY_PLANT, {130, 100, 100, 100, 150}, 6.5f, 23, 10, {2, -1}, 30, {0, 0}, 6, 30, MONSTER_KIND_NORMAL, {0, 0}, 68, {0, 0}, -1, 1, 100, 70, ITEM_TASTY_WATER, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.0f},
366 // 150: Pirate's Chariot (Enhanced)
367 {{"e154a", "", "", ""}, "e154a", 6750, MONSTER_FAMILY_METAL, {120, 80, 140, 100, 100}, 8.0f, 23, 60, {15, -1}, 30, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 25, {0, 0}, ITEM_BOMB, 1, 95, 60, ITEM_ATTACH_ENDURANCE, {80, 80, 150, 80, 20, 100}, {0, 0}, 0.5f},
368 // 151: Space Gyon (Enhanced)
369 {{"e155a", "", "", ""}, "e155a", 7800, MONSTER_FAMILY_SEA, {0, 0, 20, 0, 0}, 5.0f, 23, 10, {2, -1}, 30, {0, 0}, 4, 30, MONSTER_KIND_NORMAL, {0, 0}, 72, {0, 0}, ITEM_SOAP, 1, 100, 70, ITEM_FLAPPING_FISH, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
370 // 152: Mimic (Demon Shaft) (Enhanced x2)
371 {{"e109a", "", "", ""}, "e156a", 6500, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 23, 10, {-1, -1}, 15, {0, 0}, 26, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 309, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
372 // 153: King Mimic (Demon Shaft) (Enhanced x2)
373 {{"e110a", "", "", ""}, "e157a", 10000, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 23, 50, {-1, -1}, 25, {0, 0}, 35, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 310, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 150, 100, 100, 20}, {0, 0}, 1.0f},
374 // 154: Gemron (Holy)
375 {{"e115a", "", "", ""}, "e115a", 12500, MONSTER_FAMILY_DINO, {50, 50, 50, 50, 0}, 6.5f, 30, 10, {25, -1}, 35, {0, 0}, 20, 30, MONSTER_KIND_NORMAL, {0, 0}, 315, {0, 0}, -1, 1, 70, 60, ITEM_HOLY_GEM, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
376 // 155: Gacious (Enhanced)
377 {{"e117a", "", "", ""}, "e117a", 15000, MONSTER_FAMILY_UNDEAD, {0, 50, 50, 50, 140}, 11.0f, 30, 10, {-1, -1}, 35, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 317, {0, 0}, ITEM_BATTAN, 1, 100, 90, -1, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
378 // 156: Evil Bat (Enhanced)
379 {{"e158a", "", "", ""}, "e158a", 7500, MONSTER_FAMILY_SKY, {150, 150, 150, 150, 200}, 3.0f, 30, 10, {-1, -1}, 35, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 61, {0, 0}, ITEM_ANTIDOTE_DRINK, 0, 100, 70, ITEM_PREMIUM_CHICKEN, {100, 200, 100, 100, 100, 100}, {0, 0}, 1.0f},
380 // 157: Crescent Baron (Enhanced)
381 {{"e159a", "", "", ""}, "e159a", 16000, MONSTER_FAMILY_SKY, {100, 100, 100, 110, 100}, 6.0f, 30, 10, {21, -1}, 35, {0, 0}, 18, 50, MONSTER_KIND_NORMAL, {0, 0}, 76, {0, 0}, -1, 1, 80, 70, ITEM_MELLOW_BANANA, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
382 // 158: Statue Dog (Enhanced)
383 {{"e160a", "", "", ""}, "e160a", 12500, MONSTER_FAMILY_STONE, {100, 100, 100, 100, 60}, 9.0f, 30, 10, {-1, -1}, 35, {0, 0}, 5, 30, MONSTER_KIND_NORMAL, {0, 0}, 303, {0, 0}, ITEM_STONE, 1, 90, 100, ITEM_ATTACH_ENDURANCE, {100, 100, 100, 100, 100, 100}, {0, 0}, 0.600000024f},
384 // 159: Joker (Enhanced)
385 {{"e161a", "", "", ""}, "e161a", 9500, MONSTER_FAMILY_MAGE, {50, 50, 50, 50, 150}, 5.0f, 30, 10, {-1, -1}, 35, {0, 0}, 12, 50, MONSTER_KIND_NORMAL, {0, 0}, 48, {0, 0}, ITEM_PREMIUM_CHICKEN, 1, 50, 10, ITEM_MIGHTY_HEALING, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
386 // 160: Lich (Enhanced)
387 {{"e162a", "", "", ""}, "e162a", 10000, MONSTER_FAMILY_UNDEAD, {20, 20, 20, 20, 160}, 4.0f, 30, 10, {11, -1}, 35, {0, 0}, 15, 80, MONSTER_KIND_NORMAL, {0, 0}, 51, {0, 0}, ITEM_REVIVAL_POWDER, 0, 80, 30, ITEM_ATTACH_MAGICAL_POWER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
388 // 161: Titan (Enhanced)
389 {{"e163a", "", "", ""}, "e163a", 11500, MONSTER_FAMILY_STONE, {100, 100, 110, 110, 100}, 14.0f, 30, 50, {7, -1}, 35, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 33, {0, 0}, ITEM_REPAIR_POWDER, 1, 100, 70, ITEM_STONE, {100, 100, 150, 100, 100, 20}, {0, 0}, 0.5f},
390 // 162: Living Armor (Enhanced)
391 {{"e164a", "", "", ""}, "e164a", 9500, MONSTER_FAMILY_STONE, {100, 100, 100, 80, 80}, 4.0f, 30, 50, {-1, -1}, 35, {0, 0}, 15, 30, MONSTER_KIND_NORMAL, {0, 0}, 55, {0, 0}, -1, 1, 100, 50, ITEM_STONE, {100, 100, 150, 100, 100, 20}, {0, 0}, 1.0f},
392 // 163: Mimic (Demon Shaft) (Enhanced x3)
393 {{"e109a", "", "", ""}, "e165a", 7500, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 5.0f, 30, 10, {-1, -1}, 20, {0, 0}, 26, 80, MONSTER_KIND_MIMIC_SMALL, {0, 0}, 309, {0, 0}, ITEM_REPAIR_POWDER, 1, 90, 50, ITEM_DRAN_S_FEATHER, {100, 100, 100, 100, 100, 100}, {0, 0}, 1.0f},
394 // 164: King Mimic (Demon Shaft) (Enhanced x3)
395 {{"e110a", "", "", ""}, "e166a", 19500, MONSTER_FAMILY_MIMIC, {100, 100, 100, 100, 100}, 12.0f, 30, 50, {-1, -1}, 30, {0, 0}, 35, 80, MONSTER_KIND_MIMIC_LARGE, {0, 0}, 310, {0, 0}, ITEM_ESCAPE_POWDER, 1, 90, 50, ITEM_TREASURE_KEY, {100, 100, 150, 100, 100, 20}, {0, 0}, 1.0f},
396 // 165: Black Knight
397 {{"c21a", "", "", ""}, "c21a", 40000, MONSTER_FAMILY_METAL, {100, 100, 100, 100, 100}, 14.0f, 8, 100, {30, 33}, 5, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 221, {0, 0}, -1, 0, 50, 0, -1, {100, 100, 100, 100, 100, 50}, {0, 0}, 0.0f},
398 // 166: Black Knight Mount
399 {{"c22a", "", "", ""}, "c22a", 50000, MONSTER_FAMILY_METAL, {100, 100, 100, 100, 100}, 14.0f, 8, 100, {31, 32}, 5, {0, 0}, 0, 0, MONSTER_KIND_NO_LOCK_ON, {0, 0}, 221, {0, 0}, -1, 0, 50, 0, -1, {100, 100, 100, 100, 100, 50}, {0, 0}, 0.0f},
400};
401#include "monstorunit_floor_data.inc"
402// clang-format on
403
405 int count = 0;
406
407 for (int i = 0; i < 16; i++) {
408 if (monster[i].state != -1) {
409 count++;
410 }
411 }
412
413 return count;
414}
415
416void CMonstorUnit::DrawMapSymbol(float *offset) {
417 sceVu0FVECTOR position;
418 CRect_i_ screen;
419 CRect_i_ clip;
420 int i;
421 CTexture *texture = TexManager.GetTexture("itempack", -1);
422
423 for (i = 0; i < 16; i++) {
424 if (monster[i].state != -1 && monster[i].revealed != 0) {
425 int draw;
426
427 if (BtEquipMasuisyou != 0 || DebugStatus[3] != 0) {
428 draw = true;
429 } else if (monster[i].state == 2) {
430 draw = true;
431 } else {
432 draw = false;
433 }
434
435 if (draw == 1) {
436 CCharacter *character = &chara[i][0];
437 character->GetPosition(position);
438 int x = (int) (0.1f * position[0]);
439 int y = (int) (0.1f * position[2]);
440 clip.x = 72;
441 clip.y = 96;
442 clip.width = 8;
443 clip.height = 8;
444 screen.x = (int) (0.1f * position[0]) + 384;
445 screen.y = (int) (0.1f * position[2]) + 68;
446 screen.width = 8;
447 screen.height = 8;
448 set2DSprite(Vif1Packet, texture, screen, clip);
449 }
450 }
451 }
452}
453
455 int key;
456 int key_index = 0;
457 int keys[3] = {ITEM_SHINY_STONE, ITEM_RED_BERRY, ITEM_POINTY_CHESTNUT};
458
459 if (back_dungeon != 0) {
460 return;
461 }
462
463 if (selectMapNo == DUNGEON_SHIPWRECK && UserStatus->cur_floor == 16) {
464 return;
465 }
466
467 int remaining = 1;
468
469 if (selectMapNo == DUNGEON_WISE_OWL_FOREST) {
470 remaining = 3;
471 }
472
473 if (alive_count <= 1) {
474 return;
475 }
476
477 int attempts = 0;
478
479 for (;;) {
480 int index = (int) ((float) alive_count * (float) rand() / 2147483648.0f);
481
482 if (index < 0 || index >= alive_count) {
483 index = 0;
484 }
485
486 if (monster[index].state == -1) {
487 continue;
488 }
489
490 switch (selectMapNo) {
491 case DUNGEON_DIVINE_BEAST_CAVE:
492 key = ITEM_DRAN_S_CREST;
493 break;
494 case DUNGEON_WISE_OWL_FOREST:
495 key = keys[key_index];
496 break;
497 case DUNGEON_SHIPWRECK:
498 key = ITEM_HOOK;
499 break;
500 case DUNGEON_SUN_MOON_TEMPLE:
501 key = ITEM_KING_S_SLATE;
502 break;
503 case DUNGEON_MOON_SEA:
504 key = ITEM_GUN_POWDER;
505 break;
506 case DUNGEON_GALLERY_OF_TIME:
507 key = ITEM_CLOCK_HANDS;
508 break;
509 case DUNGEON_DEMON_SHAFT:
510 key = ITEM_BLACK_KNIGHT_CREST;
511 break;
512 default:
513 key = -1;
514 break;
515 }
516
517 if (monster[index].drop_item == -1 && monster[index].drops_items != 0) {
518 printf("check ---> %d\n", ((CDngStatusData *) UserStatus)->SearchItemIndexNo(key));
519
520 if (((CDngStatusData *) UserStatus)->SearchItemIndexNo(key) < 0 && RandomItem->CheckItemNo(key) == 0) {
521 monster[index].drop_item = key;
522 }
523
524 key_index++;
525
526 if (--remaining <= 0) {
527 return;
528 }
529 }
530
531 attempts++;
532
533 if (attempts >= 9999) {
534 monster[index].drops_items = true;
535 }
536 }
537}
538
540 for (int i = 0; i < 16; i++) {
541 if (monster[i].state == 2 && monster[i].event_flag2_pending != 0) {
543 return monster[i].event_flag2;
544 }
545 }
546
547 return -1;
548}
549
550void CMonstorUnit::ArrangementPos(CDungeonMap *map, int count, int model_no, int unused) {
551 sceVu0FVECTOR position;
552 sceVu0FVECTOR existing;
553 int used[10];
554
555 for (int i = 0; i < 10; i++) {
556 used[i] = 0;
557 }
558
559 int placed;
560 int attempts;
561 int n;
562
563 for (n = 0; n < count; n++) {
564 placed = false;
565 attempts = 0;
566
567 while (placed == 0) {
568 attempts++;
569
570 if (attempts >= 65000) {
571 placed = true;
572 }
573
574 SearchiDoPutArea(map->cells, 0, 0, 20, 20, position);
575
576 if (map->CheckTreasureBox(position, 20.0f) != 0 && map->CheckAtra(position, 20.0f) != 0 && map->CheckTrapCircle(position, 20.0f) == 0) {
577 int close = 0;
578
579 for (int i = 0; i < 16; i++) {
580 if (monster[i].state != -1) {
581 CCharacter *character = &chara[i][0];
582 character->GetPosition(existing);
583
584 if (DistVector(existing, position) <= 25.0f) {
585 close = 1;
586 }
587 }
588 }
589
590 if (close == 0) {
591 int nearby = 0;
592
593 for (int i = 0; i < 16; i++) {
594 if (monster[i].state != -1) {
595 CCharacter *character = &chara[i][0];
596 character->GetPosition(existing);
597
598 if (DistVector(existing, position) <= 480.0f) {
599 nearby++;
600 }
601 }
602 }
603
604 if (nearby < 3) {
605 int selected = model_no;
606
607 if (model_no == -1) {
608 selected = (int) ((float) model_count * (float) rand() / 2147483648.0f);
609
610 if (model[selected].kind != MONSTER_KIND_NORMAL && model[selected].kind != MONSTER_KIND_MIMIC_SMALL) {
611 if (used[selected] != 0) {
612 continue;
613 }
614
615 used[selected] = 1;
616 }
617 }
618
619 SetupViewMonstor(selected, position, -1);
620 placed = true;
621 }
622 }
623 }
624 }
625 }
626
627 SetKey();
628}
629
631 for (int i = 0; i < 16; i++) {
632 monster[i].anger_timer = 300;
633 }
634}
635
637 sceVu0FVECTOR ambient;
638 MGGetAmbient(ambient);
639
640 if (monster[current_monster].palette_cycles > 0) {
641 ambient[0] = monster[current_monster].palette_color[0];
642 ambient[1] = monster[current_monster].palette_color[1];
643 ambient[2] = monster[current_monster].palette_color[2];
644 }
645
647
648 if (monster[current_monster].palette_override_pending != 0) {
653 }
654
655 MGSetAmbient(ambient);
656}
657
659 sceVu0FVECTOR ambient;
660
661 if (monster[current_monster].palette_delay == 0) {
663
664 if (monster[current_monster].palette_alpha <= 0.0f) {
666 }
667
668 if (!(monster[current_monster].palette_alpha < 128.0f)) {
670 }
671 } else {
673 }
674
676
677 if (monster[current_monster].palette_alpha <= 32.0f) {
679 }
680
681 MGGetAmbient(ambient);
682 sceVu0CopyVector(monster[current_monster].palette_color, ambient);
683
684 if (monster[current_monster].palette_cycles > 0) {
686
687 if (!(monster[current_monster].palette_step <= 0.0f)) {
688 if (!(monster[current_monster].palette_blend < 1.0f)) {
691 }
692 } else if (monster[current_monster].palette_blend <= 0.0f) {
696 }
697
698 for (int i = 0; i < 3; i++) {
700 }
701 }
702}
703
705 sceVu0FVECTOR position;
706 CCharacter *character = &chara[current_monster][0];
707 character->GetPosition(position);
708 float frame = chara[current_monster][0].motion_type.state.time;
709 float near_distance = 50.0f;
710 float far_distance = 500.0f;
711
712 if (monster[current_monster].kind == MONSTER_KIND_NO_LOCK_ON) {
713 near_distance = 350.0f;
714 far_distance = 1000.0f;
715 }
716
717 if (sound[current_monster].sequence_start <= frame && !(sound[current_monster].sequence_end <= frame)) {
718 float volume, pan;
719 SndSeSeqPlayStop(sound[current_monster].sequence_id, sound[current_monster].sequence_step, current_monster * 2);
720 SndGetVolPan(&volume, &pan, position, near_distance, far_distance);
721 SndSetSeVolf(sound[current_monster].sequence_id, volume, current_monster * 2);
722 SndSetSePanf(sound[current_monster].sequence_id, pan, current_monster * 2);
723 }
724
725 for (int i = 0; i < 16; i++) {
726 if (sound[current_monster].cooldown[i] > 0) {
728 } else if (sound[current_monster].id[i] != -1 && sound[current_monster].start[i] <= frame && !(sound[current_monster].end[i] <= frame)) {
729 float volume, pan;
730 SndSePlay(sound[current_monster].id[i], -1, 0);
731 SndGetVolPan(&volume, &pan, position, near_distance, far_distance);
732 SndSetSeVolf(sound[current_monster].id[i], volume, 0);
733 SndSetSePanf(sound[current_monster].id[i], pan, 0);
735 }
736 }
737}
738
740 CCharacter *character;
741 sceVu0FVECTOR origin = {0.0f, 0.0f, 0.0f, 0.0f};
742 sceVu0FVECTOR ambient;
743 MGGetAmbient(ambient);
744 TexManager.ReloadTexture(Vif1Packet, 42);
745
746 for (int i = 0; i < 16; i++) {
747 if (monster[i].state == 2 && monster[i].revealed != 0) {
748 current_monster = i;
749 character = &chara[i][0];
750 character->TextureAnime(42);
751 PalletSet();
752
753 if (paused != 0 || monster[i].stop_timer > 0) {
754 chara[i][0].SetMotion(chara[i][0].motion_no, 1);
755
756 for (int j = 0; j < monster[i].attachment_count; j++) {
757 if (chara[i][j + 1].frame != NULL) {
758 chara[i][j + 1].SetMotion(chara[i][j + 1].motion_no, 1);
759 }
760 }
761 }
762
763 chara[i][0].Step();
764 character->Draw();
765
766 for (int j = 0; j < monster[i].attachment_count; j++) {
767 if (chara[i][j + 1].frame != NULL) {
768 chara[i][j + 1].Step();
769 }
770 }
771
772 if (UserStatus->cur_georama == 3 && UserStatus->cur_floor == 17 && i == 1) {
773 DrawBee(chara[i][0].frame, 15);
774 }
775
776 MGSetAmbient(ambient);
777
778 for (int j = 0; j < 16; j++) {
779 if (effect[i].timer[j] != 0) {
780 effect[i].frame[j]->GetWorldPosition(effect[i].position[j], origin);
781 }
782 }
783
784 for (int j = 0; j < 16; j++) {
785 if (effect2[i].active[j] != 0) {
786 effect2[i].frame[j]->GetWorldPosition(effect2[i].position[j], origin);
787 }
788 }
789
790 if (event[i].timer == 1) {
791 event[i].frame->GetWorldPosition(event[i].position, origin);
792 event[i].timer = 2;
793 }
794
795 if (event2[i].timer == 1) {
796 event2[i].frame->GetWorldPosition(event2[i].position, origin);
797 event2[i].timer = 2;
798 }
799
800 if (monster[i].lockon_frame != NULL) {
801 monster[i].lockon_frame->GetWorldPosition(monster[i].lockon_position, origin);
802 }
803
804 for (int j = 0; j < effect3[i].count; j++) {
805 if (effect3[i].frame[j] != NULL) {
806 effect3[i].frame[j]->GetWorldPosition(effect3[i].position[j], origin);
807 } else {
808 break;
809 }
810 }
811 }
812 }
813}
814
816 sceVu0FVECTOR position;
817
818 for (int i = 0; i < 16; i++) {
819 if (monster[i].view_held != 0) {
820 CCharacter *character = &chara[i][0];
821 character->GetPosition(position);
822 position[1] += chara[i][0].body_height;
823 cursorFrame->SetPosition(position);
824 MGDraw(cursorFrame);
825 }
826 }
827}
828
829void set3DCellModel(float *world, char *name, float size, int x, int y, int width, int height) {
830 int top_left[4];
831 int top_right[4];
832 int bottom_left[4];
833 int bottom_right[4];
834 CRect_i_ clip;
835 CTexture *texture = TexManager.GetTexture(name, -1);
836 world[3] = 1;
837
838 if (MGRotTransPers3DSprite(top_left, bottom_right, world, size, size / 2.0f, 0) == 1) {
839 top_right[0] = bottom_right[0];
840 top_right[1] = top_left[1];
841 top_right[2] = top_left[2];
842 bottom_left[0] = top_left[0];
843 bottom_left[1] = bottom_right[1];
844 bottom_left[2] = bottom_right[2];
845 clip.x = x;
846 clip.y = y;
847 clip.width = width;
848 clip.height = height;
849 set3DSprite(Vif1Packet, texture, clip, top_left, top_right, bottom_left, bottom_right, 128);
850 }
851}
852
860void InitBee(CFrame *frame, int count) {
861 int frame_num = frame->GetFrameNum();
862 printf("bee num = %d\n", frame_num);
863 int i;
864
865 for (i = 0; i < frame_num * count; i++) {
866 BeeTbl[i].phase = 6.0f * (float) rand() / 2147483648.0f;
867 BeeTbl[i].row = (int) (2.0f * (float) rand() / 2147483648.0f);
868 }
869
870 for (i = 0; i < frame_num; i++) {
871 ((CFrameVu1 *) frame)[i].attr.draw_on = 0;
872 }
873
874 printf("INIT BEE END!!\n");
875}
876
877void DrawBee(CFrame *frame, int count) {
878 sceVu0FMATRIX world;
879 sceVu0FMATRIX parent_world;
880 sceVu0FVECTOR position;
881 sceGsZbuf zbuf;
882 sceGsAlpha alpha;
883 int frame_num = frame->GetFrameNum();
884 zbuf = mgZBuffer;
885 zbuf.bits.zmsk = 1;
886 MGSetGsZBUF(&zbuf);
887 alpha = mgAlpha;
888 alpha.bits.a = 2;
889 alpha.bits.b = 0;
890 alpha.bits.c = 0;
891 alpha.bits.d = 1;
892 setAlphaFlag(Vif1Packet, &alpha);
893 int bee = 0;
894
895 for (int i = 2; i < frame_num; i++) {
896 ((CFrameVu1 *) frame)[i].GetLWMatrix(world);
897 ((CFrameVu1 *) frame)[i].parent->GetLWMatrix(parent_world);
898
899 for (int j = 0; j < count; j++) {
900 sceVu0InterVectorXYZ(position, parent_world[3], world[3], (1.0f / (float) count) * (float) j);
901 position[3] = 1;
902 int x = (int) BeeTbl[bee].phase;
903 int y = BeeTbl[bee].row;
904 set3DCellModel(position, "c15a03", 7.0f, x << 6, y << 6, (x << 6) + 64, (y << 6) + 64);
905 BeeTbl[bee].phase += 0.2f;
906
907 if (BeeTbl[bee].phase > 5.0f) {
908 BeeTbl[bee].phase = 0;
909 }
910
911 bee++;
912 }
913 }
914
915 MGSetGsALPHA(NULL);
916 MGSetGsZBUF(NULL);
917}
918
920 sceVu0FVECTOR position;
921 sceVu0FVECTOR rotation;
922 sceVu0FVECTOR light = {0.0f, 1.0f, 0.0f, 0.0f};
923
924 for (int i = 0; i < 16; i++) {
925 if (monster[i].state == 2 && monster[i].shadow_visible != 0 && monster[i].revealed != 0) {
926 if (chara[i][0].shadow_frame != NULL) {
927 CCharacter *character = &chara[i][0];
928 character->ShadowStep();
929 character->GetPosition(position);
930 character->GetRotation(rotation);
931 chara[i][0].shadow_frame->SetPosition(position);
932 chara[i][0].shadow_frame->SetRotation(0.0f, rotation[1], 0.0f);
933 position[1] -= monster[i].shadow_length;
934 MGDrawShadowFast(chara[i][0].shadow_frame, position, light);
935 }
936 }
937 }
938}
939
941 sceVu0FVECTOR player_position;
942 sceVu0FVECTOR monster_position;
943 int sorted[16];
944 int active[16];
945 sceVu0CopyVector(player_position, CharaMain.pos);
946 int active_count = 0;
947
948 for (int i = 0; i < 16; i++) {
949 active[i] = -1;
950 }
951
952 for (int i = 0; i < 16; i++) {
953 sorted[i] = -1;
954 monster[i].view_held = false;
955
956 if (monster[i].state == -1 || monster[i].revealed == 0) {
957 continue;
958 }
959
960 CCharacter *character = &chara[i][0];
961 character->GetPosition(monster_position);
962 monster_position[3] = 1;
963 player_position[3] = 1;
964 float distance = DistVector(player_position, monster_position);
965 monster[i].player_distance = distance;
966
967 if (monster[i].state == 1 && distance < monster[i].clip_distance) {
968 monster[i].state = 2;
969 }
970
971 if (monster[i].state == 2 && distance > 10.0f + monster[i].clip_distance) {
972 monster[i].state = 1;
973 }
974
975 if (monster[i].hp <= 0) {
976 monster[i].state = 2;
977 }
978
979 if (monster[i].state == 2) {
980 active[active_count] = i;
981 active_count++;
982 }
983 }
984
985 int sorted_count = 0;
986
987 if (active_count > 4) {
988 int floor = UserStatus->cur_floor;
989 int max_floor = maxFloorTbl__3[selectMapNo];
990
991 if (floor + 1 == max_floor) {
992 return;
993 }
994
995 for (int i = 0; i < active_count; i++) {
996 int closest = -1;
997 float distance = 3200.0f;
998
999 for (int j = 0; j < active_count; j++) {
1000 if (active[j] != -1 && !(distance <= monster[active[j]].player_distance)) {
1001 distance = monster[active[j]].player_distance;
1002 closest = j;
1003 }
1004 }
1005
1006 if (closest != -1) {
1007 sorted[sorted_count] = active[closest];
1008 active[closest] = -1;
1009 sorted_count++;
1010 }
1011 }
1012
1013 for (int i = 4; i < active_count; i++) {
1014 if (sorted[i] != -1 && monster[sorted[i]].state == 2 && monster[sorted[i]].hp > 0 && monster[sorted[i]].kind != MONSTER_KIND_NO_LOCK_ON) {
1015 monster[sorted[i]].state = 1;
1016 monster[sorted[i]].view_held = true;
1017 }
1018 }
1019 }
1020}
1021
1023 int item;
1024 int chance = (int) (100.0f * (float) rand() / 2147483648.0f);
1025
1026 if (chance > 70) {
1027 return -1;
1028 }
1029
1030 chance = (int) (100.0f * (float) rand() / 2147483648.0f);
1031 int changed = 0;
1032 int best = 0;
1033
1034 for (int i = 1; i < 5; i++) {
1036
1037 if (greater) {
1038 best = i;
1039 changed = 1;
1040 }
1041 }
1042
1043 if (chance < 30 && changed != 0) {
1044 item = best + ITEM_ATTACH_START;
1045
1046 if (item < ITEM_ATTACH_START || item >= ITEM_ATTACH_ELEMENT_END) {
1047 item = -1;
1048 }
1049 } else {
1050 item = monster[current_monster].attachment_kind + ITEM_ATTACH_SLAYER_START;
1051
1052 if (item < ITEM_ATTACH_SLAYER_START || item >= ITEM_ATTACH_SLAYER_END) {
1053 item = -1;
1054 }
1055 }
1056
1057 return item;
1058}
1059
1061 int result = MONSTER_DMG_NONE;
1062 COLLISION_HIT *record;
1063 int immune = 0;
1064 sceVu0FVECTOR direction, position;
1065
1066 if (monster[current_monster].stop_timer <= 0) {
1067 for (int i = 0; i < 16; i++) {
1068 if (effect2[current_monster].active[i] != 0) {
1069 float time = chara[current_monster][0].motion_type.state.time;
1070
1071 if (effect2[current_monster].motion_start[i] < time && !(effect2[current_monster].motion_end[i] <= time)) {
1072 int damage = effect2[current_monster].damage[i];
1073
1074 if (monster[current_monster].anger_timer > 0) {
1075 damage *= 2;
1076 }
1077
1078 int hit = NowColData->Set(effect2[current_monster].position[i], damage, 2, effect2[current_monster].radius[i], 0.0f, 1, effect2[current_monster].kind[i], effect2[current_monster].flags[i], 0);
1079 NowColData->SetUserID(current_monster * 5 + 200, i);
1080
1081 if (effect2[current_monster].kind[i] == 3) {
1082 float angle = effect2[current_monster].angle[i];
1083
1084 if (angle == 0.0f) {
1085 sceVu0CopyVector(direction, CharaMain.pos);
1086 chara[current_monster][0].GetPosition(position);
1087 direction[0] -= position[0];
1088 direction[1] = 0;
1089 direction[2] -= position[2];
1090 direction[3] = 1;
1091 sceVu0Normalize(direction, direction);
1092 NowColData->SetVelocity(hit, direction, 1.0f);
1093 } else {
1094 if (!(angle < 180.0f)) {
1095 angle -= 360.0f;
1096 }
1097
1098 angle = DEG_TO_RAD * angle;
1099 angle += chara[current_monster][0].GetRotation()->y;
1100
1101 if (!(angle <= TWO_PI)) {
1102 angle -= TWO_PI;
1103 }
1104
1105 if (angle < -PI) {
1106 angle += TWO_PI;
1107 }
1108
1109 sceVu0FVECTOR forward = {0, 0, 1, 0};
1110 sceVu0FMATRIX rotation_matrix, identity_matrix;
1111 sceVu0UnitMatrix(identity_matrix);
1112 sceVu0RotMatrixY(rotation_matrix, identity_matrix, angle);
1113 sceVu0ApplyMatrix(forward, rotation_matrix, forward);
1114 NowColData->SetVelocity(hit, forward, 1.0f);
1115 }
1116 }
1117 }
1118 }
1119 }
1120 }
1121
1122 sceVu0FVECTOR poison_position, guard_position, guard_origin, guard_direction;
1123 sceVu0FVECTOR steal_position, knockback_position, knockback_origin, hit_direction, player_position;
1124
1125 if (monster[current_monster].hp <= 0) {
1126 if (monster[current_monster].stop_timer > 0) {
1129 }
1130
1131 return MONSTER_DMG_NONE;
1132 }
1133
1135
1136 if (monster[current_monster].stop_timer > 0) {
1142
1143 if (monster[current_monster].stop_timer == 0) {
1145 }
1146 }
1147
1148 if (monster[current_monster].slow_timer > 0) {
1153 }
1154
1155 if (monster[current_monster].anger_timer > 0) {
1161 }
1162
1163 if (monster[current_monster].poison_timer > 0) {
1169
1170 if (monster[current_monster].poison_timer == 0) {
1172 float damage = 0.1f * (float) monster[current_monster].max_hp;
1173 monster[current_monster].hp -= (int) damage;
1174 result = MONSTER_DMG_HIT;
1175
1176 if (monster[current_monster].hp <= 0) {
1178 alive_count--;
1179 result = MONSTER_DMG_KILLED;
1180 ((CDngStatusData *) UserStatus)->AddKills();
1181 }
1182
1183 chara[current_monster][0].GetPosition(poison_position);
1184 poison_position[1] += chara[current_monster][0].body_height;
1185 HitValueEntry(NowHitValue, poison_position, (int) damage, HIT_VALUE_MONSTER, NULL);
1186 }
1187 }
1188
1189 if (monster[current_monster].invincible_timer > 0) {
1190 return result;
1191 }
1192
1194
1195 for (int i = 0; i < 16; i++) {
1196 if (effect[current_monster].timer[i] != 0) {
1197 int active = true;
1198 float incoming_time;
1199
1200 if (effect[current_monster].motion_start[i] != 0.0f && (!(effect[current_monster].motion_start[i] < (incoming_time = chara[current_monster][0].motion_type.state.time)) || effect[current_monster].motion_end[i] < incoming_time)) {
1201 active = false;
1202 }
1203
1204 if (active != 0) {
1205 int hit;
1206 int element;
1207 int owner;
1208 hit = NowColData->FindMonsterHit(effect[current_monster].position[i], effect[current_monster].radius[i]);
1209 int rejected = 0;
1210
1211 if (hit != -1) {
1212 int monster_owner = NowColData->GetMonsterOwner(hit);
1213
1214 if (monster_owner == current_monster) {
1215 rejected = 1;
1216 }
1217
1218 if (monster_owner != -1 && monster_owner != current_monster) {
1219 COLLISION_HIT *other_record = &(*NowColData->Get(hit));
1220 float chance = 100.0f * (float) rand() / 2147483648.0f;
1221
1222 if (other_record->flags & 0x1000) {
1227 SndSePlay(SE_POWER_UP, -1, 0);
1228 }
1229 }
1230
1231 rejected = 1;
1232 }
1233 }
1234
1235 if (hit != -1 && rejected == 0) {
1236 for (int j = 0; j < 3; j++) {
1237 if (guard[current_monster].active[j] != 0) {
1238 float time = chara[current_monster][0].motion_type.state.time;
1239
1240 if (guard[current_monster].motion_start[j] <= time && !(guard[current_monster].motion_end[j] < time)) {
1241 record = &(*NowColData->Get(hit));
1242
1243 if (record->knockback_mode == 2) {
1244 chara[current_monster][0].GetPosition(guard_position);
1245 sceVu0CopyVector(guard_origin, record->knockback_origin);
1246 guard_position[1] = 0;
1247 guard_origin[1] = 0;
1248 sceVu0SubVector(monster[current_monster].knockback_direction, guard_position, guard_origin);
1249 sceVu0Normalize(monster[current_monster].knockback_direction, monster[current_monster].knockback_direction);
1252 }
1253
1254 int owner = NowColData->hit[hit].owner;
1255
1256 if (NowColData->hit[hit].attack_no == 0 && (owner == 0 || owner == 2 || owner == 4)) {
1257 SwordDmgCheck1(0.1f, monster[current_monster].hardness);
1258 }
1259
1260 guard_direction[0] = 0;
1261 guard_direction[1] = 2.5f;
1262 guard_direction[2] = 0;
1263 guard_direction[3] = 1;
1264 HitMark[hitCnt].Set(effect[current_monster].position[i], guard_direction, HIT_MARK_GUARD, 0.8f, 0.005f, 0.02f, 1.3f, 32, monster[current_monster].ground_y);
1265 HitPointMark[hitCnt].Set(effect[current_monster].position[i]);
1266 SndSePlay(SE_HIT_BLOCKED, -1, 0);
1267 rejected = 1;
1268 j = 3;
1269 }
1270 }
1271 }
1272 }
1273
1274 int hit_id = -1;
1275
1276 if (hit != -1 && rejected == 0) {
1277 COLLISION_HIT *original_record = &(*NowColData->Get(hit));
1279 int attack = NowColData->hit[hit].attack_no;
1280 owner = NowColData->GetUserID(hit);
1281
1282 if (owner != -1) {
1283 hit_id = owner * 10;
1284 }
1285
1286 if (attack != -1) {
1287 hit_id += attack;
1288 }
1289
1292 int element_flags = NowColData->GetFlags(hit);
1293 printf("element = %d\n", element_flags);
1294 int item;
1295
1296 switch (element_flags) {
1297 case HIT_ELEMENT_FIRE:
1298 element = WEAPON_ELEMENT_FIRE;
1299 break;
1300 case HIT_ELEMENT_COLD:
1301 element = WEAPON_ELEMENT_COLD;
1302 break;
1303 case HIT_ELEMENT_THUNDER:
1304 element = WEAPON_ELEMENT_THUNDER;
1305 break;
1306 case HIT_ELEMENT_WIND:
1307 element = WEAPON_ELEMENT_WIND;
1308 break;
1309 case HIT_ELEMENT_HOLY:
1310 element = WEAPON_ELEMENT_HOLY;
1311 break;
1312 default:
1313 element = WEAPON_ELEMENT_NONE;
1314 break;
1315 }
1316
1318
1319 if (monster[current_monster].steal_item != -1 && (effect[current_monster].hit_attributes & 0x80) && (int) (100.0f * (float) rand() / 2147483648.0f) < 10 && (item = monster[current_monster].steal_item, ((CDngStatusData *) UserStatus)->CheckItemGet(item)) == 0) {
1320 chara[current_monster][0].GetPosition(steal_position);
1321 steal_position[1] += 12.0f;
1322 StealItem.Set(steal_position, monster[current_monster].steal_item);
1324 }
1325
1326 int attacker = NowColData->hit[hit].owner;
1327
1328 if (attacker == 0 || attacker == 2 || attacker == 4) {
1329 SwordDmgCheck1(1.0f, monster[current_monster].hardness);
1330 }
1331
1332 result = MONSTER_DMG_HIT;
1333 int boss = 0;
1334
1335 if (selectMapNo == DUNGEON_DIVINE_BEAST_CAVE && UserStatus->cur_floor == 14) {
1336 boss = 1;
1337 }
1338
1339 if (selectMapNo == DUNGEON_GALLERY_OF_TIME && UserStatus->cur_floor == 24) {
1340 boss = 1;
1341 }
1342
1343 if (boss == 0) {
1344 if (owner == 5 && NowColData->hit[hit].attack_no == 6) {
1345 result = MONSTER_DMG_NONE;
1346 }
1347
1348 if (owner == 1) {
1349 result = MONSTER_DMG_NONE;
1350 }
1351 }
1352
1353 record = &(*NowColData->Get(hit));
1354
1355 if (record->knockback_mode == 2) {
1356 chara[current_monster][0].GetPosition(knockback_position);
1357 sceVu0CopyVector(knockback_origin, record->knockback_origin);
1358 knockback_position[1] = 0;
1359 knockback_origin[1] = 0;
1360 sceVu0SubVector(monster[current_monster].knockback_direction, knockback_position, knockback_origin);
1361 sceVu0Normalize(monster[current_monster].knockback_direction, monster[current_monster].knockback_direction);
1364 }
1365
1366 hit_direction[0] = 0;
1367 hit_direction[1] = 1.1f;
1368 hit_direction[2] = 0;
1369 hit_direction[3] = 1;
1370 const float mark_scale = 1.0f;
1371 const float mark_spread = 1.0f / 2.0f;
1372 HitMark[hitCnt].Set(effect[current_monster].position[i], hit_direction, HIT_MARK_HIT, mark_spread, 0.01f, 0.02f, mark_scale, 32, monster[current_monster].ground_y);
1373 HitPointMark[hitCnt].Set(effect[current_monster].position[i]);
1374
1375 if (hitCnt == 15) {
1376 hitCnt = 0;
1377 } else {
1378 hitCnt++;
1379 }
1380
1381 if (element < WEAPON_ELEMENT_NONE) {
1382 CDngStatusData *status = (CDngStatusData *) UserStatus;
1383 WEAPON_HAVE *weapon = &status->chara_weapons[owner][status->equipped_weapon_slot[owner]];
1384 float strength = (float) weapon->elem[weapon->best_elem];
1385 static int cnt = 0;
1386 CWeaponElFx[cnt].Set(&effect[current_monster].position[i], effect[current_monster].position[i], strength, element, monster[current_monster].body_radius);
1387
1388 if (cnt >= 3) {
1389 cnt = 0;
1390 } else {
1391 cnt++;
1392 }
1393 }
1394
1395 float chance = 100.0f * (float) rand() / 2147483648.0f;
1396
1397 if (effect[current_monster].hit_attributes & 0x20) {
1398 if (100.0f * (float) rand() / 2147483648.0f <= 10.0f && chance < (float) monster[current_monster].status_chance) {
1401 } else if (owner == -1) {
1402 immune = 1;
1403 }
1404 }
1405
1406 if (effect[current_monster].hit_attributes & 0x40) {
1407 if (100.0f * (float) rand() / 2147483648.0f <= 4.0f && chance < (float) monster[current_monster].status_chance) {
1408 if (monster[current_monster].stop_timer <= 0) {
1414 } else {
1416 }
1417 } else if (owner == -1) {
1418 immune = 1;
1419 }
1420 }
1421
1422 chance = monster[current_monster].status_chance == 0 ? 100.0f : 0.0f;
1423
1424 if (original_record->flags & 0x200) {
1425 if (chance < (float) monster[current_monster].status_chance) {
1426 if (monster[current_monster].stop_timer == 0 && monster[current_monster].anger_timer == 0) {
1429 }
1430 } else if (owner == -1) {
1431 immune = 1;
1432 }
1433 }
1434
1435 if (original_record->flags & 0x100) {
1436 if (chance < (float) monster[current_monster].status_chance) {
1437 if (monster[current_monster].stop_timer <= 0) {
1443 } else {
1445 }
1446 } else if (owner == -1) {
1447 immune = 1;
1448 }
1449 }
1450
1451 if (original_record->flags & 0x800) {
1452 if (chance < (float) monster[current_monster].status_chance) {
1453 if (monster[current_monster].stop_timer == 0 && monster[current_monster].poison_timer == 0 && monster[current_monster].anger_timer == 0) {
1455 }
1456 } else if (owner == -1) {
1457 immune = 1;
1458 }
1459 }
1460
1461 float damage = (float) record->damage;
1462
1463 if (owner == 1 || owner == 3 || owner == 5) {
1464 sceVu0CopyVector(player_position, CharaMain.pos);
1465 float distance = DistVector(player_position, record->pos);
1466
1467 if (distance <= 20.0f) {
1468 damage *= 1.5f;
1469 printf("c_dist = %.3f\n", 1.5);
1470 }
1471
1472 if (!(distance < 50.0f)) {
1473 distance -= 50.0f;
1474 distance = (100.0f - distance) / 100.0f;
1475
1476 if (distance < 0.5f) {
1477 distance = 0.5f;
1478 }
1479
1480 damage *= distance;
1481 printf("c_dist = %.3f\n", distance);
1482 }
1483 }
1484
1485 int index = GetCurrentMonsterIndex();
1486 float defense = (float) monster[index].defense;
1487
1488 if (owner == 3) {
1489 defense /= 2.0f;
1490 }
1491
1492 damage -= defense;
1493
1494 if (damage <= 0.0f) {
1495 damage = 1.0f;
1496 }
1497
1498 if (element_flags != 0) {
1499 float old_damage = damage;
1500 float bonus = 0;
1501
1502 if (owner != -1) {
1503 WEAPON_HAVE *weapon = &UserStatus->chara_weapons[owner][UserStatus->equipped_weapon_slot[owner]];
1504 bonus = damage * (0.005f * (float) weapon->magic + 0.004f * (float) weapon->elem[element]);
1505 }
1506
1507 damage += bonus;
1508 damage *= 0.01f * (float) monster[index].attachment_weight[element];
1509
1510 if (damage <= 0.0f && !(old_damage <= 0.0f)) {
1511 immune = 1;
1512 }
1513 }
1514
1515 char *effectiveness = record->vs_monster;
1516
1517 if (effectiveness != NULL) {
1518 damage += damage * (0.015f * (float) effectiveness[monster[index].attachment_kind]);
1519 }
1520
1521 if (owner != -1) {
1522 float old_damage = damage;
1523 int multiplier = effect[index].parameter[i][owner];
1524 float damage_scale = (float) multiplier;
1525 damage = damage / 100.0f * damage_scale;
1526
1527 if (damage <= 0.0f) {
1528 damage = 0;
1529 }
1530
1531 if (damage <= 0.0f && !(old_damage <= 0.0f)) {
1532 immune = 1;
1533 }
1534 }
1535
1536 int target_kind = NowColData->hit[hit].target_kind;
1537
1538 if (target_kind != -1 && monster[index].attachment_kind != target_kind) {
1539 damage = 0;
1540 immune = 1;
1541 }
1542
1543 if (monster[index].anger_timer > 0) {
1544 damage /= 2.0f;
1545 }
1546
1547 if (owner == -1) {
1548 damage *= 0.01f * (float) monster[index].item_damage_rate;
1549 }
1550
1551 if (damage <= 0.0f) {
1552 damage = 0;
1553 }
1554
1555 int amount = (int) damage;
1556
1557 if (!(damage - (float) amount <= 0.0f)) {
1558 amount++;
1559 }
1560
1561 if ((effect[index].hit_attributes & 0x400) && !(damage < 100.0f)) {
1562 CUserStatus *status = UserStatus;
1563
1564 if (status->hp[(int) owner] > 0) {
1565 float heal = 0.01f * damage;
1566 int ignored = (int) heal;
1567 status->AddNowLife(owner, (short) (int) heal, 255.0f);
1568 }
1569 }
1570
1571 if ((effect[current_monster].hit_attributes & 0x1000) && monster[current_monster].kind != MONSTER_KIND_NO_LOCK_ON && 100.0f * (float) rand() / 2147483648.0f < 1.0f) {
1572 amount = monster[current_monster].hp;
1573 }
1574
1575 if (amount > 0 && (owner == 0 || owner == 2 || owner == 4) && element >= 0 && element < WEAPON_ELEMENT_NONE) {
1576 SndSePlay(element + 0x65, -1, 0);
1577 }
1578
1579 BtActStatus.monstor_target = owner;
1580 monster[current_monster].hp -= amount;
1581
1582 if (monster[current_monster].hp <= 0) {
1585 alive_count--;
1586 result = MONSTER_DMG_KILLED;
1587 ((CDngStatusData *) UserStatus)->AddKills();
1588
1589 if (monster[current_monster].event_flag2 != -1) {
1591 }
1592 }
1593
1594 if (immune == 0) {
1601 HitValueEntry(NowHitValue, effect[current_monster].position[i], amount, HIT_VALUE_MONSTER, NULL);
1602 SndSePlay(SE_MONSTER_HIT, -1, 0);
1603 } else {
1604 HitValueEntry(NowHitValue, effect[current_monster].position[i], 0, HIT_VALUE_ZERO, NULL);
1611 SndSePlay(SE_HIT_NO_DAMAGE, -1, 0);
1612 }
1613
1614 if (NowColData->hit[hit].target_mask != 3) {
1615 NowColData->active[hit] = 0;
1616 }
1617
1618 if (result == MONSTER_DMG_KILLED) {
1619 return MONSTER_DMG_KILLED;
1620 }
1621
1622 break;
1623 }
1624 }
1625 }
1626 }
1627
1628 return result;
1629}
1630
1631void CMonstorUnit::MoveCheck(float *position, float *movement, int flat) {
1632 sceVu0FVECTOR start;
1633 sceVu0FVECTOR center;
1634 sceVu0FVECTOR ground;
1635 sceVu0FVECTOR end;
1636 sceVu0FVECTOR toward;
1637 sceVu0FVECTOR direction;
1638 sceVu0FVECTOR top;
1639 sceVu0FVECTOR end_ground;
1640 sceVu0CopyVector(start, position);
1641 end[0] = start[0] + movement[0];
1642 end[1] = start[1] + movement[1];
1643 end[2] = start[2] + movement[2];
1644 movement[3] = 1.0f;
1645 sceVu0Normalize(direction, movement);
1646 direction[1] = 1.0f;
1647 sceVu0CopyVector(top, end);
1648 sceVu0CopyVector(end_ground, end);
1649 CUserStatus *status = UserStatus;
1650 top[1] += CharaHeight(status);
1651 end_ground[1] = 1.0f;
1652 float upper = top[1];
1653 float lower = end[1];
1654
1655 for (int i = 0; i < 16; i++) {
1656 if (monster[i].state == 2 && monster[i].revealed != 0) {
1657 if (effect3[i].count == 0) {
1658 CCharacter *character = &chara[i][0];
1659 character->GetPosition(center);
1660 character->GetPosition(ground);
1661 ground[1] = 1.0f;
1662
1663 if (flat != 0) {
1664 center[1] = 1.0f;
1665 lower = 1.0f;
1666 }
1667
1668 float distance = DistVector(ground, end_ground);
1669 float radius = monster[i].body_radius;
1670
1671 if (distance < 6.0f + radius) {
1672 int clear = 1;
1673 float ceiling = center[1] + 2.0f * radius;
1674
1675 if (!(ceiling < upper) && center[1] < upper) {
1676 clear = 0;
1677 }
1678
1679 if (!(ceiling < lower) && center[1] < lower) {
1680 clear = 0;
1681 }
1682
1683 if (ceiling <= upper && !(center[1] <= lower)) {
1684 clear = 0;
1685 }
1686
1687 if (!(ceiling < upper) && center[1] < lower) {
1688 clear = 0;
1689 }
1690
1691 if (clear == 0) {
1692 toward[0] = center[0] - start[0];
1693 toward[2] = center[2] - start[2];
1694 toward[1] = 0.0f;
1695 toward[3] = 1.0f;
1696 sceVu0Normalize(toward, toward);
1697
1698 if (!(sceVu0InnerProduct(direction, toward) <= 0.33333334f)) {
1699 movement[0] = 0.0f;
1700 movement[1] -= 2.0f;
1701 movement[2] = 0.0f;
1702 return;
1703 }
1704 }
1705 }
1706 } else {
1707 for (int j = 0; j < effect3[i].count; j++) {
1708 sceVu0CopyVector(center, effect3[i].position[j]);
1709 sceVu0CopyVector(ground, effect3[i].position[j]);
1710 ground[1] = 1.0f;
1711
1712 if (DistVector(ground, end_ground) <= 6.0f + effect3[i].radius[j]) {
1713 if (flat != 0) {
1714 center[1] = 1.0f;
1715 lower = 1.0f;
1716 }
1717
1718 int clear = 1;
1719 float bottom = center[1] - effect3[i].radius[j];
1720 float ceiling = center[1] + effect3[i].radius[j];
1721
1722 if (!(bottom <= upper) && ceiling < upper) {
1723 clear = 0;
1724 }
1725
1726 if (!(bottom <= lower) && ceiling < lower) {
1727 clear = 0;
1728 }
1729
1730 if (bottom < upper && !(ceiling <= lower)) {
1731 clear = 0;
1732 }
1733
1734 if (!(bottom <= upper) && ceiling < lower) {
1735 clear = 0;
1736 }
1737
1738 if (clear == 0) {
1739 toward[0] = center[0] - start[0];
1740 toward[2] = center[2] - start[2];
1741 toward[1] = 0.0f;
1742 toward[3] = 1.0f;
1743 sceVu0Normalize(toward, toward);
1744
1745 if (!(sceVu0InnerProduct(direction, toward) <= 0.33333334f)) {
1746 movement[0] = 0.0f;
1747 movement[1] -= 2.0f;
1748 movement[2] = 0.0f;
1749 return;
1750 }
1751 }
1752 }
1753 }
1754 }
1755 }
1756 }
1757}
1758
1760 sceVu0FVECTOR player_position;
1761 sceVu0FVECTOR next_position;
1762 sceVu0FVECTOR position;
1763 sceVu0FVECTOR direction;
1764 sceVu0FVECTOR displacement;
1765 sceVu0FVECTOR towards_player;
1766 sceVu0FVECTOR flat_player;
1767 sceVu0FVECTOR flat_next;
1768 sceVu0CopyVector(player_position, CharaMain.pos);
1769 CCharacter *character = &chara[current_monster][0];
1770 character->GetPosition(position);
1771 next_position[0] = position[0] + monster[current_monster].movement[0] * monster[current_monster].movement_speed;
1772 next_position[1] = position[1] + monster[current_monster].movement[1] * monster[current_monster].movement_speed;
1773 next_position[2] = position[2] + monster[current_monster].movement[2] * monster[current_monster].movement_speed;
1774 displacement[0] = next_position[0] - position[0];
1775 displacement[1] = 0;
1776 displacement[2] = next_position[2] - position[2];
1777 displacement[3] = 1;
1778 sceVu0Normalize(displacement, displacement);
1779 sceVu0Normalize(direction, monster[current_monster].movement);
1780 sceVu0CopyVector(flat_player, player_position);
1781 sceVu0CopyVector(flat_next, next_position);
1782 flat_player[1] = 1;
1783 flat_next[1] = 1;
1784
1785 if (DistVector(flat_player, flat_next) <= 6.0f + monster[current_monster].body_radius && next_position[1] < 18.0f + player_position[1]) {
1786 towards_player[0] = player_position[0] - position[0];
1787 towards_player[2] = player_position[2] - position[2];
1788 towards_player[1] = 0;
1789 towards_player[3] = 1;
1790 sceVu0Normalize(towards_player, towards_player);
1791
1792 if (!(sceVu0InnerProduct(displacement, towards_player) <= 0.0f)) {
1797 return;
1798 }
1799 }
1800}
1801
1803 sceVu0FVECTOR other_position;
1804 sceVu0FVECTOR next_position;
1805 sceVu0FVECTOR position;
1806 sceVu0FVECTOR direction;
1807 sceVu0FVECTOR displacement;
1808 sceVu0FVECTOR towards_other;
1809 sceVu0FVECTOR flat_other;
1810 sceVu0FVECTOR flat_next;
1811 CCharacter *character = &chara[current_monster][0];
1812 character->GetPosition(position);
1813 next_position[0] = position[0] + monster[current_monster].movement[0] * monster[current_monster].movement_speed;
1814 next_position[1] = position[1] + monster[current_monster].movement[1] * monster[current_monster].movement_speed;
1815 next_position[2] = position[2] + monster[current_monster].movement[2] * monster[current_monster].movement_speed;
1816 displacement[0] = next_position[0] - position[0];
1817 displacement[1] = 0;
1818 displacement[2] = next_position[2] - position[2];
1819 displacement[3] = 1;
1820 sceVu0Normalize(displacement, displacement);
1821 sceVu0Normalize(direction, monster[current_monster].movement);
1822 sceVu0CopyVector(flat_next, next_position);
1823 flat_next[1] = 1;
1824
1825 for (int i = 0; i < 16; i++) {
1826 if (monster[i].state == 2 && i != current_monster) {
1827 CCharacter *other = &chara[i][0];
1828 other->GetPosition(other_position);
1829 sceVu0CopyVector(flat_other, other_position);
1830 flat_other[1] = 1;
1831 float distance = DistVector(flat_other, flat_next);
1832 float own_radius = monster[current_monster].collision_radius;
1833 float radius = monster[i].collision_radius;
1834
1835 if (distance <= radius + own_radius && next_position[1] < other_position[1] + 2.0f * radius) {
1836 towards_other[0] = other_position[0] - position[0];
1837 towards_other[2] = other_position[2] - position[2];
1838 towards_other[1] = 0;
1839 towards_other[3] = 1;
1840 sceVu0Normalize(towards_other, towards_other);
1841
1842 if (!(sceVu0InnerProduct(displacement, towards_other) <= 0.0f)) {
1847 return;
1848 }
1849 }
1850 }
1851 }
1852}
1853
1854void CMonstorUnit::Step(int pause) {
1855 sceVu0FVECTOR position, destination, hit;
1856 CBoxVu0 box;
1857 sceVu0FVECTOR other_position, width_start, width_hit;
1858 sceVu0FVECTOR turn_position, rotation, direction;
1859 sceVu0FVECTOR drop_position, key_position, attachment_position, money_position;
1861
1862 if (pause != 0) {
1863 paused = true;
1864 return;
1865 }
1866
1867 if (paused != 0) {
1868 for (int i = 0; i < 16; i++) {
1869 if (monster[i].state == 2) {
1871
1872 if (monster[i].requested_motion_flags == 2) {
1873 chara[i][0].SetMotion(monster[i].requested_motion, 2);
1874
1875 if (!(monster[i].requested_motion_speed < 0.0f)) {
1876 chara[i][0].SetMotionSpeed(monster[i].requested_motion_speed);
1877 }
1878
1879 for (int j = 0; j < monster[i].attachment_count; j++) {
1880 chara[i][j + 1].SetMotion(monster[i].requested_motion, 2);
1881
1882 if (!(monster[i].requested_motion_speed < 0.0f)) {
1883 chara[i][j + 1].SetMotionSpeed(monster[i].requested_motion_speed);
1884 }
1885 }
1886 } else {
1887 chara[i][0].SetMotion(monster[i].requested_motion, 0);
1888
1889 if (!(monster[i].requested_motion_speed < 0.0f)) {
1890 chara[i][0].SetMotionSpeed(monster[i].requested_motion_speed);
1891 }
1892
1893 for (int j = 0; j < monster[i].attachment_count; j++) {
1894 chara[i][j + 1].SetMotion(monster[i].requested_motion, 0);
1895
1896 if (!(monster[i].requested_motion_speed < 0.0f)) {
1897 chara[i][j + 1].SetMotionSpeed(monster[i].requested_motion_speed);
1898 }
1899 }
1900 }
1901 }
1902 }
1903
1904 paused = false;
1905 }
1906
1907 BtActStatus.monstor_target = -1;
1908
1909 for (int i = 0; i < 16; i++) {
1910 if (monster[i].state == 2) {
1911 current_monster = i;
1912
1913 if (monster[current_monster].motion_reset_pending != 0) {
1915
1916 if (monster[current_monster].requested_motion_flags == 2) {
1917 chara[current_monster][0].SetMotion(monster[current_monster].requested_motion, 2);
1918
1919 if (!(monster[current_monster].requested_motion_speed < 0.0f)) {
1920 chara[current_monster][0].SetMotionSpeed(monster[current_monster].requested_motion_speed);
1921 }
1922
1923 for (int j = 0; j < monster[current_monster].attachment_count; j++) {
1924 chara[current_monster][j + 1].SetMotion(monster[current_monster].requested_motion, 2);
1925
1926 if (!(monster[current_monster].requested_motion_speed < 0.0f)) {
1927 chara[current_monster][j + 1].SetMotionSpeed(monster[current_monster].requested_motion_speed);
1928 }
1929 }
1930 } else {
1931 chara[current_monster][0].SetMotion(monster[current_monster].requested_motion, 0);
1932
1933 for (int j = 0; j < monster[current_monster].attachment_count; j++) {
1934 chara[current_monster][j + 1].SetMotion(monster[current_monster].requested_motion, 0);
1935
1936 if (!(monster[current_monster].requested_motion_speed < 0.0f)) {
1937 chara[current_monster][j + 1].SetMotionSpeed(monster[current_monster].requested_motion_speed);
1938 }
1939 }
1940 }
1941
1943 }
1944
1945 if (monster[current_monster].revealed != 0) {
1946 if (back_dungeon != 0) {
1948 }
1949
1952 chara[current_monster][0].GetPosition(position);
1953 monster[current_monster].collision_poly_count = setCollisionData(NowDngMap, monster[current_monster].collision_poly, position, 30.0f, 5.0f);
1954 int original_count = monster[current_monster].collision_poly_count;
1955 box.max[0] = 30.0f + position[0];
1956 box.max[1] = 80.0f + position[1];
1957 box.max[2] = 30.0f + position[2];
1958 box.min[0] = position[0] - 30.0f;
1959 box.min[1] = position[1] - 80.0f;
1960 box.min[2] = position[2] - 30.0f;
1961
1962 for (int j = 0; j < 16; j++) {
1963 if (j != current_monster && monster[j].state == 2) {
1964 chara[j][0].GetPosition(other_position);
1965 collision->SetPosition(other_position);
1966 float scale = 2.0f * (0.1f * monster[j].collision_radius);
1967 collision->SetScale(scale, scale, scale);
1968 monster[current_monster].collision_poly_count += collision->PickUpNearPoly(monster[current_monster].collision_poly + monster[current_monster].collision_poly_count, box);
1969 }
1970 }
1971
1972 if (monster[current_monster].collision_poly_count >= 400) {
1973 printf("err %d\n", monster[current_monster].collision_poly_count);
1974 }
1975
1976 switch (CheckDmg()) {
1977 case MONSTER_DMG_NONE:
1978 break;
1979 case MONSTER_DMG_HIT:
1982 break;
1983 case MONSTER_DMG_KILLED:
1986 break;
1987 }
1988
1989 if (monster[current_monster].stop_timer > 0) {
1990 PalletStep();
1991
1992 if (monster[current_monster].invincible_timer > 0) {
1994 }
1995 } else {
1996 if (script_state[current_monster] == 0) {
1997 if (monster[current_monster].revealed == 1) {
2000 } else {
2002 }
2003
2005 } else {
2007
2008 if (interpreter[current_monster].IsEnd() != 0) {
2010 }
2011 }
2012
2013 chara[current_monster][0].GetPosition(position);
2014
2015 if (!(monster[current_monster].knockback[0] <= 0.0f)) {
2016 sceVu0CopyVector(monster[current_monster].movement, monster[current_monster].knockback_direction);
2019
2020 if (monster[current_monster].knockback[0] <= 0.0f) {
2023 }
2024 }
2025
2026 if (monster[current_monster].collision_off_timer <= 0) {
2027 MoveCheck2();
2028 }
2029
2030 if (monster[current_monster].collision_off_timer <= 0) {
2032 }
2033
2035
2036 if (monster[current_monster].movement_speed != 0.0f || (monster[current_monster].falls != 0 && monster[current_monster].movement_speed == 0.0f)) {
2037 destination[0] = position[0] + 10.0f * monster[current_monster].movement[0];
2038 destination[1] = position[1] + 10.0f * monster[current_monster].movement[1];
2039 destination[2] = position[2] + 10.0f * monster[current_monster].movement[2];
2040 position[1] += 5.0f;
2041 destination[1] += 5.0f;
2042
2043 if (CheckHit(monster[current_monster].collision_poly, monster[current_monster].collision_poly_count, position, destination, hit, 0, 0) >= 0 && monster[current_monster].collision_off_timer <= 0) {
2044 position[1] -= 5.0f;
2046 chara[current_monster][0].SetPosition(position);
2047 } else {
2048 position[1] -= 5.0f;
2049
2050 if (monster[current_monster].falls != 0 && !(monster[current_monster].ground_distance <= 0.0001f)) {
2051 destination[0] = position[0] + monster[current_monster].movement[0] * monster[current_monster].movement_speed;
2052 destination[1] = position[1] + (monster[current_monster].movement[1] * monster[current_monster].movement_speed - 0.2f);
2053 destination[2] = position[2] + monster[current_monster].movement[2] * monster[current_monster].movement_speed;
2054 } else {
2055 destination[0] = position[0] + monster[current_monster].movement[0] * monster[current_monster].movement_speed;
2056 destination[1] = position[1] + monster[current_monster].movement[1] * monster[current_monster].movement_speed;
2057 destination[2] = position[2] + monster[current_monster].movement[2] * monster[current_monster].movement_speed;
2058 }
2059
2060 chara[current_monster][0].SetPosition(destination);
2061
2062 if (monster[current_monster].falls != 0 && !(monster[current_monster].ground_distance <= 0.0001f)) {
2063 monster[current_monster].movement_speed = DistVector(destination, position);
2064 destination[0] -= position[0];
2065 destination[1] -= position[1];
2066 destination[2] -= position[2];
2067 sceVu0Normalize(monster[current_monster].movement, destination);
2068 }
2069 }
2070
2071 chara[current_monster][0].GetPosition(width_start);
2072 width_start[1] += 5.0f;
2073
2074 if (CheckWidth(monster[current_monster].collision_poly, monster[current_monster].collision_poly_count, width_start, monster[current_monster].body_radius, width_hit, 0) != 0) {
2075 width_hit[1] -= 5.0f;
2076 chara[current_monster][0].SetPosition(width_hit);
2077 }
2078 }
2079
2081 chara[current_monster][0].GetPosition(position);
2082 position[1] += 10.0f;
2083 float ground_depth = -130.0f;
2084
2085 if (CheckHitVertical(monster[current_monster].collision_poly, monster[current_monster].collision_poly_count, position, ground_depth, hit, 0) >= 0) {
2086 position[1] -= 10.0f;
2087
2088 if (position[1] < hit[1]) {
2089 position[1] = hit[1];
2090
2091 if (monster[current_monster].falls != 0) {
2092 monster[current_monster].movement[1] *= -1.0f;
2093
2094 if (!(monster[current_monster].movement[1] <= 0.0f)) {
2096
2097 if (monster[current_monster].movement_speed < 0.2f) {
2099 }
2100 }
2101 }
2102 }
2103
2104 monster[current_monster].ground_distance = position[1] - hit[1];
2106
2107 if (monster[current_monster].falls != 0) {
2108 chara[current_monster][0].SetPosition(position);
2109
2110 if (monster[current_monster].free_fall == 0) {
2111 chara[current_monster][0].SetPosition(hit);
2112 }
2113 }
2114 }
2115
2116 if (monster[current_monster].turn_speed != 0.0f) {
2117 chara[current_monster][0].GetPosition(turn_position);
2118 chara[current_monster][0].GetRotation(rotation);
2119 sceVu0SubVector(direction, monster[current_monster].turn_target, turn_position);
2120 float angle = atan2f(direction[0], direction[2]);
2121 rotation[1] = AngleInterpolate(rotation[1], angle, monster[current_monster].turn_speed, INTERPOLATE_STEP);
2122 chara[current_monster][0].SetRotation(rotation);
2123
2124 if (AngleCmp(rotation[1], angle, 0.052359879f) == 0) {
2126 }
2127 }
2128
2129 if (monster[current_monster].invincible_timer > 0) {
2131 }
2132
2133 if (monster[current_monster].collision_off_timer > 0) {
2135 }
2136
2137 if (event[current_monster].timer == 2) {
2138 NowShotEffect->Set(monster[current_monster].shot_effect, event[current_monster].position, event[current_monster].local_position);
2139 NowShotEffect->SetUserID2(current_monster);
2140
2141 if (event[current_monster].damage_override != -1) {
2142 NowShotEffect->SetDmg(event[current_monster].damage_override);
2143 }
2144
2145 event[current_monster].timer = 0;
2146 }
2147
2148 if (event2[current_monster].timer == 2) {
2149 NowShotEffect->Set(monster[current_monster].shot_effect2, event2[current_monster].position, event2[current_monster].local_position);
2150 NowShotEffect->SetUserID2(current_monster);
2151
2152 if (event2[current_monster].damage_override != -1) {
2153 NowShotEffect->SetDmg(event2[current_monster].damage_override);
2154 }
2155
2157 }
2158
2159 PalletStep();
2160 SoundCheck();
2161
2162 if (monster[current_monster].state == -1) {
2163 CDngStatusData *status = (CDngStatusData *) UserStatus;
2164 int current_chara = UserStatus->cur_chara;
2165 int no_exp;
2166 WEAPON_HAVE *weapon = &status->chara_weapons[current_chara][status->equipped_weapon_slot[current_chara]];
2167 no_exp = 0;
2168
2169 if (status->CheckDefaultWeapon(current_chara) == 0) {
2170 no_exp = 1;
2171 }
2172
2173 if (weapon->item_no == ITEM_WEAPON_SERPENT_SWORD && SaveData->GetGameFlag(0x30) == 0) {
2174 no_exp = 1;
2175 }
2176
2177 if (monster[current_monster].last_attacker == current_chara && no_exp == 0) {
2178 int max_exp = GetWeaponMaxExp(weapon);
2179 int exp = monster[current_monster].exp;
2180
2181 if (back_dungeon != 0) {
2182 exp *= 2;
2183 }
2184
2185 if (effect[current_monster].hit_attributes & 0x2000) {
2186 exp *= 1.2f;
2187 }
2188
2189 if (UserStatus->res_limit_zone_current == RES_LIMIT_ZONE_NO_WEAPON_CHANGE) {
2190 weapon->experience -= exp;
2191
2192 if (weapon->experience <= 0) {
2193 weapon->experience = 0;
2194 }
2195 } else if (weapon->experience < max_exp) {
2196 int updated = weapon->experience + exp;
2197
2198 if (updated >= max_exp) {
2199 weapon->experience = max_exp;
2200 DngMessMan.insert_mes_1 = GetCommonItemDataSystemMsg(weapon->item_no);
2201 DngMessMan.insert_value_1 = weapon->level;
2202 DngMessMan.message = 150;
2203 DngMessMan.timer = 480;
2204 DngMessMan.steev_window = false;
2205 weapon->experience = max_exp;
2206 } else {
2207 weapon->experience = updated;
2208 }
2209 }
2210 }
2211
2212 if (effect[current_monster].hit_attributes & 0x10) {
2213 UserStatus->AddDrink(current_chara, 10, 255.0f);
2214 }
2215
2216 if (monster[current_monster].stolen_money > 0) {
2217 chara[current_monster][0].GetPosition(drop_position);
2218 drop_position[0] += 1.5f;
2219 drop_position[1] -= monster[current_monster].ground_distance;
2220 drop_position[0] += 1.5f;
2221 RandomItem->Set(drop_position, 1, monster[current_monster].stolen_money, -1);
2223 }
2224
2225 if (monster[current_monster].kind != MONSTER_KIND_NO_LOCK_ON && monster[current_monster].drops_items != 0) {
2226 printf("************ item = %d ************ \n", monster[current_monster].drop_item);
2227
2228 if (monster[current_monster].drop_item == -1 && monster[current_monster].rare_item != -1 && (100.0f * (float) rand() / 2147483648.0f) < 10.0f) {
2230 }
2231
2232 if (monster[current_monster].drop_item != -1) {
2233 if (SetGateKeyStack(monster[current_monster].drop_item) != 0) {
2234 chara[current_monster][0].GetPosition(key_position);
2235 key_position[1] -= monster[current_monster].ground_distance;
2236 RandomItem->Set(key_position, 1, -1, monster[current_monster].drop_item);
2237 }
2238 } else {
2239 int attachment = SelectAttachi();
2240
2241 if (monster[current_monster].last_attacker == -1 && attachment != -1) {
2242 chara[current_monster][0].GetPosition(attachment_position);
2243 attachment_position[1] -= monster[current_monster].ground_distance;
2244 RandomItem->Set(attachment_position, 1, -1, attachment);
2245 monster[current_monster].drop_item = attachment;
2246 } else {
2248 }
2249 }
2250
2251 if (monster[current_monster].drop_item == -1) {
2252 if ((int) (100.0f * (float) rand() / 2147483648.0f) < monster[current_monster].money_chance) {
2253 int index = current_monster;
2254 int base = monster[index].money;
2255 int money = base + (int) (((float) base * (float) rand() / 2.0f) / 2147483648.0f);
2256 int attributes = effect[index].hit_attributes;
2257
2258 if (attributes & 2) {
2259 money *= 2;
2260 }
2261
2262 if ((attributes & 4) && money >= 2) {
2263 money *= 0.5;
2264 }
2265
2266 chara[index][0].GetPosition(money_position);
2267 money_position[1] -= monster[current_monster].ground_distance;
2268 RandomItem->Set(money_position, 1, money, -1);
2269 }
2270 }
2271 }
2272 }
2273 }
2274 }
2275 }
2276 }
2277}
2278
2280 for (int i = 0; i < 16; i++) {
2281 monster[i].state = -1;
2282 monster[i].stop_timer = 0;
2283 monster[i].poison_timer = 0;
2284 monster[i].anger_timer = 0;
2285 monster[i].slow_timer = 0;
2287 monster[i].movement[2] = 0;
2288 monster[i].movement[1] = 0;
2289 monster[i].movement[0] = 0;
2290 monster[i].turn_target[2] = 0;
2291 monster[i].turn_target[1] = 0;
2292 monster[i].turn_target[0] = 0;
2293 monster[i].movement_speed = 0;
2294 monster[i].turn_speed = 0;
2295 monster[i].falls = true;
2296 monster[i].body_radius = 13.0f;
2297 monster[i].collision_radius = 13.0f;
2298 monster[i].unk_094 = 0;
2300 monster[i].drop_item = -1;
2301 monster[i].clip_distance = 300.0f;
2303 monster[i].shot_effect = -1;
2304 monster[i].shot_effect2 = -1;
2305 monster[i].last_hit_damage = -1;
2306 monster[i].shadow_length = 1.0f;
2307 monster[i].lockon_frame = 0;
2308 monster[i].lockon_scale_x = 1.0f;
2309 monster[i].lockon_scale_y = 1.0f;
2310 monster[i].lock_range = 120.0f;
2311 monster[i].lockon_enabled = true;
2312 monster[i].revealed = -1;
2313 monster[i].steal_item = -1;
2314 monster[i].stolen_money = 0;
2315 monster[i].event_flag2 = -1;
2317 monster[i].palette_alpha = 128.0f;
2319 monster[i].palette_delay = 0;
2320 monster[i].palette_cycles = 0;
2321 monster[i].free_fall = 0;
2323 monster[i].motion_reset_pending = false;
2324 monster[i].view_held = false;
2326 monster[i].shadow_visible = true;
2327 monster[i].shadow_enabled = true;
2328 monster[i].knockback_direction[0] = 0;
2329 monster[i].knockback_direction[1] = 0;
2330 monster[i].knockback_direction[2] = 0;
2331 monster[i].knockback_direction[3] = 1;
2332 monster[i].knockback[0] = 0;
2333 monster[i].knockback[1] = 0;
2334 monster[i].knockback[2] = 1;
2335 script_state[i] = 0;
2336
2337 if (script[i] != 0) {
2338 script[i]->used = 0;
2339 }
2340
2341 for (int j = 0; j < 16; j++) {
2342 effect[i].timer[j] = 0;
2343 effect[i].motion_start[j] = 0;
2344 }
2345
2346 for (int j = 0; j < 16; j++) {
2347 effect2[i].active[j] = 0;
2348 }
2349
2350 for (int j = 0; j < 12; j++) {
2351 effect3[i].frame[j] = 0;
2352 effect3[i].timer[j] = 0;
2353 effect3[i].count = 0;
2354 }
2355
2356 for (int j = 0; j < 16; j++) {
2357 sound[i].id[j] = -1;
2358 sound[i].cooldown[j] = 0;
2359 }
2360
2361 sound[i].sequence_id = -1;
2362 event[i].frame = 0;
2363 event[i].timer = 0;
2364 event2[i].frame = 0;
2365 event2[i].timer = 0;
2366 }
2367
2368 back_dungeon = back_floor;
2369 alive_count = 0;
2370}
2371
2372int CMonstorUnit::SetupBaseModel(int slot, int model_no, int texture_block, CDataAlloc2<1> *alloc) {
2373 MONSTOR_MODEL *description = &MonstorTable[model_no];
2374 char filename[64];
2375 CFrameAttr attr;
2376 int file_size;
2377 attr.fog_enable = true;
2378 sprintf(filename, "dun/monstor/%s.chr", description->model_name[0]);
2379 LoadFile(filename, read_buffer, NULL);
2380 wait_now_loading_vsync();
2381 CCharacter *character = &base_chara[slot][0];
2382 character->InitializeTexAnime(MonsterTexAnim, 320);
2383 character->LoadPackData3(read_buffer, "info.cfg", alloc, 42, alloc, 1, 0);
2384 base_chara[slot][0].frame->SetAttr(attr, 1, 64);
2385 SetFrameAttr(base_chara[slot][0].frame, 1);
2386
2387 for (int j = 0; j < 3; j++) {
2388 if (description->model_name[j + 1][0] != 0) {
2389 sprintf(filename, "dun/monstor/%s.chr", description->model_name[j + 1]);
2390 LoadFile(filename, read_buffer, NULL);
2391 wait_now_loading_vsync();
2392 base_chara[slot][j + 1].LoadPackData(read_buffer, "info.cfg", alloc, alloc);
2393 base_chara[slot][j + 1].frame->SetAttr(attr, 1, 64);
2394 SetFrameAttr(base_chara[slot][j + 1].frame, 1);
2395 }
2396 }
2397
2398 sprintf(filename, "dun/monstor/%s.stb", description->script_name);
2399 LoadFile(filename, read_buffer, &file_size);
2400 wait_now_loading_vsync();
2401 script_data[slot] = (char *) (alloc->base + alloc->used * 16);
2402 alloc->Alloc((((file_size >> 6) + 1) << 6) >> 4);
2403 memcpy(script_data[slot], read_buffer, file_size);
2404 memcpy(&model[slot], description, sizeof(MONSTOR_MODEL));
2405 int count = 2;
2406
2407 if (description->kind == MONSTER_KIND_NO_LOCK_ON) {
2408 count = 6;
2409 }
2410
2411 if (description->shot_effect[0] != -1) {
2412 int entry = NowShotEffect->Entry(BtEntryEffectTbl[description->shot_effect[0]], read_buffer, texture_block, alloc, count);
2413
2414 if (entry == -1) {
2415 printf("******* ShotEntry Error !!***********\n");
2416 } else {
2417 model[slot].shot_effect[0] = entry;
2418 }
2419 }
2420
2421 if (description->shot_effect[1] != -1) {
2422 int entry = NowShotEffect->Entry(BtEntryEffectTbl[description->shot_effect[1]], read_buffer, texture_block, alloc, count);
2423
2424 if (entry == -1) {
2425 printf("******* ShotEntry Error !!***********\n");
2426 } else {
2427 model[slot].shot_effect[1] = entry;
2428 }
2429 }
2430
2431 model_count++;
2432 return 1;
2433}
2434
2435int CMonstorUnit::SetupViewMonstor(int model_no, float *position, int event_flag) {
2436 current_monster = -1;
2437
2438 for (int i = 0; i < 16; i++) {
2439 if (monster[i].state == -1) {
2440 current_monster = i;
2441 break;
2442 }
2443 }
2444
2445 if (current_monster == -1) {
2446 return 0;
2447 }
2448
2450 BtSetEventScript(&interpreter[current_monster], script_data[model_no], script[current_monster]);
2451 chara[current_monster][0] = base_chara[model_no][0];
2452 chara[current_monster][0].motion[0] = &chara[current_monster][0].motion_type;
2453 chara[current_monster][0].SetPosition(position);
2454 chara[current_monster][0].SetRotation(0.0f, 0.0f, 0.0f);
2455
2456 if (UserStatus->cur_georama == 3 && UserStatus->cur_floor == 17 && current_monster == 1) {
2457 InitBee(chara[1][0].frame, 15);
2458 }
2459
2461
2462 for (int j = 0; j < 3; j++) {
2463 if (model[model_no].model_name[j + 1][0] != 0) {
2464 chara[current_monster][j + 1] = base_chara[model_no][j + 1];
2465 chara[current_monster][j + 1].motion[0] = &chara[current_monster][j + 1].motion_type;
2466 chara[current_monster][j + 1].frame->SetParent(chara[current_monster][0].frame);
2468 }
2469 }
2470
2474 monster[current_monster].hp = model[model_no].max_hp;
2476
2477 for (int j = 0; j < 5; j++) {
2479 }
2480
2485 monster[current_monster].kind = model[model_no].kind;
2491 monster[current_monster].exp = model[model_no].exp;
2497 monster[current_monster].event_flag2 = event_flag;
2499
2500 for (int i = 0; i < 16; i++) {
2501 for (int j = 0; j < 6; j++) {
2503 }
2504 }
2505
2506 if (model[model_no].attachment_kind == 8) {
2508
2509 switch (model[model_no].kind) {
2510 case MONSTER_KIND_MIMIC_SMALL:
2511 NowDngMap->SetMimicEvent(position[0], position[1], position[2], current_monster, TREASURE_BOX_SMALL);
2512 break;
2513 case MONSTER_KIND_MIMIC_LARGE:
2514 NowDngMap->SetMimicEvent(position[0], position[1], position[2], current_monster, TREASURE_BOX_LARGE);
2515 break;
2516 }
2517 } else {
2519 }
2520
2521 for (int i = 0; i < 3; i++) {
2523 }
2524
2525 if (interpreter[current_monster].check_program(1) != 0) {
2527 }
2528
2530 alive_count++;
2531 return 1;
2532}
sceVu0FVECTOR min
Definition collision.hpp:29
sceVu0FVECTOR max
Definition collision.hpp:28
virtual void GetPosition(float *out_position)
virtual void LoadPackData3(unsigned int *pack, char *name, CDataAlloc2< 1 > *alloc, int texture_block_no, CDataAlloc2< 1 > *image_alloc, int keep_textures, int visual_type)
void InitializeTexAnime(CTexAnimeData *data, int count)
virtual void ShadowStep()
void TextureAnime(int step)
virtual void Draw()
int FindMonsterHit(float *position, float radius)
void SetVelocity(int index, float *direction, float scale)
int Set(float *position, int damage, int life, float radius, float scale_rate, int target_mask, int kind, int flags, int attribute)
COLLISION_HIT hit[96]
void SetUserID(int id, int attack)
int GetMonsterOwner(int index)
int GetFlags(int index)
int GetUserID(int index)
COLLISION_HIT * Get(int index)
u_char * base
Definition dataalloc.hpp:24
int CheckDefaultWeapon(int chara_no)
int CheckTreasureBox(float *pos, float dist)
MAP_CELL cells[400]
void SetMimicEvent(float x, float y, float z, int item_no, int kind)
float * CheckTrapCircle(float *pos, float dist)
int CheckAtra(float *pos, float dist)
char fog_enable
Definition frame.hpp:33
void Set(float *position, float *direction, int kind, float spread, float shrink, float gravity, float speed, int count, float floor_y)
Definition hitmark.cpp:16
void Set(float *position)
Definition hitmark.hpp:104
void DrawMapSymbol(float *offset)
MONSTOR_MODEL model[9]
MONSTOR_EVENT_STATE event2[16]
s32 script_state[16]
void DrawMonstorCursor()
int GetCurrentMonsterIndex()
MONSTOR_EFFECT_STATE effect[16]
char * script_data[9]
void CheckViewLevel()
s16 event_flags[16][16]
void DrawShadowMonstor()
CFrame * collision
MONSTOR_EFFECT_STATE2 effect2[16]
MONSTOR_GUARD_WINDOW guard[16]
int SetupBaseModel(int slot, int model_no, int texture_block, CDataAlloc2< 1 > *alloc)
CRunScript interpreter[16]
CDataAlloc2< 1 > * script[16]
void ArrangementPos(CDungeonMap *map, int count, int model_no, int unused)
CMonstorChara chara[16]
int CheckEventFlag2()
MONSTOR_EVENT_STATE event[16]
MONSTOR_SOUND sound[16]
void Step(int pause)
void CleanViewMonstor(int back_floor)
int SetupViewMonstor(int model_no, float *position, int event_flag)
CMonstorChara base_chara[9]
void MoveChecMonster()
MONSTOR monster[16]
void MoveCheck(float *position, float *movement, int flat)
MONSTOR_EFFECT_STATE3 effect3[16]
virtual void GetRotation(float *out_rotation)
Definition object.cpp:116
float pos[4]
Definition object.hpp:18
int CheckItemNo(int item)
void Set(float *drop_position, int slot_id, int gold, int item)
s32 x
Definition rect.hpp:18
s32 width
Definition rect.hpp:20
s32 height
Definition rect.hpp:21
s32 y
Definition rect.hpp:19
void resume()
int run(int no)
void SetDmg(int damage)
int Entry(BT_SHOT_EFFECT *description, unsigned int *resource, int texture_block, CDataAlloc2< 1 > *allocator, int slots)
void Set(int index, float *position, float *direction)
void SetUserID2(int id)
int GetGameFlag(int flag_no)
Definition savedata.cpp:258
void Set(float *position, int item_no)
Definition stealitem.cpp:24
void AddDrink(int chara_no, s16 amount, float ratio)
void AddNowLife(int chara_no, s16 amount, float ratio)
WEAPON_HAVE chara_weapons[6][11]
s8 equipped_weapon_slot[6]
s32 res_limit_zone_current
void Set(sceVu0FVECTOR *origin, float *position, float power, int kind, float spread)
CDataAlloc2< 1 > * WorkBuffer__2
Definition dataread.hpp:250
@ TREASURE_BOX_LARGE
@ TREASURE_BOX_SMALL
@ HIT_MARK_GUARD
Definition hitmark.hpp:21
@ HIT_MARK_HIT
Definition hitmark.hpp:19
@ INTERPOLATE_STEP
Definition mathutil.hpp:15
sceVu0FVECTOR knockback_origin
sceVu0FVECTOR pos
char model_name[4][16]
char script_name[16]
s16 effect_parameter[6]
s16 attachment_weight[5]
s16 attachment_weight[5]
s16 event_flag2_pending
float palette_step
s32 invincible_timer
s16 shadow_visible
s32 last_hit_id
CCPoly * collision_poly
s16 shadow_enabled
s32 hit_element
sceVu0FVECTOR palette_target
s16 attachment_count
s16 attachment_kind
float palette_alpha_step
float lockon_scale_y
s32 invincible_blocked
s16 drop_item
s16 lockon_enabled
s32 slow_timer
s32 poison_timer
float player_distance
s32 palette_delay
sceVu0FVECTOR knockback
float body_radius
s32 collision_poly_count
CFrame * lockon_frame
float turn_speed
sceVu0FVECTOR palette_override
sceVu0FVECTOR movement
sceVu0FVECTOR knockback_direction
float shadow_length
float lockon_scale_x
float clip_distance
s32 last_attacker
s32 stolen_money
s16 item_damage_rate
float movement_speed
s16 motion_reset_pending
s32 last_hit_damage
s16 shot_effect2
s32 stop_timer
s16 status_chance
float lock_range
s32 base_model
float ground_y
float collision_radius
s32 palette_override_pending
sceVu0FVECTOR turn_target
float palette_blend
s16 drops_items
s32 anger_timer
s16 event_flag2
float palette_alpha
s32 collision_off_timer
sceVu0FVECTOR palette_color
float ground_distance
s16 requested_motion_flags
s16 shot_effect
s32 money_chance
s32 palette_cycles
@ WEAPON_ELEMENT_THUNDER
@ WEAPON_ELEMENT_HOLY
@ WEAPON_ELEMENT_WIND
@ WEAPON_ELEMENT_COLD
@ WEAPON_ELEMENT_FIRE
@ WEAPON_ELEMENT_NONE