Author Topic: Modified Scripts  (Read 8177 times)

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« on: January 01, 2005, 12:18:48 PM »
-okay, the new death arrow relies on the arcane archer's class lvl to determine the fort DC
-okay, the assassin arrows the script is done but i don't know how to script the EXACT line in the Module OnActivateItem something along the line of an ExecuteScript...but when i do it causes an error...


*if ya can help thanks...i'll prolly be post more scripts here
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
Modified Scripts
« Reply #1 on: January 01, 2005, 12:37:06 PM »
Quote
-okay, the new death arrow relies on the arcane archer's class lvl to determine the fort DC
-okay, the assassin arrows the script is done but i don't know how to script the EXACT line in the Module OnActivateItem something along the line of an ExecuteScript...but when i do it causes an error...


*if ya can help thanks...i'll prolly be post more scripts here
[snapback]14535[/snapback]
I'm not sure what yo uwant for the dc, but you can easy change it to what you like.
Code: [Select]
#include "X0_I0_SPELLS"
#include "x2_inc_itemprop"
int getlevel(object oPC)
{
     int lvl = GetLevelByPosition(1, oPC) + GetLevelByPosition(2, oPC) + GetLevelByPosition(3, oPC);
     return lvl;
}
void main()
{
    int nBonus = nBonus = ArcaneArcherCalculateBonus();
    object oTarget = GetSpellTargetObject();
    //set the dc to 10 + 2*arcane archers level
    //change it here if this isn't the dc calculation you want
    int iDC = 10 + (getlevel(OBJECT_SELF)*2);

    if (GetIsObjectValid(oTarget) == TRUE)
    {
        // * Roll Touch Attack
        int nTouch = TouchAttackRanged(oTarget, TRUE);
        if (nTouch > 0)
        {
            int nDamage = ArcaneArcherDamageDoneByBow((nTouch ==2));
            if (nDamage > 0)
            {
                effect ePhysical = EffectDamage(nDamage, DAMAGE_TYPE_PIERCING,IPGetDamagePowerConstantFromNumber(nBonus));
                effect eMagic = EffectDamage(nBonus, DAMAGE_TYPE_MAGICAL);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, ePhysical, oTarget);
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eMagic, oTarget);

                //Fire cast spell at event for the specified target
                SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));

                // * if target fails a save against iDC they die

                if (MySavingThrow(SAVING_THROW_FORT, oTarget, iDC) == 0)
                {
                    effect eDeath = EffectDeath();
                    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oTarget);
                }
            }
        }
    }
}
About the other script, could you say what the error is. It will prolly save me time so I'll wait till you post that :P

-Mel

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #2 on: January 01, 2005, 12:47:07 PM »
not really sure...i deleted the line, but all i need is what is the line to get an item's unique power(OnHit) to fire when it hits a player

"void ExecuteScript(string sScript, object oTarget)"
 -sScript would be the "assassinarrows" script
 -oTarget would be well...the target(which has to be a PC or creature)
dun tell me....

string sScript = assassinarrow;
object oTarget = GetNearestCreature();
ExecuteScript(sScript, oTarget);

<-something like that?


*and here's yet another script...i prolly forgot to put something down, it's completely compiled but i tested it and only did fire...
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #3 on: January 01, 2005, 01:06:45 PM »
NEVERMIND ABOUT THE SHIELD....sometimes it pays to LOOK at the bloody dmg type....i typed FIRE instead of COLD  :P


guess what....i tested it again and it STILL does 2 fire dmgs...

effect eShield = EffectDamageShield(nDuration, DAMAGE_BONUS_1d3, DAMAGE_TYPE_FIRE);
    effect eShield2 = EffectDamageShield(nDuration, DAMAGE_BONUS_1d3, DAMAGE_TYPE_COLD);

those 2 lines link to:

effect eLink = EffectLinkEffects(eShield, eCold);
eLink = EffectLinkEffects(eLink, eShield2);
*the eShield2 was based off: eLink = EffectLinkEffects(eLink, eVis);

those are suppose to be applied in this line:
//Apply the VFX impact and effects
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
« Last Edit: January 01, 2005, 01:25:13 PM by Khadgar of Dalaran »
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
Modified Scripts
« Reply #4 on: January 01, 2005, 01:09:06 PM »
Quote
not really sure...i deleted the line, but all i need is what is the line to get an item's unique power(OnHit) to fire when it hits a player

"void ExecuteScript(string sScript, object oTarget)"
 -sScript would be the "assassinarrows" script
 -oTarget would be well...the target(which has to be a PC or creature)
dun tell me....

string sScript = assassinarrow;
object oTarget = GetNearestCreature();
ExecuteScript(sScript, oTarget);

<-something like that?


*and here's yet another script...i prolly forgot to put something down, it's completely compiled but i tested it and only did fire...
[snapback]14538[/snapback]
Code: [Select]
   effect eShield = EffectDamageShield(nDuration, DAMAGE_BONUS_1d6, DAMAGE_TYPE_FIRE);
    effect eShield2 = EffectDamageShield(nDuration, DAMAGE_BONUS_1d4, DAMAGE_TYPE_FIRE);
No wonder it only does fire :P
How about changing DAMAGE_TYPE_FIRE to DAMAGE_TYPE_COLD for the 1d6 line?

And about activate item(onhit),  I think the normal way you use for activate item(cast) should work for activate item(onhit) too. Never did try it.

Anyway, I'll look at it later.

-Mel

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #5 on: January 01, 2005, 01:28:06 PM »
btw: in the interest of all those who would whine that Elemental shield is over powered i changed it to 1d6 fire and 3 cold SO PIKE OFF! (revised my post about saying the dmg type was fixed....it wasn't  :glare: )
« Last Edit: January 01, 2005, 01:32:34 PM by Khadgar of Dalaran »
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
Modified Scripts
« Reply #6 on: January 01, 2005, 02:37:36 PM »
Quote
btw: in the interest of all those who would whine that Elemental shield is over powered i changed it to 1d6 fire and 3 cold SO PIKE OFF! (revised my post about saying the dmg type was fixed....it wasn't  :glare: )
[snapback]14541[/snapback]
:huh: is it fixed now or not? Those post are a bit mixed you know :wacko:

Btw, always rebuild the mod a time, to be sure your changes are in effect.
You also can try whitout linking it and then link 1 by 1 to see where it goes wrong, if it doesn't works.

-Mel

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #7 on: January 01, 2005, 03:25:35 PM »
well it's sorta fixed....it does 2 instances of fire dmg per hit...or is it suppose to do that  :blink:
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
Modified Scripts
« Reply #8 on: January 01, 2005, 03:36:45 PM »
Quote
well it's sorta fixed....it does 2 instances of fire dmg per hit...or is it suppose to do that  :blink:
[snapback]14548[/snapback]
It should do 1 cold 1 fire if you changed that damage type and rebuild the mod.

Otherwise there might be something whit the linking.
Or did you take out the links?

-Mel

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #9 on: January 01, 2005, 03:39:36 PM »
i'm building the mod now...something tells me 200mb is not gonna be fun the build  :( as for the linking yep, but it still did only fire...think i gotta build
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Tea-cup

  • Hero Member
  • *****
  • Posts: 916
    • View Profile
Modified Scripts
« Reply #10 on: January 01, 2005, 06:28:06 PM »
Quote
i'm building the mod now...something tells me 200mb is not gonna be fun the build  :( as for the linking yep, but it still did only fire...think i gotta build
[snapback]14554[/snapback]
Somethimes I have to export everything and import everything i na fresh mod to make a script work, I dunno why exactly. But that already happend a few time to me.

-Mel

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #11 on: January 02, 2005, 09:54:26 AM »
well the Building worked...RDDs YO ASS IS GRASS NOW >:D
Our greatest glory is not in never falling but in rising everytime we fall.

Offline Illutian

  • Who knows what evil lurks in the hearts of Man...
  • Hero Member
  • *****
  • Posts: 891
  • The Legend Begins...
    • View Profile
    • Illutian
    • Email
Modified Scripts
« Reply #12 on: January 08, 2005, 11:35:52 PM »
okay, okay...this is giving me a hassle...i can't get the OnActivate to fire the script: assassinarrows.  i know it has to by an ExecuteScript("script", object);
but...well...the note is in the file already anyone have a clue what i did wrong

line goes like this:

object oArrows1 = AssassinsArrows; (do i need to put GetItemTagged(AssassinsArrows);  ?)
ExecuteScript("assassinarrows", oArrows1);
Our greatest glory is not in never falling but in rising everytime we fall.