Page 1 of 2
Rest timer suppression on Arena
Posted: Tue Dec 06, 2016 7:21 am
by Shad
As it is.. to support for training, tutoring between mages, and learning mechanics of lots of our new spells, suggest there would be an area where it would be possible to rest at will. Possibly Arena in Northerns Farmlands? also arenas in guildhalls.
Re: Rest timer suppression on Arena
Posted: Tue Dec 06, 2016 7:43 am
by Kiran
Great idea and bad.
You are near some good xp areas - people could easily abuse it by going in, blowing lots of spells, run back out, rest at arena, repeat.
Very nice way for a blaster to level thats for certain.
Re: Rest timer suppression on Arena
Posted: Tue Dec 06, 2016 8:57 am
by Shad
Once decision be made, that would be fine details. If it should not be abused - it wouldn't.
Re: Rest timer suppression on Arena
Posted: Fri Dec 09, 2016 5:00 pm
by Shad
Also to make arenas a place where its impossible to die.
Re: Rest timer suppression on Arena
Posted: Fri Dec 09, 2016 6:24 pm
by ValerieJean
chambordini wrote:If somehow we could deplete all of your uses on abilities and spell casts after you leave the arena, and making you wait a regular rest cooldown, it could work, dunno if it's possible though, sounds like too much work for very little gain.
I believe with a proper script it could be placed as a trigger outside of it.
onTrigger or enter trigger cant recall off the top of my head remove buffs etc
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 4:40 am
by Shad
If we'll really talk how, it may be bit more complicated, for there are multiple ways of leaving, including teleports and worse. But no matter how one leaves, to abuse this one should return. I'd for starters make the whole area covered in invisible trigger, and placed script at OnEnter that would disallow consecutive entering if there were no leaving, or timer did not expired - something like this:
OnEnter:
Code: Select all
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)||GetIsDM(oPC)||GetIsObjectValid(GetItemPossessedBy(oPC, "S_Arena_Ticket"))) return;
location lAway;
if (GetLocalInt(oPC, "S_Arena_Entered")||GetLocalInt(oPC, "S_Arena_Timer"))
{
SetCutsceneMode(oPC, TRUE);
SendMessageToPC(oPC, "You cannot enter now");
SendMessageToAllDMs(GetName(oPC)+" may be abusing arena");
AssignCommand(oPC, JumpToLocation(lAway));
SetCutsceneMode(oPC, FALSE);
return;
}
SetLocalInt(oPC, "S_Arena_Entered", TRUE);
SetLocalInt(oPC, "S_Arena_Timer", TRUE);
int nTimer = GetLocalInt(oPC, "ValidRestTimer");
DelayCommand(IntToFloat(nTimer), SetLocalInt(oPC, "S_Arena_Timer", FALSE));
}
OnExit:
Code: Select all
object oPC = GetExitingObject();
if (!GetIsPC(oPC)||GetIsDM(oPC)) return;
SetLocalInt(oPC, "S_Arena_Entered", FALSE)
p.s. This is rough work, made in half an hour. But you've got an idea.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 4:48 am
by Aspect of Sorrow
Shorter and easier is to require a normal rest first on the original timer with the area value check, all subsequent rests being suppressed which solves the abuse question and doable in two lines. This way the area designers aren't required to handle onenter/onexit/trigger events. Refactor for getnearestwaypoint usage with range for WP in existing areas than new areas altogether.
Code: Select all
(GetLocalInt(GetArea(oPC), "restSuppress") == 1) ? intflag1 : intflag2; // Handle timer change boolean
Code: Select all
(GetLocalInt(oPC, "restSuppressPC") == 0) ? SetLocalInt() : SetLocalInt() // For handling temporary onpc suppression after first rest timer threshold in area.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:14 am
by Shad
Aspect of Sorrow wrote:Shorter and easier is to require a normal rest first on the original timer with the area value check, all subsequent rests being suppressed which solves the abuse question and doable in two lines. This way the area designers aren't required to handle onenter/onexit/trigger events. Refactor for getnearestwaypoint usage with range for WP in existing areas than new areas altogether.
Code: Select all
(GetLocalInt(GetArea(oPC), "restSuppress") == 1) ? intflag1 : intflag2; // Handle timer change boolean
Code: Select all
(GetLocalInt(oPC, "restSuppressPC") == 0) ? SetLocalInt() : SetLocalInt() // For handling temporary onpc suppression after first rest timer threshold in area.
Ok, this is one way of allowing sequential rests in the area/near the waypoint. Its the same literally as checking if PC is inside a trigger, only trigger allows for any shape.
But how it prevents abuse that
chambordini mentioned - resting normal, leaving, blasting, returning-resting with suppressed timer, leaving, blasting, returning etc? How exactly would you require normal rest first any time abuser returns?
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:30 am
by Aspect of Sorrow
The trigger's shape runs checks for every one of it's points before it validates the object in it's space. Let's assume a trigger is drawn in an oval shape as much as it can in an arena area, and there's about ten points drawn (five hemispheric points on one side, five on another). All three floats are calculated against the next angle / point float, etc, 30 in this example (vector(hash.x, hash.y, hash.z)).
The area check is a single mnemonic pointer move to the area object, and one or two increment (inc eax) counters to the register for validation.
The WP approach is another mnemonic pointer move to the PC object, validating it's x,y,z difference between it and the two mnemonic moves to the WP object's vectored position, for 6 calculated contexts in the clock cycle.
Trigger is speedier than GetNearestWP only if the trigger has less than five points. The area validator is the fastest of them.
----
My claim is that area one alone will suffice, and is the most expedient of the options.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:32 am
by Aspect of Sorrow
The prevented abuse is to ensure validation of the area/trigger/getwp location as the first action of any rest, the first ternary example I gave, though in practice would be an if else to shorten up general waste in logic.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:38 am
by Shad
With great respect to your knowledge of inside mechanics behind the functions, comparing trigger with distance to WP. But its don't even need that to understand that checking single variable on Area would be more efficient, only disadvantage being area approach would only allow for designated areas for arenas, nothing like exterior building arena near the Gate.
Aspect of Sorrow wrote:The prevented abuse is to ensure validation of the area/trigger/getwp location as the first action of any rest, the first ternary example I gave, though in practice would be an if else to shorten up general waste in logic.
Well, the abuser would return to rest in "allowed" area, not firing the onrest script in between.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:40 am
by Aspect of Sorrow
I realized that I wasn't clear, my vouch is the area only version of my suggestions without needing a onenter/onexit addition being made.
The getnearestwp was an optional alternative, not a requisite.
The arenas could be all put into a single interior, differently themed, but would reduce the need of multiples externally.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:47 am
by Shad
My example was only about preventing consecutive enter/leave/enter/etc. Easily applicable to designated area in place of trigger.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:48 am
by Aspect of Sorrow
Using a DelayCommand removal of the onpc variable would fix that without onenter/onexit.
10 casts, each once a round for 6 seconds, are likely their buffs and maybe one spell. A removal of the variable after one minute would suffice.
Re: Rest timer suppression on Arena
Posted: Sat Dec 10, 2016 5:54 am
by Shad
Wiping as you wrote, should also work, I even like it more.
DelayCommand (in my example too) is not best client side crash-proof, so OnEnter (area or trigger, whatever design would need) I think would be better, because we already have reliable rest timer.
Now, as mentioned before, working out fine details only took an hour I think.
btw can use same variable that suppress rest - to suppres normal death scripts.