PDA

View Full Version : TrinityCore-Multi [C++] Dungeon And Raid Dynamic Resurrection



callmephil
10-15-2016, 02:23 PM
Hey guys so it's been a long time i didn't release something, so here i am...

Dungeon and Raid Dynamic Player Resurrection is a simple script that add a kind of "Waypoint" when a boss in dungeon or in raid is killed so that player get Resurrected at this point if they die and release there body. this features got implemented on MOP+ by blizzard but they are static graveyard that are unlocked depending on the group progress.
at the moment i wanted to do something really easy to understand and script and use.

here's how it works :
Each time someone kill a Dungeon or Raid Boss it spawn an invisible mob that will stay for 2 hours or until instance got reset. When someone die and release his body after getting atleast one spawn point he will get resurrected at the last spawn point with 70 % of his health and mana. however if no spawn point are created usual graveyard will be used.

Since i do not have VS2015 at the moment i couldn't test it on a recent core so waiting for your replay !

here's the Diff : https://gist.github.com/callmephil/6bb933fdf772119c164b6f05b6369287
here's a video preview :

https://www.youtube.com/watch?v=T0X7V6lftqo

No SQL is Required unless you decide to change the spawn point entry wich is actually (1).

PS : Stay in touch new release based on this for world PvP and World Questing is coming !

Rochet2
10-15-2016, 03:19 PM
I would not be so sure this builds on linux.
It seems you do not declare Player or include other files that declare or define it and you use it in DynamicResurrection.h and DynamicResurrection.cpp and so on.
Same for sMapStore and so.

VS is very forgiving when it comes to stuff like this so Im sure it compiles on VS though.

Travis is easy to set up to test your stuff on TC for linux : )

callmephil
10-15-2016, 04:07 PM
I would not be so sure this builds on linux.
It seems you do not declare Player or include other files that declare or define it and you use it in DynamicResurrection.h and DynamicResurrection.cpp and so on.
Same for sMapStore and so.

VS is very forgiving when it comes to stuff like this so Im sure it compiles on VS though.

Travis is easy to set up to test your stuff on TC for linux : )

Thanks for poiting this out, i made some modifications it should works now.

Sylica
10-16-2016, 07:05 AM
Looks like a nice script you have here, and works nicely. Yes, this script works for Unix, with some warnings depending on GCC version. Hope to see some more scripts in the near future.

Best of luck.

callmephil
10-16-2016, 12:00 PM
Looks like a nice script you have here, and works nicely. Yes, this script works for Unix, with some warnings depending on GCC version. Hope to see some more scripts in the near future.

Best of luck.

Thanks for the motivating comment, let me know if have to modify stuff for Unix Warnings, i'm lightly working and so much new features but i have only restricted free time.

Rochet2
10-16-2016, 12:59 PM
Disclaimer: I did not compile the code or anything

is there a typo here?
C_Resurrection_ENTRY
C_RESURECTION_ENTRY

I think the warnings come from unused creature variables you have.
And from the double to float conversion from 0.7, need to use 0.7f if float is needed.

You should probably move

+ static Dynamic_Resurrection* instance()
+ {
+ static Dynamic_Resurrection instance;
+ return &instance;
+ }

into the .cpp file. There are reasons why TC did it to all their singletons.
You can look example from ObjectMgr.h and cpp for the instance member function.
See this commit for more info: https://github.com/TrinityCore/TrinityCore/commit/329225b40d110bed634f8cd0a1ab5c6dc7bbbdd1

Also, while I am at it, you can probably change this sMapStore.LookupEntry(player->GetMapId())->Instanceable() to this player->GetMap()->Instanceable() for faster check, though the benefit is negligible. .. but it may save you from a crash possibly.

callmephil
10-16-2016, 03:51 PM
Disclaimer: I did not compile the code or anything

is there a typo here?
C_Resurrection_ENTRY
C_RESURECTION_ENTRY

I think the warnings come from unused creature variables you have.
And from the double to float conversion from 0.7, need to use 0.7f if float is needed.

You should probably move


into the .cpp file. There are reasons why TC did it to all their singletons.
You can look example from ObjectMgr.h and cpp for the instance member function.
See this commit for more info: https://github.com/TrinityCore/TrinityCore/commit/329225b40d110bed634f8cd0a1ab5c6dc7bbbdd1

Also, while I am at it, you can probably change this sMapStore.LookupEntry(player->GetMapId())->Instanceable() to this player->GetMap()->Instanceable() for faster check, though the benefit is negligible. .. but it may save you from a crash possibly.

Thanks i applied those modifications i will test and push them tomorrow !

Sylica
10-16-2016, 04:43 PM
Disclaimer: I did not compile the code or anything

is there a typo here?
C_Resurrection_ENTRY
C_RESURECTION_ENTRY

I think the warnings come from unused creature variables you have.
And from the double to float conversion from 0.7, need to use 0.7f if float is needed.

You should probably move


into the .cpp file. There are reasons why TC did it to all their singletons.
You can look example from ObjectMgr.h and cpp for the instance member function.
See this commit for more info: https://github.com/TrinityCore/TrinityCore/commit/329225b40d110bed634f8cd0a1ab5c6dc7bbbdd1

Also, while I am at it, you can probably change this sMapStore.LookupEntry(player->GetMapId())->Instanceable() to this player->GetMap()->Instanceable() for faster check, though the benefit is negligible. .. but it may save you from a crash possibly.

Pretty much what the warnings were. Thanks for posting that, since I ran out of time last night.