Aller au contenu

Photo

Alteration to Tensers transformation


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
Imperator

Imperator
  • Members
  • 64 messages

So I'm trying to make a quick and dirty fix for this spell to make it more useful for pve/pvp on a server I play on. I removed the polymorph and in lieu of that I added a simple feature where the caster will lose their bonuses if they cast a spell, but it automatically removes the bonuses a second after casting tensers. :(

 

Anyone know why?

 

//eLink and eHP are of course the ab from tensers, the bonus attacks + the temporary HP

 

object oSelf = OBJECT_SELF;
    if(GetCurrentAction(oSelf) == ACTION_CASTSPELL)
    {
    DelayCommand(1.0, RemoveEffect(oSelf, eHP));
    DelayCommand(1.0, RemoveEffect(oSelf, eLink));
    }



#2
LoA_Tristan

LoA_Tristan
  • Members
  • 40 messages
If you just have this check sitting at the end of the tenser spell script, it performs the check instantly and exactly once, at the moment the spell is cast. The statement will always evaluate true at this time - caster's current action during the spell's script is 4, aka ACTION_CASTSPELL.

I don't know much about retrieving effects and spell crap generated by a different script. Assuming it works ok, you can have the spell script trigger a self-re-running script on the caster that checks every second or so for a casting action and kills the effects.

something like
void main()
{
   if (GetHasSpellEffect(184)) // tenser's SPELLID
   {
      if (GetCurrentAction() == 4) // casting while tenser is on, nyoooo~~~
      {
         effect eToRemove = GetFirstEffect(OBJECT_SELF);
         while (GetIsEffectValid(eToRemove))
         {
            if (GetEffectSpellId(eToRemove) == 184) RemoveEffect(OBJECT_SELF, eToRemove);
            eToRemove = GetNextEffect(OBJECT_SELF);
         }
      }
      else DelayCommand(1.0, ExecuteScript("this_very_script_again", OBJECT_SELF));
      // See ya again in 1.0 seconds!
   }
}
Can't think of a less cpu-intensive way to do it
  • Imperator aime ceci

#3
Imperator

Imperator
  • Members
  • 64 messages

Thanks for the help, I'm unsure where to put the ExecuteScript("this_very_script_again", OBJECT_SELF);

 

in the main script, if I put it at the beginning it at prevents the spell from stacking, which is good. But doesn't remove it on cast.

 

and if I put it at the end it removes it immediately as the spell is cast, as it did before :[



#4
kalbaern

kalbaern
  • Members
  • 824 messages

The only thing I can think of would be to have the remove effects section added to every other wizard/sorcerer spell and fire when those cast.



#5
LoA_Tristan

LoA_Tristan
  • Members
  • 40 messages
the initial execution should be a delayed command line somewhere in nw_s0_tenser (or whatever it is called). It should not matter where. The delay should be long enough to prevent the loop script from starting while this spell is being cast, but short enough to detect a new hasted spell (3 seconds?)

DelayCommand(3.0, ExecuteScript("that_script_posted_up_There", OBJECT_SELF));
  • Imperator aime ceci

#6
Imperator

Imperator
  • Members
  • 64 messages

Thanks for the help again, I ended up needing to change the "See ya again in 1 seconds!" to "See ya again in 2 seconds!"; else it wouldn't work and would never catch the caster casting spells :[ ... now it seems to work fine.



#7
Shadooow

Shadooow
  • Members
  • 4 465 messages

if you want to prevent spellcasting in tenser why not apply 100% spell failure?



#8
Imperator

Imperator
  • Members
  • 64 messages

If we apply spell failure, without giving the caster a way to opt out of Tensers then they're locked in that spell.

 

I would use spell failure however if I could figure out a way to make a chat command unbuff tensers, but I dunno how to do that yet.



#9
Asymmetric

Asymmetric
  • Members
  • 165 messages

I'd recommend using spell hooks. It's a convenient way to modify all spells at the same time. Inside your custom spell script you'd just have to check for Tensers with GetHasSpellEffect(184) and call SetModuleOverrideSpellScriptFinished() to cancel execution of the original spell script (or cancel Tensers Transformation)



#10
Terrorble

Terrorble
  • Members
  • 193 messages


If we apply spell failure, without giving the caster a way to opt out of Tensers then they're locked in that spell.

 

I would use spell failure however if I could figure out a way to make a chat command unbuff tensers, but I dunno how to do that yet.

 

I haven't tested, but I think you can do something like this to remove all the effects of Tenser's via you module OnPlayerChat script:

#include "x0_i0_spells"
void main()
{
    string sChat = GetPCChatMessage();
    object oPC   = GetPCChatSpeaker();
 
    if( sChat == "endTensers" )
    {
        RemoveSpellEffects(SPELL_TENSERS_TRANSFORMATION,oPC,oPC);
    }
}