Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 13.02.2006, 22:43   #1
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default AI - Raid Boss in arena

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
Kirikups is offline  
Old 14.02.2006, 00:33   #2
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default

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);
		}
	}
Not tested yet, it seems correct ?
Kirikups is offline  
Old 14.02.2006, 01:25   #3
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default

hum, i just tested the last code i posted and it doesnt work :?

any help ? Ty
Kirikups is offline  
Old 14.02.2006, 12:18   #4
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default

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)
Test later...
Kirikups is offline  
Old 14.02.2006, 13:01   #5
Kirikups
Архивный участник
 
Join Date: Oct 2005
Posts: 175
Default

no, doesnt work :?
any idea ?
Kirikups is offline  
Old 16.04.2006, 16:35   #6
Xelat
Архивный участник
 
Join Date: Apr 2006
Posts: 70
Default

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); 
		}
	}
Xelat 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:24.