Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 16.03.2007, 01:34   #1
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default AI For NPC Summon Skill use

I'm trying to make a summon skill that summons an NPC which will immediatly use one skill and then vanish. Will someone get me off on the right track or is there an AI script that is available for me to play around with and mod.
goodtimeshaxor is offline  
Old 16.03.2007, 10:15   #2
evern
Архивный участник
 
Join Date: Jul 2006
Posts: 46
Default

Code:
class 1 spawn_casts_1_spell : default_npc

handler 13 17	//  CREATED
	variable_begin
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_const 3000
	push_const 1000
	func_call 184680487	//  func[AddTimerEx]
	shift_sp -2
	shift_sp -1
handler_end

handler 12 540	//  TIMER_FIRED_EX
	variable_begin
		"timer_id"
		"i0"
		"i1"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  timer_id
	push_const 236
	add
	fetch_i4
	push_const 3000
	equal
	branch_false L12899
L12899
handler_end

class_end
Code:
class spawn_casts_1_spell : default_npc
{
handler:
	EventHandler CREATED()
	{
		myself->AddTimerEx(3000,1000);
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0,i1)
	{
		if( timer_id == 3000 )
		{
		}
	}

}
here's a c4 AI for you to play around, put what you want the summon to do in timer_id == 3000, remember to despawn after that.
evern is offline  
Old 17.03.2007, 10:56   #3
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default

Much appreciated evern. I always see you helping people! This should be great, thanks
goodtimeshaxor is offline  
Old 17.03.2007, 11:29   #4
Aikeleer
Архивный участник
 
Join Date: Jun 2005
Posts: 374
Default

And with that, use i.e:
Code:
	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  master
	push_const 552
	add
	fetch_i	//  target_id
	push_const 444
	add
	fetch_i4
	push_const YourSkill
	push_const 0
	push_const 0
	push_const 1000000
	func_call 184877074	//  func[AddUseSkillDesire]
	shift_sp -5
	shift_sp -1
Or something like this
Aikeleer is offline  
Old 17.03.2007, 20:06   #5
nnightmare
Архивный участник
 
Join Date: Jun 2006
Posts: 153
Default

hmm to not make another topic, is it possible to make an npc that does an skill as soon as its summoned on all the party members but it doesnt dissappear? something like the souless id think..
nnightmare is offline  
Old 18.03.2007, 22:45   #6
Aikeleer
Архивный участник
 
Join Date: Jun 2005
Posts: 374
Default

Sure, just don't put in a DeSpawn command. I'm not too sure if you can't simply let the summon use an affect_scope=party skill, since that'll save you some AI code. Otherwise take a look at funcs GetParty, Party_GetCount, Party_GetCreature, GetMemberOfParty and perhaps ShowSysMsgToParty2. I think you'll only use getmemberofparty and the membercount.
Aikeleer is offline  
Old 18.03.2007, 23:04   #7
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Quote:
Originally Posted by Aikeleer View Post
Sure, just don't put in a DeSpawn command. I'm not too sure if you can't simply let the summon use an affect_scope=party skill, since that'll save you some AI code. Otherwise take a look at funcs GetParty, Party_GetCount, Party_GetCreature, GetMemberOfParty and perhaps ShowSysMsgToParty2. I think you'll only use getmemberofparty and the membercount.
If the summon use a skill like the "Blessing of Queen", "Gift of Queen" and the other similar skill of summons (Cat Queen, Seraphim..) i believe must work good.
FidoW 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 22:46.