Log in

View Full Version : [Share]Exp decreasing npc.


Phantom2005
27.10.2005, 10:03
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:

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



Example clavier001.htm:

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

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:

class clavier : teleporter

to

class clavier : teleporter_decreaseexp



teleporter_lowlevel.htm:

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


event_donedecrease.htm:

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




http://img146.imageshack.us/img146/8836/decreaseexp9ys.th.jpg (http://img146.imageshack.us/my.php?image=decreaseexp9ys.jpg)http://img153.imageshack.us/img153/9666/decreaseexp28bp.th.jpg (http://img153.imageshack.us/my.php?image=decreaseexp28bp.jpg)http://img20.imageshack.us/img20/9158/decreaseexp35bn.th.jpg (http://img20.imageshack.us/my.php?image=decreaseexp35bn.jpg)

top-gear
27.10.2005, 12:25
good lord:P useful for bounty hunters. Can you make it give you an item everytime it decreases your xp?

Phantom2005
27.10.2005, 14:21
Yes i can write that for you in a sec...

Phantom2005
27.10.2005, 14:38
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

push_const 110 // Item ID, 110 = Doom Shield.
push_const 1 // How Much



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

duante
27.10.2005, 17:56
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

Sauron
27.10.2005, 18:20
nope cos IncrementParam level is not permanent.

hoho324
27.10.2005, 21:46
I thought the permanent ones were: level, exp, sp, and something else...isnt it ? O.o

Sauron
28.10.2005, 17:11
i could be wrong but i remember testing it and only exp and sp was permanent.

Phantom2005
07.01.2007, 10:58
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.

Fileburner
10.01.2007, 19:02
thank you for sharing :)

Morfey
11.01.2007, 11:13
Script don`t work for me. AI have more errors. PLIZ post there put this script.

nnightmare
13.01.2007, 01:15
umm.. this post is from 2 years ago.. meaning that it doesnt work with C4 server -.-

m4rk
13.01.2007, 01:49
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?

jencxxl
19.01.2007, 12:55
Thank you for the share working great

Rexx
20.01.2007, 04:31
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

nish
20.01.2007, 10:27
i just place AI at the end of the file seems to work fine :P

Rexx
20.01.2007, 11:31
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",

nish
20.01.2007, 12:10
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

Rexx
21.01.2007, 06:27
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

DevilsAssociate
25.01.2007, 06:26
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

goodtimeshaxor
12.06.2007, 05:38
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