Auto-Helix changing include

I hope others find this useful. It's code that examines what storm you have up, then adjusts your helix to match the storm. Or if there's no storm, it will check for natural double weather, and adjust to that element of helix. This code is based off of two people's, with alterations by myself. Ddaydj, and IneptVagrant.

Functionality: The code does two things. In the storms section, it focuses on casting either hailstorm or thunderstorm primarily. If you comment this part out, and uncomment that which is currently commented, it will cast storms that will either A: match the day, or B: turn whatever existing weather there is into double weather, or in the case of double weather it will simply cancel the spell. Secondly the helix section casts the helix that fits in with the current weather, and if no weather is currently up, it will cast a helix that matches the day. If you cast the helix again within 10 seconds, it will automatically cast Modus Veritas. That code was snatched from Inept… who has a ton of other useful code up here. Search for them and check it out.

Use: Simply set up a macro that does ”/ /autostorm” and another for ”/ /autohelix” and use them. (Take the spaces out)

This goes in your init.txt file, to setup the macros stated above:

//aliases for auto-helix/storm/weathernuke
alias autostorm sc var set Autostorm 1; input /echo ***Auto-Storming***; input /ma "Hailstorm" <me>
alias autohelix sc var set Autohelix 1; input /echo ***Auto-Helix***; input /ma "Cryohelix" <t>

The include has to be labeled in two places; In your var's section of the main xml like this –

<xi:include href="autohelix.xml" xpointer="/includes/include[@name='HelixVars']/*" />

And wherever your elemental magic rules are –

<xi:include href="autohelix.xml" xpointer="/includes/include[@name='HelixRules']/*" />

And finally the include file itself: autohelix.xml

<?xml version="1.0" encoding="utf-8"?>
<includes xmlns:xi="http://www.w3.org/2001/XInclude">
    <include name="HelixVars">
        	<!--  no touchy! -->
	<var name="ModusGo">no</var>	
        	<var name="ModusRecast">Ready</var>		
	<var name="PrevHelix">None</var>
        	<var name="Icehelix">Cryohelix</var>
        	<var name="Darkhelix">Noctohelix</var>
        	<var name="Thunderhelix">Ionohelix</var>
        	<var name="Lighthelix">Luminohelix</var>
        	<var name="Windhelix">Anemohelix</var>
        	<var name="Firehelix">Pyrohelix</var>
        	<var name="Earthhelix">Geohelix</var>
        	<var name="Waterhelix">Hydrohelix</var>      
        	<!-- no touchy! -->
        	<var name="Autostorm">0</var>
        	<var name="Autohelix">0</var>
        	<var name="stormIce">Hailstorm</var>
        	<var name="stormDark">Voidstorm</var>
        	<var name="stormThunder">Thunderstorm</var>
        	<var name="stormLight">Aurorastorm</var>
        	<var name="stormWind">Windstorm</var>
        	<var name="stormFire">Firestorm</var>
	<var name="stormEarth">Sandstorm</var>
	<var name="stormWater">Rainstorm</var>
	<!-- I'm broke, dont judge... put your HQ staves here 
		Note: You probably already have these vars in the main body(or somewhere else) of your main xml code.
		Yuo can just delete these if they are the same  un-comment these if you need them-->
	<!--
	<var name="IceStaff">Ice Staff</var>
	<var name="DarkStaff">Dark Staff</var>
	<var name="ThunderStaff">Thunder Staff</var>
	<var name="LightStaff">Light Staff</var>
	<var name="WindStaff">Wind Staff</var>
	<var name="FireStaff">Fire Staff</var>
	<var name="EarthStaff">Earth Staff</var>
	<var name="WaterStaff">Water Staff</var>
	-->
	</include>
	<include name="StormRules">
		<if advanced="$Autostorm=1">
			<!-- top part focuses on use of hailstorm/thunderstorm and prioritizes accordingly -->
			<if WeatherElement="Thunder|Ice">
				<changespell Spell="$storm%WeatherElement" />
			</if>
			<elseif DayElement="Fire|Thunder">
				<changespell Spell="Thunderstorm" />
			</elseif>
			<else>
				<changespell Spell="Hailstorm" />
			</else>
 
 
			<!-- bottom section doubles existing weather, or bases storm on the day--commented out for preference of author
			<if Advanced='"%Weather"="%WeatherElement x2"'>
				<cancelspell />
			</if>
			<elseif Advanced='"%Weather"="%WeatherElement"'>
				<changespell Spell="$%WeatherElementstorm" />
			</elseif>
			<else>
				<changespell Spell="$%Dayelementstorm" />
			</else>
			-->
 
			<!-- dont touch this -->
			<var cmd="set Autostorm 0" />
		</if>
	</include>
	<include name="HelixRules">
		<if spell="*Helix">
			<if advanced="$Autohelix=1">
				<!-- Auto-modus rules by ineptVagrant... brilliant stuff... slightly altered by me for purposes -->
				<if advanced='"$ModusRecast"=="Ready"'>
					<if advanced='"$ModusGo"=="yes"'>
						<action type="command">/ja Modus Veritas %spelltargetraw</action>
						<!-- if modus dies on use, it's the following line ... it is commented out in "otherspells.xml" -->
						<action type="command">sc var set Modusrecast notReady;wait 600;sc var set Modusrecast Ready</action>
						<action type="cancelspell" />
						<action type="return" />
					</if>
					<action type="addtochat">!!~~ Modus Veritas Ready ~~!!</action>
					<action type="command" when="midcast">
						sc var set ModusGo yes;
						wait 13;
						sc var set ModusGo no;
						sc var set PrevHelix none
					</action>
					<addtochat color="25">[ERROR] line 76</addtochat>
				</if>
				<!-- check to make sure we have weather -->
				<if WeatherElement="None">
					<addtochat color="25">[ERROR] There's no weather... idiot... defaulting to day... cast a storm next time</addtochat>
					<!-- ************convert helix spell to day, because there's no weather/storm ****** -->	
					<changespell Spell="$%Dayelementhelix" />
				</if>
				<else>
					<!-- ************convert helix spell to weather/storm ****** -->		
					<changespell Spell="$%WeatherElementhelix" />
				</else>
				<var cmd="set Autohelix 0" />
			</if>
			<!-- I have a set filled with all +int... change this to whatever you deem fit -->
			<!--EQ swaps commented out incase you have it elsewhere
			<equip when="precast" set="INT" />
			-->
			<!-- Equip appropriate staff -->
			<!--
			<equip when="midcast">
				<main>$%SpellElementStaff</main>
			</equip>
			-->
		</if>
	</include>
</includes>
plugins/spellcast/userxml/sch/mookys_autohelix.txt · Last modified: 2009/08/08 14:00 (external edit)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0