Author Topic: On Damaged  (Read 817 times)

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
On Damaged
« on: July 19, 2011, 07:17:11 am »


               get last attacker
get the pcs location within 20 feet and check the tags of all creatures within radius
if there are more then 4 apply haste to the tagged creatures

Can someone write this up?
               
               

               
            

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
On Damaged
« Reply #1 on: July 19, 2011, 08:52:22 am »


               Slightly confused about how you want it to work.

If I have it right, it should be:

-Player attacks creature
-Player's location is stored
-20f radius around the stored location is checked for creatures with 'x' tag
-Continue if more than 4 creatures
-Any creatures with 'x' tag are hasted

Do I have that right?
               
               

               
            

Legacy_La Rose Noire

  • Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
On Damaged
« Reply #2 on: July 19, 2011, 03:39:43 pm »


               There is no OnDamaged event for players (if I understand well what you want).
               
               

               


                     Modifié par La Rose Noire, 19 juillet 2011 - 02:40 .
                     
                  


            

Legacy_CID-78

  • Sr. Member
  • ****
  • Posts: 261
  • Karma: +0/-0
On Damaged
« Reply #3 on: July 19, 2011, 05:17:57 pm »


               well i can only agree. with the lack of a good description of what you want. Rubies translation isn't the same i would translate it into. and there is alot of missing information. alot of Tag talk but what are you refering to. creature of thre same sort, creature with a specific tag, or just creature and you can ignore the tag talk.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
On Damaged
« Reply #4 on: July 19, 2011, 11:29:34 pm »


               So is the idea that when the PC gets damaged that somehow inspires the oppostion, who get hasted in an attempt to finish off the damaged PC?  That is if there are more than 4 of them, in this case 20 witnin meters of the PC.  You might want to do something like checking if the PC is down half their hits and then apply the haste effect, if I am on the right track.  Also applying this effect only once.  I have some creatures that I add an extra attack to if the PC is badly wounded, hasting seems a bit over the top, unless it's for a very short duration.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
On Damaged
« Reply #5 on: July 20, 2011, 12:57:02 am »


               

La Rose Noire wrote...

There is no OnDamaged event for players (if I understand well what you want).


It can be scripted however.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
On Damaged
« Reply #6 on: July 20, 2011, 01:03:53 am »


               

ShaDoOoW wrote...

La Rose Noire wrote...

There is no OnDamaged event for players (if I understand well what you want).


It can be scripted however.


How? By applying temp prop onhits to all pc armor? Or are you referring to the recent plugin by leo? It only seems to allow adding damage. Do you know of some other way?

Thanks,
Funky
               
               

               
            

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
On Damaged
« Reply #7 on: July 20, 2011, 01:23:12 am »


               Maybe explaing it again will make it clearer

When a creature"bad guy" is damaged get the last attackers position and check all creatures within a 20 foot radius.If there taq is "random tag" and there are four creatures in that circle ...........haste any creatures with the tag"random tag"

Thats kinda what i need but i cant write script
               
               

               


                     Modifié par Builder_Anthony, 20 juillet 2011 - 12:25 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
On Damaged
« Reply #8 on: July 20, 2011, 01:56:50 am »


               

FunkySwerve wrote...

ShaDoOoW wrote...

La Rose Noire wrote...

There is no OnDamaged event for players (if I understand well what you want).


It can be scripted however.


How? By applying temp prop onhits to all pc armor? Or are you referring to the recent plugin by leo? It only seems to allow adding damage. Do you know of some other way?

Thanks,
Funky


Actually PCs do have a hardcoded event script that runs for all events except OnConversation - the script is named "default". OMB uses it with the OHS, but its been a long time since I've looked at his notes. Here is an excerpt from his "default" NSS script....

"PC's and their clones are created with "default" hard-coded as the script name in each and every event handler slot except OnConversation, which goes to nw_g0_conversat. In the normal game there is no script called "default" and, although these objects receive event signals, the signals evoke no scripted response."

OMB uses these events to run the OHS, but it was beyond me to cipher how he used them...
               
               

               


                     Modifié par Pstemarie, 20 juillet 2011 - 01:01 .
                     
                  


            

Legacy_Axe_Murderer

  • Full Member
  • ***
  • Posts: 199
  • Karma: +0/-0
On Damaged
« Reply #9 on: July 20, 2011, 02:14:03 am »


               See if this does what you're looking for...

Assumptions made:
1) By 20 feet you meant 20 meters or two tiles.
2) Only creatures with the proper tag that are also inside the search radius should get hasted, not all in the area.
3) The haste should be permanent.
[nwscript]
// OnDamaged script
//::///////////////////////////////////////////////////
 
const string SEARCH_TAG           = "random tag";  // the tag to look for goes here.
const float   SEARCH_RADIUS      = 20.0;              // size of the search radius (in meters) goes here.
const int      HASTE_THRESHOLD = 4;                   // number that must be within the radius to trigger haste.
 
void main()
{ ExecuteScript( "x2_def_ondamage", OBJECT_SELF );
  
   object oDamager = GetLastDamager();
   if( !GetIsPC( oDamager )) return;
 
   location lDamager = GetLocation( oDamager );
   effect    eHaste     = EffectHaste();
   int         iCount     = 0;
   object   oFound    = GetFirstObjectInShape( SHAPE_SPHERE, SEARCH_RADIUS, GetLocation( oDamager ));
   while( GetIsObjectValid( oFound ))
   { if( (GetObjectType( oFound ) == OBJECT_TYPE_CREATURE) && (GetTag( oFound ) == SEARCH_TAG ))
       SetLocalObject( OBJECT_SELF, "Hasted_" +IntToString( ++iCount ), oFound );
    
     oFound = GetNextObjectInShape( SHAPE_SPHERE, SEARCH_RADIUS, GetLocation( oDamager ));
   }
 
   int bHasteHim = (iCount >= HASTE_THRESHOLD);
   while( iCount > 0 )
   { string sVarname = "Hasted_" +IntToString( iCount-- );
     if( bHasteHim ) ApplyEffectToObject( DURATION_TYPE_PERMANENT, eHaste, GetLocalObject( OBJECT_SELF, sVarname ));
     DeleteLocalObject( OBJECT_SELF, sVarname );
   }
}
[/nwscript]
               
               

               


                     Modifié par Axe_Murderer, 20 juillet 2011 - 01:28 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
On Damaged
« Reply #10 on: July 20, 2011, 02:29:23 am »


               

Pstemarie wrote...

FunkySwerve wrote...

ShaDoOoW wrote...

La Rose Noire wrote...

There is no OnDamaged event for players (if I understand well what you want).


It can be scripted however.


How? By applying temp prop onhits to all pc armor? Or are you referring to the recent plugin by leo? It only seems to allow adding damage. Do you know of some other way?

Thanks,
Funky


Actually PCs do have a hardcoded event script that runs for all events except OnConversation - the script is named "default". OMB uses it with the OHS, but its been a long time since I've looked at his notes. Here is an excerpt from his "default" NSS script....

"PC's and their clones are created with "default" hard-coded as the script name in each and every event handler slot except OnConversation, which goes to nw_g0_conversat. In the normal game there is no script called "default" and, although these objects receive event signals, the signals evoke no scripted response."

OMB uses these events to run the OHS, but it was beyond me to cipher how he used them...


No, it doesn't run on all events. It runs on around 3 or 4, and ondamaged is not one of them. We played with this when trying to alter damage shield behavior. If you search with the Omnibus, you'll find a few posts discussing this on the old boards.

Funky
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
On Damaged
« Reply #11 on: July 20, 2011, 03:13:03 am »


               Yes funky applying the temp or perm onhit property for all armors and making a special rug clothing when pc unequip armor, and with one technique it can be invisible for player.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
On Damaged
« Reply #12 on: July 20, 2011, 04:49:52 am »


               

ShaDoOoW wrote...

Yes funky applying the temp or perm onhit property for all armors and making a special rug clothing when pc unequip armor, and with one technique it can be invisible for player.


We tested this option too. The problem is that onhits don't fire on each hit, or even on each damage. They fire a maximum of once per flurry.

Funky
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
On Damaged
« Reply #13 on: July 20, 2011, 05:09:57 am »


               Really? It works absolutely reliably for me, Im using it for Frenzied Berserker PrC and it does trigger the save against rage all the time the PC is damaged.

Its the same as chaotic shield which works reliably too.
               
               

               


                     Modifié par ShaDoOoW, 20 juillet 2011 - 04:11 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
On Damaged
« Reply #14 on: July 20, 2011, 05:45:06 am »


               

ShaDoOoW wrote...

Really? It works absolutely reliably for me, Im using it for Frenzied Berserker PrC and it does trigger the save against rage all the time the PC is damaged.

Its the same as chaotic shield which works reliably too.


Really. I'm guessing you're not seeing a lot of multiple-hit flurries. You need at least 4 attacks per round before it becomes an issue, but that's common for tier 1 classes. Every single attack past the third in a round is essentially ignored by that method. Here's the wiki on flurries in case your memory needs refreshing:
Wiki on Flurries

Funky