ShaDoOoW wrote...
OnPhysicalAttacked shoul fire before, however I dont like this solution because it does fire also when character dont even hit the door (roll 1). Try to look at my door system scripts LINK IIRC it will give you the option to set all doors to plot via 3rd party tool - letoscript and set their scripts to my ones...
Setting a new hardness doesn't really matter if there is a hit or not just so long as it is set based on the damage type inflicted by the PCs weapon. There are two ways I have thought about running this.
1. Getting the type of weapon used and checking it before damage (BASE_ITEM_*) to set hardness or..
2. Getting damage type after first hit (DAMAGE_TYPE_PIERCING etc)
The problem though is that option one requires A LOT more code such as
int GetSlashingWeapon(object oItem)
{
//Declare major variables
int nItem = GetBaseItemType(oItem);
if((nItem == BASE_ITEM_BASTARDSWORD) ||
(nItem == BASE_ITEM_BATTLEAXE) ||
(nItem == BASE_ITEM_DOUBLEAXE) ||
(nItem == BASE_ITEM_GREATAXE) ||
(nItem == BASE_ITEM_GREATSWORD) ||
(nItem == BASE_ITEM_HALBERD) ||
(nItem == BASE_ITEM_HANDAXE) ||
(nItem == BASE_ITEM_KAMA) ||
(nItem == BASE_ITEM_KATANA) ||
(nItem == BASE_ITEM_KUKRI) ||
(nItem == BASE_ITEM_LONGSWORD)||
(nItem == BASE_ITEM_SCIMITAR)||
(nItem == BASE_ITEM_SCYTHE)||
(nItem == BASE_ITEM_SICKLE)||
(nItem == BASE_ITEM_TWOBLADEDSWORD) ||
(nItem == BASE_ITEM_DWARVENWARAXE) ||
(nItem == BASE_ITEM_THROWINGAXE) ||
(nItem == BASE_ITEM_WHIP)
)
{
return TRUE;
}
return FALSE;
}
and setting up the same for blunts and piercing. The above function is from x2_i0_spells. There is another function close to that one for blunts but relies on a call to a 2da instead of constants (I think)
In any event.. we can wait and get the info from damage type or by getting the type of weapon the attacker used to damage the door.
My secondary concern is the script firing each time it is attacked.. I think I have a way around part of the problem but no easy or even logical solution has presented itself.. I will check out your script set a bit later today shadooow. Thanks for the input.
***NOTE***
I am building this script so that when a door is bashed certain ypes of damage are more effective. A piercing weapon (stabbing, thrusting) will not cause as much damage as a slashing or blunt attack.
Its pretty sad a crossbow bolt can take out a stone door just as easily as a warhammer.
The next script in the set i'm going to complete is on weapon breakage I think. A non-magical weapon used to bash in a stone door has n% chance to break each hit.