本文整理汇总了C#中Dynel类的典型用法代码示例。如果您正苦于以下问题:C# Dynel类的具体用法?C# Dynel怎么用?C# Dynel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dynel类属于命名空间,在下文中一共展示了Dynel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FunctionExecute
public bool FunctionExecute(Dynel self, Dynel caller, object target, object[] arguments)
{
Client cli = ((Character)self).Client;
Quaternion q = new Quaternion(0, 1, 0, 0);
AOCoord a = new AOCoord();
Int32 pf;
if (target is Statels.Statel)
{
a.x = Int32.Parse((string)arguments[0]);
a.y = Int32.Parse((string)arguments[1]);
a.z = Int32.Parse((string)arguments[2]);
pf = Int32.Parse((string)arguments[3]);
}
else
{
a.x = (Int32)arguments[0];
a.y = (Int32)arguments[1];
a.z = (Int32)arguments[2];
pf = (Int32)arguments[3];
}
// Same playfield teleport sometimes has 0 for pf argument
if (pf == 0)
{
pf = cli.Character.PlayField;
}
cli.Teleport(a, q, pf);
return true;
}
示例2: FunctionExecute
public bool FunctionExecute(Dynel self, Dynel caller, object target, object[] arguments)
{
int actionnumber = (Int32)arguments[0];
NonPlayerCharacterClass knubotTarget = (NonPlayerCharacterClass)self;
knubotTarget.KnuBot.Action((Int32)arguments[0]);
return true;
}
示例3: FunctionExecute
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
Character ch = (Character)Self;
Dictionary<int, uint> statstoupdate = new Dictionary<int, uint>();
foreach (ClassStat cs in ch.Stats.All)
{
if (cs.Changed)
{
if (cs.SendBaseValue)
{
statstoupdate.Add(cs.StatNumber, cs.StatBaseValue);
}
else
{
statstoupdate.Add(cs.StatNumber, (uint)cs.Value);
}
cs.Changed = false;
}
}
if (ch.Client == null)
{
Stat.SendBulk(ch, statstoupdate);
}
else
{
Stat.SendBulk(ch.Client, statstoupdate);
}
return true;
}
示例4: FunctionExecute
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
Character ch = (Character)Self;
ch.Stats.SetPercentageModifier(
(Int32)Arguments[0], ch.Stats.GetPercentageModifier((Int32)Arguments[0]) + (Int32)Arguments[1]);
return true;
}
示例5: Execute
public override bool Execute(Dynel self, Dynel caller, object target, object[] arguments)
{
lock (self)
{
lock (caller)
{
lock (target)
{
return this.FunctionExecute(self, caller, target, arguments);
}
}
}
}
示例6: ItemContainer
public ItemContainer(int _type, uint _instance, Dynel _parent)
{
Type = _type;
Instance = _instance;
LoadFromSQL(_parent.getSQLTablefromDynelType() + "inventory");
switch (_type)
{
// only Characters and NonPC's for now
case 50000:
NumberOfSlots = 30;
break;
default:
throw new NotImplementedException("Can't create untyped container");
}
Items = new Object[NumberOfSlots];
}
示例7: FunctionExecute
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
if ((Target is Character) || (Target is NonPlayerCharacterClass))
{
Character t = (Character)Target;
bool found = false;
Int32 placement;
if (Arguments.Length == 2)
{
placement = 0;
}
else
{
placement = (Int32)Arguments[Arguments.Length - 1];
}
if (placement >= 49)
{
if (t.SocialTab.ContainsKey((Int32)Arguments[1]))
{
t.SocialTab[(Int32)Arguments[1]] = (Int32)Arguments[0];
}
else
{
t.SocialTab.Add((Int32)Arguments[1], (Int32)Arguments[0]);
}
}
else
{
foreach (AOTextures aot in t.Textures)
{
if (aot.place == (Int32)Arguments[1])
{
found = true;
aot.Texture = (Int32)Arguments[0];
}
}
if (!found)
{
t.Textures.Add(new AOTextures((Int32)Arguments[1], (Int32)Arguments[0]));
}
}
}
return true;
}
示例8: Send
public static void Send(Client client, Dynel dynel1, Dynel dynel2)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x36284f6e);
packetWriter.PushIdentity(dynel1.Type, dynel1.Id);
packetWriter.PushByte(0);
packetWriter.PushInt(1); // Knubot sends 2 here
packetWriter.PushByte(0); // and 2 here too
packetWriter.PushIdentity(dynel2.Type, dynel2.Id); // knubot 0
packetWriter.PushIdentity(0xc767, 0x39da2458); // temp bag ID?? Knubot 0, needs more testing....
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例9: FunctionExecute
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
if (Arguments.Length == 2)
{
((Character)Self).Stats.BackMesh.Set((Int32)Arguments[0]);
((Character)Self).MeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
}
else
{
int placement = (Int32)Arguments[Arguments.Length - 1];
if (placement == 51)
{
((Character)Self).SocialMeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
}
else
{
((Character)Self).Stats.BackMesh.Set((Int32)Arguments[0]);
((Character)Self).MeshLayer.AddMesh(5, (Int32)Arguments[1], (Int32)Arguments[0], 0);
}
}
return true;
}
示例10: FunctionExecute
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
Client cli = ((Character)Self).Client;
Identity pfinstance = new Identity();
Identity R = new Identity();
Identity dest = new Identity();
int gs = 1;
int sg = 0;
if (Target is Statels.Statel)
{
pfinstance.Type = Int32.Parse((string)Arguments[0]);
pfinstance.Instance = Int32.Parse((string)Arguments[1]);
R.Type = Int32.Parse((string)Arguments[2]);
R.Instance = Int32.Parse((string)Arguments[3]);
dest.Type = Int32.Parse((string)Arguments[4]);
dest.Instance = Int32.Parse((string)Arguments[5]);
}
else
{
pfinstance.Type = (Int32)Arguments[0];
pfinstance.Instance = (Int32)Arguments[1];
R.Type = (Int32)Arguments[2];
R.Instance = (Int32)Arguments[3];
dest.Type = (Int32)Arguments[4];
dest.Instance = (Int32)Arguments[5];
}
int to_pf = (Int32)((UInt32)(dest.Instance & 0xffff));
int arg2 = (Int32)((UInt32)(dest.Instance >> 16));
CoordHeading a = this.FindEntry(to_pf, arg2);
if (a.Coordinates.x != -1)
{
cli.TeleportProxy(a.Coordinates, a.Heading, to_pf, pfinstance, gs, sg, R, dest);
return true;
}
return false;
}
示例11: FunctionExecute
/// <summary>
/// Lineteleport
/// </summary>
/// <param name="Self"></param>
/// <param name="Caller"></param>
/// <param name="Target"></param>
/// <param name="Arguments">UInt32 (LineType?), UInt32 (Combo of Line# and Playfield), Int32 (Playfield to teleport to)</param>
/// <returns></returns>
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
uint arg2;
int to_pf;
Console.WriteLine(Target.GetType().ToString());
if (Target is Statels.Statel)
{
arg2 = UInt32.Parse((string)Arguments[1]); // Linesegment and playfield (lower word)
arg2 = arg2 >> 16;
to_pf = Int32.Parse((string)Arguments[2]);
}
else
{
arg2 = (UInt32)Arguments[1];
to_pf = (Int32)Arguments[2];
}
CoordHeading a = this.FindEntry(to_pf, (Int32)arg2);
if (a.Coordinates.x != -1)
{
((Character)Self).Client.Teleport(a.Coordinates, a.Heading, to_pf);
return true;
}
return false;
}
示例12: Read
/// <summary>
/// The read.
/// </summary>
/// <param name="packet">
/// The packet.
/// </param>
/// <param name="client">
/// The client.
/// </param>
/// <param name="dynel">
/// The dynel.
/// </param>
public static void Read(byte[] packet, Client client, Dynel dynel)
{
sender = client;
PacketReader packetReader = new PacketReader(packet);
packetReader.PopHeader();
packetReader.PopByte();
temp1 = packetReader.PopInt();
count = packetReader.PopInt(); // Count of commands sent
action = packetReader.PopInt();
temp4 = packetReader.PopInt();
user = packetReader.PopIdentity();
target = packetReader.PopIdentity();
packetReader.Finish();
bool feedback = true;
switch (action)
{
case 1:
// Get
break;
case 2:
// Drop
break;
case 3:
// Use
OnUse();
AOCoord newcoord = client.Character.Coordinates;
feedback = false;
if (Statels.StatelppfonUse.ContainsKey(client.Character.PlayField))
{
foreach (Statels.Statel s in Statels.StatelppfonUse[client.Character.PlayField])
{
if (s.onUse(client, target))
{
return;
}
}
}
bool teleport = false;
int playfield = 152;
switch (target.Instance)
{
// Need to add feedback to the character
// Are the Newer Grid points in this list???
// No newer Grid points in list, will be replaced by a check against a list of statels read from rdb anyway
// - Algorithman
case -1073605919: // Teleport Tower(noobisland)(right)
if (client.Character.Stats.Side.Value != 2)
{
client.SendChatText("You need to be omni to use this teleporter!");
teleport = false;
}
else
{
newcoord.x = 202;
newcoord.z = 878;
newcoord.y = 16;
playfield = 687;
}
break;
case -1073736991: // Teleport Tower(noobisland)(left)
if (client.Character.Stats.Side.Value != 1)
{
client.SendChatText("You need to be clan to use this teleporter!");
teleport = false;
}
else
{
newcoord.x = 390;
newcoord.z = 340;
newcoord.y = 0;
playfield = 545;
}
break;
case -1073671455: // Teleport Tower(noobisland)(middle)
if (client.Character.Stats.Side.Value != 0)
{
client.SendChatText("You need to be neutral to use this teleporter!");
teleport = false;
}
//.........这里部分代码省略.........
示例13: DynelStats
/// <summary>
/// Character_Stats
/// Class for character's stats
/// </summary>
/// <param name="parent">
/// Stat's owner (Character or derived class)
/// </param>
public DynelStats(Dynel parent)
{
this.all.Add(this.flags);
this.all.Add(this.life);
this.all.Add(this.volumeMass);
this.all.Add(this.attackSpeed);
this.all.Add(this.breed);
this.all.Add(this.clan);
this.all.Add(this.team);
this.all.Add(this.state);
this.all.Add(this.timeExist);
this.all.Add(this.mapFlags);
this.all.Add(this.professionLevel);
this.all.Add(this.previousHealth);
this.all.Add(this.mesh);
this.all.Add(this.anim);
this.all.Add(this.name);
this.all.Add(this.info);
this.all.Add(this.strength);
this.all.Add(this.agility);
this.all.Add(this.stamina);
this.all.Add(this.intelligence);
this.all.Add(this.sense);
this.all.Add(this.psychic);
this.all.Add(this.ams);
this.all.Add(this.staticInstance);
this.all.Add(this.maxMass);
this.all.Add(this.staticType);
this.all.Add(this.energy);
this.all.Add(this.health);
this.all.Add(this.height);
this.all.Add(this.dms);
this.all.Add(this.can);
this.all.Add(this.face);
this.all.Add(this.hairMesh);
this.all.Add(this.side);
this.all.Add(this.deadTimer);
this.all.Add(this.accessCount);
this.all.Add(this.attackCount);
this.all.Add(this.titleLevel);
this.all.Add(this.backMesh);
this.all.Add(this.alienXP);
this.all.Add(this.fabricType);
this.all.Add(this.catMesh);
this.all.Add(this.parentType);
this.all.Add(this.parentInstance);
this.all.Add(this.beltSlots);
this.all.Add(this.bandolierSlots);
this.all.Add(this.fatness);
this.all.Add(this.clanLevel);
this.all.Add(this.insuranceTime);
this.all.Add(this.inventoryTimeout);
this.all.Add(this.aggDef);
this.all.Add(this.xp);
this.all.Add(this.ip);
this.all.Add(this.level);
this.all.Add(this.inventoryId);
this.all.Add(this.timeSinceCreation);
this.all.Add(this.lastXP);
this.all.Add(this.age);
this.all.Add(this.sex);
this.all.Add(this.profession);
this.all.Add(this.cash);
this.all.Add(this.alignment);
this.all.Add(this.attitude);
this.all.Add(this.headMesh);
this.all.Add(this.missionBits5);
this.all.Add(this.missionBits6);
this.all.Add(this.missionBits7);
this.all.Add(this.veteranPoints);
this.all.Add(this.monthsPaid);
this.all.Add(this.speedPenalty);
this.all.Add(this.totalMass);
this.all.Add(this.itemType);
this.all.Add(this.repairDifficulty);
this.all.Add(this.price);
this.all.Add(this.metaType);
this.all.Add(this.itemClass);
this.all.Add(this.repairSkill);
this.all.Add(this.currentMass);
this.all.Add(this.icon);
this.all.Add(this.primaryItemType);
this.all.Add(this.primaryItemInstance);
this.all.Add(this.secondaryItemType);
this.all.Add(this.secondaryItemInstance);
this.all.Add(this.userType);
this.all.Add(this.userInstance);
this.all.Add(this.areaType);
this.all.Add(this.areaInstance);
this.all.Add(this.defaultPos);
this.all.Add(this.race);
this.all.Add(this.projectileAC);
this.all.Add(this.meleeAC);
//.........这里部分代码省略.........
示例14: FunctionExecute
public bool FunctionExecute(Dynel Self, Dynel Caller, object Target, object[] Arguments)
{
string text = (string)Arguments[0];
SystemText.Send(((Character)Self).Client, text, 0);
return true;
}
示例15: GetClientsInRadius
/// <summary>
/// Experimental - Check who is in the given radius
/// </summary>
/// <param name="client">Character or NPC to start from</param>
/// <param name="radius">RAdius</param>
/// <returns></returns>
public static List<Dynel> GetClientsInRadius(Dynel client, float radius)
{
// we're added ourselves, because we're included in the list too.
List<Dynel> clientList = new List<Dynel> { client };
// searching client as first one!
foreach (Client client1 in Program.zoneServer.Clients)
{
if (client1.Character.PlayField != client.PlayField)
{
continue;
}
if (client1.Character.Id == client.Id)
{
continue;
}
if (client1.Character.Coordinates.Distance2D(client.Coordinates) >= radius)
{
continue;
}
clientList.Add(client1.Character);
}
return clientList;
}