Здравствуйте! Подскажите пожалуйста, можно ли как-то заблокировать атаку скиллами по нпц? ( Без запрета классов )
Код:
class 1 unique_sys : (null)
{
parameter:
int WeaponID1 = 0;
int WeaponID2 = 0;
int WeaponID3 = 0;
int WeaponID4 = 0;
int WeaponID5 = 0;
int PrimaryItem1 = 0;
int PrimaryItem2 = 0;
int PrimaryItem3 = 0;
int PrimaryItem4 = 0;
int SecondaryItem1 = 0;
int SecondaryCount = 0;
int ErrorMsg = 0;
int crfpt = 25399;
int IsLeather = 0;
int DropChance = 45;
handler:
EventHandler CREATED()
{
myself.i_ai0 = 0;
}
EventHandler ATTACKED(attacker,damage,i0)
{
myself.i_ai0 = ( myself.i_ai0 + 1 );
if( myself.i_ai0 > 5 && gg::Rand(100) < 20 )
{
myself::Despawn();
}
if( myself::FloatToInt(myself.sm.x) != myself.start_x )
{
myself::InstantTeleport(myself.sm,myself.start_x,myself.start_y,myself.start_z);
}
if( gg::Rand(100) > DropChance )
{
return;
}
if( attacker.equiped_weapon_class_id == WeaponID1 || ( attacker.equiped_weapon_class_id == WeaponID2 || ( attacker.equiped_weapon_class_id == WeaponID3 || ( attacker.equiped_weapon_class_id == WeaponID4 || attacker.equiped_weapon_class_id == WeaponID5 ) ) ) )
{
i0 = gg::Rand(100);
if( i0 < 50 )
{
if( attacker.equiped_weapon_class_id == WeaponID5 )
{
myself::GiveItem1(attacker,PrimaryItem1,2);
}
else
{
myself::GiveItem1(attacker,PrimaryItem1,1);
}
if( gg::Rand(100) < 50 )
{
if( attacker.equiped_weapon_class_id == WeaponID5 )
{
myself::GiveItem1(attacker,crfpt,2);
}
else
{
myself::GiveItem1(attacker,crfpt,1);
}
}
if( gg::Rand(100) < 50 )
{
if( attacker.equiped_weapon_class_id == WeaponID5 )
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 8 ));
}
else
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 1 ));
}
}
}
if( i0 >= 50 && ( i0 < 85 && ( attacker.equiped_weapon_class_id == WeaponID2 || ( attacker.equiped_weapon_class_id == WeaponID3 || ( attacker.equiped_weapon_class_id == WeaponID4 || attacker.equiped_weapon_class_id == WeaponID5 ) ) ) ) )
{
if( i0 >= 50 && ( i0 < 85 && attacker.equiped_weapon_class_id == WeaponID5 ) )
{
myself::GiveItem1(attacker,PrimaryItem2,2);
}
else
{
myself::GiveItem1(attacker,PrimaryItem2,1);
}
if( gg::Rand(100) < 65 )
{
if( i0 >= 50 && ( i0 < 85 && attacker.equiped_weapon_class_id == WeaponID5 ) )
{
myself::GiveItem1(attacker,crfpt,2);
}
else
{
myself::GiveItem1(attacker,crfpt,1);
}
}
if( gg::Rand(100) < 65 )
{
if( i0 >= 50 && ( i0 < 85 && attacker.equiped_weapon_class_id == WeaponID5 ) )
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 8 ));
}
else
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 1 ));
}
}
}
if( i0 >= 85 && ( i0 < 99 && ( attacker.equiped_weapon_class_id == WeaponID3 || ( attacker.equiped_weapon_class_id == WeaponID4 || attacker.equiped_weapon_class_id == WeaponID5 ) ) ) )
{
if( i0 >= 85 && ( i0 < 99 && attacker.equiped_weapon_class_id == WeaponID5 ) )
{
myself::GiveItem1(attacker,PrimaryItem3,2);
}
else
{
myself::GiveItem1(attacker,PrimaryItem3,1);
}
if( gg::Rand(100) < 86 )
{
if( i0 >= 85 && ( i0 < 99 && attacker.equiped_weapon_class_id == WeaponID5 ) )
{
myself::GiveItem1(attacker,crfpt,2);
}
else
{
myself::GiveItem1(attacker,crfpt,1);
}
}
if( gg::Rand(100) < 86 )
{
if( i0 >= 85 && ( i0 < 99 && attacker.equiped_weapon_class_id == WeaponID5 ) )
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 8 ));
}
else
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 1 ));
}
}
}
if( i0 == 99 && ( attacker.equiped_weapon_class_id == WeaponID4 || attacker.equiped_weapon_class_id == WeaponID5 ) )
{
if( i0 == 99 && attacker.equiped_weapon_class_id == WeaponID5 )
{
myself::GiveItem1(attacker,PrimaryItem4,2);
}
else
{
myself::GiveItem1(attacker,PrimaryItem4,1);
}
if( gg::Rand(100) < 99 )
{
if( i0 == 99 && attacker.equiped_weapon_class_id == WeaponID5 )
{
myself::GiveItem1(attacker,crfpt,2);
}
else
{
myself::GiveItem1(attacker,crfpt,1);
}
}
if( gg::Rand(100) < 99 )
{
if( i0 == 99 && attacker.equiped_weapon_class_id == WeaponID5 )
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 8 ));
}
else
{
myself::GiveItem1(attacker,SecondaryItem1,( gg::Rand(SecondaryCount) + 1 ));
}
}
}
}
else
{
myself::ShowSystemMessage(attacker,ErrorMsg);
}
if( IsLeather == 1 )
{
myself::Despawn();
}
}
}