Log in

View Full Version : thermal_yeti AI


Renobizarro
10.08.2009, 14:00
someone has it decompiled?


i can decompile it but it sux.... some gg::() and things that are wrong...


and from C4AI is wrong...


add:


i moded C4 AI for a event on my server...


but now i get this error.


[.\NPC.cpp][6358] OwnItemCount(c=null) I'm[thermal_yeti]

add_string : Access violation read[c8], ai[thermal_yeti] event[MY_DYING], pc[414], sp[2]


this is the AI btw:


class 1 thermal_yeti : warrior_pa_casting_3skill_approach

{

handler:

EventHandler SEE_CREATURE(creature)

{

if( myself::OwnItemCount(creature, @l2aq7 ) > 0)

{

myself::Say("Alla!, " + creature.name + " tiene el Talisman!");

myself::AddAttackDesire( creature, @AMT_MOVE_TO_TARGET, 1500 );

}

else

{

myself::Say("pfff... me muero del aburrimiento...");

}

}

EventHandler MY_DYING(attacker,i1,always_list,code_info,i9,last _attacker,lparty,member,random1_list,target)

{

always_list = gg::AllocCodeInfoList();

random1_list = gg::AllocCodeInfoList();

target = last_attacker;

if( myself::HaveMemo( target, @get_fishing_shot ) == 1 )

{

random1_list::SetInfo( 0, target );

}

if( gg::IsNull( lparty ) == 0 )

{

for( i9 = 0; i9 < lparty.member_count; i9++ )

{

target = myself::GetMemberOfParty( lparty, i9 );

if( myself::HaveMemo( target, @get_fishing_shot ) == 1 )

{

random1_list::SetInfo( 0, target );

}

}

}

while( gg::IsNull( code_info = always_list::Next() ) == 0 )

{

}

code_info = random1_list::RandomSelectOne();

if( gg::IsNull( code_info ) == 0 )

{

if( code_info.code == 0 )

{

myself::SetCurrentQuestID( @get_fishing_shot );

target = code_info::RandomSelectOne();

if( gg::IsNull( target ) == 0 && myself::DistFromMe( target ) <= 1500 )

{

if( gg::Rand( 1000 ) < 355 )

{

myself::GiveItem1( target, @q_sweet_water, 4 );

myself::SoundEffect( target, "ItemSound.quest_itemget" );

}

else

{

myself::GiveItem1( target, @q_sweet_water, 3 );

myself::SoundEffect( target, "ItemSound.quest_itemget" );

}

}

}

}

if(myself::OwnItemCount(attacker, @l2aq7 ) > 0)

{

i1 = gg::Rand( 100 );

if(i1 > 96)

{

myself::GiveItem1(attacker, @cs_real, 1);

myself::SoundEffect(attacker,"ItemSound.quest_itemget" );

}

else

{

myself::Say("Ya me vengare de ti " + attacker.name + "!");

}

}

else

{

myself::Say("Mis hermanos me vengaran" + attacker.name + "!");

}

super;

}


}

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 08-10-2009, 02:00 PM. Открыть источник (https://web.archive.org/web/20100324121138id_/http://www.postpacific.com:80/archive/index.php/t-1032.html).

Renobizarro
10.08.2009, 15:13
FIXED:


the Ai was OK... the problem was that u can't use the "attacker" param into MY_DYING event handler... u need to use "last_attacker"


^^

Версия форума 2009–2010. Восстановлено из публичного снимка Wayback Machine. Тема могла сохраниться частично. Время показано по часам снимка; часовой пояс не установлен. Дата в снимке: 08-10-2009, 03:13 PM. Открыть источник (https://web.archive.org/web/20100324121138id_/http://www.postpacific.com:80/archive/index.php/t-1032.html).