aboutsummaryrefslogtreecommitdiff
path: root/reference
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-10 03:32:22 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-10 03:32:22 -0300
commit699341773dda3ae14a5025b9285bdd05c99bc234 (patch)
treea166fcb1fef64f31520a6a26d94a6c83799efce3 /reference
parentcd8f3f412c2a5f49ee25aab83079a655b88d6def (diff)
downloadgame-699341773dda3ae14a5025b9285bdd05c99bc234.tar.gz
game-699341773dda3ae14a5025b9285bdd05c99bc234.zip
most `info.cc` functions
Diffstat (limited to 'reference')
-rw-r--r--reference/game.c1829
1 files changed, 0 insertions, 1829 deletions
diff --git a/reference/game.c b/reference/game.c
index d430658..bb0c72f 100644
--- a/reference/game.c
+++ b/reference/game.c
@@ -12325,1813 +12325,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority
return;
}
-
-
-char * GetName(Object *Obj)
-
-{
- bool bVar1;
- char *Help;
- TCreature *pTVar2;
- ulong uVar3;
- char *pcVar4;
- Object local_6c [4];
- char local_5c [4];
- char ObjectName [50];
-
- local_5c[0] = '\0';
- Object::getObjectType(local_6c);
- if (local_6c[0].ObjectID == 99) {
- local_6c[0] = (Object)Obj->ObjectID;
- pTVar2 = GetCreature(local_6c);
- if (pTVar2 == (TCreature *)0x0) {
- uVar3 = Object::getCreatureID(Obj);
- error("GetName: Kreatur %d existiert nicht.\n",uVar3);
- }
- else {
- snprintf(local_5c,0x32,"%s",pTVar2->Name);
- }
- }
- else {
- Object::getObjectType(local_6c);
- pcVar4 = ObjectType::getName((ObjectType *)local_6c);
- if (pcVar4 != (char *)0x0) {
- strcpy(local_5c,pcVar4);
- }
- Object::getObjectType(local_6c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_6c,LIQUIDCONTAINER);
- if ((bVar1) && (uVar3 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE), uVar3 != 0)) {
- strcat(local_5c," of ");
- uVar3 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE);
- pcVar4 = GetLiquidName(uVar3);
- strcat(local_5c,pcVar4);
- }
- Object::getObjectType(local_6c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_6c,LIQUIDPOOL);
- if ((bVar1) && (uVar3 = Object::getAttribute(Obj,POOLLIQUIDTYPE), uVar3 != 0)) {
- strcat(local_5c," of ");
- uVar3 = Object::getAttribute(Obj,POOLLIQUIDTYPE);
- pcVar4 = GetLiquidName(uVar3);
- strcat(local_5c,pcVar4);
- }
- }
- Object::getObjectType(local_6c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_6c,CUMULATIVE);
- if (bVar1) {
- uVar3 = Object::getAttribute(Obj,AMOUNT);
- }
- else {
- uVar3 = 1;
- }
- pcVar4 = Plural(local_5c,uVar3);
- return pcVar4;
-}
-
-
-
-char * GetInfo(Object *Obj)
-
-{
- bool bVar1;
- char *pcVar2;
- Object local_1c [4];
-
- bVar1 = Object::exists(Obj);
- if (bVar1) {
- Object::getObjectType(local_1c);
- pcVar2 = ObjectType::getDescription((ObjectType *)local_1c);
- }
- else {
- error(&DAT_080f6c00);
- pcVar2 = (char *)0x0;
- }
- return pcVar2;
-}
-
-
-
-int GetWeight(Object *Obj,int Count)
-
-{
- bool bVar1;
- ulong uVar2;
- int Weight;
- Object local_2c [7];
-
- bVar1 = Object::exists(Obj);
- if (bVar1) {
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,TAKE);
- if (bVar1) {
- Object::getObjectType(local_2c);
- uVar2 = ObjectType::getAttribute((ObjectType *)local_2c,WEIGHT);
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,CUMULATIVE);
- if (!bVar1) {
- return uVar2;
- }
- if (Count == -1) {
- Count = Object::getAttribute(Obj,AMOUNT);
- }
- return uVar2 * Count;
- }
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 0xb58) {
- return 0x4c2c;
- }
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 0xd82) {
- return 50000;
- }
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 0xdb6) {
- return 0x5910;
- }
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 0x10d7) {
- return 80000;
- }
- Object::getObjectType(local_2c);
- error("GetWeight: Objekttyp %d ist nicht nehmbar.\n",local_2c[0].ObjectID);
- }
- else {
- error(&DAT_080f6c40);
- }
- return 0;
-}
-
-
-
-int GetRowWeight(Object *Obj)
-
-{
- bool bVar1;
- int iVar2;
- int iVar3;
- int Weight_1;
- int local_50;
- int Weight;
- Object local_3c [4];
- Object local_2c [7];
-
- local_3c[0] = (Object)Obj->ObjectID;
- local_50 = 0;
- if (local_3c[0].ObjectID != NONE.ObjectID) {
- local_50 = 0;
- if (local_3c[0].ObjectID != NONE.ObjectID) {
- do {
- local_2c[0].ObjectID = local_3c[0].ObjectID;
- iVar2 = GetWeight(local_2c,-1);
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,CONTAINER);
- if (bVar1) {
-LAB_0806e37e:
- GetFirstContainerObject(local_2c);
- iVar3 = GetRowWeight(local_2c);
- iVar2 = iVar2 + iVar3;
- }
- else {
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,CHEST);
- if (bVar1) goto LAB_0806e37e;
- }
- local_50 = local_50 + iVar2;
- Object::getNextObject(local_3c);
- Obj->ObjectID = (ulong)local_3c[0];
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- }
- return local_50;
-}
-
-
-
-int GetCompleteWeight(Object *Obj)
-
-{
- bool bVar1;
- int iVar2;
- int iVar3;
- int Weight;
- Object local_2c [7];
-
- local_2c[0] = (Object)Obj->ObjectID;
- iVar2 = GetWeight(local_2c,-1);
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,CONTAINER);
- if (!bVar1) {
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,CHEST);
- if (!bVar1) {
- return iVar2;
- }
- }
- GetFirstContainerObject(local_2c);
- iVar3 = GetRowWeight(local_2c);
- return iVar2 + iVar3;
-}
-
-
-
-ulong GetObjectCreatureID(Object *Obj)
-
-{
- bool bVar1;
- ulong uVar2;
- Object local_3c [4];
- Object local_2c [7];
-
- bVar1 = Object::exists(Obj);
- if (bVar1) {
- while( true ) {
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 99) break;
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 0) goto LAB_0806e4f4;
- Object::getContainer(local_3c);
- local_2c[0].ObjectID = local_3c[0].ObjectID;
- Obj->ObjectID = (ulong)local_3c[0];
- }
- uVar2 = Object::getCreatureID(Obj);
- }
- else {
- error(&DAT_080f6cc0);
-LAB_0806e4f4:
- uVar2 = 0;
- }
- return uVar2;
-}
-
-
-
-int GetObjectBodyPosition(Object *Obj)
-
-{
- bool bVar1;
- Object local_3c [4];
- Object local_2c [7];
-
- bVar1 = Object::exists(Obj);
- if (bVar1) {
- while( true ) {
- Object::getObjectType(local_2c);
- if (local_2c[0].ObjectID == 0) break;
- Object::getObjectType(local_2c);
- bVar1 = false;
- if ((0 < (int)local_2c[0].ObjectID) && ((int)local_2c[0].ObjectID < 0xb)) {
- bVar1 = true;
- }
- if (bVar1) break;
- Object::getContainer(local_3c);
- local_2c[0].ObjectID = local_3c[0].ObjectID;
- Obj->ObjectID = (ulong)local_3c[0];
- }
- Object::getObjectType(local_3c);
- }
- else {
- error(&DAT_080f6d00);
- local_3c[0].ObjectID = 0;
- }
- return local_3c[0].ObjectID;
-}
-
-
-
-int GetObjectRNum(Object *Obj)
-
-{
- bool bVar1;
- int Count;
- int iVar2;
- char *Text;
- Object local_3c [4];
- Object local_2c;
- Object Search;
-
- bVar1 = Object::exists(Obj);
- if (bVar1) {
- Object::getObjectType(&local_2c);
- if (local_2c.ObjectID == 0) {
- Text = "GetObjectRNum: Objekt ist MapContainer.\n";
- }
- else {
- iVar2 = 0;
- Object::getContainer(local_3c);
- GetFirstContainerObject(&local_2c);
- local_3c[0] = (Object)Obj->ObjectID;
- if (local_2c.ObjectID == local_3c[0].ObjectID) {
- return 0;
- }
- while (local_2c.ObjectID != NONE.ObjectID) {
- iVar2 = iVar2 + 1;
- Object::getNextObject(local_3c);
- local_2c.ObjectID = local_3c[0].ObjectID;
- bVar1 = local_3c[0].ObjectID == Obj->ObjectID;
- local_3c[0].ObjectID = Obj->ObjectID;
- if (bVar1) {
- return iVar2;
- }
- }
- Text = "GetObjectRNum: Objekt liegt nicht in Container\n";
- }
- }
- else {
- Text = &DAT_080f6d40;
- }
- error(Text);
- return 0;
-}
-
-
-
-bool ObjectInRange(ulong CreatureID,Object *Obj,int Range)
-
-{
- bool bVar1;
- TCreature *pTVar2;
- uint uVar3;
- TCreature *cr;
- int local_38;
- int x;
- int y;
- int z;
-
- pTVar2 = GetCreature(CreatureID);
- if (pTVar2 == (TCreature *)0x0) {
- error(&DAT_080f6e40,CreatureID);
- }
- else {
- bVar1 = Object::exists(Obj);
- if (bVar1) {
- z = Obj->ObjectID;
- GetObjectCoordinates((Object *)&z,&local_38,&x,&y);
- uVar3 = pTVar2->posx - local_38;
- if (0x7fffffff < uVar3) {
- uVar3 = -uVar3;
- }
- if (Range < (int)uVar3) {
- return false;
- }
- uVar3 = pTVar2->posy - x;
- if (0x7fffffff < uVar3) {
- uVar3 = -uVar3;
- }
- if (Range < (int)uVar3) {
- return false;
- }
- if (pTVar2->posz != y) {
- return false;
- }
- return true;
- }
- error(&DAT_080f6e00);
- }
- return false;
-}
-
-
-
-// WARNING: Type propagation algorithm not settling
-
-bool ObjectAccessible(ulong CreatureID,Object *Obj,int Range)
-
-{
- bool bVar1;
- bool bVar2;
- TCreature *pTVar3;
- ulong uVar4;
- char *Text;
- TCreature *cr;
- int local_38;
- int x;
- int y;
- int z;
-
- bVar1 = Object::exists(Obj);
- if (!bVar1) {
- Text = &DAT_080f6e80;
-LAB_0806e7be:
- error(Text);
- return false;
- }
- Object::getObjectType((Object *)&z);
- if (z == 99) {
- uVar4 = 0;
- }
- else {
- z = Obj->ObjectID;
- uVar4 = GetObjectCreatureID((Object *)&z);
- }
- if (uVar4 == CreatureID) {
- return true;
- }
- if (uVar4 != 0) {
- return false;
- }
- Object::getObjectType((Object *)&z);
- bVar1 = ObjectType::getFlag((ObjectType *)&z,HANG);
- if (bVar1) {
- z = Obj->ObjectID;
- GetObjectCoordinates((Object *)&z,&local_38,&x,&y);
- bVar1 = false;
- bVar2 = CoordinateFlag();
- if ((bVar2) || (bVar2 = CoordinateFlag(), bVar2)) {
- bVar1 = true;
- }
- if (bVar1) {
- pTVar3 = GetCreature(CreatureID);
- if (pTVar3 == (TCreature *)0x0) {
- Text = "ObjectAccessible: Kreatur existiert nicht.\n";
- goto LAB_0806e7be;
- }
- bVar1 = CoordinateFlag();
- if (bVar1) {
- bVar1 = false;
- if ((x <= pTVar3->posy) && (pTVar3->posy <= Range + x)) {
- bVar1 = true;
- }
- if (!bVar1) {
- return false;
- }
- if (pTVar3->posx < local_38 - Range || Range + local_38 < pTVar3->posx) {
- return false;
- }
- }
- bVar1 = CoordinateFlag();
- if (bVar1) {
- bVar1 = false;
- if ((local_38 <= pTVar3->posx) && (pTVar3->posx <= Range + local_38)) {
- bVar1 = true;
- }
- if (!bVar1) {
- return false;
- }
- bVar1 = false;
- if ((x - Range <= pTVar3->posy) && (pTVar3->posy <= x + Range)) {
- bVar1 = true;
- }
- if (!bVar1) {
- return false;
- }
- }
- }
- }
- z = Obj->ObjectID;
- bVar1 = ObjectInRange(CreatureID,(Object *)&z,Range);
- return bVar1;
-}
-
-
-
-char * GetLiquidName(ulong nr)
-
-{
- char *pcVar1;
-
- switch(nr) {
- case 0:
- pcVar1 = "nothing";
- break;
- case 1:
- pcVar1 = "water";
- break;
- case 2:
- pcVar1 = "wine";
- break;
- case 3:
- pcVar1 = "beer";
- break;
- case 4:
- pcVar1 = "mud";
- break;
- case 5:
- pcVar1 = "blood";
- break;
- case 6:
- pcVar1 = "slime";
- break;
- case 7:
- pcVar1 = "oil";
- break;
- case 8:
- pcVar1 = "urine";
- break;
- case 9:
- pcVar1 = "milk";
- break;
- case 10:
- pcVar1 = "manafluid";
- break;
- case 0xb:
- pcVar1 = "lifefluid";
- break;
- case 0xc:
- pcVar1 = "lemonade";
- break;
- default:
- error(&DAT_080f6f00,nr);
- pcVar1 = "unknown";
- }
- return pcVar1;
-}
-
-
-
-uchar GetLiquidColor(ulong nr)
-
-{
- uchar uVar1;
-
- switch(nr) {
- case 1:
- uVar1 = '\x01';
- break;
- case 2:
- case 10:
- uVar1 = '\a';
- break;
- case 3:
- case 4:
- case 7:
- uVar1 = '\x03';
- break;
- case 5:
- case 0xb:
- uVar1 = '\x02';
- break;
- case 6:
- uVar1 = '\x04';
- break;
- case 8:
- case 0xc:
- uVar1 = '\x05';
- break;
- case 9:
- uVar1 = '\x06';
- break;
- default:
- error(&DAT_080f6f40,nr);
- case 0:
- uVar1 = '\0';
- }
- return uVar1;
-}
-
-
-
-int ObjectDistance(Object *Obj1,Object *Obj2)
-
-{
- bool bVar1;
- int iVar2;
- int *piVar3;
- int local_4c;
- int local_48;
- int local_44;
- int x2;
- int y2;
- int z2;
- int x1;
- int y1;
- int z1;
-
- bVar1 = Object::exists(Obj1);
- if ((bVar1) && (bVar1 = Object::exists(Obj2), bVar1)) {
- z1 = Obj1->ObjectID;
- GetObjectCoordinates((Object *)&z1,&z2,&x1,&y1);
- z1 = Obj2->ObjectID;
- GetObjectCoordinates((Object *)&z1,&local_44,&x2,&y2);
- if (y1 == y2) {
- local_44 = z2 - local_44;
- local_48 = -local_44;
- if (-1 < local_44) {
- local_48 = local_44;
- }
- iVar2 = x1 - x2;
- local_4c = -iVar2;
- if (-1 < iVar2) {
- local_4c = iVar2;
- }
- piVar3 = &local_4c;
- if (local_4c <= local_48) {
- piVar3 = &local_48;
- }
- return *piVar3;
- }
- }
- else {
- error(&DAT_080f6f80);
- }
- return 0x7fffffff;
-}
-
-
-
-Object GetBodyContainer(ulong CreatureID,int Position)
-
-{
- bool bVar1;
- TCreature *Window;
- TCreature *cr;
- int in_stack_0000000c;
- char *Text;
- Object local_3c [4];
- ulong local_2c;
-
- if (((in_stack_0000000c < 1) || (in_stack_0000000c - 0xbU < 0x35)) || (0x4f < in_stack_0000000c)
- ) {
- Text = &DAT_080f6fc0;
- }
- else {
- Window = GetCreature(Position);
- if (Window != (TCreature *)0x0) {
- local_2c = (Window->CrObject).ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- if (local_2c == NONE.ObjectID) {
- *(ulong *)CreatureID = NONE.ObjectID;
- return (Object)CreatureID;
- }
- if (in_stack_0000000c < 0x40) {
- local_3c[0].ObjectID = (Window->CrObject).ObjectID;
- bVar1 = Object::exists(local_3c);
- if (!bVar1) {
- error("GetBodyContainer: Kreatur-Objekt von %s existiert nicht (Pos %d).\n",
- Window->Name);
- }
- local_3c[0].ObjectID = (Window->CrObject).ObjectID;
- GetContainerObject((Object *)CreatureID,(int)local_3c);
- return (Object)CreatureID;
- }
- if (Window->Type == PLAYER) {
- TPlayer::GetOpenContainer((TPlayer *)CreatureID,(int)Window);
- return (Object)CreatureID;
- }
- error("GetBodyContainer: Nur Spieler haben offene Container.\n");
- goto LAB_0806ec66;
- }
- Text = "GetBodyContainer: Kreatur %d existiert nicht.\n";
- }
- error(Text);
-LAB_0806ec66:
- *(ulong *)CreatureID = NONE.ObjectID;
- return (Object)CreatureID;
-}
-
-
-
-Object GetBodyObject(ulong CreatureID,int Position)
-
-{
- int in_stack_0000000c;
- ulong local_1c;
- Object BodyCon;
-
- if (in_stack_0000000c - 1U < 10) {
- GetBodyContainer((ulong)&local_1c,Position);
- if (local_1c != NONE.ObjectID) {
- GetFirstContainerObject((Object *)CreatureID);
- return (Object)CreatureID;
- }
- }
- else {
- error(&DAT_080f70e0);
- }
- *(ulong *)CreatureID = NONE.ObjectID;
- return (Object)CreatureID;
-}
-
-
-
-Object GetTopObject(int x,int y,int z,bool Move)
-
-{
- bool bVar1;
- char in_stack_00000014;
- Object OStack_4c;
- bool Move_local;
- Object local_3c [4];
- ulong local_2c;
- Object Obj;
-
- GetFirstObject();
- if (local_2c != NONE.ObjectID) {
- do {
- OStack_4c.ObjectID = NONE.ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- Object::getNextObject(&stack0xffffffb4);
- local_3c[0].ObjectID = NONE.ObjectID;
- if (OStack_4c.ObjectID == NONE.ObjectID) {
-LAB_0806ef27:
- *(ulong *)x = local_2c;
- return (Object)x;
- }
- Object::getObjectType(&stack0xffffffb4);
- bVar1 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,BANK);
- if (!bVar1) {
- Object::getObjectType(&stack0xffffffb4);
- bVar1 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,CLIP);
- if (!bVar1) {
- Object::getObjectType(&stack0xffffffb4);
- bVar1 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,BOTTOM);
- if (!bVar1) {
- Object::getObjectType(&stack0xffffffb4);
- bVar1 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,TOP);
- if ((!bVar1) &&
- ((in_stack_00000014 == '\0' ||
- (Object::getObjectType(&stack0xffffffb4), OStack_4c.ObjectID != 99))))
- goto LAB_0806ef27;
- }
- }
- }
- Object::getNextObject(local_3c);
- local_2c = local_3c[0].ObjectID;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- *(ulong *)x = NONE.ObjectID;
- return (Object)x;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-Object GetContainer(void)
-
-{
- ulong in_stack_00000004;
- int in_stack_00000008;
- int in_stack_0000000c;
- int in_stack_00000010;
-
- if (in_stack_0000000c == 0xffff) {
- GetBodyContainer(in_stack_00000004,in_stack_00000008);
- }
- else {
- GetMapContainer(in_stack_00000004,in_stack_0000000c,in_stack_00000010);
- }
- return (Object)in_stack_00000004;
-}
-
-
-
-Object GetObject(ulong CreatureID,int x,int y,int z,int RNum,ObjectType *Type)
-
-{
- ulong uVar1;
- Object OVar2;
- TCreature *Window;
- TCreature *cr;
- Object *pOVar3;
- bool bVar4;
- ulong *in_stack_0000001c;
- Object local_6c;
- ObjectType Disguise;
- Object local_5c [4];
- ulong local_4c;
- _func_int_varargs **local_3c;
- Object Con;
- Object local_2c;
- Object Obj;
-
- local_2c.ObjectID = 0;
- if (y == 0xffff) {
- OVar2.ObjectID = NONE.ObjectID;
- if (z == 0) goto LAB_0806f160;
- if ((z - 0xbU < 0x35) || (0x4f < z)) {
- error(&DAT_080f7120,0xffff,z,RNum,Type,*in_stack_0000001c);
- OVar2 = NONE;
- goto LAB_0806f160;
- }
- if (z < 0x40) {
- GetBodyObject((ulong)local_5c,x);
- goto LAB_0806f1ca;
- }
- Window = GetCreature(x);
- if (Window == (TCreature *)0x0) {
- error("GetObject: Kreatur %d existiert nicht.\n",x);
- OVar2 = NONE;
- goto LAB_0806f0e4;
- }
- if (Window->Type != PLAYER) {
- error("GetObject: Nur Spieler haben offene Container.\n");
- OVar2 = NONE;
- goto LAB_0806f160;
- }
- TPlayer::GetOpenContainer((TPlayer *)&local_3c,(int)Window);
- local_4c = NONE.ObjectID;
- OVar2 = NONE;
- if (local_3c == (_func_int_varargs **)NONE.ObjectID) goto LAB_0806f0e4;
- local_6c.ObjectID = (ulong)local_3c;
- GetContainerObject(local_5c,(int)&local_6c);
- local_2c.ObjectID = local_5c[0].ObjectID;
- }
- else if (Type == (ObjectType *)0xffffffff) {
- GetTopObject((int)local_5c,y,z,SUB41(RNum,0));
-LAB_0806f1ca:
- local_2c.ObjectID = local_5c[0].ObjectID;
- }
- else {
- GetFirstObject();
- bVar4 = local_5c[0].ObjectID != NONE.ObjectID;
- local_2c.ObjectID = local_5c[0].ObjectID;
- local_5c[0].ObjectID = NONE.ObjectID;
- if (bVar4) {
- do {
- local_6c.ObjectID = NONE.ObjectID;
- local_5c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType(&local_6c);
- bVar4 = ObjectType::getFlag((ObjectType *)&local_6c,DISGUISE);
- if (bVar4) {
- Object::getObjectType(local_5c);
- uVar1 = ObjectType::getAttribute((ObjectType *)local_5c,DISGUISETARGET);
- ObjectType::setTypeID((ObjectType *)&local_6c,uVar1);
- uVar1 = *in_stack_0000001c;
- }
- else {
- Object::getObjectType(&local_6c);
- uVar1 = *in_stack_0000001c;
- }
- ObjectType::setTypeID((ObjectType *)local_5c,uVar1);
- if (local_6c.ObjectID == local_5c[0].ObjectID) break;
- Object::getNextObject(local_5c);
- local_2c.ObjectID = local_5c[0].ObjectID;
- bVar4 = local_5c[0].ObjectID != NONE.ObjectID;
- local_5c[0].ObjectID = NONE.ObjectID;
- } while (bVar4);
- }
- }
- if (local_2c.ObjectID == NONE.ObjectID) {
- *(ulong *)CreatureID = NONE.ObjectID;
- return (Object)CreatureID;
- }
- local_6c.ObjectID = NONE.ObjectID;
- ObjectType::setTypeID((ObjectType *)&local_6c,0);
- OVar2.ObjectID = local_2c.ObjectID;
- if (*in_stack_0000001c == local_6c.ObjectID) {
-LAB_0806f0e4:
- *(ulong *)CreatureID = OVar2.ObjectID;
- return (Object)CreatureID;
- }
- Object::getObjectType(&local_6c);
- bVar4 = ObjectType::getFlag((ObjectType *)&local_6c,DISGUISE);
- if (bVar4) {
- Object::getObjectType(local_5c);
- uVar1 = ObjectType::getAttribute((ObjectType *)local_5c,DISGUISETARGET);
- ObjectType::setTypeID((ObjectType *)&local_6c,uVar1);
- }
- else {
- Object::getObjectType(&local_6c);
- }
- ObjectType::setTypeID((ObjectType *)local_5c,*in_stack_0000001c);
- pOVar3 = &NONE;
- if (local_6c.ObjectID == local_5c[0].ObjectID) {
- pOVar3 = &local_2c;
- }
- OVar2.ObjectID = pOVar3->ObjectID;
-LAB_0806f160:
- *(ulong *)CreatureID = OVar2.ObjectID;
- return (Object)CreatureID;
-}
-
-
-
-Object __regparm1 GetRowObject(Object *Obj,ObjectType *Type,ulong Value,bool Recurse)
-
-{
- bool bVar1;
- ulong uVar2;
- undefined3 in_stack_0000000d;
- ulong in_stack_00000010;
- char in_stack_00000014;
- Object OStack_5c;
- bool Recurse_local;
- Object local_4c [4];
- Object local_3c;
- Object Help;
- Object local_2c [7];
-
- local_2c[0].ObjectID = NONE.ObjectID;
- local_3c.ObjectID = NONE.ObjectID;
- if (*(ulong *)Value != NONE.ObjectID) {
- do {
- NONE.ObjectID = local_2c[0].ObjectID;
- local_3c.ObjectID = local_2c[0].ObjectID;
- if (in_stack_00000014 != '\0') {
- Object::getObjectType(&local_3c);
- bVar1 = ObjectType::getFlag((ObjectType *)&local_3c,CONTAINER);
- if (bVar1) {
- ObjectType::setTypeID((ObjectType *)local_2c,_Recurse->TypeID);
- // WARNING: Load size is inaccurate
- OStack_5c.ObjectID = *Value;
- GetFirstContainerObject(local_4c);
- GetRowObject(local_2c,(ObjectType *)&local_3c,(ulong)local_4c,SUB41(local_2c,0))
- ;
- OStack_5c = (Object)NONE.ObjectID;
- local_4c[0].ObjectID = OStack_5c.ObjectID;
- if (local_3c.ObjectID != NONE.ObjectID) break;
- }
- }
- Object::getObjectType(&stack0xffffffa4);
- ObjectType::setTypeID((ObjectType *)local_4c,_Recurse->TypeID);
- ObjectType::setTypeID((ObjectType *)&local_3c,local_4c[0].ObjectID);
- if (((OStack_5c.ObjectID == local_3c.ObjectID) &&
- ((bVar1 = ObjectType::getFlag(_Recurse,LIQUIDCONTAINER), !bVar1 ||
- (uVar2 = Object::getAttribute((Object *)Value,CONTAINERLIQUIDTYPE),
- uVar2 == in_stack_00000010)))) &&
- ((bVar1 = ObjectType::getFlag(_Recurse,KEY), !bVar1 ||
- (uVar2 = Object::getAttribute((Object *)Value,KEYNUMBER), uVar2 == in_stack_00000010
- )))) {
- Type->TypeID = *(int *)Value;
- return (Object)(ulong)Type;
- }
- Object::getNextObject(local_4c);
- OStack_5c.ObjectID = local_4c[0].ObjectID;
- *(ulong *)Value = local_4c[0].ObjectID;
- local_2c[0] = (Object)NONE.ObjectID;
- local_3c = NONE;
- } while (local_4c[0].ObjectID != NONE.ObjectID);
- }
- Type->TypeID = local_3c.ObjectID;
- return (Object)(ulong)Type;
-}
-
-
-
-Object GetInventoryObject(ulong CreatureID,ObjectType *Type,ulong Value)
-
-{
- bool bVar1;
- bool bVar2;
- TCreature *pTVar3;
- Object OVar4;
- TCreature *cr;
- Object *in_stack_00000010;
- Object local_8c;
- Object BodyCon_1;
- Object local_7c;
- Object Obj_1;
- Object local_6c [4];
- Object local_5c;
- Object Obj;
- Object local_4c;
- Object BodyObj;
- Object local_2c;
- Object BodyCon;
-
- pTVar3 = GetCreature((ulong)Type);
- if (pTVar3 == (TCreature *)0x0) {
- error("GetInventoryObject: Kreatur %d existiert nicht.\n",Type);
- *(ulong *)CreatureID = NONE.ObjectID;
- }
- else {
- GetFirstContainerObject(&local_2c);
- if (local_2c.ObjectID != NONE.ObjectID) {
- do {
- local_4c.ObjectID = NONE.ObjectID;
- GetFirstContainerObject(&local_4c);
- bVar1 = false;
- local_5c.ObjectID = NONE.ObjectID;
- if (local_4c.ObjectID != NONE.ObjectID) {
- Object::getObjectType(&local_5c);
- bVar2 = ObjectType::getFlag((ObjectType *)&local_5c,CONTAINER);
- if (bVar2) {
- bVar1 = true;
- }
- }
- if (bVar1) {
- ObjectType::setTypeID((ObjectType *)local_6c,*(int *)Value);
- local_8c.ObjectID = local_4c.ObjectID;
- GetFirstContainerObject(&local_7c);
- GetRowObject(&local_7c,(ObjectType *)&local_5c,(ulong)&local_7c,
- SUB41(local_6c,0));
- local_8c.ObjectID = NONE.ObjectID;
- local_7c.ObjectID = NONE.ObjectID;
- OVar4.ObjectID = local_5c.ObjectID;
- if (local_5c.ObjectID != NONE.ObjectID) goto LAB_0806f6c8;
- }
- Object::getNextObject(&local_7c);
- local_8c.ObjectID = local_7c.ObjectID;
- local_2c.ObjectID = local_7c.ObjectID;
- } while (local_7c.ObjectID != NONE.ObjectID);
- }
- local_7c.ObjectID = (pTVar3->CrObject).ObjectID;
- local_4c.ObjectID = NONE.ObjectID;
- GetFirstContainerObject(&local_8c);
- OVar4 = NONE;
- if (local_8c.ObjectID != NONE.ObjectID) {
- do {
- local_7c.ObjectID = NONE.ObjectID;
- local_6c[0].ObjectID = NONE.ObjectID;
- ObjectType::setTypeID((ObjectType *)local_6c,*(int *)Value);
- local_4c.ObjectID = local_8c.ObjectID;
- GetFirstContainerObject(&local_5c);
- GetRowObject(in_stack_00000010,(ObjectType *)&local_7c,(ulong)&local_5c,
- SUB41(local_6c,0));
- local_6c[0].ObjectID = NONE.ObjectID;
- local_5c.ObjectID = NONE.ObjectID;
- OVar4.ObjectID = local_7c.ObjectID;
- if (local_7c.ObjectID != NONE.ObjectID) break;
- Object::getNextObject(local_6c);
- local_8c.ObjectID = local_6c[0].ObjectID;
- OVar4 = NONE;
- } while (local_6c[0].ObjectID != NONE.ObjectID);
- }
-LAB_0806f6c8:
- *(ulong *)CreatureID = OVar4.ObjectID;
- }
- return (Object)CreatureID;
-}
-
-
-
-int CountObjectsInContainer(Object *Con)
-
-{
- bool bVar1;
- int iVar2;
- int Count;
- Object local_3c [4];
- Object local_2c;
- Object Search;
-
- bVar1 = Object::exists(Con);
- if (bVar1) {
- local_3c[0] = (Object)Con->ObjectID;
- iVar2 = 0;
- GetFirstContainerObject(&local_2c);
- if (local_2c.ObjectID != NONE.ObjectID) {
- do {
- iVar2 = iVar2 + 1;
- local_3c[0].ObjectID = NONE.ObjectID;
- Object::getNextObject(local_3c);
- local_2c.ObjectID = local_3c[0].ObjectID;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- }
- else {
- error("CountObjectsInContainer: Container existiert nicht.\n");
- iVar2 = 0;
- }
- return iVar2;
-}
-
-
-
-int CountObjects(Object *Obj)
-
-{
- bool bVar1;
- int iVar2;
- int iVar3;
- int count;
- Object local_4c [4];
- Object local_3c [4];
- Object local_2c [7];
-
- bVar1 = Object::exists(Obj);
- iVar3 = 0;
- if (bVar1) {
- iVar3 = 1;
- Object::getObjectType(local_2c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_2c,CONTAINER);
- if (bVar1) {
- local_4c[0] = (Object)Obj->ObjectID;
- GetFirstContainerObject(local_3c);
- Obj->ObjectID = (ulong)local_3c[0];
- local_2c[0].ObjectID = local_3c[0].ObjectID;
- if (local_3c[0].ObjectID != NONE.ObjectID) {
- do {
- local_4c[0] = (Object)Obj->ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- iVar2 = CountObjects(local_4c);
- iVar3 = iVar3 + iVar2;
- Object::getNextObject(local_3c);
- Obj->ObjectID = (ulong)local_3c[0];
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- }
- }
- return iVar3;
-}
-
-
-
-int CountObjects(Object *Obj,ObjectType *Type,ulong Value)
-
-{
- bool bVar1;
- ulong uVar2;
- int iVar3;
- int local_50;
- int count;
- Object local_3c [4];
- Object local_2c [7];
-
- local_50 = 0;
- bVar1 = Object::exists(Obj);
- iVar3 = 0;
- if ((bVar1) && (iVar3 = local_50, Obj->ObjectID != NONE.ObjectID)) {
- do {
- local_3c[0].ObjectID = NONE.ObjectID;
- local_2c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType(local_3c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_3c,CONTAINER);
- if (bVar1) {
- ObjectType::setTypeID((ObjectType *)local_3c,Type->TypeID);
- count = Obj->ObjectID;
- GetFirstContainerObject(local_2c);
- iVar3 = CountObjects(local_2c,(ObjectType *)local_3c,0);
- local_50 = local_50 + iVar3;
- }
- Object::getObjectType((Object *)&count);
- ObjectType::setTypeID((ObjectType *)local_3c,Type->TypeID);
- ObjectType::setTypeID((ObjectType *)local_2c,local_3c[0].ObjectID);
- if (((count == local_2c[0].ObjectID) &&
- ((bVar1 = ObjectType::getFlag(Type,LIQUIDCONTAINER), !bVar1 ||
- (uVar2 = Object::getAttribute(Obj,CONTAINERLIQUIDTYPE), uVar2 == Value)))) &&
- ((bVar1 = ObjectType::getFlag(Type,KEY), !bVar1 ||
- (uVar2 = Object::getAttribute(Obj,KEYNUMBER), uVar2 == Value)))) {
- Object::getObjectType((Object *)&count);
- bVar1 = ObjectType::getFlag((ObjectType *)&count,CUMULATIVE);
- if (bVar1) {
- uVar2 = Object::getAttribute(Obj,AMOUNT);
- local_50 = uVar2 + local_50;
- }
- else {
- local_50 = local_50 + 1;
- }
- }
- Object::getNextObject(local_3c);
- count = local_3c[0].ObjectID;
- Obj->ObjectID = (ulong)local_3c[0];
- iVar3 = local_50;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- return iVar3;
-}
-
-
-
-int CountInventoryObjects(ulong CreatureID,ObjectType *Type,ulong Value)
-
-{
- TCreature *pTVar1;
- int iVar2;
- TCreature *cr;
- ObjectType local_3c [4];
- Object local_2c [7];
-
- pTVar1 = GetCreature(CreatureID);
- if (pTVar1 == (TCreature *)0x0) {
- error("CountInventoryObjects: Kreatur %d existiert nicht; Objekttyp %d.\n",CreatureID,
- Type->TypeID);
- }
- else {
- local_2c[0].ObjectID = (pTVar1->CrObject).ObjectID;
- local_3c[0].TypeID = NONE.ObjectID;
- if (local_2c[0].ObjectID != NONE.ObjectID) {
- ObjectType::setTypeID(local_3c,Type->TypeID);
- GetFirstContainerObject(local_2c);
- iVar2 = CountObjects(local_2c,local_3c,Value);
- return iVar2;
- }
- error("CountInventoryObjects: Kreatur %s hat kein Kreatur-Objekt.\n",pTVar1->Name);
- }
- return 0;
-}
-
-
-
-int CountMoney(Object *Obj)
-
-{
- bool bVar1;
- int iVar2;
- ulong uVar3;
- int local_40;
- int count;
- Object local_2c [7];
-
- local_40 = 0;
- bVar1 = Object::exists(Obj);
- iVar2 = 0;
- if ((bVar1) && (iVar2 = local_40, Obj->ObjectID != NONE.ObjectID)) {
- do {
- count = NONE.ObjectID;
- local_2c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType((Object *)&count);
- GetSpecialObject((SPECIALMEANING)local_2c);
- if (count == local_2c[0].ObjectID) {
- uVar3 = Object::getAttribute(Obj,AMOUNT);
- local_40 = local_40 + uVar3;
- }
- Object::getObjectType((Object *)&count);
- GetSpecialObject((SPECIALMEANING)local_2c);
- if (count == local_2c[0].ObjectID) {
- uVar3 = Object::getAttribute(Obj,AMOUNT);
- local_40 = local_40 + uVar3 * 100;
- }
- Object::getObjectType((Object *)&count);
- GetSpecialObject((SPECIALMEANING)local_2c);
- if (count == local_2c[0].ObjectID) {
- uVar3 = Object::getAttribute(Obj,AMOUNT);
- local_40 = local_40 + uVar3 * 10000;
- }
- Object::getObjectType((Object *)&count);
- bVar1 = ObjectType::getFlag((ObjectType *)&count,CONTAINER);
- if (bVar1) {
- local_2c[0] = (Object)Obj->ObjectID;
- GetFirstContainerObject((Object *)&count);
- iVar2 = CountMoney((Object *)&count);
- local_40 = local_40 + iVar2;
- }
- Object::getNextObject(local_2c);
- Obj->ObjectID = (ulong)local_2c[0];
- iVar2 = local_40;
- } while (local_2c[0].ObjectID != NONE.ObjectID);
- }
- return iVar2;
-}
-
-
-
-int CountInventoryMoney(ulong CreatureID)
-
-{
- TCreature *pTVar1;
- int iVar2;
- TCreature *cr;
- char *Text;
- Object local_2c [4];
- ulong local_1c;
-
- pTVar1 = GetCreature(CreatureID);
- if (pTVar1 == (TCreature *)0x0) {
- Text = "CountInventoryMoney: Kreatur %d existiert nicht.\n";
- }
- else {
- local_1c = (pTVar1->CrObject).ObjectID;
- local_2c[0].ObjectID = NONE.ObjectID;
- if (local_1c != NONE.ObjectID) {
- local_1c = (pTVar1->CrObject).ObjectID;
- GetFirstContainerObject(local_2c);
- iVar2 = CountMoney(local_2c);
- return iVar2;
- }
- Text = "CountInventoryMoney: Kreatur %s hat kein Kreatur-Objekt.\n";
- CreatureID = (ulong)pTVar1->Name;
- }
- error(Text,CreatureID);
- return 0;
-}
-
-
-
-void CalculateChange(int Amount,int *Gold,int *Platinum,int *Crystal)
-
-{
- int iVar1;
- int Rest;
- int iVar2;
- int iVar3;
- int iVar4;
- char *Text;
- int iVar5;
- int iVar6;
-
- iVar6 = *Crystal;
- print();
- iVar5 = *Platinum;
- iVar3 = *Crystal;
- iVar4 = *Gold;
- if (iVar3 * 10000 + iVar5 * 100 + iVar4 < Amount) {
- Text = &DAT_080f7440;
- }
- else {
- iVar1 = Amount / 10000;
- iVar2 = Amount % 10000;
- if (iVar5 * 100 + iVar4 < iVar2) {
- *Crystal = iVar1 + 1;
- *Platinum = (iVar2 + -10000) / 100;
- *Gold = (iVar2 + -10000) % 100;
- }
- else {
- if (iVar3 < iVar1) {
- iVar2 = Amount + iVar3 * -10000;
- }
- else {
- *Crystal = iVar1;
- iVar4 = *Gold;
- }
- iVar5 = iVar2 / 100;
- iVar3 = iVar2 % 100;
- if (iVar4 < iVar3) {
- *Platinum = iVar5 + 1;
- *Gold = iVar3 + -100;
- }
- else if (*Platinum < iVar5) {
- *Gold = iVar2 + *Platinum * -100;
- }
- else {
- *Platinum = iVar5;
- *Gold = iVar3;
- }
- }
- print();
- iVar5 = *Platinum;
- iVar3 = *Crystal;
- iVar4 = *Gold;
- if (iVar3 * 10000 + iVar5 * 100 + iVar4 == Amount) {
- return;
- }
- Text = &DAT_080f73e0;
- }
- error(Text,iVar4,iVar5,iVar3,Amount,iVar6);
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-int GetHeight(void)
-
-{
- bool bVar1;
- ulong uVar2;
- int Height;
- int iVar3;
- Object local_4c [4];
- Object local_3c [4];
- ulong local_2c;
- Object Obj;
-
- iVar3 = 0;
- GetFirstObject();
- if (local_2c != NONE.ObjectID) {
- do {
- local_4c[0].ObjectID = NONE.ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType(local_4c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_4c,HEIGHT);
- if (bVar1) {
- Object::getObjectType(local_4c);
- uVar2 = ObjectType::getAttribute((ObjectType *)local_4c,ELEVATION);
- iVar3 = iVar3 + uVar2;
- }
- Object::getNextObject(local_3c);
- local_2c = local_3c[0].ObjectID;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- return iVar3;
-}
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-bool FieldPossible(void)
-
-{
- bool bVar1;
- bool bVar2;
- int in_stack_00000010;
- Object local_4c [4];
- Object local_3c [4];
- ulong local_2c;
- Object Obj;
-
- GetFirstObject();
- bVar1 = false;
- local_3c[0].ObjectID = NONE.ObjectID;
- if (local_2c != NONE.ObjectID) {
- Object::getObjectType(local_4c);
- bVar2 = ObjectType::getFlag((ObjectType *)local_4c,BANK);
- if (bVar2) goto LAB_080701d5;
- }
- bVar1 = true;
-LAB_080701d5:
- bVar2 = false;
- if (!bVar1) {
- if (local_2c != NONE.ObjectID) {
- do {
- local_4c[0].ObjectID = NONE.ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType(local_4c);
- if (local_4c[0].ObjectID != 99) {
- Object::getObjectType(local_4c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_4c,UNPASS);
- if (bVar1) {
- return false;
- }
- }
- Object::getObjectType(local_4c);
- if (local_4c[0].ObjectID != 99) {
- Object::getObjectType(local_4c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_4c,UNLAY);
- if (bVar1) {
- return false;
- }
- }
- if (in_stack_00000010 - 4U < 2) {
- Object::getObjectType(local_4c);
- bVar1 = ObjectType::getFlag((ObjectType *)local_4c,UNPASS);
- if (bVar1) {
- return false;
- }
- }
- Object::getNextObject(local_3c);
- local_2c = local_3c[0].ObjectID;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- bVar2 = true;
- }
- return bVar2;
-}
-
-
-bool SearchLoginField(int *x,int *y,int *z,int Distance,bool Player)
-
-{
- bool bVar1;
- bool bVar2;
- ushort HouseID_00;
- ushort uVar3;
- int Direction;
- uint uVar4;
- int iStack_60;
- bool BankThere;
- int dy;
- int dx;
- int Dist;
- ushort HouseID;
- Object OStack_4c;
- bool Player_local;
- Object local_3c [4];
- ulong local_2c;
- Object Obj;
-
- HouseID_00 = GetHouseID(*x,*y,*z);
- bVar1 = SearchFreeField(x,y,z,Distance,HouseID_00,false);
- if ((!bVar1) || ((Player && (bVar1 = IsNoLogoutField(), bVar1)))) {
- dx = 0;
- uVar4 = 4;
- dy = 0;
- iStack_60 = 0;
- do {
- GetFirstObject();
- bVar1 = false;
- local_3c[0].ObjectID = NONE.ObjectID;
- if (((local_2c != NONE.ObjectID) && ((!Player || (bVar2 = IsNoLogoutField(), !bVar2))))
- && ((bVar2 = IsHouse(dy + *x,iStack_60 + *y,*z), !bVar2 ||
- ((HouseID_00 != 0 &&
- (uVar3 = GetHouseID(dy + *x,iStack_60 + *y,*z), uVar3 == HouseID_00)))))) {
- if (local_2c != NONE.ObjectID) {
- do {
- OStack_4c.ObjectID = NONE.ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType(&stack0xffffffb4);
- bVar2 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,BANK);
- if (bVar2) {
- bVar1 = true;
- }
- Object::getObjectType(&stack0xffffffb4);
- if (OStack_4c.ObjectID == 99) goto LAB_08070740;
- Object::getObjectType(&stack0xffffffb4);
- bVar2 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,UNPASS);
- if (bVar2) {
- Object::getObjectType(&stack0xffffffb4);
- bVar2 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,UNMOVE);
- if (bVar2) goto LAB_08070740;
- }
- if (!Player) {
- Object::getObjectType(&stack0xffffffb4);
- bVar2 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,AVOID);
- if (bVar2) {
- Object::getObjectType(&stack0xffffffb4);
- bVar2 = ObjectType::getFlag((ObjectType *)&stack0xffffffb4,UNMOVE);
- if (bVar2) goto LAB_08070740;
- }
- }
- Object::getNextObject(local_3c);
- local_2c = local_3c[0].ObjectID;
- } while (local_3c[0].ObjectID != NONE.ObjectID);
- }
- OStack_4c.ObjectID = NONE.ObjectID;
- local_3c[0].ObjectID = NONE.ObjectID;
- if (bVar1) {
- *x = *x + dy;
- *y = *y + iStack_60;
- goto LAB_0807063b;
- }
- }
-LAB_08070740:
- if (uVar4 == 2) {
- dy = dy + -1;
- if (dy + dx == 0) {
- uVar4 = 3;
- }
- }
- else if (uVar4 < 3) {
- if ((uVar4 == 1) && (iStack_60 = iStack_60 + -1, iStack_60 + dx == 0)) {
- uVar4 = 2;
- }
- }
- else if (uVar4 == 3) {
- iStack_60 = iStack_60 + 1;
- if (iStack_60 == dx) {
- uVar4 = 4;
- }
- }
- else if ((uVar4 == 4) && (dy = dy + 1, dy == dx + 1)) {
- uVar4 = 1;
- dx = dy;
- }
- bVar1 = false;
- } while (dx <= Distance);
- }
- else {
-LAB_0807063b:
- bVar1 = true;
- }
- return bVar1;
-}
-
-
-
-bool SearchSpawnField(int *x,int *y,int *z,int Distance,bool Player)
-
-{
- bool bVar1;
- bool bVar2;
- bool bVar3;
- bool bVar4;
- bool bVar5;
- bool bVar6;
- ushort uVar7;
- ushort uVar8;
- int iVar9;
- undefined4 *puVar10;
- int iVar11;
- int *piVar12;
- long lVar13;
- int NewTieBreaker;
- int iVar14;
- int iVar15;
- int dy;
- int iVar16;
- int iVar17;
- int dx;
- int xmax;
- int iVar18;
- int local_b0;
- int ddy;
- int ddx;
- bool LoginBad;
- bool LoginPossible;
- bool ExpansionPossible;
- bool Found;
- bool Expanded;
- int Pass;
- int TieBreaker;
- int BestY;
- int BestX;
- ushort HouseID;
- bool Minimize;
- Object OStack_6c;
- bool Player_local;
- Object local_5c [4];
- ulong local_4c;
- Object Obj;
- undefined1 local_3c [4];
- matrix<int> Map;
-
- xmax = Distance;
- if (0x7fffffff < (uint)Distance) {
- xmax = -Distance;
- }
- iVar16 = -xmax;
- uVar7 = GetHouseID(*x,*y,*z);
- iVar18 = iVar16;
- matrix<int>::matrix((matrix<int> *)local_3c,iVar16,xmax,iVar16,xmax);
- if (-xmax == xmax || iVar16 < xmax) {
- do {
- iVar17 = -xmax;
- if (-xmax == xmax || iVar17 < xmax) {
- do {
- iVar9 = iVar17 - Map.xmin;
- iVar14 = iVar16 - (int)local_3c;
- if ((((iVar14 < 0) || (Map.ymin <= iVar14)) || (iVar9 < 0)) || (Map.dx <= iVar9)
- ) {
- // try { // try from 08070a0d to 08071018 has its CatchHandler @ 08071071
- error("matrix::operator(): Ungueltiger Index %d/%d.\n",
- iVar14 + (int)local_3c,iVar9 + Map.xmin);
- puVar10 = (undefined4 *)Map.dy;
- }
- else {
- puVar10 = (undefined4 *)(Map.dy + (iVar14 + iVar9 * Map.ymin) * 4);
- }
- *puVar10 = 0x7fffffff;
- iVar17 = iVar17 + 1;
- } while (iVar17 <= xmax);
- }
- iVar16 = iVar16 + 1;
- } while (iVar16 <= xmax);
- }
- if ((((int)local_3c < 1) && (-(int)local_3c < Map.ymin)) &&
- ((Map.xmin < 1 && (-Map.xmin < Map.dx)))) {
- puVar10 = (undefined4 *)(Map.dy + (-Map.xmin * Map.ymin + -(int)local_3c) * 4);
- }
- else {
- error("matrix::operator(): Ungueltiger Index %d/%d.\n",0,0);
- puVar10 = (undefined4 *)Map.dy;
- }
- *puVar10 = 0;
- BestY = 0;
- TieBreaker = 0;
- Pass = -1;
- _LoginPossible = 0;
- while( true ) {
- bVar1 = false;
- iVar16 = -xmax;
- bVar4 = false;
- if (-xmax == xmax || iVar16 < xmax) {
- do {
- iVar17 = -xmax;
- if (-xmax == xmax || iVar17 < xmax) {
- do {
- iVar9 = iVar17 - Map.xmin;
- iVar14 = iVar16 - (int)local_3c;
- if (((iVar14 < 0) || (Map.ymin <= iVar14)) ||
- ((iVar9 < 0 || (Map.dx <= iVar9)))) {
- error("matrix::operator(): Ungueltiger Index %d/%d.\n",
- iVar14 + (int)local_3c,iVar9 + Map.xmin,iVar18);
- piVar12 = (int *)Map.dy;
- }
- else {
- piVar12 = (int *)(Map.dy + (iVar14 + iVar9 * Map.ymin) * 4);
- }
- if (((*piVar12 == _LoginPossible) &&
- ((bVar5 = IsHouse(*x + iVar16,*y + iVar17,*z), !bVar5 ||
- ((uVar7 != 0 &&
- (uVar8 = GetHouseID(*x + iVar16,*y + iVar17,*z), uVar8 == uVar7))))))
- && ((Player || (bVar5 = IsProtectionZone(), !bVar5)))) {
- iVar18 = *z;
- GetFirstObject();
- local_5c[0] = (Object)NONE.ObjectID;
- if (local_4c != NONE.ObjectID) {
- bVar5 = true;
- bVar2 = true;
- bVar3 = false;
- if (local_4c != NONE.ObjectID) {
- do {
- OStack_6c.ObjectID = NONE.ObjectID;
- local_5c[0].ObjectID = NONE.ObjectID;
- Object::getObjectType(&stack0xffffff94);
- if (OStack_6c.ObjectID == 99) {
- bVar2 = false;
- }
- Object::getObjectType(&stack0xffffff94);
- bVar6 = ObjectType::getFlag((ObjectType *)&stack0xffffff94,
- UNPASS);
- if (bVar6) {
- Object::getObjectType(&stack0xffffff94);
- bVar6 = ObjectType::getFlag((ObjectType *)
- &stack0xffffff94,UNMOVE);
- if (bVar6) {
- bVar5 = false;
- bVar2 = false;
- }
- else {
- bVar3 = true;
- }
- }
- Object::getObjectType(&stack0xffffff94);
- bVar6 = ObjectType::getFlag((ObjectType *)&stack0xffffff94,
- AVOID);
- if (bVar6) {
- Object::getObjectType(&stack0xffffff94);
- bVar6 = ObjectType::getFlag((ObjectType *)
- &stack0xffffff94,UNMOVE);
- bVar3 = bVar2;
- if (bVar6) {
- bVar5 = false;
- bVar3 = false;
- if ((bVar2) && (!Player)) {
- bVar3 = true;
- }
- }
- bVar2 = bVar3;
- bVar3 = true;
- }
- Object::getNextObject(local_5c);
- local_4c = local_5c[0].ObjectID;
- } while (local_5c[0].ObjectID != NONE.ObjectID);
- }
- OStack_6c.ObjectID = NONE.ObjectID;
- local_5c[0].ObjectID = NONE.ObjectID;
- if ((bVar5) || (_LoginPossible == 0)) {
- ddy = -1;
- do {
- local_b0 = -1;
- iVar9 = ddy + iVar16;
- do {
- bVar1 = false;
- if ((-xmax <= iVar9) && (iVar9 <= xmax)) {
- bVar1 = true;
- }
- if (bVar1) {
- bVar1 = false;
- iVar14 = local_b0 + iVar17;
- if ((-xmax <= iVar14) && (iVar14 <= xmax)) {
- bVar1 = true;
- }
- if (bVar1) {
- iVar11 = iVar14 - Map.xmin;
- iVar15 = iVar9 - (int)local_3c;
- if ((((iVar15 < 0) || (Map.ymin <= iVar15)) ||
- (iVar11 < 0)) || (Map.dx <= iVar11)) {
- error(
- "matrix::operator(): Ungueltiger Index %d/%d.\n",
- iVar15 + (int)local_3c,iVar11 + Map.xmin,iVar18);
- piVar12 = (int *)Map.dy;
- }
- else {
- piVar12 = (int *)(Map.dy + (iVar15 + iVar11 *
- Map.ymin) * 4);
- }
- if (_LoginPossible < *piVar12) {
- iVar14 = iVar14 - Map.xmin;
- iVar11 = iVar9 - (int)local_3c;
- if (((iVar11 < 0) || (Map.ymin <= iVar11)) ||
- ((iVar14 < 0 || (Map.dx <= iVar14)))) {
- error(
- "matrix::operator(): Ungueltiger Index %d/%d.\n",
- iVar11 + (int)local_3c,iVar14 + Map.xmin);
- piVar12 = (int *)Map.dy;
- }
- else {
- piVar12 = (int *)(Map.dy + (iVar11 + iVar14 *
- Map.ymin) * 4);
- }
- iVar14 = -ddy;
- if (-1 < ddy) {
- iVar14 = ddy;
- }
- iVar11 = -local_b0;
- if (-1 < local_b0) {
- iVar11 = local_b0;
- }
- *piVar12 = iVar14 + _LoginPossible + iVar11;
- }
- }
- }
- local_b0 = local_b0 + 1;
- } while (local_b0 < 2);
- ddy = ddy + 1;
- } while (ddy < 2);
- bVar1 = true;
- }
- if ((bVar2) && ((bVar5 = IsNoLogoutField(), !bVar5 || (!Player)))) {
- lVar13 = random();
- if (!bVar3) {
- lVar13 = lVar13 + 100;
- }
- if (Pass < lVar13) {
- bVar4 = true;
- Pass = lVar13;
- TieBreaker = iVar17;
- BestY = iVar16;
- }
- }
- }
- }
- iVar17 = iVar17 + 1;
- } while (iVar17 <= xmax);
- }
- iVar16 = iVar16 + 1;
- } while (iVar16 <= xmax);
- }
- if (((bVar4) && (-1 < Distance)) || (!bVar1)) break;
- _LoginPossible = _LoginPossible + 1;
- }
- if (Pass < 0) {
- if (Map.dy != 0) {
- operator_delete__((void *)Map.dy);
- }
- bVar4 = false;
- }
- else {
- *x = *x + BestY;
- *y = *y + TieBreaker;
- if (Map.dy != 0) {
- operator_delete__((void *)Map.dy);
- }
- bVar4 = true;
- }
- return bVar4;
-}
-
-
-
// WARNING: Unknown calling convention -- yet parameter storage is locked
bool SearchFlightField(void)
@@ -14932,28 +13125,6 @@ char * GetBanishmentReason(int Reason)
return pcVar1;
}
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void InitInfo(void)
-
-{
- return;
-}
-
-
-
-// WARNING: Unknown calling convention -- yet parameter storage is locked
-
-void ExitInfo(void)
-
-{
- return;
-}
-
-
-
// WARNING: Unknown calling convention -- yet parameter storage is locked
void _GLOBAL__I__Z7GetName6Object(void)