Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Help
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 12.10.2005, 09:48   #1
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default Priest of Dawn/Dusk AI

Hello,

I need help with AI, i would like to make an AI for 7Signs quest registration

I have 6 Marks:

[dawn_seal_of_avarice] = 60101
[dawn_seal_of_gnosis] = 60102
[dawn_seal_of_strife] = 60103
[dusk_seal_of_avarice] = 60104
[dusk_seal_of_gnosis] = 60105
[dusk_seal_of_strife] = 60106

1) I would like in a 1st time learn how to make AI able to give 1 of those item to players (by a link in HTML)

2) I would like players able to get only 1 on those items. I mean HTML display a choice between 6 items and if i have 1 of the 6, NPC dont give me more or in other way i cannot get the list until i have 1 of those 6 items.

3) I would like players cannot choose a Dusk mark if they have a castle.

Tx in advance for any help
krapno is offline  
Old 12.10.2005, 10:16   #2
[localhost]
Архивный участник
 
Join Date: Oct 2005
Posts: 51
Default

I've already started to do this! Now learning AI programming, sometning already done! I'll share some code later, when i have to finish it (will take me few days).
[localhost] is offline  
Old 12.10.2005, 10:33   #3
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

ok take your time, i try to do something on my side, i try to learn quest structure, i use "Find Sir Windawood" quest atm
krapno is offline  
Old 12.10.2005, 11:18   #4
[localhost]
Архивный участник
 
Join Date: Oct 2005
Posts: 51
Default

What exactly you don't understand in quests structure?
[localhost] is offline  
Old 12.10.2005, 12:00   #5
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

Quote:
Originally Posted by [localhost
]What exactly you don't understand in quests structure?
i mean how to make a quest...

then i made something able to get quest items from NPC and i would like that NPC doesnt give that item if i have one yet and getting the item it cost 600 adenas, here a part of my code:

Code:
...
	push_event		// talker
	push_const 32
	add
	fetch_i
	push_const 60101	// (Item Given by NPC)
	push_const 1
	func_call 77		// func[GiveItem1]
	shift_sp -3
	shift_sp -1
	shift_sp 1
	push_event		// talker
...
Tx for help
krapno is offline  
Old 12.10.2005, 12:18   #6
TheOrder
Архивный участник
 
Join Date: Sep 2005
Posts: 731
Default

Krapno Download Hami's Tool Pach 1.3 maybe this will help you . Here is link Hami's Tools . Iff you manage to complete the 7 Sign maybe you will share it . Tnx in advance
TheOrder is offline  
Old 12.10.2005, 12:39   #7
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

Quote:
Originally Posted by TheOrder
Krapno Download Hami's Tool Pach 1.3 maybe this will help you . Here is link Hami's Tools . Iff you manage to complete the 7 Sign maybe you will share it . Tnx in advance
tx for your answer but i have all about AI var/functions/handlers, what i need is how and when use them... atm i need to make a sort of:

Code:
if (item 60101 is owned) then
 dont give more
else
 give one item 60101
 take 600 adena
end
and that code give an item but i dunno how to implement conditions wit AI :?

Code:
   push_event      // talker 
   push_const 32 
   add 
   fetch_i 
   push_const 60101   // (Item Given by NPC) 
   push_const 1 
   func_call 77      // func[GiveItem1] 
   shift_sp -3 
   shift_sp -1 
   shift_sp 1 
   push_event      // talker
Regards
krapno is offline  
Old 12.10.2005, 12:47   #8
[localhost]
Архивный участник
 
Join Date: Oct 2005
Posts: 51
Default

Understood! I'm trying to do this! Just wait for my share, think it will help u!

2TheOrder PM me password for l2tools1.3 plz ij u know...
[localhost] is offline  
Old 12.10.2005, 13:18   #9
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

Quote:
Originally Posted by Enishi
(23:48:19) (@hami) pass : datakey
krapno is offline  
Old 12.10.2005, 13:55   #10
[localhost]
Архивный участник
 
Join Date: Oct 2005
Posts: 51
Default

I'm blind) Sorry)
[localhost] is offline  
Old 12.10.2005, 14:04   #11
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

Quote:
Originally Posted by krapno
tx for your answer but i have all about AI var/functions/handlers, what i need is how and when use them... atm i need to make a sort of:

Code:
if (item 60101 is owned) then
 dont give more
else
 give one item 60101
 take 600 adena
end

[php:1:8dae0dd365] shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 60101
func_call 81 // func[OwnItemCount]
shift_sp -2
push_const 0
equal
push_reg_sp
fetch_i
branch_false L0
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 57
func_call 81 // func[OwnItemCount]
shift_sp -2
push_const 599
greater
and
L0
branch_false L2
L1
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 60101
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 57
push_const 600
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L2
[/php:1:8dae0dd365]
Sauron is offline  
Old 12.10.2005, 14:09   #12
Kenster
Архивный участник
 
Join Date: Sep 2005
Posts: 455
Default

Kranpo, You also have to make sure

if(they have any mark)
do not allow buy
else if (they have no mark)
allow buy 1
else if (you own a castle)
allow only dawn mark
end.
Kenster is offline  
Old 12.10.2005, 14:28   #13
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

Tx a lot Sauron, i m gonna try this

so, does "shift_sp 1" mean "if" or something like that ?

Quote:
Originally Posted by Kenster
Kranpo, You also have to make sure

if(they have any mark)
do not allow buy
else if (they have no mark)
allow buy 1
else if (you own a castle)
allow only dawn mark
end.
Quote:
Originally Posted by krapno
3) I would like players cannot choose a Dusk mark if they have a castle.
next step Kenster :!:
i try to make it step by step to understand :wink:
krapno is offline  
Old 12.10.2005, 15:01   #14
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

nope shift_sp 1 is like "function begin"
shift_sp -3 "function has 3 vars"
shift_sp -1 "function ends"
and in the end, (equal, greater, less, not_equad, etc)
Sauron is offline  
Old 12.10.2005, 15:39   #15
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

ok it works fine

i need to get some lines explained please, here my ai:

Code:
...
L60150
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60101 
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2

		push_const 0		//  if 0 item 60101 in pc inventory
		equal

		push_reg_sp		// ??
		fetch_i			// ??

	branch_false L60152		//  if return false goto L60152

	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 57 
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2

		push_const 599		//  if adenas > 599 in pc inventory
		greater

		and			// ??

	branch_false L60152		//  if return false goto L60152
...
what does mean lines where i put // ?? please (push_reg_sp, fetch_i, and) ... does "and" mean that 2 functions are linked ?

Tx

ps: In other part, i have to check if pc has a castle but i dont find func to get that...
krapno is offline  
Old 12.10.2005, 19:06   #16
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

Code:
shift_sp 1 
    push_event    //  talker 
    push_const 32 
    add 
    fetch_i 
    push_const 60101 
    func_call 81    //  func[OwnItemCount] 
    shift_sp -2 
    push_const 0 
    equal 
    push_reg_sp 
    fetch_i 
    branch_false L0 
    shift_sp 1 
    push_event    //  talker 
    push_const 32 
    add 
    fetch_i 
    push_const 57 
    func_call 81    //  func[OwnItemCount] 
    shift_sp -2 
    push_const 599 
    greater 
    and 
L0 
    branch_false L2 
L1 
    shift_sp 1 
    push_event    //  talker 
    push_const 32 
    add 
    fetch_i 
    push_const 60101 
    push_const 1 
    func_call 77    //  func[GiveItem1] 
    shift_sp -3 
    shift_sp -1 
    shift_sp 1 
    push_event    //  talker 
    push_const 32 
    add 
    fetch_i 
    push_const 57 
    push_const 600 
    func_call 80    //  func[DeleteItem1] 
    shift_sp -3 
    shift_sp -1 
L2
im not sure... but:
the "and"...
does it mean that if the condition:
Code:
    shift_sp 1 
    push_event    //  talker 
    push_const 32 
    add 
    fetch_i 
    push_const 57 
    func_call 81    //  func[OwnItemCount] 
    shift_sp -2 
    push_const 599 
    greater 
    and
L0 
    branch_false L2
is false L0 shall be executed and jumps to L2 then? and otherwise (condition is true) it just skips L0?
toolpunk is offline  
Old 12.10.2005, 23:24   #17
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

hmm look, think it this way.

when u use

push_reg_sp
fetch_i

then it will be replace by the 1st (and, or) u use.

so u have
[php:1:6cb3d588cd]
shift_sp 1 // function begins
push_event // talker - 1st var talker
push_const 32
add
fetch_i
push_const 60101 // 2nd var, const 60101 (item id)
func_call 81 // func[OwnItemCount]
shift_sp -2 // end 2 vars function

// note in this case there is no need for the shift_sp -1
// so far we have "OwnItemCount(talker, 60101)"

push_const 0 // pust const 0 :P
equal // this means function and value pushed has to be compared

// "if(OwnItemCount(talker, 60101) == 0)"

push_reg_sp // the if will continue
fetch_i
branch_false L0 // if return false it will jump to L0 else continue
shift_sp 1 // function begin
push_event // talker
push_const 32
add
fetch_i
push_const 57
func_call 81 // func[OwnItemCount]
shift_sp -2
push_const 599
greater
and // to write it like a nomal languaje, this should be where the "push_reg_sp; fetch_i" is

so we get

if(OwnItemCount(talker, 60101) == 0 && OwnItemCount(talker, 57) > 599)
{
..........
}
else
{
jump L0
}
[/php:1:6cb3d588cd]
Sauron is offline  
Old 13.10.2005, 00:09   #18
krapno
Архивный участник
 
Join Date: May 2005
Posts: 368
Default

well, here my code updated including conditions following Sauron's instructions:

Get Mark 60101 if
- 0 mark owned (between 60101 to 60106)
- 600 adena (or more) owned

Code:
///////////////////////////////////////////////////////////////////////// Controls
L60150
	shift_sp 1
		push_event		//  talker
		push_const 32 
		add 
		fetch_i 
		push_const 60101 
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 0		//  if 0 item 60101 in pc inventory
		equal
		push_reg_sp
		fetch_i	
	branch_false L60152		//  if return false goto L60152
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60102
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 0		//  if 0 item 60102 in pc inventory
		equal
		push_reg_sp
		fetch_i	
	branch_false L60152		//  if return false goto L60152
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60103
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 0		//  if 0 item 60103 in pc inventory
		equal
		push_reg_sp
		fetch_i	
	branch_false L60152		//  if return false goto L60152
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60104
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 0		//  if 0 item 60104 in pc inventory
		equal
		push_reg_sp
		fetch_i	
	branch_false L60152		//  if return false goto L60152
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60105
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 0		//  if 0 item 60105 in pc inventory
		equal
		push_reg_sp
		fetch_i	
	branch_false L60152		//  if return false goto L60152
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60106
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 0		//  if 0 item 60106 in pc inventory
		equal
		push_reg_sp
		fetch_i	
	branch_false L60152		//  if return false goto L60152

	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i
		push_const 57 
		func_call 81		//  func[OwnItemCount] 
		shift_sp -2
		push_const 599		//  if adenas > 599 in pc inventory
		greater

		and			// ??

	branch_false L60152		//  if return false goto L60152
///////////////////////////////////////////////////////////////////////// NPC Give Items
L60151 
	shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 60101 
		push_const 1 
		func_call 77		//  func[GiveItem1] 
		shift_sp -3 
		shift_sp -1 
		shift_sp 1 
		push_event		//  talker 
		push_const 32 
		add 
		fetch_i 
		push_const 57 		//  adenas
		push_const 600 		//  take 600 adenas
		func_call 80		//  func[DeleteItem1]
	shift_sp -3 
	shift_sp -1

	shift_sp 1
		push_event		// talker
		push_const 32
		add
		fetch_i
		S60152.	"sevensign601_d.htm"	// Quest Description
		push_string S60152
		func_call 43		// func[ShowPage]
	shift_sp -2
	shift_sp -1

	shift_sp 1
		push_event		// talker
		push_const 32
		add
		fetch_i
		S60153.	"ItemSound.quest_accept"
		push_string S60153
		func_call 173		// func[SoundEffect]
	shift_sp -2
	shift_sp -1
L60152
	exit_handler
/////////////////////////////////////////////////////////////////////////
now we need to check castle condition in order to filter Dawn Marks...

in other part, if i set marks as "is_destruct=1" in order player can change if he made a mistake registering (should i ?), then if i do like that and i destruct the Mark, quest memo stay ... then i need to delete that memo with the mark... i dunno how to do it too.

finally, will i have to delete automatically all marks owned each 2 weeks ? because i cannot use MSSQL Agent do to that, it doesnt work in real time, it only deletes in databases, not in Cache :? well maybe u know a way to delete items in real time to all players who own it/them ?

Regards

PS: Again tx a lot to Sauron for all explanations
krapno is offline  
Old 13.10.2005, 16:12   #19
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

so the "and" makes ai check if both/all conditions are true?
means in this case the item to be given isnt already in the inventory and the player has to have more than 599 adena (so at least 600) in order to continue...
so otherwise it executes L0, right?
sorry if im confusing somebody with all this but i really wanna learn this and this is my desperate attempt to it
toolpunk is offline  
Old 24.10.2005, 20:51   #20
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

ok thanks...
i understood it now...
must have been kinda blackout XD
sorry for disturbing. lol
toolpunk is offline  
Old 22.01.2006, 18:51   #21
xarion
Архивный участник
 
Join Date: Sep 2005
Posts: 220
Default

2 Krapno
Did you complete quest on 7 signs?
Can you share your files?
xarion is offline  
Old 22.01.2006, 22:16   #22
Flamestrike
Архивный участник
 
Join Date: Aug 2005
Posts: 434
Default

Why are you still breathing?
Flamestrike is offline  
Old 23.01.2006, 00:55   #23
TheOrder
Архивный участник
 
Join Date: Sep 2005
Posts: 731
Default

I doubth you will get that fix , and one more thing i last saw Krapno 2 mounths ago . I think he kinda left the community , hope i am wrong and he will reply . Srry for the OFFTOPIC
TheOrder is offline  
Old 23.01.2006, 02:13   #24
Kenster
Архивный участник
 
Join Date: Sep 2005
Posts: 455
Default

And his c4 server shut down.
Kenster 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 23:17.