Making Scripted spells

Post » Tue Jul 12, 2011 2:48 am

Hi folks!

I've reached a point developing my mod, where I have to use scripts in spells in order to create new spells. I explored the scripts at Scripted spells, and similar mods, but I got no clue of how to link an script to a spell

I have two spells, wich I have to make:

Remove SunDamage 30 secs. -> I think, on simply make a DeleteSpell only for 30 secs, is it possible?

Summon Creature 30 secs -> This seems more simple, but still I have no idea on link the script with the spell.

Lots of thanks.
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Tue Jul 12, 2011 2:30 am

It will basically boil down to running global variables and a start script (Tribunal required for this IIRC). http://www.gamesas.com/index.php?/topic/1113264-how-do-i-make-a-summon-spell/page__p__16339097__hl__summoning__fromsearch__1#entry16339097 discussing the summoning effect, and the same principles can be applied to any "spell detect->do something else" scenario.
User avatar
Chenae Butler
 
Posts: 3485
Joined: Sat Feb 17, 2007 3:54 pm

Post » Tue Jul 12, 2011 1:31 am

Here are two samples of scripts used to summon a creature, taken from one of Calishan's mods, that may give you some ideas. Both are annotated with useful comments by the author:
begin sm_spidersummonG_00 ;;Make Startscriptif ( player->getspelleffects, "SM_SpiderGreater_sp" == 1 )	player->removeSpellEffects, "SM_SpiderGreater_sp";		playsound "conjuration area"		Placeatpc "cali_SM_Spider_med" 1 128 1endifend


begin sm_spiderG_01 ;;Put on Creaturefloat timershort countshort doOnceif ( doOnce == 0 )aifollow, player, 0, 0, 0, 0set doOnce to 1endifIf ( OnActivate )returnendifif ( GetDisabled == 1 );the creature has been disabledset count to ( count + 1 )if ( count == 5 )DontSaveObject;make sure it isn't saved (duh!)SetDelete, 1;delete it from current gameendifendifif ( MenuMode == 1 );make sure it doesn't count during inventory and dialogueReturnendifset timer to ( timer + GetSecondsPassed )if ( timer < 30 );don't do anything until 30 seconds have passedreturnendifDisableend


Hope this is helpful

DARoot
User avatar
Stacy Hope
 
Posts: 3391
Joined: Thu Jun 22, 2006 6:23 am


Return to III - Morrowind