Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [Help] NPC Against attacks (https://postpacific.loc-online.com/showthread.php?t=7176)

MyLover 21.03.2007 13:28

[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:

FidoW 21.03.2007 13:35

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.

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.

FidoW 21.03.2007 18:14

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.

MyLover 22.03.2007 00:11

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?


All times are GMT. The time now is 15:27.