All pastes #56487 Raw Edit

tobz

public text v1 · immutable
#56487 ·published 2006-05-17 02:59 UTC
rendered paste body
int pos = -1;
				VMOperand ret = new VMOperand();
				VMOperand[] args = new VMOperand[2];

				args[0] = new VMOperand();
				args[1] = new VMOperand();

				Scripting.ScriptMgr.VirtualMachine.CreateType(args[0], Scripting.TypeNames.PLAYER_NAME, "myPlayer", new VMOperand[0]);
				Scripting.ScriptMgr.WriteCustomData(args[0].UnsafeObject, player.Persistent.RegionID, player.Persistent.ZoneID, player.EntityID);

				foreach (string param in cmdParams)
				{
					args[1].SetTableItem(++pos, param);
				}

				res = Scripting.ScriptMgr.ExecuteFunction(ourCmd.Script, ourCmd.FunctionName, args, ret);

				for (int i = 0; i < args.Length; i++)
				{
					args[i].Dispose();
					args[i] = null;
				}

#warning work with the result or whatever

				ret.Dispose();