PDA

View Full Version : Help with multiple item turnins / triggered spawn


Fyrre
06-30-2003, 07:27 AM
ok, first of all, I need help with multiple item turn ins. Lets say I have item IDs 195, 196, 197, and 198 and I want the NPC to respond only if all 4 are handed in. How do I accomplish this?

second of all, what does guildwarset and grid on this npcspawn trigger mean? I know that npc_type means the ID of the mob in the database and that x y and z is the location of the mob.

spawn(npc_type,grid,guildwarset,x,y,z) - Spawn "npc_type" on "grid" with "guildwarset" at "x","y","z".

IANumtin
06-30-2003, 08:22 AM
http://forums.eqemu.net/viewtopic.php?t=5719

That'll answer your questions about multiple item turn in. As far as the guildwar set I'm not to sure about, I've never messed with it.

Fyrre
06-30-2003, 08:39 AM
Right, I've looked at that topic at least 100 times. I want someone to provide an example on how to use $item1, $item2, and so on.

IANumtin
06-30-2003, 12:37 PM
$item1, $item2, etc is just a way of telling the quest npc to look for x amount of items. the "="1001" after is the item it looks for.

Here's an example. It's one I wrote a while ago.

EVENT_SAY {
if ($1- =~ "Hail") { say("Hail $name . I am skilled in the arts of smithing. I would be more than willing to make you some [armor] if you wish.") }
if ($1- =~ "armor") { say("I can craft a nice [helm] [vambraces] [greaves] [breastplate] [boots] [gauntlets] or [bracer].") }
if ($1- =~ "helm") { say("I can make you a fine helm. Bring me a lambent stone and a water flask. Don't forget the Full Plate Helm Mold.") }
if ($1- =~ "vambraces") { say("I can make you a fine set of vambraces. Bring me a lambent stone and a water flask. Don't forget the Full Plate Vambrace Mold.") }
if ($1- =~ "greaves") { say("I can make you a fine set of greaves. Bring me a lambent stone and a water flask. Don't forget the Full Plate Greaves Mold.") }
if ($1- =~ "breastplate") { say("I can make you a fine Breastplate. Bring me a lambent stone and a water flask. Don't forget the Full Breastplate Mold.") }
if ($1- =~ "boots") { say("I can make you a fine pair of boots. Bring me a lambent stone and a water flask. Don't forget the Full Plate Boot Mold.") }
if ($1- =~ "gauntlets") { say("I can make you a fine set of gauntlets. Bring me a lambent stone and a water flask. Don't forget the Full Plate Gauntlet Mold.") }
if ($1- =~ "bracer") { say("I can make you a fine bracer. Bring me a lambent stone and a water flask. Don't forget the Full Plate Bracer Mold.") }
}
EVENT_ITEM {
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22047") { say("Excellent Work. Here is your Helm") summonitem("4153") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22051") { say("Excellent Work. Here is your Vambraces") summonitem("4155") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22052") { say("Excellent Work. Here is your Greaves") summonitem("4158") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22053") { say("Excellent Work. Here is your Breastplate") summonitem("4154") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22046") { say("Excellent Work. Here is your Boots") summonitem("4159") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22054") { say("Excellent Work. Here is your Gauntlets") summonitem("4157") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22045") { say("Excellent Work. Here is your Bracer") summonitem("4156") }
}

Notice how the NPC asks for three things. The quest needs to know a way to identify the three things you're turning in to get such and such item in return. The $item1 and $item2, etc just tells the NPC how many items need to be turned in to hand out the reward.

EDIT: Btw, that's a ready made quest, feel free to use it if you wish. Just place it in the correct quest folder for whatever zone you want and save with an NPC id with .qst as an extension.

Bigpull
06-30-2003, 05:40 PM
EVENT_SAY {
if ($1- =~ "Hail") { say("Hail $name . I am skilled in the arts of smithing. I would be more than willing to make you some [armor] if you wish.") }
if ($1- =~ "armor") { say("I can craft a nice [helm] [vambraces] [greaves] [breastplate] [boots] [gauntlets] or [bracer].") }
if ($1- =~ "helm") { say("I can make you a fine helm. Bring me a lambent stone and a water flask. Don't forget the Full Plate Helm Mold.") }
if ($1- =~ "vambraces") { say("I can make you a fine set of vambraces. Bring me a lambent stone and a water flask. Don't forget the Full Plate Vambrace Mold.") }
if ($1- =~ "greaves") { say("I can make you a fine set of greaves. Bring me a lambent stone and a water flask. Don't forget the Full Plate Greaves Mold.") }
if ($1- =~ "breastplate") { say("I can make you a fine Breastplate. Bring me a lambent stone and a water flask. Don't forget the Full Breastplate Mold.") }
if ($1- =~ "boots") { say("I can make you a fine pair of boots. Bring me a lambent stone and a water flask. Don't forget the Full Plate Boot Mold.") }
if ($1- =~ "gauntlets") { say("I can make you a fine set of gauntlets. Bring me a lambent stone and a water flask. Don't forget the Full Plate Gauntlet Mold.") }
if ($1- =~ "bracer") { say("I can make you a fine bracer. Bring me a lambent stone and a water flask. Don't forget the Full Plate Bracer Mold.") }
}
EVENT_ITEM {
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22047") { say("Excellent Work. Here is your Helm") summonitem("4153") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22051") { say("Excellent Work. Here is your Vambraces") summonitem("4155") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22052") { say("Excellent Work. Here is your Greaves") summonitem("4158") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22053") { say("Excellent Work. Here is your Breastplate") summonitem("4154") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22046") { say("Excellent Work. Here is your Boots") summonitem("4159") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22054") { say("Excellent Work. Here is your Gauntlets") summonitem("4157") }
if ($item1 == "10000" && $item2 == "13006" && $item3 == "22045") { say("Excellent Work. Here is your Bracer") summonitem("4156") }
}

that should read more like


if ($item0 == "10000" && $item0 == "13006" && $item2== "22047") { say("Excellent Work. Here is your Helm") summonitem("4153") }

Items start at $item0

Lets say we have an npc that turns cloth caps(1001) in to cloth veils (1002)

EVENT_ITEM {
if ($item0 == "1001" ) {
say("Well done here is your veil")
summonitem("1002")
}
if ($item1 == "1001" ) {
say("Well done here is your veil")
summonitem("1002")
}
if ($item2 == "1001" ) {
say("Well done here is your veil")
summonitem("1002")
}
if ($item3 == "1001" ) {
say("Well done here is your veil")
summonitem("1002")
}
if ($item0 != "1001") {
say("Sorry i have no need of this you may have it back.")
summonitem("$item0")
}
if ($item1 != "1001") {
say("Sorry i have no need of this you may have it back.")
summonitem("$item1")
}
if ($item2 != "1001") {
say("Sorry i have no need of this you may have it back.")
summonitem("$item1")
}
if ($item3 != "1001") {
say("Sorry i have no need of this you may have it back.")
summonitem("$item1")
}
}


or using $itemcount()

EVENT_ITEM {
if ($itemcount("1001")){
say("Well done!")
summonitem("1002")
break()
}
if ($item0){
summonitem("$item0")
summonitem("$item1")
summonitem("$item2")
summonitem("$item3")
say("Say sorry I do not need those.")
}
}

Fyrre
06-30-2003, 06:12 PM
I figured it out shortly before you guys posted some help. Thanks anyways.

IANumtin
06-30-2003, 10:37 PM
Actually Bigpull, I did try it starting with $item0 and it kept giving me an unknown item error (or something like that, it's been a while). Could be that they fixed it in 4.4 I wrote that quest when I was using 4.3

mamba666
07-01-2003, 06:42 AM
In my quests I cannot use $Item(0) with 4.4 exe's I had to start with $item(1)

I hope this helps.

Bigpull
07-01-2003, 10:06 AM
Teach me to read the source not the docs =P

Correct dunno when or why, but it is $item1-4

killspree
07-01-2003, 11:05 PM
It was originally 0-3, wes fixed it to check for 1-4 a month or two ago.

Edgar1898
07-02-2003, 04:44 AM
forgot all those $item# variables, just use $itemcount. Ex:

if($itemcount(101)==1 && $itemcount(102)==1 && $itemcount(103)==1 && $itemcount(104)==1) { say("Ha! pwned.") }

oh and btw, depending on what system your compiling on, you might or might not have to put quotes around the item numbers.

Bigpull
07-04-2003, 10:44 AM
Bah I showed an itemcount example too. And uhm no quotes are fucking mandatory untill A) someone merges the quote snarfer, or B) wes commits his new parser, which he says quotes won't matter one way or another

For you techincal minded it's MS's non ansi complient implmentation of some basic c lib functions that are at fault, which no one really noticed till we started using it on compliant systems eg linux & bsd.

If I hear one more person say thier optional i'm apt to club you with your own leg, If your using an old parser.cpp (mid aprilish to mid mayish) you really should upgrade it and port you .qst's it's best everyones on the same page when it comes tto writing quests or we get Joeblow whineing in irc because quests JoeSmoe posted don't work on his system.