Randymarsh9
04-16-2009, 02:29 PM
I just modified one of my old quests to work as a teleporter. The npc doesn't respond to hails or when you give him money. I did enable quest globals for him.
sub EVENT_SAY{
if ($text=~/hail/i){
quest::say("Greetings, $name. I have the ability to teleport you to a variety of [zones], but it will cost you 50 platinum for each teleport.");
}
if ($text=~/zones/i){
quest::say("I can send you to [Cazic] Thule, [Cobalt] Scar, [Dawnshroud], [Iceclad], [Twilight] Sea, and [Wakening] Lands. You must have sufficient [credit].");
}
if ($text=~/credit/i){
quest::say("For each platinum you give me, you will earn one credit for teleports. You can also see your current [balance].");
}
if ($text=~/balance/i){
if ($porter >= 1) {
quest::say("Your current credit is $porter");
$porter = undef;
}
else {
quest::say("You have 0 credit.");
$porter = undef;
}
}
if ($text=~/cazic/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(1375)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/cobalt/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2025)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/dawnshroud/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2431)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/iceclad/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2022)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/twilight/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2426)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/wakening/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2024)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
}
sub EVENT_ITEM {
if($platinum >= 1){
quest::setglobal("porter", $porter+$platinum, 0, "Y9");
quest::say("Your credit has risen.");
$porter = undef;
}
else {
quest::say("I only take platinum.");
$porter = undef;
plugin::return_items(\%itemcount);
}
}
sub EVENT_SAY{
if ($text=~/hail/i){
quest::say("Greetings, $name. I have the ability to teleport you to a variety of [zones], but it will cost you 50 platinum for each teleport.");
}
if ($text=~/zones/i){
quest::say("I can send you to [Cazic] Thule, [Cobalt] Scar, [Dawnshroud], [Iceclad], [Twilight] Sea, and [Wakening] Lands. You must have sufficient [credit].");
}
if ($text=~/credit/i){
quest::say("For each platinum you give me, you will earn one credit for teleports. You can also see your current [balance].");
}
if ($text=~/balance/i){
if ($porter >= 1) {
quest::say("Your current credit is $porter");
$porter = undef;
}
else {
quest::say("You have 0 credit.");
$porter = undef;
}
}
if ($text=~/cazic/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(1375)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/cobalt/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2025)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/dawnshroud/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2431)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/iceclad/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2022)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/twilight/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2426)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
if ($text=~/wakening/i){
if ($porter >= 50) {
quest::setglobal("porter", $porter-50, 0, "Y9");
quest::say("Farewell");
quest::selfcast(2024)
$porter = undef;
}
else {
quest::say("You need more credits!");
$porter = undef;
}
}
}
sub EVENT_ITEM {
if($platinum >= 1){
quest::setglobal("porter", $porter+$platinum, 0, "Y9");
quest::say("Your credit has risen.");
$porter = undef;
}
else {
quest::say("I only take platinum.");
$porter = undef;
plugin::return_items(\%itemcount);
}
}