Если Вам наскучили мобы или Вы просто хотите сделать временный эвент, то этот код поможет Вам, научить мобов пить бутылки жизни (в зависимости от уровня мобов, используются разные бутылки жизни) и использовать соски.
AI:
AI:
Код:
class 1 monster_parameter : default_npc{
parameter:
int AttackLowLevel = 0;
int RunAway = 1;
int SetCurse = 0;
int AttackLowHP = 0;
int HelpHeroSilhouette = 0;
string HelpHeroAI = "warrior_hero";
int SetAggressiveTime = -1;
int HalfAggressive = 0;
int RandomAggressive = 0;
int SetHateGroup = -1;
int SetHateGroupRatio = 0;
int SetHateOccupation = -1;
int SetHateOccupationRatio = 0;
int SetHateRace = -1;
int SetHateRaceRatio = 0;
int IsTransform = 0;
int step1 = 1000130;
int step2 = 1000006;
int step3 = 1000853;
int DaggerBackAttack = 0;
int IsVs = 0;
int SpecialSkill = 0;
int MoveAroundSocial = 0;
int MoveAroundSocial1 = 0;
int MoveAroundSocial2 = 0;
int ShoutMsg1 = 0;
int ShoutMsg2 = 0;
int ShoutMsg3 = 0;
int ShoutMsg4 = 0;
int SSQLoserTeleport = 0;
int SSQTelPosX = 0;
int SSQTelPosY = 0;
int SSQTelPosZ = 0;
int SwapPosition = 0;
int FriendShip = 0;
int DungeonType = 0;
int DungeonTypeAI = 0;
string DungeonTypePrivate = "";
int ShoutTarget = 0;
int AcceptShoutTarget = 0;
int SelfExplosion = 0;
int FriendShip1 = 0;
int FriendShip2 = 0;
int FriendShip3 = 0;
int FriendShip4 = 0;
int FriendShip5 = 0;
int DungeonType = 0;
int DungeonTypeAI = 0;
string DungeonTypePrivate = "";
int SoulShot = 0;
int SoulShotRate = 0;
int SpiritShot = 0;
int SpiritShotRate = 0;
int SpeedBonus = 0;
int HealBonus = 0;
int CreviceOfDiminsion = 0;
handler:
EventHandler ATTACKED(attacker, damage, f0)
{
if ( gg::Rand(5) < 1 && myself.sm.hp < (myself.sm.max_hp / 3.000000) )
{
if ( myself.sm.level < 21 )
{
myself::AddUseSkillDesire(myself.sm, 519937, 1, 1, 1000000);
}
else if ( myself.sm.level > 41 )
{
myself::AddUseSkillDesire(myself.sm, 521473, 1, 1, 1000000);
}
else
{
myself::AddUseSkillDesire(myself.sm, 520193, 1, 1, 1000000);
}
myself::UseSoulShot(1);
myself::UseSpiritShot(1, 1, 1);
}
super;
}
EventHandler ATTACK_FINISHED(target)
{
if ( target.alive == 0 && target.is_pc == 0 )
{
if ( myself::IsInCategory(11, target.npc_class_id) != 0 )
{
myself::AddAttackDesire(target.master, 1, 500);
}
}
}
}
Код:
class 1 monster_parameter : default_npc
parameter_define_begin
int AttackLowLevel 0
int RunAway 1
int SetCurse 0
int AttackLowHP 0
int HelpHeroSilhouette 0
string HelpHeroAI "warrior_hero"
int SetAggressiveTime -1
int HalfAggressive 0
int RandomAggressive 0
int SetHateGroup -1
int SetHateGroupRatio 0
int SetHateOccupation -1
int SetHateOccupationRatio 0
int SetHateRace -1
int SetHateRaceRatio 0
int IsTransform 0
int step1 1000130
int step2 1000006
int step3 1000853
int DaggerBackAttack 0
int IsVs 0
int SpecialSkill 0
int MoveAroundSocial 0
int MoveAroundSocial1 0
int MoveAroundSocial2 0
int ShoutMsg1 0
int ShoutMsg2 0
int ShoutMsg3 0
int ShoutMsg4 0
int SSQLoserTeleport 0
int SSQTelPosX 0
int SSQTelPosY 0
int SSQTelPosZ 0
int SwapPosition 0
int FriendShip 0
int DungeonType 0
int DungeonTypeAI 0
string DungeonTypePrivate ""
int ShoutTarget 0
int AcceptShoutTarget 0
int SelfExplosion 0
int FriendShip1 0
int FriendShip2 0
int FriendShip3 0
int FriendShip4 0
int FriendShip5 0
int DungeonType 0
int DungeonTypeAI 0
string DungeonTypePrivate ""
int SoulShot 0
int SoulShotRate 0
int SpiritShot 0
int SpiritShotRate 0
int SpeedBonus 0
int HealBonus 0
int CreviceOfDiminsion 0
parameter_define_end
handler 1 147 // ATTACKED
variable_begin
"attacker"
"damage"
"f0"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_event // gg
push_const 632
add
fetch_i
push_const 5
func_call 218169344 // func[Rand]
shift_sp -1
push_const 1
less
push_reg_sp
fetch_i
branch_false L3
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // hp
push_const 392
add
fetch_d
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // max_hp
push_const 1216
add
fetch_d
push_const 3.000000
div
less
and
L3
branch_false L2
L1
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // level
push_const 1092
add
fetch_i4
push_const 21
less
branch_false L5
L4
push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i
push_const 519937
push_const 1
push_const 1
push_const 1000000
func_call 184877074 // func[AddUseSkillDesire]
shift_sp -5
shift_sp -1
jump L6
L5
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i // level
push_const 1092
add
fetch_i4
push_const 41
greater
branch_false L8
L7
push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i
push_const 521473
push_const 1
push_const 1
push_const 1000000
func_call 184877074 // func[AddUseSkillDesire]
shift_sp -5
shift_sp -1
jump L9
L8
push_event // myself
push_const 704
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i
push_const 520193
push_const 1
push_const 1
push_const 1000000
func_call 184877074 // func[AddUseSkillDesire]
shift_sp -5
shift_sp -1
L9
L6
push_event // myself
push_const 704
add
fetch_i
push_const 1
func_call 184615138 // func[UseSoulShot]
shift_sp -1
shift_sp -1
push_event // myself
push_const 704
add
fetch_i
push_const 1
push_const 1
push_const 1
func_call 184746211 // func[UseSpiritShot]
shift_sp -3
shift_sp -1
L2
call_super
handler_end
handler 58 61 // ATTACK_FINISHED
variable_begin
"target"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_event // target
push_const 96
add
fetch_i // alive
push_const 104
add
fetch_i4
push_const 0
equal
push_reg_sp
fetch_i
branch_false L12
push_event // target
push_const 96
add
fetch_i // is_pc
push_const 100
add
fetch_i4
push_const 0
equal
and
L12
branch_false L11
L10
push_event // myself
push_const 704
add
fetch_i
push_const 11
push_event // target
push_const 96
add
fetch_i // npc_class_id
push_const 1928
add
fetch_i4
func_call 184680656 // func[IsInCategory]
shift_sp -2
push_const 0
not_equal
branch_false L14
L13
push_event // myself
push_const 704
add
fetch_i
push_event // target
push_const 96
add
fetch_i // master
push_const 2008
add
fetch_i
push_const 1
push_const 500
func_call 184745993 // func[AddAttackDesire]
shift_sp -3
shift_sp -1
L14
L11
handler_end
class_end