Jump to content

[Dev] Destructible Building (type 33)


Recommended Posts

Ok all done and works great :D

diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index a03e866..ef7543c 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -147,7 +147,10 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
    SetGoAnimProgress(animprogress);

    if(goinfo->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
-        m_health = goinfo->destructibleBuilding.damagedHealth;
+    {
+        m_health = goinfo->destructibleBuilding.damagedHealth + goinfo->destructibleBuilding.damagedDisplayId;
+        SetGoAnimProgress(255);
+    }

    //Notify the map's instance data.
    //Only works if you create the object in it, not if it is moves to that map.
@@ -208,7 +211,7 @@ void GameObject::Update(uint32 /*p_time*/)
                            udata.BuildPacket(&packet);
                            ((Player*)caster)->GetSession()->SendPacket(&packet);

-                            SendGameObjectCustomAnim(GetGUID());
+                            SendGameObjectCustomAnim(GetGUID(), GetGoAnimProgress());
                        }

                        m_lootState = GO_READY;                 // can be successfully open with some chance
@@ -1075,7 +1078,7 @@ void GameObject::Use(Unit* user)

            // this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389)
            if (time_to_restore && info->goober.customAnim)
-                SendGameObjectCustomAnim(GetGUID());
+                SendGameObjectCustomAnim(GetGUID(), GetGoAnimProgress());
            else
                SetGoState(GO_STATE_ACTIVE);

@@ -1462,6 +1465,8 @@ void GameObject::TakenDamage(uint32 damage, Unit* pKiller)
        else
            m_health = 0;
    }
+
+    SetGoAnimProgress(m_health*255/(m_goInfo->destructibleBuilding.damagedDisplayId + m_goInfo->destructibleBuilding.destroyedHealth));
}

void GameObject::Rebuild(Unit* pKiller)
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 55cc856..07ba552 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -1618,11 +1618,11 @@ void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
    SendMessageToSet(&data, true);
}

-void WorldObject::SendGameObjectCustomAnim(uint64 guid)
+void WorldObject::SendGameObjectCustomAnim(uint64 guid, uint8 animprogress)
{
    WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4);
    data << uint64(guid);
-    data << uint32(0);                                      // not known what this is
+    data << uint32(animprogress);
    SendMessageToSet(&data, true);
}

diff --git a/src/game/Object.h b/src/game/Object.h
index 074fc94..527bec5 100644
--- a/src/game/Object.h
+++ b/src/game/Object.h
@@ -447,7 +447,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
        void PlayDirectSound(uint32 sound_id, Player* target = NULL);

        void SendObjectDeSpawnAnim(uint64 guid);
-        void SendGameObjectCustomAnim(uint64 guid);
+        void SendGameObjectCustomAnim(uint64 guid, uint8 animprogress);

        virtual bool IsHostileTo(Unit const* unit) const =0;
        virtual bool IsFriendlyTo(Unit const* unit) const =0;

That's the last update enjoy it and thanks to all :)

U have a typo... u using DisplayId in the health calculation... "m_goInfo->destructibleBuilding.damagedDisplayId" i think it should be "m_goInfo->destructibleBuilding.damagedHealth"

Link to comment
Share on other sites

  • Replies 92
  • Created
  • Last Reply

Top Posters In This Topic

Can you update with the vehicle patch because there are a conflict with TARGET_AREAEFFECT_CUSTOM_2.

In vehicle patch TARGET_AREAEFFECT_CUSTOM_2 is similar that TARGET_AREAEFFECT_CUSTOM.

With the Strand of the Ancients patch provided by Rage Hunter i have a crash when i destroyed a gate with a vehicle.

Link to comment
Share on other sites

    class GameObjectInRangeCheck
   {
   public:
       GameObjectInRangeCheck(float _x, float _y, float _z, float _range) : x(_x), y(_y), z(_z), range(_range) {}
       bool operator() (GameObject* go)
       {
           return go->IsInRange(x, y, z, range);
       }
   private:
       float x, y, z, range;
   };

this function cause the crash....we need to do more research on it, server crash when you are in range of some normal gameobjects

Link to comment
Share on other sites

Ok there is the final release of Destructible Buildings, tested and seems to works fine and stable.

http://paste2.org/p/841160

Also fixed gameobject crash encountered in lastest Destructible Buildings revision.

Please test and give ur feedbacks thanks :)

EDIT : This patch works but is still unstable when we are in range of gameobjects with quests, atm i don't know how to fix this problem, if someone know how to fix this, post it :)

Link to comment
Share on other sites

Can you update with the vehicle patch because there are a conflict with TARGET_AREAEFFECT_CUSTOM_2.

In vehicle patch TARGET_AREAEFFECT_CUSTOM_2 is similar that TARGET_AREAEFFECT_CUSTOM.

With the Strand of the Ancients patch provided by Rage Hunter i have a crash when i destroyed a gate with a vehicle.

Mathman, i don't have the patch for Strand of the Ancients, so i can't try by self if Destructible Buildings patch is still stable with this battleground....

please link me SoTA patch, and i will make a test :)

Link to comment
Share on other sites

This patch isnt for a clean mangos repo, may a patch for a clean repo would be easier to implement and test? Though it worked, i started testing with saronite bombs on one of the three wintergrasp towers in the south of the map, the bomb destroyed the tower in one try, the animations are working great but the tower "dies" directly.

Link to comment
Share on other sites

This patch isnt for a clean mangos repo, may a patch for a clean repo would be easier to implement and test? Though it worked, i started testing with saronite bombs on one of the three wintergrasp towers in the south of the map, the bomb destroyed the tower in one try, the animations are working great but the tower "dies" directly.

We may a patch compatible with vehicle patch

Link to comment
Share on other sites

Mmmm... I have applied the patch but I have a crash when I leave the BG. Here is the crashlog:

http://pastebin.com/vKq44D9J

EDIT: More exactly, server crashes when you exit using the pvp icon in the minimap. If you close the client, server doesn't crash, also if you use command .tele someplace, server doesn't crashes at all, so may be related to relocation of player when he abandon the bg? And debug says that is an assertion fault. Hope this can help.

EDIT2: On Ubuntu server doesn't crashes.

Link to comment
Share on other sites

Anyone can update SoTA+Buildings patch for clean mangos 9993+?

Good idea, because vehicles arent necessary for testing SotA gates (destructible building), we may test it at first with the bombs spawned at the docks and the vehicle factory and if that works without crashs, we add the vehicles...

In the SotA thread in russian mangos forum, there're two SotA patches, which one is the clean SotA patch without other modifications?

Link to comment
Share on other sites

Well, I have tested the patches from russian forums, but with Wotja's vehicles branch, and finally I got it working. You must apply the GO_type_33 and the SotA patch from ru-mangos, then fix conflicts/compilation errors. I can't post a patch updated because my branch is heavy modified, I have spend two days implementing this. Also, the servers crashes at windows as I have described in my previous post :/ and I don't know how to fix that. But, at least, we know that this works with the vehicles patch from this forums ^^

Link to comment
Share on other sites

ok... this all looks like good attempts to work on the modification and such but I am having one small problem with the communication in this thread.:

1.) why all the russian? ppl are supposed to be posting in english in this part of the forums

2.) whats the hubbub about copyrights.. the way i see it, if you want open source HELP you keep your patch OPEN SOURCE.. dont ask the community for help on a project if you are not going to share the final product with the community

3.) why is there a password on the patch? this sort of refers to #2... there is no reason to password something you intend to share with everyone, and if you do not intend to share it you shouldnt even bring it up in here.

aside from all that.. is the patch working or no on clean mangos apply...

and seriously.. to all those ppl that are always saying UPDATE UPDATE UPDATE... go buy some damn pampers.. i can understand if a patch is like several hundred revisions older than current, but seriously, is it THAT hard to open c++ and fix what doesnt apply correctly?! Do you REALLY need someone to do ALL the work FOR you? If so, you really have no business in the Developmental part of the forums to begin with ya leeches

Link to comment
Share on other sites

Ok HSC_Dev3...ok...don't get your panties in a bunch now....and in this forum we don't talk russian... We talk Matian!..get it right!...you greenie!

"Oh freddled gruntbuggly/thy micturations are to me/As plurdled gabbleblotchits on a lurgid bee.

Groop I implore thee, my foonting turlingdromes. And hooptiously drangle me with crinkly bindlewurdles,

Or I will rend thee in the gobberwarts with my blurglecruncheon, see if I don't!"

Link to comment
Share on other sites

Suddenly, I feel the urge to beat my brains in with a brick wrapped in a slice of lemon. Or is it just to go out and drink a few dozen Pan-Galactic Gargleblasters? :P

To be honest, I know enough to resolve simple conflicts, but rewriting code to fix things is just a little beyond my reach at this time. As such, I do feel a bit more gently towards those poor souls who think C++ is an improved vitamin, yet, that's no excuse not to learn how to use a diff utility for three-way merges.

As for the crashes, didn't the fellow who presented his version of a final patch say that quest objects were the cause? Doesn't that sound like a TYPE_MISMATCH error or is it a case of me knowing just enough to sound ignorant?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use