Author Topic: scripting spells  (Read 6865 times)

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
scripting spells
« on: January 05, 2005, 08:30:50 AM »
Is there anyone here who can tell me what command(s) I have to use to change a spell that it only affects hostile players? (like some spells on arivs or GS)
because I seem to be unable to figure it out  :(
I could change the hellball script that it won't affect the caster but it still affects all other players around  :(
Could anyone post an example please?

thx  :excl:
« Last Edit: January 05, 2005, 08:35:13 AM by Daniel1975 »
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
scripting spells
« Reply #1 on: January 05, 2005, 10:25:27 AM »
In the scripts you'll find a line like this:
if[/span] (spellsIsTarget(oTarget, [span style=\'color:orange\']SPELL_TARGET_STANDARDHOSTILE[/span], [span style=\'color:blue\']OBJECT_SELF[/span]))

change that to:

[span style=\'color:blue\']if[/span] (spellsIsTarget(oTarget, [span style=\'color:purple\']SPELL_TARGET_SELECTIVEHOSTILE[/span], [span style=\'color:blue\']OBJECT_SELF
))

This is so for most spells.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
scripting spells
« Reply #2 on: January 08, 2005, 07:28:40 AM »
I want to edit following spells:

- true strike
 (I like the idea to make the bonus for AB depending on spellcaster levels)

- balagharn's ironhorn
- true strike
- gust of wind

but where are they located?  :blink:
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
scripting spells
« Reply #3 on: January 08, 2005, 07:45:07 AM »
oh and talking about spells, I want to edit/change the spells a shifter gets depending on his form. Where do I have to make that?
(for example adding a spell to a form who has normally no spell-ability)
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
scripting spells
« Reply #4 on: January 08, 2005, 08:56:31 AM »
truestrike -> x0_s0_truestrike
iron horn -> x0_xsS0_ironhorn
gust of wind -> x0_s0_gustwind

The changes to the spell scripts can be compiled in the mod (you have to get their origenal scripts out of a sou or hotu patched toolset) or you can extract them from a .erf and put them in the overide directory.

To change shifter script you'll have to edit the 2da called polymorph.2da (look in the sources directory for them or extract them from 2dasource.zip)
To apply changes to the .2da put the edited one in the overide directory.

Order it gets loaded is, the origenal scripts, then the edited scripts (if they exist), then the overide directory (if the scripts exist there). The last loaded script takes effect.

-Mel

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
scripting spells
« Reply #5 on: January 08, 2005, 11:39:58 AM »
I want to edit the true strike spell.
I want to make it depending on GetCasterLevel.
I assume I will have to make some "if" conditions like

if GetCasterLevel(OBJECT_SELF)..........

but how do I have to script it correct?

I tried smt like:

int nCasterLvl = GetCasterLevel(OBJECT_SELF);
if (nCasterLvl =< 5 )
 { ....... and so on}

but then I got an error message.
How can I tell the script that when nCasterLvl is 5 or less than do this
and when nCasterLvl is 6 or between 6 and 10 then do this and so on...

 :blink:   :blink:
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
scripting spells
« Reply #6 on: January 08, 2005, 12:41:01 PM »
Quote
I want to edit the true strike spell.
I want to make it depending on GetCasterLevel.
I assume I will have to make some "if" conditions like

if GetCasterLevel(OBJECT_SELF)..........

but how do I have to script it correct?

I tried smt like:

int nCasterLvl = GetCasterLevel(OBJECT_SELF);
if (nCasterLvl =< 5 )
 { ....... and so on}

but then I got an error message.
How can I tell the script that when nCasterLvl is 5 or less than do this
and when nCasterLvl is 6 or between 6 and 10 then do this and so on...

 :blink:   :blink:
[snapback]15177[/snapback]
Post the script here. For the bonus you get depending on the casterlevel I would use a calculation. Something like
Code: [Select]
int ab = GetCasterLevel(OBJECT_SELF) *2;This makes 20 ab on level 10 wiz/sorc (can't go over 20), 10 ab on level 5 sorc/wiz, and so on. This is just a example.

Also this makes the script shorter, you only have to use the variable ab in the function that aplly the ab effect.

(This is reply on made on less than a minute :P I'm busy)

-Mel
« Last Edit: January 08, 2005, 12:41:23 PM by Tea-cup »

Offline Daniel1975

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • http://
    • Email
scripting spells
« Reply #7 on: January 11, 2005, 04:39:10 AM »
Now I'm looking for two other spells:

Mestil's acid aura & Elemental shield


under what name are they saved?  :blink:

I searched and search...  :glare: may be I have tomatoes on my eyes  :D

...


oops...already found them! Thanks anyway  :P
« Last Edit: January 11, 2005, 04:51:35 AM by Daniel1975 »
G[/span][span style=\'color:orange\']w[/span][span style=\'color:yellow\']y[/span][span style=\'color:green\']d[/span][span style=\'color:blue\']i[/span][span style=\'color:purple\']on[/span] - Slann [span style=\'color:red\']Lord[/span] of the [span style=\'color:green\']Antediluvians