Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 02-14-2013, 07:34 PM
Loxo
Fire Beetle
 
Join Date: Jun 2012
Posts: 5
Default Climb a tree

Code:
##a_Pine.pl
sub EVENT_SPAWN
{
	$x = $npc->GetX();
	$y = $npc->GetY();
	$z = $npc->GetZ();
	quest::set_proximity($x - 8, $x + 8, $y - 8, $y + 8, $z - 200, $z + 50);
}

sub EVENT_ENTER
{
$climberchar = ($client);
	$npc->SignalClient($climberchar, 1);
}
sub EVENT_EXIT
{
	$npc->SignalClient($climberchar, 2);
$climberchar = undef;
}
Code:
##player.pl
sub EVENT_SIGNAL
{
	if ($signal == 1) 
	{
	$weight = ($client->GetWeight() / 10);
	$basedex = $client->GetBaseDEX();
	$basestr = $client->GetBaseSTR();
	$climbertime = ((($basedex + $basestr) / ($weight + 1)*2));
		quest::settimer("treeclimb",3);
		quest::settimer("climber",$climbertime);
	}
	elsif ($signal == 2)
	{
		quest::stoptimer("climber");
		quest::stoptimer("treeclimb");
		$client->SetFlyMode(0);
	}
	else
	{
		quest::emote(" is broken");
	}
}

sub EVENT_TIMER
{
	if ($timer eq "treeclimb")
	{
		$client->SetFlyMode(1);
		$client->Message(10, "You begin to climb...");
		quest::stoptimer("treeclimb");
	}
	elsif ($timer eq "climber")
	{
	$climbervar = quest::ChooseRandom(1, 2, 3);
		if ($climbervar == 1)
		{
			$client->Message(10, "You almost lose your grip...");
			quest::doanim(12);
		}
		elsif ($climbervar == 2)
		{
			$client->Message(10, "You feel a bug crawl up your leg and almost lose your grip...");
			quest::doanim(23);
		}
		else
		{				
			$client->SetFlyMode(0);
			$client->Message(10, "You lose your grip...");
			quest::stoptimer("climber");
		}
	}
}
It always seems to work when all the parenthesis are there.
Reply With Quote
  #2  
Old 02-14-2013, 08:12 PM
orionsun
Banned
 
Join Date: May 2009
Location: USA
Posts: 22
Default

Quote:
It always seems to work when all the parenthesis are there.
Is there a programming language where improper syntax results in working code?
Reply With Quote
  #3  
Old 02-14-2013, 08:17 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default

Quote:
Originally Posted by orionsun View Post
Is there a programming language where improper syntax results in working code?
Yes.

if(var = othervar) in C++ will compile, but will not have the proper comparison.
Reply With Quote
  #4  
Old 02-14-2013, 08:21 PM
orionsun
Banned
 
Join Date: May 2009
Location: USA
Posts: 22
Default

Quote:
if(var = othervar) in C++ will compile, but will not have the proper comparison.
Quote:
Is there a programming language where improper syntax results in working code?
Notice I didnt just say that it would compile. Got more hairs to split Secrets?
Reply With Quote
  #5  
Old 02-14-2013, 08:23 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default

Quote:
Originally Posted by orionsun View Post
Notice I didnt just say that it would compile. Got more hairs to split Secrets?
It works as unintended.

Confirmed working.

Reply With Quote
  #6  
Old 02-14-2013, 08:48 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Quote:
Originally Posted by Secrets View Post
Yes.

if(var = othervar) in C++ will compile, but will not have the proper comparison.
Luckily almost every compiler out there has warnings to tell you if you've made this mistake. If it isn't a mistake, and there are valid reasons to use this construct, then you can write your code to avoid the warning in those cases.
Reply With Quote
  #7  
Old 02-14-2013, 08:55 PM
Drajor's Avatar
Drajor
Developer
 
Join Date: Nov 2012
Location: Halas
Posts: 355
Default

Quote:
Originally Posted by Secrets View Post
Yes.

if(var = othervar) in C++ will compile, but will not have the proper comparison.
This is valid c++.

http://stackoverflow.com/questions/1...in-a-condition
__________________
Drajor regards you indifferently -- what would you like your tombstone to say?
Reply With Quote
  #8  
Old 02-14-2013, 10:20 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by orionsun View Post
Notice I didnt just say that it would compile. Got more hairs to split Secrets?
Cata, is that you?
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 01:41 PM.


 

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