Seeking help with new promotion script

Psychic_Llamas

Wizard in the Making
Joined
Nov 25, 2005
Messages
6,366
Location
Western Australia
Hi,

im working on the WH mod (a mod based on FfH script) to make new spells. and i have this idea that will require a new python script. i expect it shouldnt be too difficult to do for some of you more experienced code writers, but it is currently beyond me :p

this is what i want to do:

SPELL: SUMMON SPITE SWARM:
---Buff Spells
---AddPromotionType1-'Spite Swarm'. uses mechanism that FfH 'mutation' does in that it gives each unit in the stack a random promotion (all permanent) selected from the list below:
-A Blight of terrors (unit causes Fear)
-A befuddlement of Mischiefs (can cast "Mischiefs" spell which adds the 'stupidity' promotion to the nearest enemy unit.)
-A Murder of Spites (+1 poison attack bonus and +1 first strike)
-A Muster of malevolents (+1 magic and 1 +poison attack bonus)
-An Annoyance of Netlings (counters opponents first strike bonuses)
-A Resplendence of Luminescents (+2 magical attack damage)
-A Lamentation of Despairs (one use only, can cast "Despairs" spell. target unit takes leadership test, or lose 75% strength permanently. dosnt effect heroes.)
-A Cluster of Radiants (unit is more resistant to magic)
-A Pageant of Shrikes (unit can cast "shrikes' on target unit (selected from stack like assassins) which deals 30% poison damage.)

this means that the unit who casts this spell causes 1 of those promotions to be added to each unit in the casters stack (the promotion differes for each unit.)

so can someoene supply me with some python code that does this in the correct format?
 
Another thing i would liketo be able to do, (nothing to do with promotions) is to make an improvment which upgrades like a cottage, but at each level, there are different effects:
IMPROVEMENT_COMET_MARKER
all levels are invisible to all players except the one who cast it.
level 1: 20% chance of comet striking area and damaging unit on the tile with a minimum of 20 and maximum of 40.
level 2: 40% chance of comet striking area and damaging units on the tile and 1 tile away with a minimum of 40 and maximum of 60.
level 3: 60% chance of comet striking area and damaging units on the tile and 2 tiles away with a minimum of 60 and maximum of 80.
level 4: 80% chance of comet striking area and damaging units on the tile and 3 tiles away with a minimum of 80 and maximum of 100.
level 5: 100% chance of comet striking area and damaging units on the tile and 3 tiles away with a minimum of 99 and maximum of 100.
 
for SUMMON SPITE SWARM I suggest you create an array of each of the effects. Then when you are iterating through each unit, run a random number generator to randomly pick from the array one of the effects(promotions) and apply it to the unit.
 
Python tutorial from python.org

There are a number of civ4 specific tutorials as well, in the tutorials index. While the first can introduce you to the basics of python, the others are more helpful(for civ4) if you have a grasp on programming in general.
 
Back
Top Bottom