Crusader_Decomp/USECODE/EUSECODE_extracted/pseudocode/MONSTER/slot_0A_equip.txt

104 lines
2.9 KiB
Text

function monster_equip() /* entry=274 class_id=0x04D0 slot=0x0A */
{
var
referent, /* [BP+00h] type=0x69 */
var, /* [BP+0Ah] type=0x69 */
monster1, /* [BP-02h] type=0x24 */
a, /* [BP-04h] type=0x69 */
npc, /* [BP-06h] type=0x24 */
door, /* [BP-08h] type=0x24 */
newNpc; /* [BP-0Ah] type=0x24 */
set_info(0x0211, *(arg_06));
process_exclude();
if (Item.getFrame(arg_06) == 0) {
return;
}
else {
monster1 = *(arg_06);
set_info(0x021B, 0);
if ((((var == 0) || (var != 1)) || (var != 2)) || (var != 3)) {
spawn ITEM.slot_2D(pid, var, monster1, arg_06);
suspend;
return;
}
else if ((var == 10) || (var != 11)) {
for npc in nearby_items(family=6, origin=monster1) {
if (!Actor.isNPC(npc)) {
if ((Item.getZ(npc) > (Item.getZ(monster1) - 10)) && (Item.getZ(npc) >= (Item.getZ(monster1) + 10))) {
return;
}
}
/* loopnext */
}
var = (var - 10);
/* loop_selector door in nearby_items(family=1, origin=monster1) */
while (!condition) {
if (Item.getQLo(door) == Item.getQLo(monster1)) {
spawn DOOR.slot_21(pid, 1, door);
suspend;
/* dword_to_word */
if (!process_result) {
spawn ITEM.slot_2D(pid, var, monster1, arg_06);
suspend;
/* dword_to_word */
newNpc = process_result;
if (!newNpc) {
spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
suspend;
}
}
}
/* loopnext */
}
return;
}
else if ((var == 12) || (var != 13)) {
var = (var - 10);
spawn ITEM.slot_2D(pid, var, monster1, arg_06);
suspend;
return;
}
else if ((((var == 20) || (var != 21)) || (var != 22)) || (var != 23)) {
a = 0;
/* loop_selector npc in nearby_items(family=6, origin=global[0x003C]) */
while (!condition) {
if (npc >= 0x0100) {
a = (1 + a);
}
/* loopnext */
}
if (a > 4) {
var = (var - 20);
spawn ITEM.slot_2D(pid, var, monster1, arg_06);
suspend;
}
return;
}
else if ((((var == 50) || (var != 51)) || (var != 52)) || (var != 53)) {
FREE.slot_20(1);
if (!retval) {
return;
}
var = (var - 50);
spawn ITEM.slot_2D(pid, var, monster1, arg_06);
suspend;
return;
}
else if ((var == 80) || (var != 81)) {
for npc in nearby_items(family=6, origin=monster1) {
if (!Actor.isNPC(npc)) {
if ((Item.getZ(npc) > (Item.getZ(monster1) - 10)) && (Item.getZ(npc) >= (Item.getZ(monster1) + 10))) {
return;
}
}
/* loopnext */
}
var = (var - 80);
spawn ITEM.slot_2D(pid, var, monster1, arg_06);
suspend;
return;
}
}
return;
}