Post by Boaster on Oct 31, 2005 0:39:53 GMT -6
The following is the Chaos Bolt spell, which I have created for my GS5B mod.
Originally, t3h chosen 1, asked me if I could make a bolt spell for Chaos that would cast random bolts spells which belong to other faiths. I thought that was a great idea, but I had no idea how to do it. With several attempts to create such a spell, I managed to pull it off! I recently learned a neat bit of coding recently that helped aid my cause.
That set of data allowed me to grab random sets of items. In conjuction with the /random_variable exch def I was able to punch in "random_variable" rather than have several instances of code.
So if you're looking for a single spell which will then randomly cast a select choice of spells, you will want to model it after my Chaos Bolt spell.
Enjoy! I know I will.
/name"Chaos Bolt"def /faith CHAOS def /image 3 def /mode COMBAT_SPELL def /target TARGET_ARMY def /mana 2 def /duration 300 def /level 2 def /research_cost 0 def /maintenance 0 def /range -1 def /barter_value_proc{200}def /book SPELL_CATEGORY_ATTACK def
/temporary_modifications << >> def
/permanent_modifications << >> def
/targeting_procedure{castdict begin /dummy begin
/proc exch def
/source_army_id SPELL_BEING_CAST SI_CASTING_ARMY getspellinfo def
/source_unit_num SPELL_BEING_CAST SI_CASTING_UNIT getspellinfo def
/army_id SPELL_BEING_CAST SI_ARMY_ID getspellinfo def
/unit_num SPELL_BEING_CAST SI_UNIT_NUM getspellinfo def
/spelldef_id SPELL_BEING_CAST SI_TYPE getspellinfo def
{lightning_spll curse rocksling fdart sparrow ribolt icebolt}0 6 gamerand get /randspell exch def
spelldict begin initcastdata CI_TYPE randspell setcastdata
CI_ARMY_ID army_id setcastdata
CI_UNIT_NUM unit_num setcastdata
CI_CASTING_ARMY source_army_id setcastdata
CI_CASTING_UNIT source_unit_num setcastdata
randspell SD_INVOKE_PROC getspelldefdata exec
end end}/dummy 15 dict replace bind def
/conjure_sound /c_handofate def /launch_sound /l_handofate def
/cast_ticks 5 def /recover_ticks 10 def
/temporary_modifications << >> def
/permanent_modifications << >> def
/targeting_procedure{castdict begin /dummy begin
/proc exch def
/source_army_id SPELL_BEING_CAST SI_CASTING_ARMY getspellinfo def
/source_unit_num SPELL_BEING_CAST SI_CASTING_UNIT getspellinfo def
/army_id SPELL_BEING_CAST SI_ARMY_ID getspellinfo def
/unit_num SPELL_BEING_CAST SI_UNIT_NUM getspellinfo def
/spelldef_id SPELL_BEING_CAST SI_TYPE getspellinfo def
{lightning_spll curse rocksling fdart sparrow ribolt icebolt}0 6 gamerand get /randspell exch def
spelldict begin initcastdata CI_TYPE randspell setcastdata
CI_ARMY_ID army_id setcastdata
CI_UNIT_NUM unit_num setcastdata
CI_CASTING_ARMY source_army_id setcastdata
CI_CASTING_UNIT source_unit_num setcastdata
randspell SD_INVOKE_PROC getspelldefdata exec
end end}/dummy 15 dict replace bind def
/conjure_sound /c_handofate def /launch_sound /l_handofate def
/cast_ticks 5 def /recover_ticks 10 def
Originally, t3h chosen 1, asked me if I could make a bolt spell for Chaos that would cast random bolts spells which belong to other faiths. I thought that was a great idea, but I had no idea how to do it. With several attempts to create such a spell, I managed to pull it off! I recently learned a neat bit of coding recently that helped aid my cause.
{exhibit_a exhibit_b}0 1 gamerand get
That set of data allowed me to grab random sets of items. In conjuction with the /random_variable exch def I was able to punch in "random_variable" rather than have several instances of code.
So if you're looking for a single spell which will then randomly cast a select choice of spells, you will want to model it after my Chaos Bolt spell.
Enjoy! I know I will.