need help with a script

Mu online season 21 - grand opening

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
123
Germany
so now much will laughing but i didnt know it other at that point :)

to add items i created inside the db over 5000 items means :

RingDerOffenbarung (original)
RingDerOffenbarungI(F) F=Fire Ignis means adding 1st possibility
RingDerOffenbarungII(F) 2nd possibility
RingDerOffenbarungIII(F) 3rd possibility
RingDerOffenbarungI(E) E=Eis Gelu 1st possibility and so on

a Added item with first possibility give +3 element
a Added item with second pos give +6 element and the 3rd give +9 Element

so is it possible to get a script that look if its I(F) or II(F) or or and put that item got taken by the npc and the npc give back an original unadded item ?? like in my case RingDerOffenbarung ??

i know i had used a long way to come to the same finish as a simple script to add ( as i said was at my start and i didnt know it better. ) i hope there is a shorter way as to take the full script again and change by setting every step after step (maybe some of u can imagin how long that script is*lol)

so i hope someone have a idea id would be also a to high work to change all rings buy addind it in the normal way i mean to trade my items i build with items the server build ;(

lg

ameno
( i really have no idea i wrote ida 1 week ago or longer but he had other probs thats why there comes no idea from that side so pls)
 

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
94
dont exactly understand your english hehe, but maybe take a look at this code from one of my scripts..
Code:
<Input Item Name/@@itemupgrade2>\
[@@itemupgrade2]
#ACT
Mov A1 %INPUTSTR
Mov A2 (III)
Mov A3 (II)
ForMatStr "%s%s" %A1 %A2
Mov A4 %A9     ; new item
ForMatStr "%s%s" %A1 %A3
Mov A7 %A9    ; old item
-------
another example
---------
<Input Item Name/@@itemupgrade1>\
[@@itemupgrade1]
#ACT
Mov A1 %INPUTSTR
Mov A2 (II)
ForMatStr "%s%s" %A1 %A2
Mov A4 %A9

you ask the user to type the original name of the item.. then you can manipulate it to whatever you want, adding (II) or (III) etc.. then do an itemcheck... etc to see if they have it and give them the other item
 
Last edited:
Upvote 0

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
123
Germany
mhh nice one with ForMatStr "%S%S" a1 a2 he puts two parts together or ?
so example

inputstr = RingDerOffenbarung
a2= I(F)
than the script write RingDerOffenbarungI(F) and that is now =a4 or ??

than i need a check like

#if
checkitem %a4 1
act
give %a1

?? u mean it in that kind???

ohh why u use @@ is that a must or is @xyz also working?
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
94
@@ is used for input strings..

so it makes a popup textbox.. where you type in the info :) and yes its needed

lets look at small example :)

<Input Item Name/@@itemupgrade1>\ <----- user types in the item name
[@@itemupgrade1]
#ACT
Mov A1 %INPUTSTR <---- %INPUTSTR is the itemname, we move it to A1
Mov A2 (II) <-- move another value can be anything you want.. to A2
ForMatStr "%s%s" %A1 %A2 <--- we fuse this together to it becomes itemname(II)
Mov A4 %A9 <--- move this temp variable into a permanent variable
goto @checkitem

[@checkitem]
#IF
checkitem %A1 1 <---- check to see the person has the item in bag
#ACT
take %A1 1 <--- old item
give %A4 1<--- new item



remember you must manually add in the items to SQL db though hehe :) the rest of this script can be automated, the only thing i found wrong with this script was... people trying to upgrade items.. that arent in the database.. so it takes their item without giving anything back. that i am not sure how to fix :)
 
Upvote 0

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
123
Germany
mhh 1 moment pls
A4 is not the fused item name ?? in that example itemname(II)??

normaly if one write in the inputstring only the word (itemname) without the adds (II) that will be stay in A1

so under
#act it must be the other way or not

#act
take %A4
give %A1 (( i wanna that they can trade back added items to original ones that they can change the original ones to fp or other)

---------------------------------------------------------------------

[@main]
#say
what kind of added item u have
<(I)/@add1>
<(II)/@add2>
<(III)/@add3>

[@add1]
Write here the name without the add!!!\
<Input Item Name/@@itemupgrade1>\

[@@itemupgrade1]
#ACT
Mov A1 %INPUTSTR
Mov A2 (I)
ForMatStr "%s%s" %A1 %A2
Mov A5 %A9
goto @checkitem1

[@checkitem1]
#if
checkitem %A5 1
#act
take %A5 1
give %A1

[@add2]
Write here the name without the add!!!\
<Input Item Name/@@itemupgrade2>\

[@@itemupgrade2]
#ACT
Mov A1 %INPUTSTR
Mov A3 (II)
ForMatStr "%s%s" %A1 %A3
Mov A5 %A9
goto @checkitem2

[@checkitem2]
#if
checkitem %A5 1
#act
take %A5 1
give %A1

[@add3]
Write here the name without the add!!!\
<Input Item Name/@@itemupgrade3>\

[@@itemupgrade3]
#ACT
Mov A1 %INPUTSTR
Mov A4 (III)
ForMatStr "%s%s" %A1 %A4
Mov A5 %A9
goto @checkitem3

[@checkitem3]
#if
checkitem %A5 1
#act
take %A5 1
give %A1

/// so in that way or not as result i shoul ever get the item the user had before he add it so the original item or not ?? ps: I HATE VARIABLES BAHHHHHHHHHHHHHHHHHHHHHHHHHHH *lol and they hate me iam sure they do
 
Last edited:
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
94
yes that works, i just thought of something else as well going back to my example in the last post at the end

[@checkitem]
#IF
checkitem %A1 1 <---- check to see the person has the item in bag
#ACT
take %A1 1 <--- old item
give %A4 1<--- new item

instead of that.. you can do...

[@checkitem]
#IF
checkitem %A1 1 <---- check to see the person has the item in bag
#ACT
give %A4 1<--- new item
goto @checkitemagain

[@checkitemagain]
#IF
checkitem %A4 1
checkitem %A1 1
#ACT
take %A1 1
#ELSEACT
take %A4 1
------------------


this way... it first gives the new item (in your case the original item), then it does another check.. to make sure the person recieved the item.. if they didnt recieve the item.. then its all cancelled out :), if they recieved the new item.. then it will take the olditem away.. this way someone who tries to downgrade some weapon that is not in your database for some reason.. doesnt loose his old item :) hope you follow me hehe.

but overall it looks like your script is right.. for the use you need it.. the thing i showed.. is just another additional check :) so person doesnt loose item.. or tries to exploit NPC
 
Upvote 0

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
123
Germany
yeah i need time but i do lol i must read every step 2 or 3 times but than hey its clicking in the old smal brain *hihihi as i said i hate variable that is really a good way and much better as to use a script with a volume over 32 pages dinA4 lol
 
Upvote 0

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
94
ya hehe i did the samething with my character rebirth script :) made it into like 20 lines.. rather than hundreds of lines lol
 
Upvote 0