View Full Version : [Help] NPC Against attacks
As to place the NPC's of the city aggressive ? for example, if some player to beat in it, it to beat in player? (Without leaving the place it is clearly) ^^
Grateful!
:wave:
class 1 citizen : default_npc {
parameter:
int iSkill = 1663745;
handler:
EventHandler ATTACKED(attacker) {
myself->AddUseSkillDesire(attacker, iSkill, 0, 1, 1000000);
}
}
Where iSkill is skill_pch number of the skill you want to use, for example, some type of paralyze... or you can use AddAttackDesire if you want... but that will finish killing the player.
seraphii
21.03.2007, 17:46
if i put this, all npc when attacked, will attack? o nly need put this code in ai? or need insert for all npcs in ai?
sorry bad english.
First you need - compile code
Second - insert handler attacked in the class you want, maybe insert in citizen class isnt a good idea, i have some problems with some quest npcs (in C1 times, actually im not using this) that fight each other or you have to hit for some reason... anyway is easy to exclude that npcs if you know what they are.
Third - If you are going to use the "paralyze" mode you need to create the skill, or change iSkill for some that exist.
class 1 citizen : default_npc
parameter_define_begin
string fnTradeSkill0 ""
string fnTradeSkill1 ""
string fnTradeSkill2 ""
string fnHi "chi.htm"
string fnFeudInfo "defaultfeudinfo.htm"
string fnNoFeudInfo "nofeudinfo.htm"
string fnBracketL "["
string fnBracketR "]"
int MoveAroundSocial 0
int MoveAroundSocial1 0
int MoveAroundSocial2 0
int HavePet 0
int silhouette 1000130
int FriendShip1 0
int FriendShip2 0
int FriendShip3 0
int FriendShip4 0
int FriendShip5 0
string fnNoFriend ""
int NoFnHi 0
parameter_define_end
handler 3 138 // TALKED
variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end
push_parameter NoFnHi
push_const 1
equal
branch_false L1
L0
exit_handler
I am certain that it is here that dumb, more where I must add the command that you it wrote above?