ozziedave Posted March 8, 2009 Author Share Posted March 8, 2009 Hi All,I have a bit of code from the Scripting Forum, but I want to stop the Quest from starting again,couls someone please help me.Case 2 '########## RING QUEST ########### Call PlayerMsg(index, "I'm the Gate Keeper, can you buy me Zorgon's Ring from the store?", 12) If CanTake(Index, 4, 1) = false then Call PlayerMsg(index, "Better Hurry Now !!", 12) Else Call TakeItem(index, 4, 1) Call GiveItem(index, 4, 100) Call PlayerMsg(index, "Thanks I've increased your HP and Exp ", 12) Call SetPlayerHP(index, GetPlayerHP(index) + 8) Call SetPlayerExp(index, GetPlayerExp(index) + 10) Call SendStats(index) Call PlayerMsg(index, "This Quest has been completed ", 15) End If Exit Sub Many Thanks Link to comment Share on other sites More sharing options...
DrNova Posted March 8, 2009 Share Posted March 8, 2009 Make playername.ini files with values that keep track of quests.[QUESTS]q1=q2=ect ect any way you want to rig it Link to comment Share on other sites More sharing options...
ozziedave Posted March 8, 2009 Author Share Posted March 8, 2009 Thanks for the prompt reply DrNova, could you elaberate on the scripting I need to add to thequest to complete the task.Many Thanks Link to comment Share on other sites More sharing options...
DrNova Posted March 8, 2009 Share Posted March 8, 2009 make a folder called "player" in your main server folderThese will the the lines your using> Call putvar("/player/" & getplayername(index) & ".ini", "QUEST", "quest1", 0)And this line> If getvar("/player/" & getplayername(index) & ".ini", "QUEST", "quest1") = 0Now, you will have to rig the OnNewChar sub to add each entry to the .ini file for each quest, changing the "quest1" to quest2, quest3, ect, or however you want to keep track of them.> Sub OnNewChar(Index, CharNum)> Call putvar("/player/" & getplayername(index) & ".ini", "QUEST", "quest1", 0)> End Subthis will make a .ini named after the player that will look like this> [QUEST]> quest1=0In this example we are using the assumption that 0 = not started yet, is a simple way to do it.Now you add a check to the beginning of the script to see if quest1=0, if its 0, they can do the quest, if its 1, they have dont the quest.> If getvar("/player/" & getplayername(index) & ".ini", "QUEST", "quest1") = 0 Then> script for quest> Else> call message that says quest done or whatever> End IfThe final version of your quest will look like this (however read what I wrote so you will understand .ini's for future use, very usefull)> If getvar("/player/" & getplayername(index) & ".ini", "QUEST", "quest1") = 0 Then> Call PlayerMsg(index, "I'm the Gate Keeper, can you buy me Zorgon's Ring from the store?", 12)> > If CanTake(Index, 4, 1) = false then> Call PlayerMsg(index, "Better Hurry Now !!", 12)> Else> Call TakeItem(index, 4, 1)> Call GiveItem(index, 4, 100)> Call PlayerMsg(index, "Thanks I've increased your HP and Exp ", 12)> Call SetPlayerHP(index, GetPlayerHP(index) + 8)> Call SetPlayerExp(index, GetPlayerExp(index) + 10)> Call SendStats(index)> Call PlayerMsg(index, "This Quest has been completed ", 15)> End If> Else> Call PlayerMsg(index, "Thank you for your assistance.", 12)> End IfNot you can make multi layered quests like this, say after buying the ring you must deliver something for the guy, add an extra check, if quest1=1 then (next scripted step) ect ect. Link to comment Share on other sites More sharing options...
Skillzalot Posted March 8, 2009 Share Posted March 8, 2009 this may be someone elses request but this will help me. Thanks Link to comment Share on other sites More sharing options...
ozziedave Posted March 8, 2009 Author Share Posted March 8, 2009 Great DrNova, this is one of the best explanations I could get, added to the skeleton Quest script,it makes it vary easy for us Newbies to understand(we need it Simplified every time).Thanks for the Explanation. Link to comment Share on other sites More sharing options...
Nubbs Posted March 8, 2009 Share Posted March 8, 2009 yea lol thats a really good tutorial on easy PutVar,GetVar set up bravo you even explained how to you it with an if-statement…. this helped me too thanks Link to comment Share on other sites More sharing options...
XxArchAngelxX Posted March 8, 2009 Share Posted March 8, 2009 wow nova, please post this in the scripting tutorial section, everyone seems to love it Link to comment Share on other sites More sharing options...
ozziedave Posted March 8, 2009 Author Share Posted March 8, 2009 Hi DrNova,Sorry but this did not work for me, it didn't make an ini file, so I set one up myselfServer/player - Zorgon.ini - [QUEST] quest1=1Would not read or write the variable to the ini file 'If Getvar' did not work, with a 1 it shouldnot have displayed the Quest, but it did, what am I doing wrong ?.Case 2 '########## RING QUEST ########### Call putvar("\player\"& getplayername(index) & ".ini", "QUEST", "quest1", 0) If getvar("\player\" & getplayername(index) & ".ini", "QUEST", "quest1") = 0 Then Call PlayerMsg(index, "I'm the Gate Keeper, can you buy me Zorgon's Ring from the store?", 12) If CanTake(Index, 4, 1) = false then Call PlayerMsg(index, "Better Hurry Now !!", 12) Else Call TakeItem(index, 4, 1) Call GiveItem(index, 4, 100) Call PlayerMsg(index, "Thanks I've increased your HP and Exp ", 12) Call SetPlayerHP(index, GetPlayerHP(index) + 8) Call SetPlayerExp(index, GetPlayerExp(index) + 10) Call SendStats(index) Call PlayerMsg(index, "This Quest has been completed ", 15) Call putvar("player\" & getplayername(index) & ".ini", "QUEST", "quest1", 1) End If Else Call PlayerMsg(index, "Thank you for your assistance.", 12) End If Exit Sub Link to comment Share on other sites More sharing options...
Nubbs Posted March 8, 2009 Share Posted March 8, 2009 check your spelling on the PutVar/GetVar you are using"\" instead of "/" and missing a few quotes here and there recheck your spelling and this should work Link to comment Share on other sites More sharing options...
ozziedave Posted March 8, 2009 Author Share Posted March 8, 2009 GOT IT.Had to chage it slightly to get it to work, placed my Zorgon.ini in the Server Directory and it works fine. Case 2 '########## RING QUEST ########### If getvar(getplayername(index) & ".ini", "QUEST", "quest1") = 0 Then Call PlayerMsg(index, "I'm the Gate Keeper, can you buy me Zorgon's Ring from the store?", 12) If CanTake(Index, 4, 1) = false then Call PlayerMsg(index, "Better Hurry Now !!", 12) Else Call TakeItem(index, 4, 1) Call GiveItem(index, 4, 100) Call PlayerMsg(index, "Well done your Quest has been accomplished", 12) Call SetPlayerHP(index, GetPlayerHP(index) + 8) Call SetPlayerExp(index, GetPlayerExp(index) + 10) Call SendStats(index) Call PlayerMsg(index, "I've increased your HP and Exp", 15) Call putvar(getplayername(index) & ".ini", "QUEST", "quest1", 1) End If Else Call PlayerMsg(index, "Sorry this quest has been completed", 12) End If Exit SubA BIG thanks to all and DrNova, Mr Fahrenheit. Link to comment Share on other sites More sharing options...
cheatking Posted March 8, 2009 Share Posted March 8, 2009 @[SB:> Nubbs aka mR. FahREnhEIT link=topic=40084.msg391656#msg391656 date=1236507070]> check your spelling on the PutVar/GetVar you are using"\" instead of "/" and missing a few quotes here and there recheck your spelling and this should workIts supposed to be \ Link to comment Share on other sites More sharing options...
balliztik1 Posted March 8, 2009 Share Posted March 8, 2009 It doesn't matter. Both / and \ work. Link to comment Share on other sites More sharing options...
Nubbs Posted March 8, 2009 Share Posted March 8, 2009 nice script and nice topic lol this topic has alot of good info in it.. if you post it in the script database make sure you tell people it takes godlords inventory script to run.. you could also tell people how to alter this script so they can use the same .ini for each one time quest , good job Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now