Aller au contenu

Photo

On Damaged


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

#1
Builder_Anthony

Builder_Anthony
  • Members
  • 450 messages
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?

#2
Rubies

Rubies
  • Members
  • 292 messages
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?

#3
La Rose Noire

La Rose Noire
  • Members
  • 25 messages
There is no OnDamaged event for players (if I understand well what you want).

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


#4
CID-78

CID-78
  • Members
  • 1 124 messages
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.

#5
ffbj

ffbj
  • Members
  • 593 messages
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.

#6
Shadooow

Shadooow
  • Members
  • 4 470 messages

La Rose Noire wrote...

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


It can be scripted however.

#7
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#8
Builder_Anthony

Builder_Anthony
  • Members
  • 450 messages
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 .


#9
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

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 .


#10
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages
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 .


#11
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#12
Shadooow

Shadooow
  • Members
  • 4 470 messages
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.

#13
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#14
Shadooow

Shadooow
  • Members
  • 4 470 messages
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 .


#15
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#16
Shadooow

Shadooow
  • Members
  • 4 470 messages
Funky thanks, though its me who added last three attacks into the article so I know what we talk about :). And Im pretty sure such condition like you describing happened to me as well though I must admit, I couldnt be able to notice any missing script fires as if there is lot of monsters attacking a no-AC char, then is quite hard to keep track in it. What I know is that chaos shield does work still very well even with a no-AC char surrouned by a 10 (not much more melee monsters at least if not totally tiny size can't surround character) monsters with 4attacks and haste.

But I will take care when testing my Frenzy Berserker at epic levels if its absolutely reliable then (you know when raging, it counts the totaldamage dealth which is then applied after rage is ended).

EDIT: just remembered another situation where I use an onhit armor on one PW with onhit Ice Storm lvl 40 and went with a wiz/pm con based epic reduction build with lot of regeneration and maximum Heal skill and nlimited number of Healing Kits into the dungeon meant for party of four peoples and did it solo cos there were archers with ab 99 firing 6 attacks each round in pack of 6 per spawn and each attack fired the Ice Storm, what happened? When I spawned them (and sometimes there were like 4 different groups, I got pretty bug graphic lag as in one second the Ice Storm spel was being cast two times for each of the archer, that is like 20times in second and then everyone was dead...

Modifié par ShaDoOoW, 20 juillet 2011 - 07:16 .


#17
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

FunkySwerve wrote...

Pstemarie wrote...

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


Thanks for updating me on that. As I'd stated some of what OMB did with that system was over my head. I'll check out those threads at some point. Posted Image

#18
Shadooow

Shadooow
  • Members
  • 4 470 messages

Pstemarie wrote...

Thanks for updating me on that. As I'd stated some of what OMB did with that system was over my head. I'll check out those threads at some point. Posted Image

In recent past I also discovered that default script is run for every trap created by a scripting command each heartbeat which means that I would not used default script for PC's heartbeat anymore. You can add a simple check if(!GetIsPC(OBJECT_SELF))return; but the script is fired neverlethess. In my environment where im creating around 10 random traps per area, its outstanding CPU increase.

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


#19
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
Thanks Shad, that's good to know.

#20
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

ShaDoOoW wrote...

Pstemarie wrote...

Thanks for updating me on that. As I'd stated some of what OMB did with that system was over my head. I'll check out those threads at some point. Posted Image

In recent past I also discovered that default script is run for every trap created by a scripting command each heartbeat which means that I would not used default script for PC's heartbeat anymore. You can add a simple check if(!GetIsPC(OBJECT_SELF))return; but the script is fired neverlethess. In my environment where im creating around 10 random traps per area, its outstanding CPU increase.


Wow. I wonder if that's new as of the patch that added the trap functionality.

Funky

#21
Builder_Anthony

Builder_Anthony
  • Members
  • 450 messages
OK axe thanks and nice to see you around.Ill test it out but after reading the script i think it should work well.I guess this script is a little differnt from the normal.......Just kind of thought about it when i was in the toolset.Thanks.

#22
Shadooow

Shadooow
  • Members
  • 4 470 messages

FunkySwerve wrote...

Wow. I wonder if that's new as of the patch that added the trap functionality.

Funky

must be cos normal traps painted in toolset dont run any heartbeat script