PDA

View Full Version : ...after decompilation. Stranges in npc


HF
14.07.2007, 14:16
agent_of_slaughter


If ( 1 != 0 && 1 == 1 )
{
myself->GiveItem1(target, 7543, 1);
myself->SoundEffect(target, "ItemSound.quest_itemget");
}
If ( 0 != 0 && 0 == 1 )
{
myself->GiveItem1(target, 0, 0);
myself->SoundEffect(target, "ItemSound.quest_itemget");
}

This npc spawn in world, have quest.
But... this code confused me.

- two identical conditions
If ( 0 != 0 && 0 == 1 )
- two strange conditions
If ( 0 != 0 && 0 == 1 ) 0 != 0 and 0 == 1??? Madness...
- GiveItem, id=0, amount 0
what is it? debug code? Horror.

Is very interesting to examine the code in nps. Much interesting it is possible there to find.

m4rk
14.07.2007, 14:26
if( 0 != 0 && 1 == 1 )
That one is kind of fun too...

I can only think of debug code or that ncsoft use custom variables when coding the AI.

ateh
14.07.2007, 14:29
There are hundreds of such examples, like
"myself->GiveItem1(target,0,0);" exists 1170 times in whole AI...
"if ( 1 == 1 )" 476 times
"0 != 0" 2554 times
"0 == 1" 4541 times...
And one might wonder why AI has 140 MB... ;P
Prolly they had some erros in questdata.txt file for nasc.

HF
14.07.2007, 17:14
Well... we need C4Compiler for remade full ai.obj

Kenjiro
14.07.2007, 19:37
I suspect this was for error checks from PTS l2npc (maybe it has some weird 'bugs'?).
Or left by previous version as 'backup' code...

barabashka
15.07.2007, 11:34
Well... we need C4Compiler for remade full ai.obj

In Testing...

HF
15.07.2007, 11:36
In Testing...php? .net? i want it to test too ;)

Sauron
16.07.2007, 14:29
that's probably code for future quest.