Alter miracle spots! (script)

Willy

Administrator
Elder
Joined
Jul 27, 2011
Messages
130
/* INFO PLEASE READ!!!!!!
This script is for anyone who are making new miracles. This script find the 6 spots around
the alter no matter where or what angle it is place at.
If you are wondering why I us only globals, it is because local Variables can and will change
value sometimes which will wreak the math and the answers for this script.
DON'T DELETE "14/57.294" becuase this is the distance from the center to the out side
and the 57.294 is there because B&W2 calculations are off by 57.294 okay.
If you have anymore questions for me please leave a comment I am more then happy
to help, Thank you. -Willy */

define NUMBER_OF_ALTERS = 1

define script Alterspots

global sopt1 = 0
global sopt2 = 0
global sopt3 = 0
global sopt4 = 0
global sopt5 = 0
global sopt6 = 0
global Alter2[NUMBER_OF_ALTERS]
global Angle = 0
global Angle2 = 0
global Angle3 = 0
global Angle4 = 0
global Angle5 = 0
global Angle6 = 0
global AlterPos = 0
global AlterPos2 = 0
global SpotD = 0
global Landing = 0
global SpotD2 = 0
global AlterPos4 = 0
global AlterPos3 = 0
global spopt3 = 0
global Angle7 = 0
global oTown2 = 0

run script Alterspots
begin script Alterspots
//delete these local Variables when it is working
Visuu1 = 0
Visuu2 = 0
Visuu3 = 0
Visuu4 = 0
Visuu5 = 0
Visuu6 = 0
start
oTown2 = get town with id 0
begin loop
Alter2[0] = get building ABODE_NUMBER_ALTAR in oTown2 max built 1.0
until Alter2[0] exists and SCRIPT_OBJECT_PROPERTY_TYPE_BUILT_PERCENTAGE of Alter2[0] >= 0.999
end loop

Landing = land height at {Alter2[0]}
Landing -= 5.1
AlterPos = SCRIPT_OBJECT_PROPERTY_TYPE_XPOS of Alter2[0]
AlterPos2 = SCRIPT_OBJECT_PROPERTY_TYPE_ZPOS of Alter2[0]
SpotD2 = 3/57.294
Angle7 = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle7 += 90
sopt3 = marker at {AlterPos+SpotD2*cos Angle7, Landing, AlterPos2+SpotD2*sin Angle7}

Angle = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle += 12.758

Angle2 = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle2 -= 23.758

Angle3 = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle3 -= 59.4

Angle4 = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle4 -= 120.784

Angle5 = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle5 -= 192.758

Angle6 = SCRIPT_OBJECT_PROPERTY_TYPE_ANGLE of Alter2[0]
Angle6 -= 157.242

AlterPos3 = SCRIPT_OBJECT_PROPERTY_TYPE_XPOS of sopt3
AlterPos4 = SCRIPT_OBJECT_PROPERTY_TYPE_ZPOS of sopt3
SpotD = 14/57.294
sopt1 = marker at {AlterPos3+SpotD*cos Angle, Landing, AlterPos4+SpotD*sin Angle}
sopt2 = marker at {AlterPos3+SpotD*cos Angle2, Landing, AlterPos4+SpotD*sin Angle2}
sopt4 = marker at {AlterPos3+SpotD*cos Angle4, Landing, AlterPos4+SpotD*sin Angle4}
sopt5 = marker at {AlterPos3+SpotD*cos Angle5, Landing, AlterPos4+SpotD*sin Angle5}
sopt6 = marker at {AlterPos3+SpotD*cos Angle6, Landing, AlterPos4+SpotD*sin Angle6}
spopt3 = marker at {AlterPos3+SpotD*cos Angle3, Landing, AlterPos4+SpotD*sin Angle3}
//run background script yourmiraclescript
Visuu1 = create visual effect VISUAL_EFFECT_SIREN_BEAM at {sopt1} time -1
Visuu2 = create visual effect VISUAL_EFFECT_EPIC_VOLCANO_BEAM at {sopt2} time -1
Visuu3 = create visual effect VISUAL_EFFECT_EARTHQUAKE_BEAM at {spopt3} time -1
Visuu4 = create visual effect VISUAL_EFFECT_HURRICANE_BEAM at {sopt4} time -1
Visuu5 = create visual effect VISUAL_EFFECT_EPIC_VOLCANO_BEAM at {sopt5} time -1
Visuu6 = create visual effect VISUAL_EFFECT_EARTHQUAKE_BEAM at {sopt6} time -1

end script Alterspots

 
Back
Top