Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2004, 08:57 AM
Monrezz's Avatar
Monrezz
Dragon
 
Join Date: Mar 2003
Location: #loc
Posts: 745
Default Money Conversion Quest

Just written a simple perl money conversion quest that converts the money given to the NPC to it's highest possible coinage.

e.g.
Give the NPC 10 copper = 1 silver returned.
Give the NPC 100 copper = 1 gold returned.
Give the NPC 50 copper, 5 silver and 19 gold = 2 platinum returned.


If you give the NPC a value that it can't upgrade it will give you the coin back and tell you it cannot be upgraded.
e.g.
Give the NPC 7 copper = 7 copper returned.
Give the NPC 8 gold = 8 gold returned.


If you give the NPC coinage that adds up to a decimal value it will be rounded down to the nearest full coin.
e.g.
Give the NPC 11 copper = 1 silver returned.
Give the NPC 19 gold = 1 platinum returned.
Give the NPC 55 copper, 97 silver and 107 gold = 117 platinum returned.


Not sure if this could help anyone but it was kinda fun to do and thought someone could use it. Just stick the following into a .pl file:

Code:
sub EVENT_SAY
{
	if($text =~ /Hail/i){
	quest::say("Greetings $name. Would you like me to [convert] some money?");}

	if($text =~ /convert/i){
	quest::say("Give me some loose change and I will change it into the highest coinage I can. I will always round down - I have to make a living somehow!");}
}

sub EVENT_ATTACK
{
	if(($ulevel > $mlevel) && ($mlevel < 51))
	{
	quest::say("Please, somebody help me! $name is attacking me!");
	quest::emote("calls out for help.");}

	else
	{
        @responses =
        ("Time do die, $name!",
        "That was a bad idea, $name!",
	"Prepare to die $name!",
	"Foolish $race, you think you can defeat me?");
        my $length = $#responses + 1;
        $length = rand($length);
        $length = int $length;
        quest::say($responses[$length]);
	}
}

sub EVENT_DEATH
{
	quest::say("My comrades will avenge my death!");
}

sub EVENT_ITEM
{
	$myplatinum = (($copper/1000) + ($silver/100) + ($gold/10) + $platinum);
	$mygold = (($copper/100) + ($silver/10) + $gold + (10*$platinum));
	$mysilver = (($copper/10) + $silver + (10*$gold) + (100*$platinum));
	$mycopper = ($copper + (10*$silver) + (100*$gold) + (1000*$platinum));

if($mycopper < 10){
	quest::say("Sorry, but I need at least 10 copper to upgrade you into silver. Here, have your money back.");
	quest::givecash($copper,0,0,0);}

if((($mycopper >= 10) && ($mycopper < 100)) || (($mysilver >= 1) && ($mysilver < 10))){
	quest::say("You gave me coins worth a total value of $mysilver silver. Here you go:");
	quest::givecash(0,$mysilver,0,0);}

if((($mycopper >= 100) && ($mycopper < 1000)) || (($mysilver >= 10) && ($mysilver < 100)) || (($mygold >= 1) && ($mygold < 10))){
	quest::say("You gave me coins worth a total value of $mygold gold. Here you go:");
	quest::givecash(0,0,$mygold,0);}

if(($mycopper >= 1000) || ($mysilver >= 100) || ($mygold >= 10) || ($myplatinum >= 1)){
	quest::say("You gave me coins worth a total value of $myplatinum platinum. Here you go:");
	quest::givecash(0,0,0,$myplatinum);}
}
__________________

kRPG Profile
Reply With Quote
  #2  
Old 02-15-2004, 10:02 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

Pretty sweet, that could be a very good thing to add to newbie zones to guards so one doesnt have to run back to town every time one turns around.. If I put this as default.pl and put it in the quest folder, that wont overwrite quests, but will add a quest to any npc that doenst already have one right?
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #3  
Old 02-15-2004, 10:53 AM
Monrezz's Avatar
Monrezz
Dragon
 
Join Date: Mar 2003
Location: #loc
Posts: 745
Default

If you name it as default.pl and put it in EQEMu\quests\ then ANY mob without a quest will get this (but mobs with quests will keep their custom quest).

If you name it as default.pl and put it in EQEMu\quests\$zonesn then ANY mob witout a quest in that zone will get this (but mobs with quests will keep their custom quests).

In other words, only mobs without a quest will be affected.

Monrezz
__________________

kRPG Profile
Reply With Quote
  #4  
Old 02-15-2004, 02:06 PM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

Thought so. Thanks.
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #5  
Old 02-16-2004, 07:13 AM
Monrezz's Avatar
Monrezz
Dragon
 
Join Date: Mar 2003
Location: #loc
Posts: 745
Default

Which is your server samandhi?
__________________

kRPG Profile
Reply With Quote
  #6  
Old 02-17-2004, 08:49 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

It is called "My Own Personal Everquest Server", but I dont leave it running all the time..Only when I play (until I get it where I want it anyhow)...
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:23 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3