Log in

View Full Version : a little something i been working on.


liquest
03-12-2011, 02:18 PM
is there a way to shorten this down? i help run a server in development where you may only play the wizard class to play the server. i created a welcome NPC to only teleport the wizard class to the next area. if there isnt a way to shorten thats fine. figured i would share anyways. feedback is appreciated

sub EVENT_SPAWN {
#Variables
$MobName = "Cancelius_the_Gate_Keeper";
$x = $npc->GetX();
$y = $npc->GetY();
}

sub EVENT_SAY {
my $wizard = quest::saylink("Wizard",1);
if ($text =~/Hail/i)
{
$client->Message(10,"Cancelius the Gate Keeper says, Greetings, $name. I am Cancelius, I watch the gates of this citadel. If you are a [wizard], I can let you pass.");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Wizard" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, Seek out the Grand Wizard.");
quest::assigntask(21);
quest::movepc(185,489.0,3.0,-981.9,102.6)
}
if ($class eq "Magician" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Warrior" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Monk" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Cleric" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Necromancer" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Paladin" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Shadow Knight" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Ranger" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Beastlord" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Berserker" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Rogue" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Enchanter" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Bard" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Druid" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Shaman" & $text =~/wizard/i) {
$client->Message(10,"Cancelius the Gate Keeper says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
}

Akkadius
03-12-2011, 03:23 PM
sub EVENT_SAY {
my $wizard = quest::saylink("Wizard",1);
$MobName = $npc->GetCleanName();
if ($text =~/Hail/i) {
$client->Message(10,"$MobName says, Greetings, $name. I am Cancelius, I watch the gates of this citadel. If you are a [$wizard], I can let you pass.");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
if ($class eq "Wizard" && $text =~/wizard/i) {
$client->Message(10,"$MobName says, Seek out the Grand Wizard.");
quest::assigntask(21);
quest::movepc(185, 489.0, 3.0, -981.9, 102.6)
}
elsif ($text =~/wizard/i) {
$client->Message(10,"$MobName says, You shall not pass unless you follow the path of the wizard!");
$client->Message(13,"A voice from the fourth-wall whispers, The Citadel of Magic server only supports the use of wizards, you will be able to tank in melee combat, deal damage in both melee and ranged, or heal depending on your specialization choices.");
}
}

liquest
03-12-2011, 03:42 PM
ahh $mobname would help alot so i dont keep adding more to the text now is there a way to reduce the length instead of having a line for each class to deny them entrance is there a way to have all classes besides wizard on one single line

Akkadius
03-12-2011, 04:00 PM
ahh $mobname would help alot so i dont keep adding more to the text now is there a way to reduce the length instead of having a line for each class to deny them entrance is there a way to have all classes besides wizard on one single line

Look a little closer.