Changed folder name.
Changed folder name.
This commit is contained in:
51
_module/nss/ambush.nss
Normal file
51
_module/nss/ambush.nss
Normal file
@@ -0,0 +1,51 @@
|
||||
void main()
|
||||
{
|
||||
object oPC= GetEnteringObject();
|
||||
if (GetIsPC(oPC)) {
|
||||
int NumOfParty = 0;
|
||||
object oPartyMember = GetFirstFactionMember(oPC, TRUE);
|
||||
while(GetIsObjectValid(oPartyMember)) {
|
||||
|
||||
if (GetArea(oPC) == GetArea(oPartyMember))
|
||||
{
|
||||
NumOfParty++;
|
||||
}
|
||||
oPartyMember = GetNextFactionMember(oPC, TRUE);
|
||||
}
|
||||
|
||||
|
||||
if (NumOfParty >= 3){return;}
|
||||
|
||||
|
||||
int roll = d100() ;
|
||||
if (NumOfParty == 2){roll = roll +1;}
|
||||
string percent = IntToString(roll);
|
||||
string msg = (", and is not activated on " + GetName(oPC) + ".");
|
||||
if (roll<=2){ msg = (". Drow Ambush activated on " + GetName(oPC) + ".");}
|
||||
|
||||
//SendMessageToAllDMs("Ambush trigger rolls a " + percent + msg);
|
||||
if (roll <= 2){
|
||||
location ambush1 = GetLocation(GetNearestObjectByTag("ambush1"));
|
||||
location ambush2 = GetLocation(GetNearestObjectByTag("ambush2"));
|
||||
location ambush3 = GetLocation(GetNearestObjectByTag("ambush3"));
|
||||
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowwizard001", ambush1);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowwizard001", ambush2);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowwarrior1", ambush3);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowwarrior1", ambush3);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowwarrior1", ambush3);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowbattlespider", ambush2);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowbattlespider", ambush2);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowbattlespider", ambush3);
|
||||
CreateObject( OBJECT_TYPE_CREATURE, "drowbattlespider", ambush3);
|
||||
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, SupernaturalEffect(EffectVisualEffect(VFX_DUR_DARKNESS)),ambush1, 180.0);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, SupernaturalEffect(EffectVisualEffect(VFX_DUR_DARKNESS)),ambush2, 180.0);
|
||||
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, SupernaturalEffect(EffectVisualEffect(VFX_DUR_DARKNESS)),ambush3, 180.0);
|
||||
|
||||
FloatingTextStringOnCreature("IT'S AN AMBUSH!", oPC, TRUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user