Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 21.03.2007, 13:28   #1
MyLover
Архивный участник
 
Join Date: Feb 2007
Posts: 16
Default [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:
MyLover is offline  
Old 21.03.2007, 13:35   #2
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Code:
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.
FidoW is offline  
Old 21.03.2007, 17:46   #3
seraphii
Архивный участник
 
Join Date: Jun 2006
Posts: 126
Default

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.
seraphii is offline  
Old 21.03.2007, 18:14   #4
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

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.
FidoW is offline  
Old 22.03.2007, 00:11   #5
MyLover
Архивный участник
 
Join Date: Feb 2007
Posts: 16
Default

Quote:
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?
MyLover is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 19:12.