![]() |
|
|
|
|
#1 |
|
Архивный участник
Join Date: Oct 2005
Posts: 175
|
Hello,
i would like to write an AI able to do something if NPC like RaidBoss is in an arena, in effect some players aggros RB in order he follows them to the nearest arena, in that way they can kill him without taking any risk to loose xp. then i can controle myself.start_x/y/z with the 4 coordinates of the arena and do something if: (x1<x<x2) && (x3<x<x4) && (y4<y<y1) && (y3<y<y2) using that way i have to declare 8 integers by area: int x1 = int y1 = int x2 = int y2 = etc... but is it possible to use arrays/strings to declare those areas with NASC, because i would like to restrict more than 1 area in same AI, like: MyAreas = {{{x11,y11};{x12,y12};{x13;y13};{x14;y14}};{{x21,y 21};{x22,y22};{x23;y23};{x24;y24}}} If anybody know what are availables functions :roll: Btw i found those functions: SetVariableList, CTerritory but i have no idea how to use them. Regards |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Oct 2005
Posts: 175
|
i see there is the following handler:
OUT_OF_TERRITORY() anybody knows if it can solve my problem ? anw here what i wrote in order the mob turn back to his initial spawn location if someone try to kill him in Coliseum Area: Code:
int RA_x11 = 146923;
int RA_y11 = 44711;
int RA_x12 = 152070;
int RA_y12 = 44711;
int RA_x13 = 152070;
int RA_y13 = 48730;
int RA_x14 = 146923;
int RA_y14 = 48730;
EventHandler ATTACKED(attacker)
{
if (
(RA_x11<myself.sm.x) && (myself.sm.x<RA_x12) &&
(RA_x14<myself.sm.x) && (myself.sm.x<RA_x13) &&
(RA_y14<myself.sm.y) && (myself.sm.y<RA_y11) &&
(RA_y13<myself.sm.y) && (myself.sm.y<RA_y12)
) {
Say("You make me waste my time " + attacker.name + ", cya !");
InstantTeleport(myself.sm, myself.start_x, myself.start_y, myself.start_z);
}
}
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Oct 2005
Posts: 175
|
hum, i just tested the last code i posted and it doesnt work :?
any help ? Ty |
|
|
|
|
#4 |
|
Архивный участник
Join Date: Oct 2005
Posts: 175
|
maybe like that it will be better:
Code:
(RA_x11<FloatToInt(myself.sm.x)) && (FloatToInt(myself.sm.x)<RA_x12) && (RA_x14<FloatToInt(myself.sm.x)) && (FloatToInt(myself.sm.x)<RA_x13) && (RA_y11<FloatToInt(myself.sm.y)) && (FloatToInt(myself.sm.y)<RA_y14) && (RA_y12<FloatToInt(myself.sm.y)) && (FloatToInt(myself.sm.y)<RA_y13) |
|
|
|
|
#5 |
|
Архивный участник
Join Date: Oct 2005
Posts: 175
|
no, doesnt work :?
any idea ? |
|
|
|
|
#6 |
|
Архивный участник
Join Date: Apr 2006
Posts: 70
|
If I right understand what you want, try this:
Code:
// x1 x2
int RA_x1 = 146923; *----* -y1
int RA_y1 = 44711; | |
int RA_x2 = 152070; | |
int RA_y2 = 48730; *----* -y2
EventHandler CREATED()
{
SetTimerPeriodByTick(1);
}
EventHandler TIMER_FIRED()
{
if((myself.sm.x<RA_x1) || (myself.sm.x>RA_x2) || (myself.sm.y<RA_y1) || (myself.sm.y>RA_y2))
{
InstantTeleport(myself.sm, myself.start_x, myself.start_y, myself.start_z);
}
}
EventHandler ATTACKED(attacker, damage, i6, i5)
{
if((myself.sm.x<RA_x1) || (myself.sm.x>RA_x2) || (myself.sm.y<RA_y1) || (myself.sm.y>RA_y2))
{
Say("You make me waste my time " + attacker.name + ", cya !");
InstantTeleport(myself.sm, myself.start_x, myself.start_y, myself.start_z);
}
}
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|