On Damaged
#1
Posté 19 juillet 2011 - 06:17
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
Posté 19 juillet 2011 - 07:52
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
Posté 19 juillet 2011 - 02:39
Modifié par La Rose Noire, 19 juillet 2011 - 02:40 .
#4
Posté 19 juillet 2011 - 04:17
#5
Posté 19 juillet 2011 - 10:29
#6
Posté 19 juillet 2011 - 11:57
It can be scripted however.La Rose Noire wrote...
There is no OnDamaged event for players (if I understand well what you want).
#7
Posté 20 juillet 2011 - 12:03
ShaDoOoW wrote...
It can be scripted however.La Rose Noire wrote...
There is no OnDamaged event for players (if I understand well what you want).
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
Posté 20 juillet 2011 - 12:23
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
Posté 20 juillet 2011 - 12:56
FunkySwerve wrote...
ShaDoOoW wrote...
It can be scripted however.La Rose Noire wrote...
There is no OnDamaged event for players (if I understand well what you want).
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
Posté 20 juillet 2011 - 01:14
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
Posté 20 juillet 2011 - 01:29
Pstemarie wrote...
FunkySwerve wrote...
ShaDoOoW wrote...
It can be scripted however.La Rose Noire wrote...
There is no OnDamaged event for players (if I understand well what you want).
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
Posté 20 juillet 2011 - 02:13
#13
Posté 20 juillet 2011 - 03:49
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
Posté 20 juillet 2011 - 04:09
Its the same as chaotic shield which works reliably too.
Modifié par ShaDoOoW, 20 juillet 2011 - 04:11 .
#15
Posté 20 juillet 2011 - 04:45
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
Posté 20 juillet 2011 - 07:11
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
Posté 20 juillet 2011 - 10:11
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.
#18
Posté 20 juillet 2011 - 04:47
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.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.
Modifié par ShaDoOoW, 20 juillet 2011 - 04:47 .
#19
Posté 20 juillet 2011 - 05:07
#20
Posté 20 juillet 2011 - 05:54
ShaDoOoW wrote...
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.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.
Wow. I wonder if that's new as of the patch that added the trap functionality.
Funky
#21
Posté 22 juillet 2011 - 02:33
#22
Posté 23 juillet 2011 - 02:03
must be cos normal traps painted in toolset dont run any heartbeat scriptFunkySwerve wrote...
Wow. I wonder if that's new as of the patch that added the trap functionality.
Funky





Retour en haut






