Loading...   


#### 	ADD THESE TO GLOBAL_PLAYER.PL

### 	plugin::object_manipulation_EVENT_CLICK_OBJECT();   #Place this in EVENT_CLICK_OBJECT in global_player.pl

###		plugin::object_manipulation_EVENT_SAY(); 			#Place this in EVENT_SAY in global_player.pl


#THE REST OF THE FILE MUST BE IN THE plugins folder name it object_manip.pl or whatever you want

sub object_manipulation_EVENT_CLICK_OBJECT {
	my $objectid = plugin::val('$objectid');
	my $clicker_id = plugin::val('$clicker_id');
	my $client = plugin::val('$client');
	my $entity_list = plugin::val('$entity_list');
	
	my $my_object = $entity_list->GetObjectByID($objectid);
	
	if ($my_object) {
		$client->SetEntityVariable("EditObject", $objectid);
		$client->Message(335, "Object $objectid [" . quest::saylink("#obj edit", 1, "Edit Object") . "] [" . quest::saylink("obj",1, "Help") . "]");
	}
	
	
}

sub object_manipulation_EVENT_SAY {
	my $text = plugin::val('$text');
	my $client = plugin::val('$client');
	my $entity_list = plugin::val('$entity_list');
	my $zonesn = plugin::val('$zonesn');
	
	my $object;
	
	if($client->GetEntityVariable("EditObject") > 0){ $object = $entity_list->GetObjectByID($client->GetEntityVariable("EditObject")); }
	
	my @arg = split(' ', $text);
	
	if ($arg[0] =~/obj/i) {
		if (!$arg[1]) {
			$client->Message(335, "Commands!");
			$client->Message(335, "#obj edit icon ###");
			$client->Message(335, "#obj edit model IT1337_ACTORDEF");
			$client->Message(335, "#obj edit    ... after clicking an object or click the saylink.");
		
		} elsif ($arg[1] =~/edit/i && $object) {
			my ($optionX, $optionXN, $optionY, $optionYN, $optionZ, $optionZN, $optionH, $optionHN, $optionSize, $optionSizeN, $optionTiltX, $optionTiltXN, $optionTiltY, $optionTiltYN) = "";
			my ($i, $Num) = 0;
			
			
			if (!$arg[2]) {
				$optionX .= quest::saylink("#obj edit setX .25", 1, " .25");
				$optionY .= quest::saylink("#obj edit setY .25", 1, " .25");
				$optionZ .= quest::saylink("#obj edit setZ .25", 1, " .25");
				$optionH .= quest::saylink("#obj edit setH .25", 1, " .25");
				$optionSize .= quest::saylink("#obj edit setSize .25", 1, " .25");
				$optionTiltX .= quest::saylink("#obj edit setTiltX .25", 1, " .25");
				$optionTiltY .= quest::saylink("#obj edit setTiltY .25", 1, " .25");
				for($i = 0; $i <= 15; $i+=5){
					if($i == 0){ $Num = 1; }else{ $Num = $i } 
					$optionX .= quest::saylink("#obj edit setX " . $Num, 1, " ". abs($Num));
					$optionY .= quest::saylink("#obj edit setY " . $Num, 1, " ". abs($Num));
					$optionZ .= quest::saylink("#obj edit setZ " . $Num, 1, " ". abs($Num));
					$optionH .= quest::saylink("#obj edit setH " . $Num, 1, " ". abs($Num));
					$optionSize .= quest::saylink("#obj edit setSize " . $Num, 1, " ". abs($Num));
					$optionTiltX .= quest::saylink("#obj edit setTiltX " . $Num, 1, " ". abs($Num));
					$optionTiltY .= quest::saylink("#obj edit setTiltY " . $Num, 1, " ". abs($Num));
				}
				for($i = -15; $i <= 0; $i+=5){
					if($i == 0){ $Num = -1; }else{ $Num = $i }
					$optionXN .= quest::saylink("#obj edit setX " . $Num, 1, " ". abs($Num));
					$optionYN .= quest::saylink("#obj edit setY " . $Num, 1, " ". abs($Num)); 
					$optionZN .= quest::saylink("#obj edit setZ " . $Num, 1, " ". abs($Num)); 
					$optionHN .= quest::saylink("#obj edit setH " . $Num, 1, " ". abs($Num)); 
					$optionSizeN .= quest::saylink("#obj edit setSize " . $Num, 1, " ". abs($Num));
					$optionTiltXN .= quest::saylink("#obj edit setTiltX " . $Num, 1, " ". abs($Num));
					$optionTiltYN .= quest::saylink("#obj edit setTiltY " . $Num, 1, " ". abs($Num));
				}
				$optionXN .= quest::saylink("#obj edit setX -.25", 1, " .25");
				$optionYN .= quest::saylink("#obj edit setY -.25", 1, " .25");
				$optionZN .= quest::saylink("#obj edit setZ -.25", 1, " .25");
				$optionHN .= quest::saylink("#obj edit setH -.25", 1, " .25");
				$optionSizeN .= quest::saylink("#obj edit setSize -.25", 1, " .25");
				$optionTiltXN .= quest::saylink("#obj edit setTiltX -.25", 1, " .25");
				$optionTiltYN .= quest::saylink("#obj edit setTiltY -.25", 1, " .25");
				
				$client->Message(335, "MODEL: [" . $object->GetModelName() . "] SIZE: [" . $object->GetSize() . "] [" . quest::saylink("#obj save", 1, "SAVE") . "]");
				$client->Message(335, "[". $optionXN . " - [X] +" . $optionX . "]");
				$client->Message(335, "[". $optionYN . " - [Y] +" . $optionY . "]");
				$client->Message(335, "[". $optionZN . " - [Z] +" . $optionZ . "]");
				$client->Message(335, "[". $optionHN . " - [H] +" . $optionH . "]");
				$client->Message(335, "[". $optionSizeN . " - [Size] +" . $optionSize . "]");
				$client->Message(335, "[". $optionTiltXN . " - [TiltX] +" . $optionTiltX . "]");
				$client->Message(335, "[". $optionTiltYN . " - [TiltY] +" . $optionTiltY . "]");
				
			} elsif ($arg[2] =~/setX/i) {
				$object->SetX($object->GetX() + $arg[3]);
			} elsif ($arg[2] =~/setY/i) {
				$object->SetY($object->GetY() + $arg[3]);
			} elsif ($arg[2] =~/setZ/i) {
				$object->SetZ($object->GetZ() + $arg[3]);
			} elsif ($arg[2] =~/setH/i) {
				$object->SetH($object->GetH() + $arg[3]);
			} elsif ($arg[2] =~/setSize/i) {
				$object->SetSize($object->GetSize() + $arg[3]);
			} elsif ($arg[2] =~/model/i) {
				$object->SetModelName(uc($arg[3]));
			} elsif ($arg[2] =~/icon/i) {
				$object->SetIcon($arg[3]);
			} elsif ($arg[2] =~/setTiltX/i) {
				$object->SetTiltX($object->GetTiltX() + $arg[3]);
			} elsif ($arg[2] =~/setTiltY/i) {
				$object->SetTiltY($object->GetTiltY() + $arg[3]);
			}
		} elsif ($arg[1] =~/save/i && $object) {
			$object->Save();
			$client->Message(335, "Object saved!");
		}
	}
	
	
}


return 1;

Raw Paste Data