1
Modification Help / applyBodyColors sets default preferences.
« on: February 06, 2011, 12:02:29 AM »
Never-mind, I didn't know there was a node for all of the hats.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
//vic is the player hit by a projectile.
//client is the client firing the projectile
%vic.client.camera.setMode("Corpse",%client.player);
%client.player.setControlObject(%vic.client.camera);




function AIPlayer::randomMove(%player,%z)
{
%loc = vectorAdd(%player.getTransform(),getRandom(-25,25) SPC getRandom(-25,25) SPC %z);
%vec = VectorDist(%player.SpawnPos, %player.gettransform());
%EyeVector = %player.getEyeVector();
%EyePoint = %player.getEyePoint();
%Range = 2;
%RangeScale = VectorScale(%EyeVector, %Range);
%RangeEnd = VectorAdd(%EyePoint, %RangeScale);
%raycast = containerRayCast(%eyePoint,%RangeEnd,$TypeMasks::FxBrickObjectType, %player);
if(isObject(%raycast))
{
if(vectorDist(%player.PrevLoc,%player.position) < 2)
{
%player.BotJump();
}
//Make the bot turn here?
}
%player.setMoveDestination(%loc);
}
1 - This is the spawncount.
Trader PosX PosY PosZ - This is normal.
2
Orc PosX PosY PosZ - Trader is overwritten by Orc.
Orc PosX PosY PosZ - Orc is placed on the last line as well.
function serverCmdNPCSpawn(%client,%type)
{
%Pos = %client.player.getPosition();
%file = new FileObject();
%file.openForWrite("Config/Server/Medieval/NPC/Spawns.txt");
$SpawnCount += 1;
%file.writeline($SpawnCount);
while(%Saved <= $SpawnCount)
{
%Saved += 1;
%file.writeline(%Type SPC %Pos);
}
%Saved = 0;
%file.close();
%file.delete();
}
$RoleplayLightOn = 0;
package Inv
{
function serverCmdLight(%client)
{
if($RoleplayLightOn == 1)
{
parent::ServerCmdLight(%client);
}
else
{
commandToClient(%client,'OpenInvMenu');
}
}
};
activatePackage(Inv);
function serverCmdGetResources(%client)
{
while(%Set < $MaxInvItems)
{
%Set += 1;
%type = $InvItem[%Set];
%amt = %client.Roleplay[%type];
commandToClient(%client,'SetRPItems',%type,%amt);
}
}
$InvItem[1] = "CopperOre";
$InvItem[2] = "IronOre";
$MaxInvItems = 2;
function clientCmdOpenInvMenu(%this)
{
while(%UT < $MaxInvItems)
{
%UT += 1;
%Obj = $InvItem[%UT];
echo("Object: " @ %Obj);
%Amt = serverCmdGetResource(%Obj);
echo("Amount: " @ %type);
if(%type > 0)
{
InvTextList.addRow(%UT, %obj TAB %amt);
}
}
canvas.pushDialog(Medieval_Inventory);
}
datablock ShapeBaseImageData(RPSpider)
{
shapeFile = "./Shapes/Monster/Spider.dts";
emap = false;
mountPoint = $PantsSlot;
offset = "0 0 -1.8"; // Set the model to the ground based on the Bot PantSlot.
eyeOffset = "0 0 0";
rotation = "0 0 0 0 0";
className = "itemimage";
};
if(%F $= "Spider")
{
%Mob.setNodeColor("ALL","0 0 0 0");
%Mob.mountImage(RPSpider,$PantsSlot);
}


