Difference between revisions of "NDMobileTemplates"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
(Created page with "<p style="width:60%;margin: 0 auto">[Main] [Lua Examples]</p> <center><p style="width: 60%">A B C [...")
 
Line 1: Line 1:
<p style="width:60%;margin: 0 auto">[[NewDawnHome|[Main]]] [[NDServerIndexScriptsMain|[Lua Examples]]]</p>
+
<p style="width:60%;margin: 0 auto">[[NewDawnHome|[Main]]] [[NDServerIndexTemplateMain|[Templates]]]</p>
 +
 
  
<center><p style="width: 60%">[[NDGIA|A]] [[NDGIB|B]] [[NDGIC|C]] [[NDGID|D]] [[NDGIE|E]] [[NDGIF|F]] [[NDGIG|G]] [[NDGIH|H]] [[NDGII|I]] [[NDGIJ|J]] [[NDGIK|K]] [[NDGIL|L]] [[NDGIM|M]] [[NDGIN|N]] [[NDGIO|O]] [[NDGIP|P]] [[NDGIQ|Q]] [[NDGIR|R]] [[NDGIS|S]] [[NDGIT|T]] [[NDGIU|U]] [[NDGIV|V]] [[NDGIW|W]] [[NDGIX|X]] [[NDGIY|Y]] [[NDGIZ|Z]]</p></center>
 
 
<p style="color: #DDDD88;font-size: 22px;width:60%;margin: 0 auto">Global Functions & Examples</p>
 
<p style="color: #DDDD88;font-size: 22px;width:60%;margin: 0 auto">Global Functions & Examples</p>
 
<center>
 
<center>
Line 11: Line 11:
 
<p style="width: 60%;margin: 0 auto">Example of adding a view to a object</p>
 
<p style="width: 60%;margin: 0 auto">Example of adding a view to a object</p>
 
<div style="width:60%;margin: 0 auto">
 
<div style="width:60%;margin: 0 auto">
  --this will add a view that will interact with players within 30 units
+
<ObjectTemplate>
  --It will check and update every 0.5 seconds
+
<ClientId>134</ClientId>
  AddView("UniqueViewHandler",SearchPlayerInRange(30,true),0.5)
+
<Name>Grizzly Bear</Name>
 +
<ScaleModifier>1</ScaleModifier>
 +
<SharedStateEntry name="BodyOffset" type="double" value="1.15"/>
 +
<MobileComponent>
 +
<BaseRunSpeed>0.9</BaseRunSpeed>
 +
<MobileType>Animal</MobileType>
 +
</MobileComponent>
 +
<ObjectVariableComponent>
 +
<DoubleVariable Name="BaseHealth">300</DoubleVariable>
 +
<StringVariable Name="MobileTeamType">Bear</StringVariable>
 +
<StringVariable Name="MobileKind">Animal</StringVariable>
 +
<DoubleVariable Name="HostileLevel">7</DoubleVariable>
 +
<BoolVariable Name="AI-Leash">False</BoolVariable>
 +
<BoolVariable Name="AI-RandomizeScale">False</BoolVariable>
 +
<BoolVariable Name="AI-CanUseCombatAbilities">false</BoolVariable>
 +
<BoolVariable Name="AI-ScaleToAge">False</BoolVariable>
 +
<BoolVariable Name="AI-CanFlee">True</BoolVariable>
 +
<DoubleVariable Name="Armor">46</DoubleVariable>
 +
<DoubleVariable Name="Attack">12</DoubleVariable>
 +
<DoubleVariable Name="BardingDifficulty">100</DoubleVariable>
 +
<BoolVariable Name="DoNotEquip">True</BoolVariable>
 +
<DoubleVariable Name="TamingDifficulty">59.1</DoubleVariable>
 +
<DoubleVariable Name="PetSlots">1</DoubleVariable>
 +
</ObjectVariableComponent>
 +
<ScriptEngineComponent>
 +
<LuaModule Name="ai_default_animal">
 +
<Initializer>
 +
{
 +
Stats = { Str=40, Agi=30, Int=21, Wis=10, Wil=10 },
 +
MobTraits =
 +
{
 +
},
 +
Skills =
 +
{
 +
Brawling = 10, 
 +
},
 +
LootTables =
 +
{
 +
},
 +
}
 +
</Initializer>
 +
</LuaModule>
 +
<LuaModule Name="animal_parts">
 +
<Initializer>
 +
{
 +
MeatCount = 4,
 +
 +
MeatType = "TenderMeat",
 +
AnimalParts =
 +
{
 +
{ ResourceType="LeatherHide", RarityPct=100, Count=2 },
 +
{ ResourceType="CornSeed", RarityPct=5, Count=1 },
 +
{ ResourceType="SquashSeed", RarityPct=5, Count=1 },
 +
{ ResourceType="GreenLeafLettuceSeed", RarityPct=5, Count=1 },
 +
{ ResourceType="RedLeafLettuceSeed", RarityPct=5, Count=1 },
 +
{ ResourceType="ButtonMushroomSeed", RarityPct=5, Count=1 },
 +
{ ResourceType="MelonSeed", RarityPct=5, Count=1 },
 +
},
 +
}
 +
</Initializer>
 +
</LuaModule>
 +
</ScriptEngineComponent>
 +
</ObjectTemplate>
 
</div>
 
</div>

Revision as of 01:58, 5 December 2019

[Main] [Templates]


Global Functions & Examples

AddView(eventid,searcher,frequency)

eventid - Event identifier for events
searcher - Object searcher that defines the view
frequency - Update frequency check in seconds.
The frequency argument may be omitted, the View will default to 0.25 seconds for the frequency. The minimum value of frequency is 0.1 seconds.

Example of adding a view to a object

<ObjectTemplate>
	<ClientId>134</ClientId>
	<Name>Grizzly Bear</Name>
	<ScaleModifier>1</ScaleModifier>
	<SharedStateEntry name="BodyOffset" type="double" value="1.15"/>
	<MobileComponent>			
		<BaseRunSpeed>0.9</BaseRunSpeed>
		<MobileType>Animal</MobileType>
	</MobileComponent>
	<ObjectVariableComponent>		
		<DoubleVariable Name="BaseHealth">300</DoubleVariable>
		<StringVariable Name="MobileTeamType">Bear</StringVariable>
		<StringVariable Name="MobileKind">Animal</StringVariable>
		<DoubleVariable Name="HostileLevel">7</DoubleVariable>
		<BoolVariable Name="AI-Leash">False</BoolVariable>
		<BoolVariable Name="AI-RandomizeScale">False</BoolVariable>
		<BoolVariable Name="AI-CanUseCombatAbilities">false</BoolVariable>
		<BoolVariable Name="AI-ScaleToAge">False</BoolVariable>
		<BoolVariable Name="AI-CanFlee">True</BoolVariable>
		<DoubleVariable Name="Armor">46</DoubleVariable>
		<DoubleVariable Name="Attack">12</DoubleVariable>
		<DoubleVariable Name="BardingDifficulty">100</DoubleVariable>
		<BoolVariable Name="DoNotEquip">True</BoolVariable>
		<DoubleVariable Name="TamingDifficulty">59.1</DoubleVariable>
		<DoubleVariable Name="PetSlots">1</DoubleVariable>
	</ObjectVariableComponent>					
	<ScriptEngineComponent>
		<LuaModule Name="ai_default_animal">
			<Initializer>
				{ 
				Stats = { Str=40, Agi=30, Int=21, Wis=10, Wil=10 },
				MobTraits =
					{
					},
				Skills = 
					{ 
					Brawling = 10,  
					},	
				LootTables = 
					{ 
					},		
				}
			</Initializer>
		</LuaModule>
		<LuaModule Name="animal_parts">
			<Initializer>
				{
					MeatCount = 4,					

					MeatType = "TenderMeat",
					AnimalParts =
					{
						{ ResourceType="LeatherHide", RarityPct=100, Count=2 },
						{ ResourceType="CornSeed", RarityPct=5, Count=1 },
						{ ResourceType="SquashSeed", RarityPct=5, Count=1 },
						{ ResourceType="GreenLeafLettuceSeed", RarityPct=5, Count=1 },
						{ ResourceType="RedLeafLettuceSeed", RarityPct=5, Count=1 },
						{ ResourceType="ButtonMushroomSeed", RarityPct=5, Count=1 },
						{ ResourceType="MelonSeed", RarityPct=5, Count=1 },
					},
				}
			</Initializer>
		</LuaModule>
	</ScriptEngineComponent>
</ObjectTemplate>