EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Custom adventure merchant (https://www.eqemulator.org/forums/showthread.php?t=27346)

Randymarsh9 01-29-2009 10:45 PM

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.

Randymarsh9 01-30-2009 06:43 PM

...Bump...

ChaosSlayer 01-30-2009 07:04 PM

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

Randymarsh9 01-30-2009 09:00 PM

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.

ChaosSlayer 01-30-2009 09:40 PM

thats what I ment. The Credit System quest write up using actual plat but it can be easily changed to use items instead

Randymarsh9 01-30-2009 10:01 PM

ok lol can you link what you are looking at then because I must have been looking at something way diferent. Uhm my bad

ChaosSlayer 01-30-2009 10:11 PM

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:


sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Hello, $name. Are you interested in [buffs] or would you like to know 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 [buffs]?");
}

if($text=~/obtain/i){
quest::say("For every platinum you bring me you shall receive one credit.  These credits can be redeemed for buffs at your request.");
}

if($text=~/buffs/i || $text=~/yes/i) {  #### What buffs does he offer and how much credit?
quest::say("I have the following to offer you:");
quest::say("[Cleanse] --full health and mana restore-- - FREE");
quest::say("[Temperance] - 25p");
quest::say("[Virtue] - 50p");
quest::say("[C1] - 5p");
quest::say("[C2] - 25p");
quest::say("[C3] - 75p");
}

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 [buffs]?");
$buffbot = undef;
}
}

#cleanse
if($text=~/cleanse/i){ #### Restores Mana and Health.  I use this as an alternative to simply casting a spell
$client->Heal();
$client->SetMana($client->GetMaxMana());
quest::say("As you wish!");
}

#buffs begins

#buff 1- Temperance
if($text=~/Temperance/i){
if ($buffbot >= 25) {
quest::selfcast(3692);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-25, 0, "Y9");
$buffbot = undef;
        }
else {
quest::say("You need more credits!");
$buffbot = undef;
        }
}
#temperance ends

#virtue
if($text=~/virtue/i){
if ($buffbot >= 50) {
quest::selfcast(3467);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-50, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}

#c1
if($text=~/c1/i){
if ($buffbot >= 5) {
quest::selfcast(174);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-5, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}

#c2
if($text=~/c2/i){
if ($buffbot >= 25) {
quest::selfcast(1693);
quest::say("As you wish!");
quest::setglobal("buffbot", $buffbot-25, 0, "Y9");
$buffbot = undef;
}
else {
quest::say("You need more credits!");
$buffbot = undef;
}
}

#c3
if($text=~/c3/i){
if ($buffbot >= 75) {
quest::selfcast(2570);
quest::say("As you wish!");
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($platinum >= 1){
          quest::setglobal("buffbot", $buffbot+$platinum, 0, "Y9");
        quest::say("Your credit has been increased by $platinum.");
        $buffbot = undef;
        quest::settimer(1,1);
        }
else {
        quest::say("I only accept platinum.");
        $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);
        }
}


Randymarsh9 01-30-2009 10:16 PM

Alright thanks. So this will just go on a normal NPC and not a merchant or anything, right?

ChaosSlayer 01-31-2009 12:25 AM

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

Randymarsh9 01-31-2009 12:41 AM

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.

Randymarsh9 01-31-2009 02:13 PM

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);
}
}

leslamarch 01-31-2009 02:22 PM

make sure to check and see that qglobal is set to 1 and not 0 in your database.

leslamarch 01-31-2009 02:29 PM

Quote:

Originally Posted by Randymarsh9 (Post 163635)

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");
}

just a suggestion, but for this part i would use this in your script
Code:

quest::itemlink(item #);
this way they can just click on the link and see the reward.

Randymarsh9 01-31-2009 02:29 PM

I checked buffbot in quest_globals and it was already set to 1.

Randymarsh9 01-31-2009 06:48 PM

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.