Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintentional self-gassing in Davik's Estate #49

Closed
DarthParametric opened this issue Apr 26, 2019 · 1 comment
Closed

Unintentional self-gassing in Davik's Estate #49

DarthParametric opened this issue Apr 26, 2019 · 1 comment
Labels
Module: Taris Issue occurs primarily on Taris

Comments

@DarthParametric
Copy link
Contributor

DarthParametric commented Apr 26, 2019

While in Davik's Estate (tar_m08aa), if you head from the guest quarters through the throne room, enter the northern room, AKA Barracks (Throne Room), and use the computer terminal there to gas the adjoining room, AKA Barracks (Storage), you can inadvertently kill some or all of the party if standing too close to the door. It seems the radius of the effect exceeds the boundaries of the room.

Reported by ebmar.

Here is the script (tar08_stargas) that is fired when gassing any of the rooms:

void sub1(string stringParam1, float floatParam2, int intParam3);

void sub1(string stringParam1, float floatParam2, int intParam3) {
	object oWP = GetWaypointByTag(stringParam1);
	object oPC = GetFirstPC();
	if (GetIsObjectValid(oWP)) {
		effect efVisual = EffectVisualEffect(3006, 0);
		ApplyEffectAtLocation(0, efVisual, GetLocation(oWP), 0.0);
		object oNearest = GetNearestCreature(0, 6, oWP, 1, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
		int int2 = 1;
		while ((GetIsObjectValid(oNearest) && (GetDistanceBetween(oNearest, oWP) <= floatParam2))) {
			{
				float float2 = (3.0 + (IntToFloat(d10(1)) / 10.0));
				float float4 = ((float2 + 1.0) + (IntToFloat(d20(1)) / 10.0));
				if (((GetIsFriend(oNearest, oPC) || GetIsNeutral(oNearest, oPC)) && (intParam3 == 0))) {
					DelayCommand(float2, ApplyEffectToObject(1, EffectChoke(), oNearest, 3.0));
					DelayCommand(float4, ApplyEffectToObject(2, EffectPoison(2), oNearest, 0.0));
				}
				else {
				if ((GetIsEnemy(oNearest, oPC) || (intParam3 == 1))) {
					DelayCommand(float2, ApplyEffectToObject(1, EffectChoke(), oNearest, 10.0));
					DelayCommand(float4, ApplyEffectToObject(0, EffectDeath(0, 1), oNearest, 0.0));
				}
				}
				(int2++);
				oNearest = GetNearestCreature(0, 6, oWP, int2, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
			}
		}
	}
}

void main() {
	DelayCommand(1.5, sub1("Xterminal1", 10.0, 1));
	DelayCommand(1.5, sub1("Xterminal2", 10.0, 1));
	DelayCommand(1.5, sub1("Xterminal3", 10.0, 1));
	DelayCommand(1.5, sub1("Xterminal4", 10.0, 1));
}
@DarthParametric DarthParametric added the Module: Taris Issue occurs primarily on Taris label Apr 26, 2019
@JCarter426
Copy link
Contributor

Fixed, thanks to the power of basic geometry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Taris Issue occurs primarily on Taris
Projects
None yet
Development

No branches or pull requests

2 participants