mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
27 lines
711 B
Plaintext
27 lines
711 B
Plaintext
include library.buff;
|
|
|
|
trigger OnCreatureDamaged(obj_id attacker, obj_id weapon, int[] damage)
|
|
{
|
|
string shield_buff = "bh_shields";
|
|
string shield_charge = "bh_shields_charged";
|
|
|
|
if (!buff.hasBuff(self, shield_buff))
|
|
{
|
|
detachScript(self, "player.skill.bh_shields");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
int stackCount = (int)buff.getBuffStackCount(self, shield_buff);
|
|
int timeLeft = (int)buff.getBuffTimeRemaining(self, "bh_shields");
|
|
if (stackCount < 2 || timeLeft < 2)
|
|
{
|
|
buff.applyBuff(self, "bh_shields_block");
|
|
detachScript(self, "player.skill.bh_shields");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
buff.decrementBuffStack(self, shield_buff, 1);
|
|
buff.applyBuff(self, shield_charge);
|
|
return SCRIPT_CONTINUE;
|
|
}
|