From 3f85ce3cfb46adee8caf890a8369cd7cd7814874 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Mon, 2 Jun 2025 12:07:24 -0300 Subject: use `Actor` instead of `Creature` with spell functions --- reference/game.c | 583 ------------------------------------------------------- 1 file changed, 583 deletions(-) (limited to 'reference') diff --git a/reference/game.c b/reference/game.c index aee0dd9..2062902 100644 --- a/reference/game.c +++ b/reference/game.c @@ -20988,589 +20988,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority return; } -void KillAllMonsters(TCreature *cr,int EffectNr,int Radius) - -{ - bool bVar1; - int iVar2; - TCreature *pTVar3; - undefined4 *puVar4; - char *pcVar5; - int dy; - int local_78; - int *local_74; - TCreature *dest; - int dx; - int j; - int i; - TSkill *local_4c; - Object Help; - TSkill *local_2c; - Object Obj; - - if (cr != (TCreature *)0x0) { - if (((cr->Type != PLAYER) || (bVar1 = CheckRight(cr->ID,CREATE_MONSTERS), bVar1)) && - (j = 0, -1 < Radius)) { - local_74 = &Circle[0].Count; - local_78 = 0; - do { - dx = 0; - iVar2 = local_78; - if (0 < *local_74) { - do { - // try { // try from 08080c93 to 08080e80 has its CatchHandler @ 08080e81 - bVar1 = ThrowPossible(cr->posx,cr->posy,cr->posz, - Circle[0].x[iVar2 + dx] + cr->posx, - Circle[0].y[iVar2 + dx] + cr->posy,cr->posz,0); - if ((bVar1) && (bVar1 = IsProtectionZone(), !bVar1)) { - GetFirstObject(); - if (local_2c != (TSkill *)NONE.ObjectID) { - do { - dest = (TCreature *)&local_4c; - local_4c = local_2c; - Object::getNextObject((Object *)&i); - iVar2 = i; - local_2c = (TSkill *)i; - Object::getObjectType((Object *)&i); - if (i == 99) { - i = (int)local_4c; - pTVar3 = GetCreature((Object *)&i); - if (pTVar3 == (TCreature *)0x0) { - error(&DAT_080fae40,dest); - } - else if ((cr != pTVar3) && (pTVar3->Type == MONSTER)) { - pcVar5 = pTVar3->Name; - print(); - (*(pTVar3->super_TSkillBase).Skills[2]->_vptr_TSkill[2]) - ((pTVar3->super_TSkillBase).Skills[2],0,pcVar5 - ); - (*pTVar3->_vptr_TCreature[2])(pTVar3); - } - } - } while (iVar2 != NONE.ObjectID); - } - local_4c = (TSkill *)NONE.ObjectID; - GraphicalEffect(); - } - dx = dx + 1; - iVar2 = j * 0x41; - } while (dx < *local_74); - } - j = j + 1; - local_74 = local_74 + 0x41; - local_78 = local_78 + 0x41; - } while (j <= Radius); - } - return; - } - error(&DAT_080fae80); - puVar4 = (undefined4 *)__cxa_allocate_exception(4); - *puVar4 = 0xffffffff; - // WARNING: Subroutine does not return - __cxa_throw(puVar4,&RESULT::typeinfo,0); -} - - - -// WARNING: Unknown calling convention -- yet parameter storage is locked - -void CreateField(void) - -{ - bool bVar1; - undefined4 *puVar2; - int iVar3; - TCreature *in_stack_00000004; - Object *in_stack_00000008; - int in_stack_0000000c; - int in_stack_00000010; - int in_stack_00000014; - char *Text; - int iVar4; - bool local_4c; - int local_48; - int x; - int y; - int z; - Object local_2c [7]; - - if (in_stack_00000004 == (TCreature *)0x0) { - Text = &DAT_080faf00; - } - else { - // try { // try from 08080ec3 to 080810b4 has its CatchHandler @ 080810d2 - bVar1 = Object::exists(in_stack_00000008); - if (bVar1) { - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - GetObjectCoordinates(local_2c,&local_48,&x,&y); - iVar3 = x; - iVar4 = y; - bVar1 = FieldPossible(); - if (bVar1) { - CheckAffectedPlayers(); - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,local_48,x,y,0); - if (bVar1) { - iVar3 = 1000; - if (WorldType != PVP_ENFORCED) { - iVar3 = 2000; - } - CheckMana(in_stack_00000004,in_stack_0000000c,in_stack_00000010,iVar3); - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - z = (in_stack_00000004->CrObject).ObjectID; - Missile((Object *)&z,local_2c,(in_stack_00000014 != 1) + 4); - local_4c = false; - if (WorldType == NON_PVP) { - iVar3 = (*in_stack_00000004->_vptr_TCreature[4])(); - local_4c = (char)iVar3 != '\0'; - } - CreateField(local_48,x,y,in_stack_00000014,in_stack_00000004->ID,local_4c); - bVar1 = false; - if ((0 < in_stack_00000014) && (in_stack_00000014 < 4)) { - bVar1 = true; - } - if (bVar1) { - TCreature::BlockLogout(in_stack_00000004,0x3c,true); - } - return; - } - puVar2 = (undefined4 *)__cxa_allocate_exception(4); - *puVar2 = 7; - } - else { - puVar2 = (undefined4 *)__cxa_allocate_exception(4,iVar3,iVar4); - *puVar2 = 4; - } - goto LAB_0808107d; - } - Text = &DAT_080faec0; - } - error(Text); - puVar2 = (undefined4 *)__cxa_allocate_exception(4); - *puVar2 = 0xffffffff; -LAB_0808107d: - // WARNING: Subroutine does not return - __cxa_throw(puVar2,&RESULT::typeinfo,0); -} - - - -// WARNING: Unknown calling convention -- yet parameter storage is locked - -void CreateField(void) - -{ - bool bVar1; - undefined4 *puVar2; - int x; - int y_00; - int y; - int z_00; - int in_stack_00000004; - int iVar3; - undefined4 uVar4; - int z; - - if (in_stack_00000004 == 0) { - error(&DAT_080faf00); - puVar2 = (undefined4 *)__cxa_allocate_exception(4); - *puVar2 = 0xffffffff; -LAB_080811d9: - // WARNING: Subroutine does not return - __cxa_throw(puVar2,&RESULT::typeinfo,0); - } - uVar4 = *(undefined4 *)(in_stack_00000004 + 0x278); - y_00 = *(int *)(in_stack_00000004 + 0x270); - z_00 = *(int *)(in_stack_00000004 + 0x274); - iVar3 = *(int *)(in_stack_00000004 + 0x284); - if (iVar3 == 1) { - y_00 = y_00 + 1; - } - else if (iVar3 < 2) { - if (iVar3 == 0) { - z_00 = z_00 + -1; - } - } - else if (iVar3 == 2) { - z_00 = z_00 + 1; - } - else if (iVar3 == 3) { - y_00 = y_00 + -1; - } - if (*(int *)(in_stack_00000004 + 0x28c) == 0) { - bVar1 = CheckRight(*(ulong *)(in_stack_00000004 + 0x208),ATTACK_EVERYWHERE); - if (!bVar1) { - iVar3 = z_00; - bVar1 = IsProtectionZone(); - if (bVar1) { - puVar2 = (undefined4 *)__cxa_allocate_exception(4,iVar3,uVar4); - *puVar2 = 0x2f; - goto LAB_080811d9; - } - } - } - // try { // try from 08081162 to 08081221 has its CatchHandler @ 08081236 - GetMapContainer((int)&z,y_00,z_00); - CreateField(); - return; -} - - - -// WARNING: Unknown calling convention -- yet parameter storage is locked - -void MassCreateField(void) - -{ - bool bVar1; - int iVar2; - undefined4 *puVar3; - int iVar4; - int dx; - int zx; - TCreature *in_stack_00000004; - Object *in_stack_00000008; - int in_stack_0000000c; - int in_stack_00000010; - int in_stack_00000014; - int in_stack_00000018; - char *Text; - int local_64; - int *local_60; - bool local_58; - int local_50; - int j; - int i; - int x; - int y; - int z; - Object local_2c [7]; - - if (in_stack_00000004 == (TCreature *)0x0) { - Text = &DAT_080faf80; - } - else { - // try { // try from 08081273 to 08081538 has its CatchHandler @ 08081556 - bVar1 = Object::exists(in_stack_00000008); - if (bVar1) { - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - GetObjectCoordinates(local_2c,&i,&x,&y); - CheckAffectedPlayers(); - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,i,x,y,0); - if (bVar1) { - iVar4 = 1000; - if (WorldType != PVP_ENFORCED) { - iVar4 = 2000; - } - CheckMana(in_stack_00000004,in_stack_0000000c,in_stack_00000010,iVar4); - if (((in_stack_00000004->posx != i) || (in_stack_00000004->posy != x)) || - (in_stack_00000004->posz != y)) { - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - z = (in_stack_00000004->CrObject).ObjectID; - Missile((Object *)&z,local_2c,(in_stack_00000014 != 1) + 4); - } - j = 0; - if (0 < in_stack_00000018) { - local_60 = &Circle[0].Count; - local_64 = 0; - do { - local_50 = 0; - iVar4 = local_64; - if (0 < *local_60) { - do { - zx = i + Circle[0].x[iVar4 + local_50]; - iVar4 = x + Circle[0].y[iVar4 + local_50]; - bVar1 = ThrowPossible(i,x,y,zx,iVar4,y,0); - if ((bVar1) && (bVar1 = IsProtectionZone(), !bVar1)) { - local_58 = false; - if (WorldType == NON_PVP) { - iVar2 = (*in_stack_00000004->_vptr_TCreature[4])(); - local_58 = (char)iVar2 != '\0'; - } - CreateField(zx,iVar4,y,in_stack_00000014,in_stack_00000004->ID, - local_58); - } - local_50 = local_50 + 1; - iVar4 = j * 0x41; - } while (local_50 < *local_60); - } - j = j + 1; - local_60 = local_60 + 0x41; - local_64 = local_64 + 0x41; - } while (j < in_stack_00000018); - } - bVar1 = false; - if ((0 < in_stack_00000014) && (in_stack_00000014 < 4)) { - bVar1 = true; - } - if (bVar1) { - TCreature::BlockLogout(in_stack_00000004,0x3c,true); - } - return; - } - puVar3 = (undefined4 *)__cxa_allocate_exception(4); - *puVar3 = 7; - goto LAB_08081515; - } - Text = &DAT_080faf40; - } - error(Text); - puVar3 = (undefined4 *)__cxa_allocate_exception(4); - *puVar3 = 0xffffffff; -LAB_08081515: - // WARNING: Subroutine does not return - __cxa_throw(puVar3,&RESULT::typeinfo,0); -} - - - -// WARNING: Unknown calling convention -- yet parameter storage is locked - -void CreateFieldWall(void) - -{ - bool bVar1; - uint uVar2; - undefined4 *puVar3; - int iVar4; - int dx; - int iVar5; - TCreature *in_stack_00000004; - Object *in_stack_00000008; - int in_stack_0000000c; - int in_stack_00000010; - int in_stack_00000014; - int in_stack_00000018; - char *Text; - int local_80; - int local_7c; - int local_78; - int local_74; - int local_70; - int local_6c; - int local_68; - int local_5c; - int i; - bool Peaceful; - int Dir; - int StepY; - int StepX; - int x; - int y; - int z; - Object local_2c [7]; - - if (in_stack_00000004 != (TCreature *)0x0) { - // try { // try from 08081593 to 08081b48 has its CatchHandler @ 08081b54 - bVar1 = Object::exists(in_stack_00000008); - if (!bVar1) { - Text = &DAT_080fb000; - goto LAB_08081b44; - } - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - GetObjectCoordinates(local_2c,&StepX,&x,&y); - CheckAffectedPlayers(); - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,StepX,x,y,0); - if (!bVar1) { - puVar3 = (undefined4 *)__cxa_allocate_exception(4); - *puVar3 = 7; - goto LAB_080816e6; - } - iVar4 = 1000; - if (WorldType != PVP_ENFORCED) { - iVar4 = 2000; - } - CheckMana(in_stack_00000004,in_stack_0000000c,in_stack_00000010,iVar4); - iVar4 = in_stack_00000004->posx; - if (((iVar4 != StepX) || (iVar5 = in_stack_00000004->posy, iVar5 != x)) || - (in_stack_00000004->posz != y)) { - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - z = (in_stack_00000004->CrObject).ObjectID; - Missile((Object *)&z,local_2c,(in_stack_00000014 != 1) + 4); - iVar5 = in_stack_00000004->posy; - iVar4 = in_stack_00000004->posx; - } - uVar2 = Direction(StepX - iVar4,x - iVar5); - switch(uVar2) { - case 0: - puVar3 = (undefined4 *)__cxa_allocate_exception(4); - *puVar3 = 4; - goto LAB_080816e6; - case 1: - case 5: - StepY = 0; - break; - case 2: - case 6: - StepY = 1; - break; - case 3: - case 7: - StepY = 1; - Dir = 0; - goto LAB_0808170c; - case 4: - case 8: - StepY = -1; - break; - default: - error(&DAT_080fafc0,uVar2); - goto LAB_08081ae7; - } - Dir = 1; -LAB_0808170c: - i._3_1_ = false; - if ((WorldType == NON_PVP) && - (iVar4 = (*in_stack_00000004->_vptr_TCreature[4])(), (char)iVar4 != '\0')) { - i._3_1_ = true; - } - CreateField(StepX,x,y,in_stack_00000014,in_stack_00000004->ID,i._3_1_); - local_5c = 1; - if (0 < in_stack_00000018) { - local_6c = 0; - local_68 = StepY; - local_70 = StepY; - local_74 = Dir; - local_78 = StepY; - local_7c = Dir; - local_80 = StepY; - do { - iVar5 = local_80 + StepX; - iVar4 = local_7c + x; - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,iVar5,iVar4,y,0); - if ((bVar1) && (bVar1 = IsProtectionZone(), !bVar1)) { - CreateField(iVar5,iVar4,y,in_stack_00000014,in_stack_00000004->ID,i._3_1_); - } - iVar5 = StepX - local_78; - iVar4 = x - local_74; - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,iVar5,iVar4,y,0); - if ((bVar1) && (bVar1 = IsProtectionZone(), !bVar1)) { - CreateField(iVar5,iVar4,y,in_stack_00000014,in_stack_00000004->ID,i._3_1_); - } - if ((uVar2 & 1) == 0) { - iVar5 = local_70 + StepX; - iVar4 = local_6c + x; - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,iVar5,iVar4,y,0); - if ((bVar1) && (bVar1 = IsProtectionZone(), !bVar1)) { - CreateField(iVar5,iVar4,y,in_stack_00000014,in_stack_00000004->ID,i._3_1_); - } - iVar5 = StepX - local_68; - iVar4 = x - (local_5c + -1) * Dir; - bVar1 = ThrowPossible(in_stack_00000004->posx,in_stack_00000004->posy, - in_stack_00000004->posz,iVar5,iVar4,y,0); - if ((bVar1) && (bVar1 = IsProtectionZone(), !bVar1)) { - CreateField(iVar5,iVar4,y,in_stack_00000014,in_stack_00000004->ID,i._3_1_); - } - } - local_5c = local_5c + 1; - local_68 = local_68 + StepY; - local_6c = local_6c + Dir; - local_70 = local_70 + StepY; - local_74 = local_74 + Dir; - local_78 = local_78 + StepY; - local_7c = local_7c + Dir; - local_80 = local_80 + StepY; - } while (local_5c <= in_stack_00000018); - } - bVar1 = false; - if ((0 < in_stack_00000014) && (in_stack_00000014 < 4)) { - bVar1 = true; - } - if (bVar1) { - TCreature::BlockLogout(in_stack_00000004,0x3c,true); - } - return; - } - Text = &DAT_080fb040; -LAB_08081b44: - error(Text); -LAB_08081ae7: - puVar3 = (undefined4 *)__cxa_allocate_exception(4); - *puVar3 = 0xffffffff; -LAB_080816e6: - // WARNING: Subroutine does not return - __cxa_throw(puVar3,&RESULT::typeinfo,0); -} - - - -// WARNING: Unknown calling convention -- yet parameter storage is locked - -void DeleteField(void) - -{ - bool bVar1; - undefined4 *puVar2; - TCreature *in_stack_00000004; - Object *in_stack_00000008; - int in_stack_0000000c; - int in_stack_00000010; - char *Text; - undefined4 uVar3; - int local_58; - int x; - int y; - int z; - ulong local_3c; - Object Help; - Object local_2c [7]; - - if (in_stack_00000004 == (TCreature *)0x0) { - Text = &DAT_080fb0c0; - } - else { - // try { // try from 08081b90 to 08081d0f has its CatchHandler @ 08081d30 - bVar1 = Object::exists(in_stack_00000008); - if (bVar1) { - local_2c[0].ObjectID = in_stack_00000008->ObjectID; - GetObjectCoordinates(local_2c,&local_58,&x,&y); - uVar3 = 0; - bVar1 = FieldPossible(); - if (bVar1) { - CheckMana(in_stack_00000004,in_stack_0000000c,in_stack_00000010,1000); - GetFirstObject(); - in_stack_00000008->ObjectID = local_3c; - if (local_3c != NONE.ObjectID) { - do { - local_2c[0].ObjectID = NONE.ObjectID; - Object::getNextObject((Object *)&z); - in_stack_00000008->ObjectID = z; - local_2c[0].ObjectID = z; - Object::getObjectType((Object *)&z); - bVar1 = ObjectType::getFlag((ObjectType *)&z,MAGICFIELD); - if (bVar1) { - z = local_3c; - Delete((Object *)&z,-1); - } - local_3c = in_stack_00000008->ObjectID; - } while (local_3c != NONE.ObjectID); - } - local_3c = NONE.ObjectID; - local_2c[0].ObjectID = NONE.ObjectID; - GraphicalEffect(); - return; - } - puVar2 = (undefined4 *)__cxa_allocate_exception(4,x,y,uVar3); - *puVar2 = 4; - goto LAB_08081cec; - } - Text = &DAT_080fb080; - } - error(Text); - puVar2 = (undefined4 *)__cxa_allocate_exception(4); - *puVar2 = 0xffffffff; -LAB_08081cec: - // WARNING: Subroutine does not return - __cxa_throw(puVar2,&RESULT::typeinfo,0); -} - - - // WARNING: Unknown calling convention -- yet parameter storage is locked void CleanupField(void) -- cgit v1.2.3