Custom adventure merchant
Is there a way to edit an adventure merchant so it will use a different type of currency like items and give it custom gear to sell? I made one and I have been trying to find out how to make it accept a certain item as currency and then sell special gear, but I can't find any way to even edit it. I checked my merchant editor but he wasn't even listed, so once again I could use some help.
|
...Bump...
|
you can set up sort of work aroudn using quest globals system
when you give new currency items to an npc- you get your credit score when npc gives you something - its value substracted from your total credit look up Credit System quest set up in quest section |
I looked that up and it doesn't quite seem to be what I'm looking for. I saw on some server where an adventure merchant accepted some tokens that were dropped from random monsters and used to buy gear, and I want to try to emulate that.
|
thats what I ment. The Credit System quest write up using actual plat but it can be easily changed to use items instead
|
ok lol can you link what you are looking at then because I must have been looking at something way diferent. Uhm my bad
|
I can't seem to find the original but here is my copy
use this as a base but convert from using plat to using items and giving items instead of casting spells credit card system Code:
|
Alright thanks. So this will just go on a normal NPC and not a merchant or anything, right?
|
this can go onto ANY npc (except a banker cuase you cannot give things to a banker)
you see where npc tells you how much it cost to cast a spell? you can price your armor/weapon in same way so players comes to this NPC and gvies him 50 tokens npcs adds this up- and you now have credit of 50 then npc will tell you: "Filth Covered Magnificent Shoulderpads of the Slime - cost 35 tokens" player will say "give me Filth Covered Magnificent Shoulderpads of the Slime" Npc gives player the "Filth Covered Magnificent Shoulderpads of the Slime" and substracts 35 credits from player's account thats the general idea |
alright, I'm looking at the code and trying to figure out how I will be able to do it, and it looks like it will be relatively easy excluding the fact that I have no experience in coding. Thanks a lot for the code.
|
Alright, I changed everything around to match what I want on my server, but when I turn in the item that should be used for credit, he doesn't count it. He will say he accepted and it will say that your credit has risen, but when I do credit value it will say I have 0 credit and cannot buy anything.
sub EVENT_SAY { if($text=~/Hail/i){ quest::say("Greetings, $name. Are you looking to get rare [items] or do you want to see your [Credit Info]?"); } if($text=~/Credit Info/i){ quest::say("Would you like to know how to [obtain] credit, your current [credit value], or available [items]?"); } if($text=~/obtain/i){ quest::say("For every Zipz Drake Skull you bring me you will get one credit which you can use to buy items that are not in any loot tables."); } if($text=~/items/i || $text=~/yes/i) { #### What buffs does he offer And how much credit? quest::say("This is it:"); quest::say("[Arrow of Striking] --25 damage/200 range arrow-- - 10"); quest::say("[Orb of the Spectre] --Illusion Spectre clicky-- - 10"); quest::say("[Master Pelican Charm]--Improved Charm-- - 20"); quest::say("[Essence of the Spellcaster] --Gather Mana clicky and decent range item-- - 20"); quest::say("[Ring of Ice] --Summons a multi-element pet-- - 25"); quest::say("[Kazookaleyli] --The ultimate bard instrument-- - 20"); } if($text=~/credit value/){ if ($buffbot >= 1) { quest::say("Your current credit is $buffbot"); $buffbot = undef; } else { quest::say("You have 0 credit. Would you like to know how much you need to donate obtain [items]?"); $buffbot = undef; } } #cleanse if($text=~/Arrow of Striking/i){ #### Restores Mana And Health. I use this as an alternative to simply casting a spell if ($buffbot >= 10) { quest::summonitem(1441); quest::setglobal("buffbot", $buffbot-10, 0, "Y9"); quest::say("Arrows are good for shooting!"); $buffbot = undef; } else { quest::say("You need more credits!"); $buffbot = undef; } } #buff 1- Temperance if($text=~/Orb of the Spectre/i){ if ($buffbot >= 10) { quest::summonitem(1442); quest::say("Have fun with it."); quest::setglobal("buffbot", $buffbot-10, 0, "Y9"); $buffbot = undef; } else { quest::say("You need more credits!"); $buffbot = undef; } } #temperance ends #virtue if($text=~/Master Pelican Charm/i){ if ($buffbot >= 20) { quest::summonitem(1446); quest::say("This is definitely an item!"); quest::setglobal("buffbot", $buffbot-20, 0, "Y9"); $buffbot = undef; } else { quest::say("You need more credits!"); $buffbot = undef; } } #c1 if($text=~/Essence of the Spellcaster/i){ if ($buffbot >= 20) { quest::summonitem(1447); quest::say("Enjoy the mana!"); quest::setglobal("buffbot", $buffbot-20, 0, "Y9"); $buffbot = undef; } else { quest::say("You need more credits!"); $buffbot = undef; } } #c2 if($text=~/Ring of ice/i){ if ($buffbot >= 25) { quest::summonitem(11154); quest::say("Beware of frostbite when you wear it for extended durations."); quest::setglobal("buffbot", $buffbot-25, 0, "Y9"); $buffbot = undef; } else { quest::say("You need more credits!"); $buffbot = undef; } } #c3 if($text=~/Kazookaleyli/i){ if ($buffbot >= 20) { quest::summonitem(1448); quest::say("Only the best bards have this!"); quest::setglobal("buffbot", $buffbot-75, 0, "Y9"); $buffbot = undef; } else { quest::say("You need more credits!"); $buffbot = undef; } } } sub EVENT_ITEM { #give a plat, get a credit. Takes any platinum over 1. if($itemcount{1440} >= 1){ quest::setglobal("buffbot", $buffbot+$itemcount{1440}, 0, "Y9"); quest::say("Your credit has risen."); $buffbot = undef; quest::settimer(1,1); } else { quest::say("I only accept Zipz Drake Skulls."); $buffbot = undef; } plugin::return_items(\%itemcount); } sub EVENT_TIMER { if ($timer == 1) { quest::say("Would you like to know your total [credit value]?"); quest::stoptimer(1); } } |
make sure to check and see that qglobal is set to 1 and not 0 in your database.
|
Quote:
Code:
quest::itemlink(item #); |
I checked buffbot in quest_globals and it was already set to 1.
|
Is there anything wrong with the code or any reason it should not be working?
|
All times are GMT -4. The time now is 04:07 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.