PDA

View Full Version : Valkyrie's Javelin



DDKL
09-05-2009, 06:00 PM
Fiddlin' around with the games data files I came across the code for valkyrie's javelin and this interesting section within it.

<damage effecttype="Magic" amount="90,180,270,360" />
<condition test="distance lt 300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="500"/>
</condition>
<condition test="distance ge 300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="1000"/>
</condition>
<condition test="distance ge 450" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="1500"/>
</condition>
<condition test="distance ge 600" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="2000"/>
</condition>
<condition test="distance ge 750" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="2500"/>
</condition>
<condition test="distance ge 900" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="3000"/>
</condition>
<condition test="distance ge 1050" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="3500"/>
</condition>
<condition test="distance ge 1300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="4000"/>
</condition>
<condition test="distance ge 1450" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="4500"/>
</condition>
<condition test="distance ge 1500" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="5000"/>
</condition>

There are a few curious things there. First one being the way the ability has been coded; why not use a simple function instead of such horrendously large and unnecesarily complicated wall of text? Stuntime = distance/300 would allow for much more precision and simplicity.
Edit: Actually the target- and proxy-entity dependent script could be replaced with one that calculates the distance based on the time javelin has existed.

The second curiosity regards the distance dependency. The four last values are 1050, 1300, 1450, 1500. (250, 150, 50 being the differences) So what I'm wondering is wether this is just a mistake or is it intentional?

ElementUser
09-05-2009, 06:07 PM
Every 150 distance the Javelin travels, 0.5 seconds of stun is added. 1500 distance for 5 second stun time.


The second curiosity regards the distance dependency. The four last values are 1050, 1300, 1450, 1500. (250, 150, 50 being the differences) So what I'm wondering is wether this is just a mistake or is it intentional?


Elune's Arrow Code from Tales' Triggered Skill guide:


From the group the first unit is picked (is it random or has a pattern?), if there's a unit there, then recover the "OriginalX" and "OriginalY" from the cache, create a dummy unit (e00E), give it a storm bolt ability (A0L7) with its level set to the distance between the projectile current location and the Original location divided by 150 or 10, whichever is lower.

After everything, if there's no unit but the distance between the projectile current location and the original location is bigger than 1600 then the unit is killed and the timed function removed.

Based on this, I believe there is some error in porting Elune's Arrow over to Valkyrie's Javelin of Light. Numbers should be 1050, 1200, 1350, 1500.

But yeah, I agree your coding suggestion would be more optimal & accurate

Idejder
09-05-2009, 08:08 PM
I changed it to 1200 and 1350 for now. That was a typo as someone had their hand one key too far to the right on those keys.

ElementUser
09-05-2009, 08:34 PM
Thanks again Idejder :). You're really helpful at communicating S2's changes to the community & we appreciate that very much

_Archangel_
09-05-2009, 08:41 PM
Interesting. :)