acces in kr

smoochy boys on tour

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
i whant to make a key sistem that will allow ppl going in kr's (same as zedinas keymaker's) , i added a new table in game3g "TBL_keymaker" with 2 rows "FLD_nume" and "FLD_NRkey"

in mapquest i put this code

D1504 [0] 0 [MonDie] NumaRuinsKeyMaker * [MapQuest_Def\Mon_NRKM] [@Main] Group

in MapQuest_Def i added a txt file Mon_NRKM and in this i put this script

[@main]

#act
formatstr "FLD_nume='%s'" %username

ReadValueSQL "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" [@nextline]

[@nextline()]
#act
mov A1 %ARG(1)
mov D1 %ARG(2)
goto @givekey
#IF
equal A1 ""
#act
formatstr "'%s','%S'" %username 0
mov A8 %A9
FormatStr "FLD_nume='%S'" %username
Mov A2 %A9
WriteValueSql "TBL_Keymaker" %A2 "FLD_Username,FLD_NRkey" %A8

goto @givekey

[@givekey]
mov D7 1
formatstr "FLD_nume='%S'" %username
MOV A8 %A9
Formatstr "FLD_NRkey='%S'" %D7
updatevaluesql "TBL_KeyMaker" %A8 %A9

but after i make and kill a "numaruinskeymaker" in d1504 nothing happens in the sql table wot do i need to change to make it work ? ty
 
Last edited:

mapadale

Guest
Why you creating a SQL script for it, doing it this way is far easier and your not actually storing anything in SQL as the key will be used.

Code:
[main]
#IF
CHECKITEM RuinsKey
#ACT
TAKE RuinsKey
#SAY
You may now enter.
#ELSESAY
You don't have the required key

If its from an NPC, then just add MAPMOVE

Code:
[main]
#IF
CHECKITEM RuinsKey
#ACT
TAKE RuinsKey
[B]MAPMOVE 0 213 213[/B]
#SAY
You may now enter.
#ELSESAY
You don't have the required key

Or even like this.

Code:
[main]
#IF
CHECKITEM RuinsKey
#ACT
TAKE RuinsKey
#SAY
You may now enter
<Enter/@ent>
#ELSESAY
You don't have the required key

[ent]
#ACT
MAPMOVE 0 213 213

If you don't want people to enter the KR though the map then remove the entrance cords and you only need to create the item in the DB.

The mapquest only needs to be used, if you want the mob to drop the item at a specific time or after its been killed a certain amount of times or to allow access straight into the KR. All the SQL jargon, doesn't really need to be done. Unless I'm missing the point.
 
Last edited:
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
You can leave the doors open as normal if you use Flags.. (as it works just the same as SQL and it uses a lot less code)..

Code:
D1504 [0] 0 [MonDie] NumaRuinsKeyMaker * [MapQuest_Def\Mon_NRKM] [@Main] Group
D1506 [0] 0 [Enter] * * [MapQuest_Def\EnterKR] [@NMKR]

MapQuest_Def\Mon_NMKM.txt
Code:
[@Main]
#ACT
Set [400] 1

MapQuest_Def\EnterKR.txt
Code:
[@NMKR]
#IF
Check [400] 1
#ACT
Set [400] 0 ;Use this line if they have to have a key every time
Enter_OK
#ELSEACT
Enter_Fail
#ELSESAY
You cannot get in here! Get a Key!\\\

Then for each boss/KR you want.. set another Flag..

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

To do it with the SQL...

Code:
[@nextline()]
#act
mov A1 %ARG(1)
mov D1 %ARG(2)
goto @givekey
#IF
equal A1 ""
#act
formatstr "'%s','%S'" %username 0
mov A8 %A9
FormatStr "FLD_nume='%S'" %username
Mov A2 %A9
WriteValueSql "TBL_Keymaker" %A2 "FLD_Username,FLD_NRkey" %A8
goto @givekey
Why do you have "goto @givekey" at the top?

Also FLD_Username is not what the rest of the script is looking for.. thats looking for FLD_Nume
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
the point in making this truw a sql script is so i dont make a "key" item , cos i dont whant ppl beeing able to sell the kr key's or even worse dont whant them to go with a full grp of noobs kill 1 km and take 11 key's and use them all only on theyr main char .. im trying using sql so i can creat a list with player name and how many key's they have for every kr , and everytime the player kills a specific km ( numaruinskeymaker in my ex) 1 key will be added in hes list , and when he will whant to go in kr il make a script that read's from the keymaker list , takes 1 key and rs the boss and the subbs (duno how il do the last part yet :P but if il get how to use and write value's to sql probably will be easy )
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
Why do you have "goto @givekey" at the top?

Also FLD_Username is not what the rest of the script is looking for.. thats looking for FLD_Nume

the "goto @givekey" from the top i put it cos i made the script using inflikted's idiot guide :P , but i deleted it now and changed the FLD_username into FLD_nume but still nothing happens .. i kill the mob and nothing get's added in sql , and id preffer use this not the flag's way cos i dont know how to read the flag's after (duno even if it's possible ) cos il need to make a script to show ppl how many key's they have in all the kr's ( but again il get there after i make this script adding vallue's to sql first )
 
Upvote 0

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
mhh u have in ur HL_Stditems Db a field called Disapear. so the one that go as example with 10 noobs to hunt kr key must use it that day or it will be deleted next day from server self. so it brings him nothing to take noobs with.

as next zedina made that script that one dont steal the boss from another one example.
im inside kr and fight vs NK than another one enter the KR attack me also that i die and he steal the boss and the drop. if u wanna have it same way than it brings u nothing if make a key maker that give everyone a key that kill the key maker.

the best way would it be if a keymob respawn first if a boss died inside kr than u need nothing no flag no sql nothing

so how i would do it :
i create first a key inside db with disapear time 1 day.

than i make a mapquest check if boss die (goto keyrespwanscript)
than respawn keymaster ( or how ever u call him inside ur monster db keyguard keymaster what ever)

and finished

so in that case u kill a keymaster and get a key . if a grp wanna go inside kr u can make it also with mapquest group and all have a key ( how u said it before )

than only that one or that grp have a key. if they go inside kr they find example NK kill him and noone else can enter that KR and steal that boss or drop. with the extra result that the next that hunt for a key can only enter the kr if the grp before had killed.

sure that way have the prob that one can kill the keymaster get the key and find it funny to not kill the NK and noone can enter the kr but he have nothing from it he can sell it for a high price or kill self mhh all other would make no sense.

think about it maybe it would be also possible to use a time script like ida did on npc hidden script for event i never test it if it work with boss respawn or keymaster respawn but it should be also possible. maybe it would be also possible to use a time script for disapeartime

example
#if
hour 1 (1 hour is gone)
#act
take XYZKEY (mapquest) so it disapear

with that geordic ida or inflikted are much better than me *hehe
 
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
Try this, although I haven't tested it as I am at work..

Code:
[@Main]
#IF
#ACT
FormatStr "FLD_Nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_Nume,FLD_NRKey" @LoadKeys

[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)
Mov   D1   %ARG(2)

#IF
Equal  A1  ""
#ACT
Mov  A1  %USERNAME
Mov  D1  1
FormatStr "'%s',%s" %A1 %D1
Mov A8 %A9
FormatStr "FLD_Nume='%s'" %A1
WriteValueSql "TBL_KeyMaker" %A9 "FLD_Nume,FLD_NRKey" %A8

#ELSEACT
Mov  A1  %USERNAME
Inc  D1  1
FormatStr "FLD_NRKey=%s" %D1
Mov A8 %A9
FormatStr "FLD_Nume'%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8
 
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
nope still doesnt work ida and i added a = in here
FormatStr "FLD_Nume'%s'" %A1
cos i thout u missed it , but doesnt work with or without the = ..

@amenovis still have some problems with the disapear items :P cos they disapear str8 after relog , but anyway i dont really whant to make them disapear cos then il make the player's to go in kr in same day when they killed the keymob and at least me as a player i woudent liked that , and even if they disapear they allways can use all the 11key's in same day .. so the problem of ppl going with noobs to take more then 1 key from a keymob wount disapear
 
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
kyeron, Your problem is your Field Names..

In the script they are showing as FLD_nume and FLD_NRkey but they are actually just nume and NRKey


ida how u find my idea it should be possible also or not for disapear time or respawn ?

Its workable.. and would stop it from ever being stolen...

But it could also mean that if someone killed it, got the Key and never killed the boss, nobody else could either, so you would have to safeguard it with a timer of some sort.. i.e. set a flag, (which is cleared by the bosses death), and after the timer runs out, it clears you key if you haven't killed the boss (also clears on Login in case you log out to remove the timer).
 
Last edited:
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
lol didnt knew i need to name the FLD with FLD i thout they are called FLD_something cos something is a field in the tablle ... but anyways works now ty a lot ida
 
Last edited:
Upvote 0

kyeron

LOMCN Veteran
Veteran
Loyal Member
Sep 28, 2008
296
1
45
timisoara
ok so for others who will need this .... ida's script

Code:
[@Main]

#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" @LoadKeys

[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)
Mov   D1   %ARG(2)

#IF
Equal  A1  ""
#ACT
Mov  A1  %USERNAME
Mov  D1  1
FormatStr "'%s',%s" %A1 %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
WriteValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" %A8

#elseact
Mov  A1  %USERNAME
Inc  D1  1
FormatStr "FLD_NRkey=%s" %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8

this add's ur name in FLD_nume only if u kill the km alone , if u kill it in grp and 1 persone from grp has hes name allready in FLD_nume only that persone will get 1 key .. so wot i did to make it work proparly is
add this in 00default at [@HLSCRIPTSYSTEM]
Code:
 Delaygoto [Local] 3 @add_keymaker
          [@add_keymaker]
          #cALL [HLSCRIPT\keymaker.txt] @keymakeradd

and in keymaker.txt add this
Code:
[@keymakeradd]
{
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" @LoadKeys

[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)
Mov   D1   %ARG(2)

#IF
Equal  A1  ""
#ACT
Mov  A1  %USERNAME
Mov  D1  0
FormatStr "'%s',%s" %A1 %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
WriteValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" %A8

}
this will add ur name in FLD_nume from the first time when u log in game .. so when u kill a km ur name will allready be in the list
 
Upvote 0

Zordon

Golden Oldie
Golden Oldie
Apr 26, 2008
1,176
20
145
Manchester, UK
ok so for others who will need this .... ida's script

Code:
[@Main]
 
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" @LoadKeys
 
[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)
Mov   D1   %ARG(2)
 
#IF
Equal  A1  ""
#ACT
Mov  A1  %USERNAME
Mov  D1  1
FormatStr "'%s',%s" %A1 %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
WriteValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" %A8
 
#elseact
Mov  A1  %USERNAME
Inc  D1  1
FormatStr "FLD_NRkey=%s" %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
UpdateValueSql "TBL_KeyMaker" %A9 %A8

this add's ur name in FLD_nume only if u kill the km alone , if u kill it in grp and 1 persone from grp has hes name allready in FLD_nume only that persone will get 1 key .. so wot i did to make it work proparly is
add this in 00default at [@HLSCRIPTSYSTEM]
Code:
 Delaygoto [Local] 3 @add_keymaker
          [@add_keymaker]
          #cALL [HLSCRIPT\keymaker.txt] @keymakeradd

and in keymaker.txt add this
Code:
[@keymakeradd]
{
#IF
#ACT
FormatStr "FLD_nume='%s'" %USERNAME
ReadValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" @LoadKeys
 
[@LoadKeys()]
#ACT
Mov   A1   %ARG(1)
Mov   D1   %ARG(2)
 
#IF
Equal  A1  ""
#ACT
Mov  A1  %USERNAME
Mov  D1  0
FormatStr "'%s',%s" %A1 %D1
Mov A8 %A9
FormatStr "FLD_nume='%s'" %A1
WriteValueSql "TBL_KeyMaker" %A9 "FLD_nume,FLD_NRkey" %A8
 
}
this will add ur name in FLD_nume from the first time when u log in game .. so when u kill a km ur name will allready be in the list

what do you put in the enterkr.txt to check the sql table for keys and then enter the kr?
 
Upvote 0