• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Phased duel (pets work)

Rochet2

Moderator / Eluna Dev
I got a request a week ago to look into the pet phasing on the phased duel script from a while ago and now I checked it and it was pretty simple.
Decided to release the script as I cant see one released and even if there is one, it doesnt have the proper solution for the pet phasing.
This script also wont make the players lose their targets upon entering the phase.

What it does?
The script gets all players from 100 yard radius ( duel radius is 40-50 yd )
Checks what phases they use and then tries to find an unique unused phase.
If one is found, the duelers will be phased to that phase. Also their pets and the duel flag will be phased.
Their phases will be restored after duel ends.

Get it:
https://gist.github.com/Rochet2/8bffd9d0847f4269c174
 

Rochet2

Moderator / Eluna Dev
Any idea if this would work on 4.3.4 with or without minor adjustments?

Most likely needs a few edits since phasing changed on cata and likely the functions etc changed too.
Dont know if its major or minor edit. But as you can see, the script is mostly about phasing so it can be a big change in any case considering the size of the script.
 

tonka4ok

Enthusiast
The script is working fine on latest tc rev 76ca6ba, but there is a problem - the script gets you to another phase only when your PvP flag is turned on. Is there a way to change it so you can always get a phase ?
 
Last edited:

Rochet2

Moderator / Eluna Dev
The script is working fine on latest tc rev 76ca6ba, but there is a problem - the script gets you to another phase only when your PvP flag is turned on. Is there a way to change it so you can always get a phase ?

And a duel was actually started?
Since from that it sounds like no duel was ever triggered between the players. (script hook did not trigger)
 

tonka4ok

Enthusiast
And a duel was actually started?
Since from that it sounds like no duel was ever triggered between the players. (script hook did not trigger)
The duel started, yes. I was playing around with the duels and it seems that when I log in, I have to teleport somewhere and then it sarts working fine (although i get "No free phases" quite often and I'm the only one dueling in the server)
P.S When a gm appears to you ( .app ) when you are in the middle of a phased duel, the gm appears in that phase and no one can see him even after the duel ends
 
Last edited:

Rochet2

Moderator / Eluna Dev
The duel started, yes. I was playing around with the duels and it seems that when I log in, I have to teleport somewhere and then it sarts working fine (although i get "No free phases" quite often and I'm the only one dueling in the server)

Sounds like someone is in GM mode ;)
Should probably add some code to ignore players who are in GM mode.

When it doesnt phase, does it always send that error message?
 

tonka4ok

Enthusiast
Yep it does
P.S When a gm appears to you ( .app ) when you are in the middle of a phased duel, the gm appears in that phase and no one can see him even after the duel ends
EDIT: You are right, when someone near you is in GM mod everything gets messed up :)
 
Last edited:

Rochet2

Moderator / Eluna Dev
Yep it does
P.S When a gm appears to you ( .app ) when you are in the middle of a phased duel, the gm appears in that phase and no one can see him even after the duel ends
EDIT: You are right, when someone near you is in GM mod everything gets messed up :)

Ill try see later today if I can add some simple check to ignore GMs.
Also, about the appearing, I believe the appear code will make the GM go to your phase (the player appeared at).
This means that the GM needs to .gm on .gm off or similar to come back visible. Unsure though
 

Krisis

Emulation Addict
Sorry to revive, but is there any possible way you can upload it and add something so people out of duel can see people dueling but people dueling can't see people not dueling?

I mean, a lot of people just want to see other people dueling but they don't want to duel anyone. Maybe there is a possible way with something similar to .gm vis off and .gm on, if you have .gm vis off and .gm on you can see everything including people dueling but dueling people can't see you.
 

Rochet2

Moderator / Eluna Dev
Sorry to revive, but is there any possible way you can upload it and add something so people out of duel can see people dueling but people dueling can't see people not dueling?

I mean, a lot of people just want to see other people dueling but they don't want to duel anyone. Maybe there is a possible way with something similar to .gm vis off and .gm on, if you have .gm vis off and .gm on you can see everything including people dueling but dueling people can't see you.

This is not possible with phases or similar. Only with invisibility (like spells .. not doable to well) or coremodifications and this is intended only as a script, not a patch.
The GM visibility thing is a hard coded thing (so changing it also needs a patch). You can make ppl invisible with it, but not really well so that you can see them but they cant see you.
Things like that would require everyone to be invisible and you to be visible.

It would be easier to just to have everyone see everyone or neither see either.
Additionally could try some spells and mechanics similar to mind control that let you see with the player's perspective.

Im not going to make that, sorry.
However you or someone else could try making a workaround using those methods or making the coremod required. (Hint: WorldObject::CanNeverSee)
 

lavolpe

Epic Member
Hey, I used this script for my own project but I noticed something strange. If you use a hunter and set a trap on it's activation it just disappears. It does not trigger the spell. The trap is visible as object.

Another thing I noticed is that it doesn't display the countdown before the duel (Duel starts in 3...).

Could you take a look what is going on when you have a spare minute, please? Thanks in advance. If you need I will give you the script I use. It might be old but works for latest TrinityCore.
 

callmephil

Respected Member
Code:
void OnDuelStart(Player* firstplayer, Player* secondplayer) override

Maybe should be OnduelRequest ? because the duel is starting at 0 and not when the counting start.

Code:
void OnDuelRequest(Player* firstplayer, Player* secondplayer) override
 

Jpp

Administrator
Code:
void OnDuelStart(Player* firstplayer, Player* secondplayer) override

Maybe should be OnduelRequest ? because the duel is starting at 0 and not when the counting start.

Code:
void OnDuelRequest(Player* firstplayer, Player* secondplayer) override

Rethink your logic.
 

Krisis

Emulation Addict
Another thing I noticed is that it doesn't display the countdown before the duel (Duel starts in 3...).

I tested it and I see the countdown. It's logical because it changes your phase AFTER the countdown gets to 0 which is when OnDuelStart is activated and so, when the script is executed.

Confirmed the bug with traps, the traps are visible but they dissapear on their activation.
 
Top