Post Pacific  

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

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 27.10.2005, 10:03   #1
Phantom2005
Архивный участник
 
Join Date: Aug 2005
Posts: 394
Default [Share]Exp decreasing npc.

This is originally used on my own server... but i'm using event mangers on my own server and i'm sharing gatekeeper version.

First of all you have to add this line to every GK:
Code:
<a action="link teleporter_decreaseexp.htm">Decrease my experience.</a>
Example clavier001.htm:
Code:
<html>
<head>
<body>
<html>
<head>
<body>
Gatekeeper Clarissa:<br> We Gatekeepers use the will of the Gods to open the doors to time and space and teleport others.  Which door would you like to open?<br>
<a action="bypass -h teleport_request"> Teleport</a><br>
<a action="bypass -h menu_select?ask=-303&reply=518"> Exchange with the Dimension Diamond</a><br>
<a action="bypass -h menu_select?ask=-19&reply=0"> [Noblesse Only] teleport</a><br>
<a action="bypass -h menu_select?ask=255&reply=4" msg="811;Monster Derby Track"> Move to Monster Derby Track (Free of Charge)</a><br>
<a action="link teleporter_decreaseexp.htm">Decrease my experience.</a>
<a action="bypass -h talk_select">Quest </a>
</body>
</html>
IMPORTANT NOTE: Add this class before all teleporter classes(clavier for example)
But after the "teleporter" class!

Open your ai.obj and add:
Code:
class teleporter_decreaseexp : teleporter
parameter_define_begin
	string fnLowLevel "teleporter_lowlevel.htm"
	string fnDoneDecrease "teleporter_donedecrease.htm"
parameter_define_end

handler 32 2123	//  MENU_SELECTED
	variable_begin
		"talker"
		"ask"
		"reply"
		"myself"
		"_choiceN"
		"_code"
		"_from_choice"
	variable_end

	push_event	//  ask
	push_const 160
	add
	fetch_i4
	push_const 100
	equal
	branch_false L50000

	push_event	//  reply
	push_const 164
	add
	fetch_i4
	push_const 0
	equal
	branch_false L50003

	push_event	//  talker
	push_const 40
	add
	fetch_i	//  level
	push_const 1092
	add
	fetch_i
	push_const 70
	greater
	branch_false L50001

	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  talker
	push_const 40
	add
	fetch_i
	push_const 0
	push_const 25000000
	negate
	func_call 184746219	//  func[IncrementParam]
	shift_sp -3
	shift_sp -1
	jump L50006
L50003
	push_event	//  reply
	push_const 164
	add
	fetch_i4
	push_const 1
	equal
	branch_false L50004

	push_event	//  talker
	push_const 40
	add
	fetch_i	//  level
	push_const 1092
	add
	fetch_i
	push_const 60
	greater
	branch_false L50001

	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  talker
	push_const 40
	add
	fetch_i
	push_const 0
	push_const 3500000
	negate
	func_call 184746219	//  func[IncrementParam]
	shift_sp -3
	shift_sp -1
	jump L50006
L50004
	push_event	//  reply
	push_const 164
	add
	fetch_i4
	push_const 2
	equal
	branch_false L50005

	push_event	//  talker
	push_const 40
	add
	fetch_i	//  level
	push_const 1092
	add
	fetch_i
	push_const 50
	greater
	branch_false L50001

	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  talker
	push_const 40
	add
	fetch_i
	push_const 0
	push_const 1000000
	negate
	func_call 184746219	//  func[IncrementParam]
	shift_sp -3
	shift_sp -1
	jump L50006
L50005
	push_event	//  reply
	push_const 164
	add
	fetch_i4
	push_const 3
	equal
	branch_false L50000

	push_event	//  talker
	push_const 40
	add
	fetch_i	//  level
	push_const 1092
	add
	fetch_i
	push_const 40
	greater
	branch_false L50001

	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  talker
	push_const 40
	add
	fetch_i
	push_const 0
	push_const 500000
	negate
	func_call 184746219	//  func[IncrementParam]
	shift_sp -3
	shift_sp -1
	jump L50006
L50001
	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  talker
	push_const 40
	add
	fetch_i
	push_parameter fnLowLevel
	func_call 184680516	//  func[ShowPage]
	shift_sp -2
	shift_sp -1
	jump L50000
L50006
	push_event	//  myself
	push_const 704
	add
	fetch_i
	push_event	//  talker
	push_const 40
	add
	fetch_i
	push_parameter fnDoneDecrease
	func_call 184680516	//  func[ShowPage]
	shift_sp -2
	shift_sp -1
	jump L50000
L50000
	call_super
handler_end

class_end
Now you have to open ai.obj and change:
Code:
class clavier : teleporter
to
Code:
class clavier : teleporter_decreaseexp

teleporter_lowlevel.htm:
Code:
<html>
<head>
<body>
Your level is too low you can't decrease your exp anymore.
</body>
</head>
</html>
event_donedecrease.htm:
Code:
<html>
<head>
<body>
Your exp has been decreased! Have fun!<br><br>

<center><a action="bypass -h menu_select?ask=100&reply=0">Level 70~80</a><br></center><br1>
<center><a action="bypass -h menu_select?ask=100&reply=1">Level 60~70</a><br></center><br1>
<center><a action="bypass -h menu_select?ask=100&reply=2">Level 50~60</a><br></center><br1>
<center><a action="bypass -h menu_select?ask=100&reply=3">Level 40~50</a><br></center><br>
</body>
</head>
</html>


Phantom2005 is offline  
Old 27.10.2005, 12:25   #2
top-gear
Архивный участник
 
Join Date: Aug 2005
Posts: 605
Default

good lord:P useful for bounty hunters. Can you make it give you an item everytime it decreases your xp?
top-gear is offline  
Old 27.10.2005, 14:21   #3
Phantom2005
Архивный участник
 
Join Date: Aug 2005
Posts: 394
Default

Yes i can write that for you in a sec...
Phantom2005 is offline  
Old 27.10.2005, 14:38   #4
Phantom2005
Архивный участник
 
Join Date: Aug 2005
Posts: 394
Default

Use this code if you want to give an item to someone after his exp has been decreased.

Change this line for which item and how much
Code:
   push_const 110 // Item ID, 110 = Doom Shield.
   push_const 1 // How Much
Code:
class teleporter_decreaseexp : teleporter 
parameter_define_begin 
   string fnLowLevel "teleporter_lowlevel.htm" 
   string fnDoneDecrease "teleporter_donedecrease.htm" 
parameter_define_end 

handler 32   //  MENU_SELECTED 
   variable_begin 
      "talker" 
      "ask" 
      "reply" 
      "myself" 
      "_choiceN" 
      "_code" 
      "_from_choice" 
   variable_end 

   push_event   //  ask 
   push_const 100 
   add 
   fetch_i 
   push_const 100 
   equal 
   branch_false L50000 

   push_event   //  reply 
   push_const 104 
   add 
   fetch_i 
   push_const 0 
   equal 
   branch_false L50003

   push_event   //  talker 
   push_const 32 
   add 
   fetch_i   //  level 
   push_const 888 
   add 
   fetch_i 
   push_const 70 
   greater 
   branch_false L50001 

   shift_sp 1 
   push_event   //  talker 
   push_const 32 
   add 
   fetch_i 
   push_const 0 
   push_const 25000000 
   negate 
   func_call 171   //  func[IncrementParam] 

   shift_sp 1
   push_event	//  c1
   push_const 276
   add
   fetch_i
   push_const 110 // Item ID, 110 = Doom Shield.
   push_const 1 // How Much
   func_call 77	//  func[GiveItem1]
   shift_sp -3
   shift_sp -1
   jump L50006 
L50003 
   push_event   //  reply 
   push_const 104 
   add 
   fetch_i 
   push_const 1 
   equal 
   branch_false L50004 

   push_event   //  talker
   push_const 32
   add
   fetch_i   //  level
   push_const 888
   add
   fetch_i
   push_const 60
   greater
   branch_false L50001

   shift_sp 1 
   push_event   //  talker 
   push_const 32 
   add 
   fetch_i 
   push_const 0 
   push_const 3500000 
   negate 
   func_call 171   //  func[IncrementParam] 

   shift_sp 1
   push_event	//  c1
   push_const 276
   add
   fetch_i
   push_const 110 // Item ID, 110 = Doom Shield.
   push_const 1 // How Much
   func_call 77	//  func[GiveItem1]
   shift_sp -3
   shift_sp -1
   jump L50006 
L50004 
   push_event   //  reply 
   push_const 104 
   add 
   fetch_i 
   push_const 2 
   equal 
   branch_false L50005 

   push_event   //  talker 
   push_const 32 
   add 
   fetch_i   //  level 
   push_const 888 
   add 
   fetch_i 
   push_const 50 
   greater 
   branch_false L50001

   shift_sp 1 
   push_event   //  talker 
   push_const 32 
   add 
   fetch_i 
   push_const 0 
   push_const 1000000 
   negate 
   func_call 171   //  func[IncrementParam] 

   shift_sp 1
   push_event	//  c1
   push_const 276
   add
   fetch_i
   push_const 110 // Item ID, 110 = Doom Shield.
   push_const 1 // How Much
   func_call 77	//  func[GiveItem1]
   shift_sp -3
   shift_sp -1
   jump L50006 
L50005 
   push_event   //  reply 
   push_const 104 
   add 
   fetch_i 
   push_const 3 
   equal 
   branch_false L50000 

   push_event   //  talker 
   push_const 32 
   add 
   fetch_i   //  level 
   push_const 888 
   add 
   fetch_i 
   push_const 40 
   greater 
   branch_false L50001 

   shift_sp 1 
   push_event   //  talker 
   push_const 32 
   add 
   fetch_i 
   push_const 0 
   push_const 500000 
   negate 
   func_call 171   //  func[IncrementParam] 

   shift_sp 1
   push_event	//  c1
   push_const 276
   add
   fetch_i
   push_const 110 // Item ID, 110 = Doom Shield.
   push_const 1 // How Much
   func_call 77	//  func[GiveItem1]
   shift_sp -3
   shift_sp -1
   jump L50006 
L50001 
   shift_sp 1 
   push_event   //  talker 
   push_const 32 
   add 
   fetch_i 
   push_parameter fnLowLevel 
   func_call 43   //  func[ShowPage] 
   shift_sp -2 
   shift_sp -1 
   jump L50000 
L50006 
   shift_sp 1 
   push_event   //  talker 
   push_const 32 
   add 
   fetch_i 
   push_parameter fnDoneDecrease 
   func_call 43   //  func[ShowPage] 
   shift_sp -2 
   shift_sp -1 
   jump L50000 
L50000 
   call_super 
handler_end 

class_end
Phantom2005 is offline  
Old 27.10.2005, 17:56   #5
duante
Архивный участник
 
Join Date: Aug 2005
Posts: 36
Default

instead of decreasing exp you could just decrease the level by 1 per click... just look up the param option 0-6 to find the right one.

duante
duante is offline  
Old 27.10.2005, 18:20   #6
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

nope cos IncrementParam level is not permanent.
Sauron is offline  
Old 27.10.2005, 21:46   #7
hoho324
Архивный участник
 
Join Date: May 2005
Posts: 52
Default

I thought the permanent ones were: level, exp, sp, and something else...isnt it ? O.o
hoho324 is offline  
Old 28.10.2005, 17:11   #8
Sauron
Архивный участник
 
Join Date: Feb 2005
Posts: 357
Default

i could be wrong but i remember testing it and only exp and sp was permanent.
Sauron is offline  
Old 07.01.2007, 10:58   #9
Phantom2005
Архивный участник
 
Join Date: Aug 2005
Posts: 394
Default

Sorry for bumping this topic.
Someone requested an updated version of this.
I included the html just dont forget to save it as unicode.
This new script is fully supported by C4.
Phantom2005 is offline  
Old 10.01.2007, 19:02   #10
Fileburner
Архивный участник
 
Join Date: Jun 2006
Posts: 8
Default

thank you for sharing
Fileburner is offline  
Old 11.01.2007, 11:13   #11
Morfey
Архивный участник
 
Join Date: Jan 2007
Posts: 61
Default

Script don`t work for me. AI have more errors. PLIZ post there put this script.
Morfey is offline  
Old 13.01.2007, 01:15   #12
nnightmare
Архивный участник
 
Join Date: Jun 2006
Posts: 153
Default

umm.. this post is from 2 years ago.. meaning that it doesnt work with C4 server -.-
nnightmare is offline  
Old 13.01.2007, 01:49   #13
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

Quote:
Originally Posted by Phantom
Sorry for bumping this topic.
Someone requested an updated version of this.
I included the html just dont forget to save it as unicode.
This new script is fully supported by C4.
Morrey what kind of problems do you have with this AI? Does L2NPC tells you that the AI is incorrect for that class?
m4rk is offline  
Old 19.01.2007, 12:55   #14
jencxxl
Архивный участник
 
Join Date: Apr 2005
Posts: 122
Default

Thank you for the share working great
jencxxl is offline  
Old 20.01.2007, 04:31   #15
Rexx
Архивный участник
 
Join Date: Jun 2006
Posts: 64
Default

Please excuse my ignorance but Im am trying to understand the structure of the ai.
Where in the ai should this script be placed,
and if you wouldn't mind, a short explanation as to why it goes there and not just placed anywhere.

Thanks
Rexx
Rexx is offline  
Old 20.01.2007, 10:27   #16
nish
Архивный участник
 
Join Date: May 2006
Posts: 237
Default

i just place AI at the end of the file seems to work fine :P
nish is offline  
Old 20.01.2007, 11:31   #17
Rexx
Архивный участник
 
Join Date: Jun 2006
Posts: 64
Default

Thanks Nish
I tried that but got all sorts of errors when the NPC's loaded, but at least I know thats were you put yours and it worked for you.
Going through the error logs, it looks like the main error is :
Cannont find AI class [default_maker]

I will take another look at my AI as I too have added other scripts to my AI with no problems before.
Did you leave your class heading as in the post: "class teleporter_decreaseexp : teleporter",
or did you change it to "class 1 teleporter_decreaseexp : teleporter",
Rexx is offline  
Old 20.01.2007, 12:10   #18
nish
Архивный участник
 
Join Date: May 2006
Posts: 237
Default

default maker is a npcpos error im pretty sure there is a fix for that somewhere here not sure where since its a older topic.... try a search
nish is offline  
Old 21.01.2007, 06:27   #19
Rexx
Архивный участник
 
Join Date: Jun 2006
Posts: 64
Default

For those having difficulty with this, here is what I did to get it to work.
Thanks to Phantom for the share.

Adding the line to every gate keepers html you wish to have the function worked , no problems there.

<a action="link teleporter_decreaseexp.htm">Decrease my experience.</a>

After that it all went wrong for me.
Fix for my server but not all, maybe I have a different AI to some.
You must change the AI from the original post to class 1 eg:

class teleporter_decreaseexp : teleporter (original post)
class 1 teleporter_decreaseexp : teleporter (my server)

This class must be added to your AI before the gatekeeper you wish to have the function. eg find clavier and add this class above or before clavier. This must be added to every gate keeper you wish to have the function.
Then you must change

class 1 clavier : teleporter
to
class 1 clavier : teleporter_decreaseexp
and the same for any other gate keepers you have given this function too.

Then make you html as you desire.
Here is mine if you wish to use them as an example

teleporter_decreaseexp.htm

<html>
<head>
<body>
Choose the amount of EXP you would like me to suck from you<br><br>

<center><a action="bypass -h menu_select?ask=100&reply=0">Decrease my EXP by 25000000</a><br></center><br1>
<center><a action="bypass -h menu_select?ask=100&reply=1">Decrease my EXP by 3500000</a><br></center><br1>
<center><a action="bypass -h menu_select?ask=100&reply=2">Decrease my EXP by 1000000</a><br></center><br1>
<center><a action="bypass -h menu_select?ask=100&reply=3">Decrease my EXP by 500000</a><br></center><br>
</body>
</head>
</html>

teleporter_donedecrease.htm
<html>
<head>
<body>
Your sole has been sucked of EXP<br>
<br>
<br>
<a action="link teleporter_decreaseexp.htm">Have you sole sucked again.</a>

</body>
</head>
</html>

teleporter_lowlevel.htm
<html>
<head>
<body>
Your level is too low you can't decrease your exp anymore.
</body>
</head>
</html>

Sorry about not putting the html into code, not sure how to do that.
Hope this helps those having problems implementing this option to there servers.
It seems Phantoms method worked for some servers but not for others, I am not at all saying his method is incorrect.
Thanks again for sharing.

Rexx
Rexx is offline  
Old 25.01.2007, 06:26   #20
DevilsAssociate
Архивный участник
 
Join Date: Jul 2006
Posts: 81
Default

great share


**off topic**

is there any type of guide for ai scripting
the c4 fetch_i const?
tryig to learn it myself for future stuff

i seen the function post and thats about it
DevilsAssociate is offline  
Old 12.06.2007, 05:38   #21
goodtimeshaxor
Архивный участник
 
Join Date: Oct 2006
Posts: 108
Default

I wanted to add some search key words to this thread cause I had some trouble finding it:

Delevel, deleveling, reduce, experience, sp, exp, xp
goodtimeshaxor 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 18:36.