I saw this on a PW (Cormanthor) and got the code for it (at least I hope that is all of it). I think it is pretty nifty. So you just put this code on the OnDisturbed event on the door...and then beside unlocking the door normally as a rogue..you can also bash it....but don't have to respawn the door....
//Door HP is determined either by:
//varint Bash int ##
//Or the close lock DC, if the above wasn't found.
void MyShoutDisturbed(object oAttacker)
{
if (GetLocalInt(OBJECT_SELF,"DamageTaken") > 0)
{
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_CREATURE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if (GetFactionEqual(oTarget, OBJECT_SELF) == TRUE)
{
// * Make anyone who is a member of my faction hostile if I am violated
SetIsTemporaryEnemy(oAttacker,oTarget,TRUE,60.0);
AssignCommand(oTarget, ActionAttack(oAttacker));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_CREATURE);
}
}
}
void main()
{
int iDC = GetLocalInt(OBJECT_SELF,"Bash");
if (!iDC) iDC = GetLockLockDC(OBJECT_SELF);
int iDamage = GetLocalInt(OBJECT_SELF,"DamageTaken");
object oPC = GetLastAttacker();
if (GetLockKeyRequired(OBJECT_SELF))
{
DelayCommand(0.1, FloatingTextStringOnCreature("*This lock cannot be bashed.*", oPC, FALSE));
}
else
{
if (iDamage <= iDC)
{
if (GetLocked(OBJECT_SELF))
{
MyShoutDisturbed(oPC);
if (iDamage < 0) iDamage = 0;
iDamage = iDamage + 1;
DelayCommand(0.1, FloatingTextStringOnCreature("*Lock damage done: " + IntToString(iDamage) + " of " + IntToString(iDC)+"*", oPC, FALSE));
if (iDamage >= iDC)
{
iDamage = iDC;
SetLocked(OBJECT_SELF, FALSE);
DelayCommand(0.1, FloatingTextStringOnCreature("*The lock breaks!*", oPC, FALSE));
AssignCommand(oPC,ClearAllActions());
DelayCommand(60.0,DeleteLocalInt(OBJECT_SELF,"DamageTaken"));
}
SetLocalInt(OBJECT_SELF,"DamageTaken",iDamage);
}
else
{
SetLocalInt(OBJECT_SELF,"DamageTaken",iDC);
}
}
else
{
SetLocalInt(OBJECT_SELF,"DamageTaken",iDC+1);
//DelayCommand(0.1, FloatingTextStringOnCreature("*Not locked.*", oPC, FALSE));
AssignCommand(oPC,ClearAllActions());
}
}
}
I am just not sure how to configure it. How to set the time until it resets....or how many hits the door takes before it breaks...because it is not really HP is it? ...and then also if it is possible to add some "soak" to this...hmm...actually...I guess I could just put the amount of soak on the normal properties on the door?
Bit confused here....
They didn't have time to help me further..so any further information about this would be great...
Modifié par SuperFly_2000, 04 novembre 2010 - 01:42 .