From 60b89174c6b6300079344267bae60d74347e1fa5 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Wed, 11 Jun 2025 03:30:51 -0300 Subject: some announce functions --- reference/game.c | 323 ------------------------------------------------------- 1 file changed, 323 deletions(-) (limited to 'reference') diff --git a/reference/game.c b/reference/game.c index 213e714..2a7f774 100644 --- a/reference/game.c +++ b/reference/game.c @@ -18375,329 +18375,6 @@ void __static_initialization_and_destruction_0(int __initialize_p,int __priority return; } - - -void AnnounceMovingCreature(ulong CreatureID,Object *Con) - -{ - TConnection *Connection; - TCreature *pTVar1; - int iVar2; - ulong CharacterID; - TPlayer *pTVar3; - int iVar4; - int iVar5; - TCreature *cr; - int local_68; - int x; - int y; - int z; - TFindCreatures Search; - Object local_2c [7]; - - pTVar1 = GetCreature(CreatureID); - if (pTVar1 == (TCreature *)0x0) { - error("AnnounceMovingCreature: Kreatur %d existiert nicht.\n",CreatureID); - } - else { - local_2c[0] = (Object)Con->ObjectID; - GetObjectCoordinates(local_2c,&local_68,&x,&y); - iVar4 = x - pTVar1->posy; - iVar2 = -iVar4; - if (-1 < iVar4) { - iVar2 = iVar4; - } - iVar5 = local_68 - pTVar1->posx; - iVar4 = -iVar5; - if (-1 < iVar5) { - iVar4 = iVar5; - } - TFindCreatures::TFindCreatures - ((TFindCreatures *)&z,iVar4 / 2 + 0x11,iVar2 / 2 + 0xf, - (local_68 + pTVar1->posx) / 2,(x + pTVar1->posy) / 2,1); - while( true ) { - CharacterID = TFindCreatures::getNext((TFindCreatures *)&z); - if (CharacterID == 0) break; - pTVar3 = GetPlayer(CharacterID); - if ((pTVar3 != (TPlayer *)0x0) && - (Connection = (pTVar3->super_TCreature).Connection, Connection != (TConnection *)0x0) - ) { - SendMoveCreature(Connection,CreatureID,local_68,x,y); - } - } - } - return; -} - - - -void AnnounceChangedCreature(ulong CreatureID,int Type) - -{ - TKnownCreature *pTVar1; - TConnection *this; - bool bVar2; - TCreature *pTVar3; - TKnownCreature *KnownCreature; - TConnection *Connection; - TCreature *cr; - - pTVar3 = GetCreature(CreatureID); - if (pTVar3 == (TCreature *)0x0) { - error("AnnounceChangedCreature: Kreatur %d existiert nicht (Type=%d).\n",CreatureID,Type); - } - else { - for (pTVar1 = pTVar3->FirstKnowingConnection; pTVar1 != (TKnownCreature *)0x0; - pTVar1 = pTVar1->Next) { - this = pTVar1->Connection; - if ((this->State == CONNECTION_GAME) && (pTVar1->State != KNOWNCREATURE_OUTDATED)) { - bVar2 = TConnection::IsVisible(this,pTVar3->posx,pTVar3->posy,pTVar3->posz); - if (bVar2) { - switch(Type) { - case 1: - SendCreatureHealth(this,CreatureID); - break; - case 2: - SendCreatureLight(this,CreatureID); - break; - case 3: - SendCreatureOutfit(this,CreatureID); - break; - case 4: - SendCreatureSpeed(this,CreatureID); - break; - case 5: - SendCreatureSkull(this,CreatureID); - break; - case 6: - SendCreatureParty(this,CreatureID); - } - } - else { - pTVar1->State = KNOWNCREATURE_OUTDATED; - } - } - } - } - return; -} - - - -void AnnounceChangedField(Object *Obj,int Type) - -{ - TConnection *this; - bool bVar1; - ulong ID; - ulong CharacterID; - TPlayer *pTVar2; - TPlayer *pl; - int local_68; - int x; - int y; - int z; - TFindCreatures Search; - Object local_2c [7]; - - bVar1 = Object::exists(Obj); - if (bVar1) { - local_2c[0] = (Object)Obj->ObjectID; - GetObjectCoordinates(local_2c,&local_68,&x,&y); - TFindCreatures::TFindCreatures((TFindCreatures *)&z,0x10,0xe,local_68,x,1); -LAB_0808e5c0: - CharacterID = TFindCreatures::getNext((TFindCreatures *)&z); - if (CharacterID != 0) { - pTVar2 = GetPlayer(CharacterID); - if (((pTVar2 != (TPlayer *)0x0) && - (this = (pTVar2->super_TCreature).Connection, this != (TConnection *)0x0)) && - (bVar1 = TConnection::IsVisible(this,local_68,x,y), bVar1)) { - if (Type != 1) { - if (Type < 2) { - if (Type == 0) { - local_2c[0] = (Object)Obj->ObjectID; - SendDeleteField((pTVar2->super_TCreature).Connection,local_68,x,y, - local_2c); - goto LAB_0808e5c0; - } - } - else if (Type == 2) { - local_2c[0] = (Object)Obj->ObjectID; - SendChangeField((pTVar2->super_TCreature).Connection,local_68,x,y,local_2c); - goto LAB_0808e5c0; - } - error(&DAT_080fee80,Type); - return; - } - local_2c[0] = (Object)Obj->ObjectID; - SendAddField((pTVar2->super_TCreature).Connection,local_68,x,y,local_2c); - } - goto LAB_0808e5c0; - } - } - else { - error(&DAT_080fee40); - } - return; -} - - - -void AnnounceChangedContainer(Object *Obj,int Type) - -{ - bool bVar1; - ulong ID; - ulong CharacterID; - TPlayer *Window; - TPlayer *pl; - int con; - int ContNr; - int iVar2; - Object local_6c [4]; - Object local_5c [4]; - undefined1 local_4c [4]; - TFindCreatures Search; - - bVar1 = Object::exists(Obj); - if (bVar1) { - local_5c[0] = (Object)Obj->ObjectID; - TFindCreatures::TFindCreatures((TFindCreatures *)local_4c,1,1,local_5c,1); - while (CharacterID = TFindCreatures::getNext((TFindCreatures *)local_4c), CharacterID != 0) - { - Window = GetPlayer(CharacterID); - if ((Window != (TPlayer *)0x0) && - ((Window->super_TCreature).Connection != (TConnection *)0x0)) { - ContNr = 0; - do { - iVar2 = ContNr; - TPlayer::GetOpenContainer((TPlayer *)local_5c,(int)Window); - Object::getContainer(local_6c); - if (local_5c[0].ObjectID == local_6c[0].ObjectID) { - if (Type == 1) { - local_6c[0] = (Object)Obj->ObjectID; - SendCreateInContainer - ((Window->super_TCreature).Connection,ContNr,local_6c); - } - else if (Type < 2) { - if (Type != 0) goto LAB_0808e7c7; - local_6c[0] = (Object)Obj->ObjectID; - SendDeleteInContainer - ((Window->super_TCreature).Connection,ContNr,local_6c); - } - else { - if (Type != 2) { -LAB_0808e7c7: - error(&DAT_080fef00,Type,iVar2); - return; - } - local_6c[0] = (Object)Obj->ObjectID; - SendChangeInContainer - ((Window->super_TCreature).Connection,ContNr,local_6c); - } - } - ContNr = ContNr + 1; - } while (ContNr < 0x10); - } - } - } - else { - error(&DAT_080feec0); - } - return; -} - - - -void AnnounceChangedInventory(Object *Obj,int Type) - -{ - bool bVar1; - ulong id; - TCreature *pTVar2; - int iVar3; - TCreature *cr; - char *Text; - Object local_3c [4]; - Object local_2c [7]; - - bVar1 = Object::exists(Obj); - if (bVar1) { - local_2c[0] = (Object)Obj->ObjectID; - id = GetObjectCreatureID(local_2c); - pTVar2 = GetCreature(id); - if (pTVar2 != (TCreature *)0x0) { - if (pTVar2->Type != PLAYER) { - return; - } - if (Type != 0) { - if ((-1 < Type) && (Type < 3)) { - local_3c[0] = (Object)Obj->ObjectID; - local_2c[0].ObjectID = local_3c[0].ObjectID; - iVar3 = GetObjectBodyPosition(local_3c); - SendSetInventory(pTVar2->Connection,iVar3,local_2c); - return; - } - error(&DAT_080fef80,Type); - return; - } - local_2c[0] = (Object)Obj->ObjectID; - iVar3 = GetObjectBodyPosition(local_2c); - SendDeleteInventory(pTVar2->Connection,iVar3); - return; - } - Text = "AnnounceChangedInventory: Objekt liegt in keinem Inventory.\n"; - } - else { - Text = &DAT_080fef40; - } - error(Text); - return; -} - - - -void AnnounceChangedObject(Object *Obj,int Type) - -{ - bool bVar1; - Object local_4c [4]; - Object local_3c [4]; - Object local_2c [7]; - - bVar1 = Object::exists(Obj); - if (bVar1) { - Object::getContainer(local_2c); - Object::getObjectType(local_3c); - if (local_3c[0].ObjectID == 0) { - local_3c[0] = (Object)Obj->ObjectID; - AnnounceChangedField(local_3c,Type); - } - else { - Object::getContainer(local_3c); - Object::getObjectType(local_4c); - bVar1 = false; - if ((0 < (int)local_4c[0].ObjectID) && ((int)local_4c[0].ObjectID < 0xb)) { - bVar1 = true; - } - if (bVar1) { - local_4c[0] = (Object)Obj->ObjectID; - AnnounceChangedInventory(local_4c,Type); - } - else { - local_4c[0] = (Object)Obj->ObjectID; - AnnounceChangedContainer(local_4c,Type); - } - } - } - else { - error(&DAT_080ff000); - } - return; -} - - - void AnnounceGraphicalEffect(int x,int y,int z,int Type) { -- cgit v1.2.3