Need help to do a small script

Post » Wed Jul 13, 2011 9:31 am

Ok so i finally made my little mod that allow me to play as a dremora, but when i tried it, i feel like if it was inferior to other race... i mean, each race or almost each as a greater power or good buff, but he only has resist fire 33 and weakness to shock, to be sure, i checked uesp.net, and saw that dremora has resist to magick, but it depend on their ranks. Each rank = appear at certain level.

So i need a script that when the dremora reach X level, his natural buff get switched with the better one, until he reach the full buff.
So right here is wich rank enemy dremora get buff and the name of the ability(buff), followed at wich level my dremora should get it:
Rank 1: AbDremora0ChurllResist <--My dremora will start with this one
Rank 2: AbDremora1CaitlifflResist <-- Should get this one at level 8
Rank 3: AbDremora2KynvalResist <-- Should get this one at level 11
Rank 4: AbDremora3KynreeveResist <-- should get this one at level 14
Rank 5: AbDremora4KynmarcherResist <-- Should get this one at level 17
Rank 6: AbDremora5MarkynazResist <-- Should get this one at level 21
Rank 7: AbDremora6ValkynazResist <-- Should get this one at level 24


So what i want is that when my character lvl up, the script check if my player is a DremoraPlayable then check if the player has reached the the corresponding lvl and also if the DoOnce variable is ok, and if yes, remove the previous ability, and give the new one and set the DoOnce to the corresponding rank.

So im not sure exactly how to do that.
I will try, and if wrong, correct me, never did script in oblivion, but i know C programming language.

Begin OnLevelUpShort DoOnce;If (Player.GetIsRace == DremoraPlayable){If (Player.LVL >= 8 && DoOnce == 0){Player.RemoveSpell(AbDremora0ChurllResist);Player.GiveSpell(AbDremora1CaitlifflResist);DoOnce = DoOnce++;}Else If (Player.LVL >= 11 && DoOnce == 1){Player.RemoveSpell(AbDremora1CaitlifflResist);Player.GiveSpell(AbDremora2KynvalResist);DoOnce = DoOnce++;}Else If (Player.LVL >= 14 && DoOnce == 2){Player.RemoveSpell(AbDremora2KynvalResist);Player.GiveSpell(AbDremora3KynreeveResist);DoOnce = DoOnce++;}Else If (Player.LVL >= 17 && DoOnce == 3){Player.RemoveSpell(AbDremora3KynreeveResist);Player.GiveSpell(AbDremora4KynmarcherResist);DoOnce = DoOnce++;}Else If (Player.LVL >= 21 && DoOnce == 4){Player.RemoveSpell(AbDremora4KynmarcherResist);Player.GiveSpell(AbDremora5MarkynazResist);DoOnce = DoOnce++;}Else If (Player.LVL >= 24 && DoOnce == 5){Player.RemoveSpell(AbDremora5MarkynazResist);Player.GiveSpell(AbDremora6ValkynazResist);DoOnce = DoOnce++;}Else{Return 0;}}


I only need to insert that script then my mod is done, what my mod has special contrary to other dremora playable mod?
1- It use the default attribute and default skill, like the normal dremora, and same ability.
2- Compatible and require UOP to work: I downloaded a mod that made dremora playable, and in a conflict detector, it detected it modified some thing that UOP already modified, and bashed patch could to nothing (im not an expert in tag...), so i decided to use UOP to create one, that will not overwrite fixe.
3- As the dremora will lvl up, he will be better, by getting the same ability as the enemy dremora, the ability that resist magic.

When i will finish it, i will publish the result, i will also modify my mod to add the 2 other race added by shiviring isle playable, and i will do the same script if they have special levelled ability.

Also, one last thing: do i need to do anything else when i create a race about vampirisme? I don't know if my guy will be able to become vampire.
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Return to IV - Oblivion