Guide to the .qst Quest System
Basic Overview
The new quest system is very similar to MIRC scirpting. It introduces if() statements, $vars and %variables, and EVENTS.With the new quest system you can set dynamic variables example: "%DynamicVariable = "Something";"."Something" can also be a $var or %variable. Saving Quests You have to save quests using the .qst file type. Which can be done by using note pad and using Save As. Then go to File type and select All Files . Quests should be saved in /quests/Zonename/NPCID.qst . You can use /quests/world.qst . to have that quest work for every npc. %Variables You can set custom %variables and use them in scripts. Syntax: %variable_name = "Something here"; Example: %level = "$calc($mlevel + 3)"; Commands - Events - EVENT_SAY - Triggered when a mob is targeted and the PC types something. EVENT_ITEM - Triggered when (an) item(s) is turned into a PC via trade. EVENT_DEATH - Triggered when the NPC dies. EVENT_ATTACK - Triggered when the NPC is attacked. (Note: It will not trigger again until the mob has been disengaged in combat for 13 seconds. EVENT_SPAWN - Triggered when the NPC spawns. - Variables - $1 - $9 = Used to identify words said directed torward an NPC. Say you said "Hello Tunare, my name is chauncie." $1 would be "Hello " $2 would be "Tunare,". $2- would be "Tunare, my name is chauncie" $3 would be "my" $3- would be "my name is chauncie" $1- would be "Hello Tunare, my name is chauncie." - Identifiers - $name - Returns the name of the user that triggered the Event. $race - Returns the race of the user that triggered the Event. $class - Returns the class of the user that triggered the event. $userid - Returns the ID of the user that triggered the Event. $ulevel - Returns the level of the user that triggered the Event. $uguildid - Returns the ID of the guild of the user that triggered the Event. $ugildrank - Returns the guild rank of the user that triggered the Event. $mobid - Returns the NPCTypeID of the mob that the user triggered the Event on. $mlevel - Returns the level of the mob that the user triggered the Event on. $item 1-4 - If user turned in an item, $item1 would be the first item they turned in, $item2 the second, $item3 the third etc etc. $faction - Returns the faction level of the user with the mob. $zonesn - Returns the zone short name that the Event occured in. $zoneln - Returns the zone long name that the Event occured in. $status - Returns the account status of the user that triggered the Event. $+ - Say that $name is billy : Great_Lord_ $+ $name would be: Great Lord billy. $item0-3 - If user turned in an item, $item0 would be the first item Also when an item is turned in it is given an identifier: $item0 - The item in the first slot. $item1 - The item in the second slot. $item2 - The item in the third slot. $item3 - The item in the fourth slot. $mid(string,index,end) - $mid("Hello",1,3) would return "ell". $calc(Mathematical operation) - $calc((2*90) / 4) would return 45. $hasitem(itemid) $hasitem(1001) would return $true if user has item# 1001 $false if not. $strlen(string) - $strlen("Hello") would return 5. $asc(character) - $asc(A) would return 65. $chr(number) - $chr(65) would return A. $gettok(string,character,index) - gettok(heh1.heh2.heh3,46,0) would return "heh2". $replace(string,Find,Replace) - Replaces letters/numbers in text. Ex $replace(hi there,u,l) would return "hi there". Ex $replace(hi there,e,l) would return "hi thlrl". - Commands - say("Text") - Mob will say "Text". emote("Text") - Mob will emote "Text". shout("Text") - Mob will shout "Text". spawn(npc_type,grid,guildwarset,x,y,z) - Spawn "npc_type" on "grid" with "guildwarset" at "x","y","z". echo("Text") - Echoes specified text to console. summonitem(itemid) - Summons "itemid" to user that triggered Event. castspell(id,spellid) - Casts "spell" on entity with "id". depop() - Mob will de-spawn. cumflag() - Flag 50 for mob will increase by 1. flagnpc(flag,flag_value) - Sets "flag" to "flag_value" for mob. flagclient(flag,flag_value) - Sets "flag" to "flag_value" for client. exp(amount) - Adds "amount" of exp to user's exp amount. level(newlevel) - Sets user level. safemove() - Moves user to zone's safe x,y,z. rain(1/0)/snow(1/0) - Makes it rain or snow in zone. givecash (cop.,silv.,gold,plat) - Gives client coin. pvp("on/off") - Sets pvp on/off for user. doanim(anim_num) - Mob will do animation for "anim_num". addskill(skill,value) - Increases "skill" by "value" for user. me(text) - Does a name-less emote, me("The ground below you begins to shake") - If Statements - An if statement is used to check to see if a condition is true, if it is true then it continues on. If statements can use operators: ==,!=,<,>,<=,>=,=~. Syntax: if (something operator something_else (&&,||) etc. if ($calc("$mlevel - $ulevel") <= 3) { say("Your low, so i'll kill you $name") } if ($1 == "Hail,") { say("Hail there $name $+ ! How is your day?") } if ($1- =~ "Hi" || $1- =~ "hey" || $1- =~ "yo") { shout("Hello!") } if ($1 != "password" && $1 != "12321") { say("That's the incorrect password, I won't talk to you!") } You may use if statements inside of if statements example: if ($1 == "heh") { if ($2 == "4") { say("Bahh") } } Examples A simple hail script. Code:
Code:
EVENT_SAY { Code:
EVENT_ITEM { Code:
EVENT_SAY { Code:
EVENT_DIE { Code:
EVENT_SAY { |
Ok I am not sure if this matters, but can you space out the script to make it easier to follow. IE putting it on multiple lines. I have done a little programming in C and you can put in on multiple lines. And is there any way to spawn other NPC's, and pass some kind of variable to that other NPC? For example:
Say I had an NPC and I hailed it, then have that NPC spawn 4 other NPC's and have them cast 4 different fireworks spells. Oh one more thing is there any kind of timer that can be used? Also is there any command to move the character to a loc in the zone. Kind of like the #goto command in EQEmu? |
Does this work with EQEmu 4.2?
|
This is for 4.3-DR*
|
Does any one have answers to my questions :?:
|
Is there anywhere to download the binaries for 4.3dr2? I'd definitely like to try out this new scripting system - looks much more flexible than the old one, with IF, AND, OR etc, particularly for things like multiple item turn-ins.
|
Telmet has some binaries that work fairly well.
|
OMG
Mirc scripting in EQ... that's my job! that's soo cool... i was actually trying to find a good purpose for mirc in all this hehe is this quest system actually working right now? |
Yeah it's working in 4.3 dr2.
|
Another thing to note is that the .qst files don't just go in the \quests folder, they need to go in a sub-folder named after the zone the quest NPC is in - e.g quests\qeynos2\01.qst.
This is a really handy feature, as it makes organising .qst files and finding ones to modify/fix much easier. |
Agreed Drawde. It also should allow you to make multiple quest scripts for the same npc type if you choose to spawn them in different zones.
Haven't tried that yet but it should probably work. All in all I'm really excited about the new quest system, looks like lots of flexability that wasn't available in the old system. |
Very nice work, its nice having one place to look for info on quests, the new system will help bring more to the emu, since quests are a major part of EQ. just my 2cents =P
|
An Idea Maybe?
Hrm anyone have a way to test these new scripts outside of game maybe? Would definatly save time from having to log into the game, find out it doesn't work, just to edit it, and re-log in, over-n-over ;) Sorry if I sound too n00b ;) -- but just wish there was a 3rd party tool to do quest scripting tests ;) any ideas?
|
Try running EQ using EQW quest were (are?) read each time they are activated. So a change made to the .qst file will show up the next time it is triggered. so no need to log out ect, just switch windows, edit the quest and switch back to test.
I havn't tried this with the new quest system yet, but hoping it still works. |
The files are loaded when the zone is booted up, so you have to camp out and reboot the zone for the changes to take affect.
|
QST command
or if You are serverOP you can use the #reloadqst command to flush are reload the quest cache.
|
Oh wow, didn't know that command exsisted. That'll help a lot. :)
|
Feature Request:
Could: $sex (Returns sex of the person that triggered event or whatever ;)) be added to next release? Would just make some of the says a little more personal :D |
hi everyone. I am not familiar with mirc scripting. Are there any guides i can follow that will teach me how to do it? You know, something llike a for dummies book?
Thanks in advance |
The first post in this thread is your guide.
|
I 'm new to EQEmu
My question is how do you bind a quest to an npc? Does one simply name the .qst file after the NPC?
|
It's named after the NPCID (The unique ID associated with the NPC)
|
What root directory
is the root directory where you have the emulator installed(world.exe etc) or mysql\bin or what? I'm assuming the emulator right now.
|
emufolder\quests\zoneshortname\
OR emufolder\quests\all\ You can put the quest files in either of those folders, of course if they're put in the zonename folder, they only work in that zone, if they're in all they work for any zone that has that npc in it. |
Would this work?
Would this work in world.qst ? This is a little quest that I think every server should have for it's staff. For 1, it can help your staff members to get the job done easier. Like if they are starting a quest, they can write the quest in there. Of coarse the code would have to be updated for the staff members unless there is a flag variable that I didn't see. But for admins, if your just starting a char over this would be a good code, especially if you program it further to give you items for that class. It's a good idea. Feel free to modify it if it works.
Code:
EVENT_SAY { |
world.qst? have I been sleeping and missed that or is that something you were suggesting wes add?
Actually it sounds interesting, as long as it will not be a performance problem. A thought along those lines, since it is global make it a command to access the global quest file. This might be a way to give some limited scripting capabilities to server operators. |
ive seen some people talk about world.qst, wether it really exists or not I have no idea, but I have heard of it. Test it out.
|
I'm pretty sure it goes in /quests/default.qst
Heres a debug quest Code:
EVENT_SAY { |
How are coded the race to check the race of the player ? jsut as the define in the source code ?
|
Are these new Quests working in 4.4-DR1?
Are these new Quests working in 4.4-DR1?
I tried to create my own quest, and then I downloaded a bunch of quests from a thread here. And in neither case did they do anything. I even shut everything down and restarted world.exe and the zones. My equemu directory is: D:\EQEmu\EQEMu-0.4.3-Win32\quests\rivervale (Yes it is really 0.4.4-DR1). I placed the quests in D:\EQEmu\EQEMu-0.4.3-Win32\quests. Here is one quest I was testing the file is at: D:\EQEmu\EQEMu-0.4.3-Win32\quests\rivervale\11.qst, and the contents of the file are: Code:
/* Zone:rivervale ID:11 -- Ace_Slighthand */ I could show the text in the shell of world.exe and the zone server that loaded rivervale, but neither says anything about quests. Could there be a different version of 4.4-DR1 that I should download that has the quests enabled? Thanks for any help you can supply. |
Quote:
|
So...
The binaries for 0.4.4-dr1 don't support .qst files?
|
I just wanted to say i love the way you did the quest system wes. its easy and fast.
|
My .qst files are working with 4.4 dr1, my only problem is that when I say the second part of the quest trigger it says the first along with the second.
|
kk
OK, I wanna know WHERE you write the quests... do you implement them during game? Or do you write them up in a certain program like database or something?
|
You can write the quests using "notepad" but when you save them, change the file type to ALL and then save the file with .qst extention. It goes in your emu directory under the folder "quests" (be sure to put it in the correct subfolder for the zone).
|
K cool
Yeah to practice the new Quest system I wrote a quest in Notepad cause it seemed compatible, which Databases include the Quest package? And can anyone include a quick Start to Finish guide on getting the system up and running? n00b at all this but have plenty of time to learn...
|
try placing the quest folder in C:\eqemu\binary\Quests
then inside the quest folder you will need the name of the zone you want the quest in C:\eqemu\binary\Quests\Qeynos then name the .qst file after the npcid number of the npc you want to use the quest. for instance, captain tillan, i do a #npcstats or #showstats while targeting captain tillan and see that his npcid number is 1000. i would name the file 1000.qst. and place it into the Qeynos folder. C:\eqemu\binary\Quests\Qeynos the zone has to reboot for the quest to work, if not rebooted, and someone is in zone you can do #reloadqst and this will clear the .qst memory cache. good luck. |
NPC's not casting
I can get all the other commands i have tried to work in the scripts, except i can't get an npc to cast in a quest situation. I have put text before and after the cast command(s) and the npc will say the text but seems to just disregard the cast commands.. could someone give me an example of an npc casting a translocate spell on the hailer?
Thanks in advance |
here is example of working soulbinder -
EVENT_SAY{ if ($1-=~ "Hail"){ say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to [bind your soul] to this location if that is your wish.") } if ($1-=~ "bind my soul"){ say("Very well. You will return to this spot when you die.") castspell("$userid","2049")) } /*END of FILE Zone:freporte ID:5552 -- Soulbinder_Grunson */ |
All times are GMT -4. The time now is 07:49 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.