Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   AI For NPC Summon Skill use (https://postpacific.loc-online.com/showthread.php?t=7134)

goodtimeshaxor 16.03.2007 01:34

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.

evern 16.03.2007 10:15

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.

goodtimeshaxor 17.03.2007 10:56

Much appreciated evern. I always see you helping people! This should be great, thanks

Aikeleer 17.03.2007 11:29

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 ;)

nnightmare 17.03.2007 20:06

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..

Aikeleer 18.03.2007 22:45

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. :)

FidoW 18.03.2007 23:04

Quote:

Originally Posted by Aikeleer (Post 81647)
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.


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